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 = $_GET['board']; //Get the topic ID @$topic = $_GET['topic']; // print_r (get_defined_vars()); if($board == '' && $topic == '') { archive_main(); exit(); } if($board != '') { archive_board($board); exit(); } if($topic != '') { archive_topic($topic); exit(); } function archive_board($boardid) { global $boardurl, $db_prefix, $maxtopics, $mbname, $user_info; //print_r ($user_info); $boardid = addslashes($boardid); $start = $_REQUEST['start']; $query = "SELECT b.name, b.numTopics, bp.addDeny FROM {$db_prefix}boards AS b LEFT JOIN {$db_prefix}board_permissions AS bp ON b.ID_BOARD = bp.ID_BOARD WHERE b.ID_BOARD = $boardid AND $user_info[query_see_board] AND ((b.permission_mode = 0) OR ( bp.permission = 'enter_board' )) ORDER BY bp.addDeny DESC LIMIT 1"; //echo ($query); $request = db_query($query, __FILE__, __LINE__); // 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] // AND ((b.permission_mode = 0) OR (FIND_IN_SET(bp.ID_BOARD, b.memberGroups) AND bp.permission = 'enter_board' AND bp.addDeny = 1))"; $row = mysql_fetch_assoc($request); //Show board Menu Parent List echo '
Forum: ' . $mbname . ' (see the full version of ' . $mbname . ')
'; archive_header($row['name'],$boardurl . '/index.php?board=' . $boardid . '.' . $start); if ($row['addDeny'] <> 1) { //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 '
'; $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"; $request2 = db_query($query, __FILE__, __LINE__); $i = 0; while($row2 = mysql_fetch_assoc($request2)) { $i++; echo '

' . $i . '. ' . $row2['subject'] . ' (' . $row2['numReplies'] . ' replies)

'; } echo '
'; archive_footer(); } else { echo '
'; echo 'You are not allowed to see these topics.'; echo '
'; } // if } function archive_topic($topicid) { global $boardurl, $db_prefix, $maxposts, $user_info, $mbname; $topicid = addslashes($topicid); $start = $_REQUEST['start']; $query = "SELECT m.subject, t.numReplies, b.name, b.ID_BOARD, m.ID_BOARD, bp.addDeny FROM {$db_prefix}messages AS m, {$db_prefix}topics AS t, {$db_prefix}boards AS b LEFT JOIN {$db_prefix}board_permissions AS bp ON b.ID_BOARD = bp.ID_BOARD 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] AND ((b.permission_mode = 0) OR (FIND_IN_SET(bp.ID_BOARD, b.memberGroups) AND bp.permission = 'enter_board' AND bp.addDeny = 1))"; // echo $query; $request = db_query($query, __FILE__, __LINE__); $row = mysql_fetch_assoc($request); echo '
Forum: ' . $mbname . ' (see the full version of ' . $mbname . ')
'; echo '
Board: ' . $row['name'] . ' (see the full version of ' . $row['name'] . ')
'; archive_header($row['subject'],$boardurl . '/index.php?topic=' . $topicid . '.' . $start); // echo '
Board: ' . $row['name'] . '
'; if ($row['addDeny'] <> 1) { //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__); while($row2 = mysql_fetch_assoc($request2)) { echo '
'; echo '

Subject: ' . $row2['subject'] . '

'; echo 'By: ' . $row2['posterName'] . '
'; echo 'Date: ' . timeformat($row2['posterTime']) . '
'; if(function_exists('parse_bbc')) echo parse_bbc($row2['body']); else echo doUBBC($row2['body']); // echo '
'; echo '
'; } } else { echo '
'; echo 'You are not allowed to see these posts.'; echo '
'; } // if archive_footer(); } function archive_main() { global $mbname,$boardurl, $db_prefix, $ID_MEMBER, $user_info, $modSettings; archive_header($mbname,$boardurl); //Show cats echo '
'; $request1 = db_query("SELECT c.ID_CAT, c.catOrder, c.name FROM {$db_prefix}categories AS c ORDER BY c.catOrder ASC", __FILE__, __LINE__); while ($row1 = mysql_fetch_assoc($request1)) { $catid = $row1['ID_CAT']; $request2 = db_query(" SELECT b.name, b.numPosts, b.ID_BOARD, b.ID_CAT, b.childLevel, b.ID_PARENT, b.boardOrder FROM {$db_prefix}boards AS b LEFT JOIN {$db_prefix}log_boards AS lb ON (lb.ID_BOARD = b.ID_BOARD AND lb.ID_MEMBER = $ID_MEMBER) WHERE $user_info[query_see_board]" . (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? " AND b.ID_BOARD != " . (int) $modSettings['recycle_board'] : '') . " AND $catid = b.ID_CAT ", __FILE__, __LINE__); $b_count = db_affected_rows(); if($b_count !=0) { echo '

' . $row1['name'] . '

'; //List the forums and subforums echo '
    '; while ($row2 = mysql_fetch_assoc($request2)) { echo '
  • ' . $row2['name'] . ' (' . $row2['numPosts'] . ' posts)

  • '; } echo '
'; } mysql_free_result($request2); } mysql_free_result($request1); echo '
'; archive_footer(); } function archive_header($title, $url) { global $boardurl, $context, $mbname, $modSettings, $userinfo, $board_info; // print_r (get_defined_vars()); echo ' '; echo '' , htmlspecialchars($mbname) . ' : '; if (! empty($context['current_board'])) { echo htmlspecialchars($board_info['name']) . ' - ' . htmlspecialchars($board_info['cat']['name'] . ' - '); }; echo htmlspecialchars($title), ' - '; echo 'forum Uzicana - mesta: Uzice, Pozega, Arilje, Ivanjica, Kosjeric, Bajina Basta, Priboj, Prijepolje, Zlatibor - Cajetina, Nova Varos, Sjenica '; } function archive_footer() { //Link back to SMF Hacks must remain. echo '
'; } ?>s must stay-->
'; } ?>