"; exit(); } $_GET['id'] = stripslashes(strip_tags($_GET['id'])); $_GET['sort'] = stripslashes(strip_tags($_GET['sort'])); if (!array_key_exists('start', $_GET) || $_GET['start'] < 0) { $_GET['start'] = 0; } $forum = getForum($_GET['id']); $category = getCategory($forum->category); if ($category->is_helpdesk) { $sort_style = $_GET['sort']; if (!$sort_style) { $sort_style = $_COOKIE['hd_sort_style']; } else { setcookie('hd_sort_style', $sort_style, time()+3600*24*365); } if (!$sort_style) $sort_style = 'activity'; page_head('Help Desk'); } else { $sort_style = $_GET['sort']; if (!$sort_style) { $sort_style = $_COOKIE['forum_sort_style']; } else { setcookie('forum_sort_style', $sort_style, time()+3600*24*365); } if (!$sort_style) $sort_style = 'modified-new'; page_head('Message boards : '.$forum->title); } echo "
"; // If there are more than the threshold number of threads on the page, // show only the first $n and display links to the rest // show_page_nav($forum); if ($category->is_helpdesk) { start_forum_table(array("Question", "Answers")); } else { start_forum_table(array("Threads", "Posts", "Author", "Views", "Last post")); } // TODO: Move this into its own function? $threads = getThreads($forum->id, $_GET['start'], $n, $sort_style); $n = 0; while ($thread = mysql_fetch_object($threads)) { $user = lookup_user_id($thread->owner); $first_post = getFirstPost($thread->id); $excerpt = sub_sentence($first_post->content, ' ', EXCERPT_LENGTH, true); echo "Go to page '; if ($curPage == 0) { $gotoStr .= '1'; } else { $gotoStr .= '1'; } for ($i = 1 ; $i < count($pages)-1 ; $i++) { if ($curPage == $pages[$i]) { $gotoStr .= ($i > 0 && $pages[$i-1] == $pages[$i] - 1)?', ':' ... '; $gotoStr .= ''.($pages[$i]+1).''; } else { $gotoStr .= ($i > 0 && $pages[$i-1] == $pages[$i] - 1)?', ':' ... '; $gotoStr .= ''; } } if ($curPage == $totalPages-1) { $gotoStr .= ', '.$totalPages.''; } else { $gotoStr .= ', '; $gotoStr .= '