Pagina 1 van 1
viewforum link Markeer alle onderwerpen als gelezen
Geplaatst: 03 apr 2005, 17:34
door obiku
Ik heb net een nieuw forum aangemaakt in mijn phpbb, hier staan uiteraard nog geen topics in. De link boven aan het forum "Markeer alle onderwerpen als gelezen" staat wel boven aan het forum. Als men deze link nu aan klikt krijg je dus een sql error.
Code: Selecteer alles
Could not access topics
DEBUG MODE
SQL Error : 1064 You have an error in your SQL syntax near ') AND forum_id = 27 AND topic_moved_id = 0' at line 3
SELECT topic_id FROM phpbb_topics WHERE topic_id IN () AND forum_id = 27 AND topic_moved_id = 0
Line : 217
File : viewforum.php
Wat ik dus graag zou willen is, dat deze link alleen zichtbaar is, als er ook inderdaad onderwerpen in het forum staan. Dit zodat gebruikers deze foutmelding niet kunnen veroorzaken.
Is er hier iemand die weet hoe ik dit zou moeten doen...
Geplaatst: 03 apr 2005, 20:12
door Luuk
Je krijgt normaal geen foutmelding als er niets in een forum staat... heb je niets aangepast aan de bestanden?
Geplaatst: 04 apr 2005, 17:58
door obiku
Ik heb wel de Keep Unread mod geinstalleerd
Code: Selecteer alles
//
// Handle marking posts
//
if ( $mark_read == 'topics' )
{
//-- mod : keep unread -----------------------------------------------------------------------------
//-- delete
// if ( $userdata['session_logged_in'] )
// {
// $sql = "SELECT MAX(post_time) AS last_post
// FROM " . POSTS_TABLE . "
// WHERE forum_id = $forum_id";
// if ( !($result = $db->sql_query($sql)) )
// {
// message_die(GENERAL_ERROR, 'Could not obtain forums information', '', __LINE__, __FILE__, $sql);
// }
//
// if ( $row = $db->sql_fetchrow($result) )
// {
// $tracking_forums = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f']) : array();
// $tracking_topics = ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t']) : array();
//
// if ( ( count($tracking_forums) + count($tracking_topics) ) >= 150 && empty($tracking_forums[$forum_id]) )
// {
// asort($tracking_forums);
// unset($tracking_forums[key($tracking_forums)]);
// }
//
// if ( $row['last_post'] > $userdata['user_lastvisit'] )
// {
// $tracking_forums[$forum_id] = time();
//
// setcookie($board_config['cookie_name'] . '_f', serialize($tracking_forums), 0, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']);
// }
// }
//-- add
$board_config['tracking_forums'][$forum_id] = time();
// clean cookies
$s_topics = '';
// unreads
@reset($board_config['tracking_unreads']);
while ( list($id, $time) = @each($board_config['tracking_unreads']) )
{
$s_topics .= ( empty($s_topics) ? '' : ', ' ) . $id;
}
// reads
@reset($board_config['tracking_topics']);
while ( list($id, $time) = @each($board_config['tracking_topics']) )
{
$s_topics .= ( empty($s_topics) ? '' : ', ' ) . $id;
}
// read the relevant topic ids
$sql = "SELECT topic_id
FROM " . TOPICS_TABLE . "
WHERE topic_id IN ($s_topics)
AND forum_id = $forum_id
AND topic_moved_id = 0";
if ( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not access topics', '', __LINE__, __FILE__, $sql);
}
// clean them
while ( $row = $db->sql_fetchrow($result) )
{
if ( isset($board_config['tracking_unreads'][ $row['topic_id'] ]) )
{
unset($board_config['tracking_unreads'][ $row['topic_id'] ]);
}
if ( isset($board_config['tracking_topics'][ $row['topic_id'] ]) )
{
unset($board_config['tracking_topics'][ $row['topic_id'] ]);
}
}
// except the cookies
write_cookies($userdata);
//-- fin mod : keep unread -------------------------------------------------------------------------
$template->assign_vars(array(
'META' => '<meta http-equiv="refresh" content="3;url=' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . '">')
);
//-- mod : keep unread -----------------------------------------------------------------------------
//-- delete
// }
//-- fin mod : keep unread -------------------------------------------------------------------------
$message = $lang['Topics_marked_read'] . '<br /><br />' . sprintf($lang['Click_return_forum'], '<a href="' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . '">', '</a> ');
message_die(GENERAL_MESSAGE, $message);
}
//
// End handle marking posts
//
Voor de rest volgens mij geen verandering. Dat zou dus betekenen dat de Keep Unread niet goed werkt.
Dan is de volgende vraag, hoe dit te verbeteren???