'.$lang_common['Login'].' '.$lang_common['or'].' '.$lang_common['register'].'.'); if (!$cookie['is_guest']) { $disp_topics = $cur_user['disp_topics']; $disp_posts = $cur_user['disp_posts']; } else { $disp_topics = $options['disp_topics_default']; $disp_posts = $options['disp_posts_default']; } $id = intval($_GET['id']); if (empty($id) || $id < 0) message($lang_common['Bad request']); // Load the viewforum.php language file require 'lang/'.$language.'/'.$language.'_forum.php'; // Fetch some info from the forum $result = $db->query('SELECT forum_name, moderators, num_topics, closed, admmod_only FROM '.$db->prefix.'forums WHERE id='.$id) or error('Unable to fetch forum info', __FILE__, __LINE__, $db->error()); if (!$db->num_rows($result)) message($lang_common['Bad request'], true); list($forum_name, $moderators, $num_topics, $closed, $admmod_only) = $db->fetch_row($result); if ($admmod_only == '1' && $cur_user['status'] < 1) message($lang_common['Bad request']); $mods_array = array(); if ($moderators != '') { $mods_array = unserialize($moderators); while (list($mod_username, $mod_id) = @each($mods_array)) $temp_array[] = ''.htmlspecialchars($mod_username).''; $mods_string = implode(', ', $temp_array); } if ($closed != '1') { if ($permissions['guests_post_topic'] == '0' && $cookie['is_guest'] || $permissions['users_post_topic'] == '0' && $cur_user['status'] < 1) $post_link = ' '; else $post_link = ''.$lang_forum['Post topic'].''; } else { if ($cur_user['status'] > 1 || $cur_user['status'] == 1 && array_key_exists($cur_user['username'], $mods_array)) $post_link = $lang_forum['Forum closed'].' / '.$lang_forum['Post topic'].''; else $post_link = $lang_forum['Forum closed']; } $page_title = htmlspecialchars($options['board_title']).' / '.htmlspecialchars($forum_name); require 'header.php'; ?>
/
$num_pages) { $p = 1; $start_from = 0; } else { $p = $_GET['p']; $start_from = $disp_topics * ($p - 1); } // Fetch topics (with or without "the dot") if ($cookie['is_guest'] || $options['show_dot'] == '0') { // Without "the dot" $result = $db->query('SELECT id, poster, subject, posted, last_post, last_post_id, last_poster, num_views, num_replies, closed, sticky, moved_to FROM '.$db->prefix.'topics WHERE forum_id='.$id.' ORDER BY sticky DESC, last_post DESC LIMIT '.$start_from.', '.$disp_topics) or error('Unable to fetch topic list for forum', __FILE__, __LINE__, $db->error()); } else { // Fetch topic ID's $result = $db->query('SELECT id FROM '.$db->prefix.'topics WHERE forum_id='.$id.' ORDER BY sticky DESC, last_post DESC LIMIT '.$start_from.', '.$disp_topics) or error('Unable to fetch topic list for forum', __FILE__, __LINE__, $db->error()); $threadids = '0'; while ($row = $db->fetch_row($result)) $threadids .= ','.$row[0]; // Fetch topics $result = $db->query('SELECT DISTINCT p.poster_id AS has_posted, t.id, t.poster, t.subject, t.posted, t.last_post, t.last_post_id, t.last_poster, t.num_views, t.num_replies, t.closed, t.sticky, t.moved_to FROM '.$db->prefix.'topics AS t LEFT JOIN '.$db->prefix.'posts AS p ON t.id=p.topic_id AND p.poster_id='.$cur_user['id'].' WHERE t.id IN('.$threadids.') ORDER BY sticky DESC, last_post DESC') or error('Unable to fetch topic list for forum', __FILE__, __LINE__, $db->error()); } // If there are topics in this forum. if ($db->num_rows($result)) { while ($cur_topic = $db->fetch_assoc($result)) { if ($cur_topic['moved_to'] == null) $last_post = ''.format_time($cur_topic['last_post']).' '.$lang_common['by'].' '.htmlspecialchars($cur_topic['last_poster']); else $last_post = ' '; if ($options['censoring'] == '1') $cur_topic['subject'] = censor_words($cur_topic['subject']); if ($cur_topic['moved_to'] != 0) $subject = $lang_forum['Moved'].': '.htmlspecialchars($cur_topic['subject']).''; else if ($cur_topic['closed'] != '1' && $closed != '1') $subject = ''.htmlspecialchars($cur_topic['subject']).''; else $subject = ''.htmlspecialchars($cur_topic['subject']).''; if (!$cookie['is_guest'] && $cur_topic['last_post'] > $cookie['last_timeout'] && $cur_topic['moved_to'] == null) { if ($cur_user['show_img'] != '0') $icon = ''; else $icon = ''; $subject = ''.$subject.''; } else $icon = ' '; // Should we display the dot or not? :) if (!$cookie['is_guest'] && $options['show_dot'] == '1') { if ($cur_topic['has_posted'] == $cur_user['id']) $subject = '· '.$subject; else $subject = '  '.$subject; } if ($cur_topic['sticky'] == '1') $subject = $lang_forum['Sticky'].': '.$subject; $num_pages_topic = ceil(($cur_topic['num_replies'] + 1) / $disp_posts); if ($num_pages_topic > 1) { $stop = ($num_pages_topic < 3) ? ($num_pages_topic + 1) : 4; $subject .= '  ['; for ($current=1; $current < $stop; $current++) $subject .= ' '.$current.''; if ($num_pages_topic > 3) $subject .= ' - '.$lang_common['Last page'].' ]'; else $subject .= ' ]'; } ?> '."\n"; ?>
 
'.$lang_forum['Empty forum'].'