' . $row1['name'] . '
'; //List the forums and subforums echo '- ';
while ($row2 = mysql_fetch_assoc($request2))
{
echo '
' . $row2['name'] . ' (' . $row2['numPosts'] . ' posts)
';
}
echo '
/* SMF Archive Version: 1.1 http://www.smfhacks.com By:vbgamer45 1.1 just normal archive not tied into SMF SEO yet wait for 1.2 Install: Just upload archive.php to your forum's main directory License: The footer links must remain. If you want to remove them you need to talk to me. ************************ archive.php - Generates a search engine friendly version of the forum. ************************ Function list void archive_board($boardid) - shows a board's topics passed is the ID_BOARD void archive_topic($topicid) - shows a topic's post passed is the ID_TOPIC void archive_main() - shows the board index of the archive //Template functions void archive_header($title, $url) - shows the header html information for the template. Takes a title of the page and the url to the full version void archive_footer() - shows the footer html for the archive. Links must remain! */ define('SMF', '1'); //Report all the errors error_reporting(E_ALL); //Get the database and board information require_once(dirname(__FILE__) . '/Settings.php'); //Max topics to show per page in a forum $maxtopics = 20; //Max posts to show per page in a topic $maxposts = 15; //Check if board is in maintenance mode if($maintenance == 2) die('Board is in maintenance mode. The archive is not open durning this time.'); //Connect to the database if($db_persist == 0) $db_connection = @mysql_connect($db_server, $db_user, $db_passwd); else $db_connection = @mysql_pconnect($db_server, $db_user, $db_passwd); //Check if you can connect to the database if (!$db_connection ) die('Could not connect to the database.'); if(!@mysql_select_db($db_name, $db_connection )) die('Could not select the database.'); //Take off that wirless warning define('WIRELESS', false); //These are mainly here to check for user permissions what boards and topics they can view. require_once($sourcedir . '/QueryString.php'); require_once($sourcedir . '/Subs.php'); require_once($sourcedir . '/Errors.php'); require_once($sourcedir . '/Load.php'); require_once($sourcedir . '/Security.php'); if (@version_compare(PHP_VERSION, '4.2.3') != 1) require_once($sourcedir . '/Subs-Compat.php'); reloadSettings(); cleanRequest(); //multidomain feature //Load custom domain information loadDomain(); //Load User Setttings loadUserSettings(); $user_info['smiley_set'] = $modSettings['smiley_sets_default']; $user_info['groups'] = array_unique($user_info['groups']); $user_info['groups_set'] = implode(', ', $user_info['groups']); // Just build this here, it makes it easier to change/use. if ($user_info['is_guest']) $user_info['query_see_board'] = 'FIND_IN_SET(-1, b.memberGroups)'; // Administrators can see all boards. elseif ($user_info['is_admin']) $user_info['query_see_board'] = '1'; // Registered user.... just the groups in $user_info['groups']. else $user_info['query_see_board'] = '(FIND_IN_SET(' . implode(', b.memberGroups) OR FIND_IN_SET(', $user_info['groups']) . ', b.memberGroups))'; if(!isset($topic)) loadBoard(); //Load the Current User Permmissions loadPermissions(); //Check if they have smfseo installed and turned on if(@$modSettings['smfseo_enabled'] == 1) $smfseo = true; else $smfseo = false; $board = ''; $topic = ''; //print_r ($user_info); //All $context['browser'] code from loadTheme from Load.php // The following determines the user agent (browser) as best it can. $context['browser'] = array( 'is_opera' => 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 '
'; 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 '