strpos($_SERVER['HTTP_USER_AGENT'], 'Opera') !== false, 'is_opera6' => strpos($_SERVER['HTTP_USER_AGENT'], 'Opera 6') !== false, 'is_opera7' => strpos($_SERVER['HTTP_USER_AGENT'], 'Opera 7') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'Opera/7') !== false, 'is_opera8' => strpos($_SERVER['HTTP_USER_AGENT'], 'Opera 8') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'Opera/8') !== false, 'is_ie4' => strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 4') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'WebTV') === false, 'is_safari' => strpos($_SERVER['HTTP_USER_AGENT'], 'Safari') !== false, 'is_mac_ie' => strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 5.') !== false && strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') !== false, 'is_web_tv' => strpos($_SERVER['HTTP_USER_AGENT'], 'WebTV') !== false, 'is_konqueror' => strpos($_SERVER['HTTP_USER_AGENT'], 'Konqueror') !== false, 'is_firefox' => strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') !== false, ); $context['browser']['is_gecko'] = strpos($_SERVER['HTTP_USER_AGENT'], 'Gecko') !== false && !$context['browser']['is_safari'] && !$context['browser']['is_konqueror']; // Internet Explorer 5 and 6 are often "emulated". $context['browser']['is_ie7'] = strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 7') !== false && !$context['browser']['is_opera'] && !$context['browser']['is_gecko'] && !$context['browser']['is_web_tv']; $context['browser']['is_ie6'] = strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 6') !== false && !$context['browser']['is_opera'] && !$context['browser']['is_gecko'] && !$context['browser']['is_web_tv']; $context['browser']['is_ie5.5'] = strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 5.5') !== false && !$context['browser']['is_opera'] && !$context['browser']['is_gecko'] && !$context['browser']['is_web_tv']; $context['browser']['is_ie5'] = strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 5.0') !== false && !$context['browser']['is_opera'] && !$context['browser']['is_gecko'] && !$context['browser']['is_web_tv']; $context['browser']['is_ie'] = $context['browser']['is_ie4'] || $context['browser']['is_ie5'] || $context['browser']['is_ie5.5'] || $context['browser']['is_ie6'] || $context['browser']['is_ie7']; $context['browser']['needs_size_fix'] = ($context['browser']['is_ie5'] || $context['browser']['is_ie5.5'] || $context['browser']['is_ie4'] || $context['browser']['is_opera6']) && strpos($_SERVER['HTTP_USER_AGENT'], 'Mac') === false; //Get the board ID @$board = (int) $_GET['board']; //Get the topic ID @$topic = (int) $_GET['topic']; if(empty($board) && empty($topic)) { archive_main(); exit(); } if(!empty($board)) { archive_board($board); exit(); } if(!empty($topic)) { archive_topic($topic); exit(); } function archive_board($boardid) { global $boardurl, $db_prefix, $maxtopics, $mbname; $boardid = addslashes($boardid); $start = (int) $_REQUEST['start']; $request = db_query("SELECT b.name, b.numTopics FROM {$db_prefix}boards AS b WHERE b.ID_BOARD = $boardid", __FILE__, __LINE__); $row = mysql_fetch_assoc($request); archive_header($row['name'],$boardurl . '/index.php?board=' . $boardid . '.' . $start); //Show board Menu Parent List echo '
' . $mbname . '
'; //Show Pages List $totalpages = (int) $row['numTopics'] / $maxtopics; if($totalpages < 1) $totalpages = 1; echo '
Pages: '; for($i=1; $i <= $totalpages; $i++) { if($i != $totalpages) echo '' . $i . ', '; else echo '' . $i . ''; } echo '
'; echo '
'; $request2 = db_query("SELECT m.subject, t.ID_TOPIC, t.numReplies FROM {$db_prefix}messages AS m, {$db_prefix}topics AS t WHERE m.ID_BOARD = $boardid AND m.ID_MSG = t.ID_FIRST_MSG ORDER BY t.ID_LAST_MSG DESC LIMIT $start,$maxtopics", __FILE__, __LINE__); $i = 0; while($row2 = mysql_fetch_assoc($request2)) { $i++; echo $i . '. ' . $row2['subject'] . ' (' . $row2['numReplies'] . ' replies)
'; } echo '
'; archive_footer(); } function archive_topic($topicid) { global $boardurl, $db_prefix, $maxposts, $user_info, $mbname; $topicid = addslashes($topicid); $start = $_REQUEST['start']; $request = db_query("SELECT m.subject, t.numReplies, b.name, b.ID_BOARD, m.ID_BOARD FROM {$db_prefix}messages AS m, {$db_prefix}topics AS t, {$db_prefix}boards AS b WHERE b.ID_BOARD = m.ID_BOARD AND t.ID_TOPIC = $topicid AND m.ID_MSG = t.ID_FIRST_MSG AND $user_info[query_see_board]", __FILE__, __LINE__); $row = mysql_fetch_assoc($request); archive_header($row['subject'],$boardurl . '/index.php?topic=' . $topicid . '.' . $start); echo '
' . $mbname . ' ' . $row['name'] . '
'; //Show Pages List $totalpages = floor($row['numReplies'] / $maxposts) + 1; if($totalpages < 1) $totalpages = 1; echo '
Pages: '; for($i=1; $i <= $totalpages; $i++) { if($i != $totalpages) echo '' . $i . ', '; else echo '' . $i . ''; } echo '
'; //Get all posts in a topic $request2 = db_query("SELECT m.subject, m.posterName, m.body, m.posterTime FROM {$db_prefix}messages AS m LEFT JOIN {$db_prefix}boards AS b ON(b.ID_BOARD = m.ID_BOARD) WHERE m.ID_TOPIC = $topicid AND $user_info[query_see_board] ORDER BY m.ID_MSG ASC LIMIT $start,$maxposts", __FILE__, __LINE__); echo '
'; while($row2 = mysql_fetch_assoc($request2)) { echo $row2['subject'] . ' By: ' . $row2['posterName'] . ' Date: ' . timeformat($row2['posterTime']) . '
'; if(function_exists('parse_bbc')) echo parse_bbc($row2['body']); else echo doUBBC($row2['body']); echo '
'; } echo '
'; archive_footer(); } function archive_main() { global $mbname,$boardurl, $db_prefix, $ID_MEMBER, $user_info, $modSettings; archive_header($mbname,$boardurl); //Show cats echo '
'; archive_footer(); } function archive_header($title, $url) { global $boardurl; echo ' ' . $title . ' '; } function archive_footer() { //Footer. echo '
'; } ?>