gle|msnbot|yahoo! slurp)#si", $_SERVER['HTTP_USER_AGENT']))) { header("HTTP/1.0 301 Moved Permanently"); header('Location: ' . preg_replace('#\?s=[0-9a-f]+#', '', $uri)); exit(); } // ########################### LOAD SUBDREAMER CORE ############################ include($rootpath . 'includes/core.php'); // ############################# ENABLE GZIP COMPRESSION ######################## $sd_gzhandler = false; $tmp_handler = @ini_get('output_handler'); $tmp_zcompress = @ini_get('zlib.output_compression'); if ( !empty($mainsettings['gzipcompress']) && @extension_loaded('zlib') && //$tmp_zcompress != '1' && $tmp_handler != 'ob_gzhandler') { // This setting can be used to adjust the amount of compression applied (1-9) // However it may not work depending on the server environment //@ini_set('zlib.output_compression_level', 3); $sd_gzhandler = @ob_start('ob_gzhandler'); } unset($tmp_handler,$tmp_zcompress); // ################################ MOD REWRITE ################################ if(substr($uri,-12) == '?categoryid=') { $uri .= '1'; $_GET['categoryid'] = 1; } // mongeron: Redirect URLs that start with index.php to SEO friendly URLs if($mainsettings['modrewrite'] && (($ipos = strpos($uri, 'index.php')) !== false) && !(isset($_POST['login']) && $_POST['login']=='login') ) { if(isset($_GET['categoryid']) && (empty($_GET['categoryid']) || !ereg("^[0-9]+$", $_GET['categoryid']))) { $categoryid = 1; sd_redirect(404, '', $sdlanguage['url_not_found']); } $url = '/'; if(isset($_GET['categoryid'])) { $newlink = RewriteLink(substr($uri, $ipos)); if ($newlink !== $uri) { $url = $newlink; } } sd_redirect(301, $url); } // ############################### USER SYSTEM ################################ // usersystem is fetched in core.php // fix username and password for foreign chracters, this only needs to be done // on the frontend, becuase subdreamer doesn't htmlspecialchars data in the backend. if(isset($_POST['loginusername']) || isset($_POST['loginpassword'])) { // IPB stores usernames and passwords as their entities in the database // IPB changes the single quote to the entity ' however, our htmlspecialchars changes it to ' // conclusion: the usernames and passwords have already gone through htmlspecialchars, // but we need to fix the single quote to match what IPB does if($usersystem['name'] == 'Invision Power Board 2') { $_POST['loginusername'] = str_replace(''', ''', isset($_POST['loginusername'])?(string)$_POST['loginusername']:''); $_POST['loginpassword'] = str_replace(''', ''', isset($_POST['loginpassword'])?(string)$_POST['loginpassword']:''); } else if($usersystem['name'] != 'Subdreamer') { // vBulletin, SMF, & PHPBB DO NOT store usernames and passwords with entities // conclusion: because the POST username and password have gone though htmlspecialchars(), // we need to change them back: $_POST['loginusername'] = unhtmlspecialchars(isset($_POST['loginusername'])?(string)$_POST['loginusername']:''); $_POST['loginpassword'] = unhtmlspecialchars(isset($_POST['loginpassword'])?(string)$_POST['loginpassword']:''); // HOWEVER, now that they are back to normal (example: Zi'ad), they can break the database // conclusion: Use AddSlashes() $_POST['loginusername'] = $DB->escape_string(isset($_POST['loginusername'])?(string)$_POST['loginusername']:''); // What about the passwords? // the passwords are never queried, however some forums use the addslashes function // on their passwords before encrypting them: if($usersystem['name'] == 'phpBB2') { $_POST['loginpassword'] = $DB->escape_string(isset($_POST['loginpassword'])?(string)$_POST['loginpassword']:''); } } // What about the SDCMS User System? // SDCMS only allows alphanumeric chars for usernamers and passwords, so we do not have to // worry about that usersystem. } if(preg_match('#(logout\/1$)|(logout=1$)#', $uri)) { $_GET['logout'] = '1'; } // switch database? if($usersystem['dbname'] != $dbname) { // Subdreamer is being integrated with a Forum in a different database $DB->select_db($usersystem['dbname']); require($rootpath . 'includes/usersystems/' . $usersystem['queryfile']); $DB->select_db($dbname); } else { // Subdreamer may be integrated with a forum in the same database, // or is using the Subdreamer User System require($rootpath . 'includes/usersystems/' . $usersystem['queryfile']); } unset($userinfo); $userinfo = GetUserInfo($usersettings); unset($usersettings); // if not already set by a forum, set a global define with the user IP if(!defined('SESSION_HOST')) { $userip = ( !empty($HTTP_SERVER_VARS['REMOTE_ADDR']) ) ? $HTTP_SERVER_VARS['REMOTE_ADDR'] : ( ( !empty($HTTP_ENV_VARS['REMOTE_ADDR']) ) ? $HTTP_ENV_VARS['REMOTE_ADDR'] : 'unknown'); define('SESSION_HOST', substr(addslashes($userip), 0, 15)); unset($userip); } if($mainsettings['modrewrite'] && strlen($uri) && !strstr($uri, '/index.php') && (substr($uri, -4) != '.php')) { // use to determine if the variable's values need addslashes $addslashes = get_magic_quotes_gpc() ? false : true; // first thing to do is get the real $_SERVER['REQUEST_URI'] // because if Subdreamer is in a subfolder, then that subfolder will be part // of the request_uri for example, if // url = http://localhost/subdreamer/ // then the request_uri is // /subdreamer/ // so in a way, we have to subtract the url from the request_uri // request_uri, get rid of the trailing slash $requesturi = (substr($uri, -1) == '/') ? substr($uri, 0, -1) : $uri; // pattern to get rid of the root url, ex: http://localhost // leaving only the subfolders, ex: /subdreamer/ $subfolders = preg_replace("#https?://[^/]+(/?.*)#", "\$1", $sdurl); // now subtract the subfolders from the request_uri, and get the url with the variables // ex: var1/val1/var2/val2 (trailing slash removed above) $urlvariables = substr($requesturi, strlen($subfolders)); // MOD 2b. allow normal parameters, need to cut off anything with "?" // - Mongeron if(strpos($urlvariables, '?') !== FALSE) { $urlvariables = substr($urlvariables, 0, strpos($urlvariables, '?')); } // MOD 2b. END // explode the url variables $urlvariables = (substr($urlvariables, 0, 1) == '/') ? substr($urlvariables, 1) : $urlvariables; $variables = explode('/', $urlvariables); // Darth Pincho: // http://www.subdreamer.com/forum/showthread.php?t=10495 // Enhanced mod of article url rewrite introduced by spib // incl. title AND article ID to make unique URL if(preg_match('#(\.html$)|(\.htm$)|(.php$)#', $variables[count($variables)-1])) { //clean title to get rid of the .html part $title = preg_replace('#(\.html$)|(\.htm$)|(\.php$)#', '', $variables[count($variables)-1]); //explode the title to find article numer and page number $aux = explode('-', $title); //if the article have page number if (substr($aux[count($aux)-1],0,4) == 'page') { $page = substr($aux[count($aux)-1], 4); $article['articleid'] = substr($aux[count($aux)-2],1); } else //this means that the url doesn't have -pageXXXX then page is 0, so we find the article number. { $article['articleid'] = substr($aux[count($aux)-1], 1); $page = 1; } if($article['articleid'] > 0) { $aok = true; // remove last variable as it is the article title, but interferes // with mongeron's subcategory mod (further below) if(count($variables)) { array_splice($variables,count($variables)-1,1); } $_GET['p2_articleid'] = $article['articleid']; if((int)$page > 1) { $_GET['p2_page'] = $page; } } unset($title); } if(empty($mainsettings['url_subcategories'])) { // Default code for "single" category names if(isset($variables[0]) && strlen($variables[0])) { // before we loop the variable into the $_GET array, lets first grab the categoryid if(sd_is_url_param($variables[0])) { // set the categoryid $_GET['categoryid'] = 1; // now it's time to create the variables // i = 1 because we're skipping the home category for($i = 0, $vc = count($variables); $i < $vc; $i = $i+2) { if(isset($variables[$i + 1])) { // ($i + 1 = value of variable, ex: var1/val1/ etc...) $variablevalue = $variables[$i + 1]; // clean the values first $variablevalue = $addslashes ? addslashes(PreClean($variablevalue)) : PreClean($variablevalue); // variable names dont' have to be cleaned, because they are called directly $_GET[$variables[$i]] = $variablevalue; } } if(!isset($_POST['com_action']) && !isset($_GET['com_action']) && //empty($aok) && isset($_GET['p2_articleid']) && ereg("^[0-9]+$", $_GET['p2_articleid'])) { /* At this point we need to detect already if a) the article exists at all (no = send 404) b) if the user has view permission for both category AND article plugin c) if applicable, redirect to a new SEO titled URL We do not check here if the article is offline or not, that is to be done by the article plugin itself! */ sd_checkarticle((int)$_GET['p2_articleid'],empty($aok)); } } else { $cat_count = 0; $variable_start = 1; $urlcategoryname = ''; // 2.5.4: only try to recognise the first value as a categoryname // or otherwise plugins with non-SD parameters will not work!!! // Replaced "while" by "if": if(count($variables) && !sd_is_url_param($variables[0])) { $urlcategoryname = $variables[0]; array_splice($variables,0,1); $cat_count++; $variable_start = 0; } $do_redirect = ($cat_count > 1); // now clean the categoryname and addslashes: $urlcategoryname = $addslashes ? addslashes(PreClean($urlcategoryname)) : PreClean($urlcategoryname); if($category = $DB->query_first("SELECT categoryid FROM {categories} WHERE urlname = '%s'", $urlcategoryname)) // AND LENGTH(link) <= 0 { // set the categoryid $_GET['categoryid'] = $category['categoryid']; // now it's time to create the variables // i = 1 because we're skipping the home category $invalid = false; $new_var_uri = ''; for($i = $variable_start, $vc = count($variables); $i < $vc; $i = $i+2) { // ($i + 1 = value of variable, ex: var1/val1/ etc...) if(isset ($variables[$i + 1])) { $variablevalue = $variables[$i + 1]; // clean the values first $variablevalue = $addslashes ? addslashes(PreClean($variablevalue)) : PreClean($variablevalue); // variable names dont' have to be cleaned, because they are called directly $_GET[$variables[$i]] = $variablevalue; // Build "new" URI variables needed for RewriteLink if($variables[$i] != 'categoryid') { $new_var_uri .= '&'.$variables[$i].'='.$variablevalue; } } else { $invalid = true; break; } } // If an odd number of values was detected, do error: if($invalid) { sd_redirect(404, '', $sdlanguage['url_not_found']); } if(!isset($_POST['com_action']) && !isset($_GET['com_action']) && //empty($aok) && isset($_GET['p2_articleid']) && ereg("^[0-9]+$", $_GET['p2_articleid'])) { /* At this point we need to detect already if a) the article exists at all (no = send 404) b) if the user has view permission for both category AND article plugin c) if applicable, redirect to a new SEO titled URL We do not check here if the article is offline or not, that is to be done by the article plugin itself! */ sd_checkarticle((int)$_GET['p2_articleid'],empty($aok)); } // If a sub-cat link was detected, although currently this option // is off, we redirect to the "regular" link with the just // processed variables if($do_redirect) { if(!strlen($new_var_uri) && !empty($aok)) { $new_var_uri = '&p2_articleid='.$_GET['p2_articleid']; if(!empty($_GET['p2_page'])) { $new_var_uri .= '&p2_page='.$_GET['p2_page']; } } $newlink = RewriteLink('index.php?categoryid='.$category['categoryid'].$new_var_uri); sd_redirect(301, $newlink); } } else { if(!isset($variables[0]) || @!is_dir($variables[0])) { header("HTTP/1.0 404 Not Found"); // set HTTP header } PrintMessage($sdlanguage['page_not_found'] . '

' . $sdlanguage['redirect_to_homepage'] . ''); } } } else { // no strlen for category name probably means we've loaded the main url // ex:www.domain.com $_GET['categoryid'] = 1; } } else // mongeron: "Subcategories in URL" // http://www.subdreamer.org/forum/showthread.php?p=13630#post13630 // allows rewrites like: http://www.mysite.com/cat/subcat1/subcat2 if(isset($variables[0]) && strlen($variables[0])) { $varclean = array(); // Create a PreCleaned version of $variables, and enclose stings with '' foreach ($variables as $varline) { if(sd_is_url_param($varline)) break; // skip plugin parameters $varclean[] = "'" . ($addslashes ? addslashes(PreClean($varline)) : PreClean($varline)) . "'"; $varclean[] = "'" . ($addslashes ? addslashes(PreClean($varline)) : PreClean($varline)) . ".html'"; } // Get all categories whose urlname matches to some variable $catcount = 0; if(!empty($varclean)) { $catlist = $DB->query('SELECT urlname, categoryid, parentid FROM {categories} WHERE urlname IN (%s)', implode(',', $varclean)); //AND LENGTH(link) <= 0 $catcount = $DB->get_num_rows($catlist); } if(!empty($varclean) && ($catcount !== (count($varclean)/2))) { sd_redirect(404, '', $sdlanguage['url_not_found']); } if(empty($catlist)) { $catid = 1; $linkcat = false; $cat_wrongcase = false; } else { $rows = array(); // Create local array of the results while($row = $DB->fetch_array($catlist)) { if (!empty($row)) { $rows[] = $row; } } // First category's parent id (catid) is 0 $catid = 0; $rownum = count($rows); $invalid = 0; $linkcat = 0; $cat_wrongcase = 0; $do_redirect = false; // Special case: an "old" friendly url has only one category in the URL // and may still be valid, so we'd need to redirect it: if(count($rows)==1 && ($rows[0]['parentid'] > 1)) { $urlcategoryname = $addslashes ? addslashes(PreClean($variables[0])) : PreClean($variables[0]); array_shift($variables); $catid = $rows[0]['categoryid']; $do_redirect = true; } else // Check each $variables element against results from DB query // If match is found, update catid, remove the row from results array // and the element from $variables array while (count($rows) != 0 && !$invalid) { $urlcategoryname = $addslashes ? addslashes(PreClean($variables[0])) : PreClean($variables[0]); $urlcategoryname_lc = strtolower($urlcategoryname); for($i = 0, $rc = count($rows); $i != $rc; $i++) { $cat_row_lc = strtolower($rows[$i]['urlname']); if((($cat_row_lc == $urlcategoryname_lc) || ($cat_row_lc == $urlcategoryname_lc.'.html')) && (($rows[$i]['parentid'] == 1) || ($rows[$i]['parentid'] == $catid))) { $catid = $rows[$i]['categoryid']; $linkcat = empty($rows[$i]['link']) ? 0 : 1; $cat_wrongcase = ($rows[$i]['urlname'] !== $urlcategoryname) ? 1 : 0; array_splice($rows, $i, 1); array_shift($variables); break; } } // Infinite loop prevention, in case the URL is invalid if ($rownum == count($rows)) { $invalid = 1; } else { $rownum--; } } //while unset($rc); } // at this point $variables should be an array with an odd number of values (cat/var1/val1) // so exit if it's not! // In case the URL was declared invalid previously, output 404 too if(((count($variables) > 1) && (count($variables) % 2 == 1)) || !empty($invalid) || !empty($linkcat)) { sd_redirect(404, '', $sdlanguage['url_not_found']); } $_GET['categoryid'] = $catid; // now it's time to create the variables $new_var_uri = ''; // string with passed variables except category! for($i = 0, $vc = count($variables); $i < $vc; $i = $i+2) { // ($i + 1 = value of variable, ex: var1/val1/ etc...) if(isset($variables[$i+1])) { $variablevalue = $variables[$i+1]; // clean the values first $variablevalue = $addslashes ? $DB->escape_string(PreClean($variablevalue)) : PreClean($variablevalue); // variable names dont' have to be cleaned, because they are called directly $_GET[$variables[$i]] = $variablevalue; // Build "new" URI variables needed for RewriteLink if($variables[$i] != 'categoryid') { $new_var_uri .= '&'.$variables[$i].'='.$variablevalue; } } } unset($vc); if($cat_wrongcase) { $url = RewriteLink('index.php?categoryid='.(int)$_GET['categoryid'].$new_var_uri); sd_redirect(301, $url); } if(empty($sd_article_seo) && !empty($aok)) { $do_redirect = true; } // mongeron: if(!isset($_POST['com_action']) && !isset($_GET['com_action']) && empty($aok) && isset($_GET['p2_articleid']) && ereg("^[0-9]+$", $_GET['p2_articleid'])) { /* At this point we need to detect already if a) the article exists at all (no = send 404) b) if the user has view permission for both category AND article plugin c) if applicable, redirect to a new SEO titled URL We do not check here if the article is offline or not, that is to be done by the article plugin itself! */ sd_checkarticle($_GET['p2_articleid'], $do_redirect); } else if($do_redirect) { // If a SEO article title was already detected, recreate the correct // SEO article URL, otherwise redirect to "regular" URL if(!empty($aok)) { $page = 1; if(isset($_GET['p2_page']) && ((int)$_GET['p2_page'] > 1)) { $page = (int)$_GET['p2_page']; } $url = RewriteNewsLink((int)$_GET['categoryid'],$_GET['p2_articleid'],$page,null,2); } else { $url = RewriteLink('index.php?categoryid='.(int)$_GET['categoryid'].$new_var_uri); } sd_redirect(301, $url); } } } else { // Special article SEO case: non-friendly URL with article id, but // Friendly URL's is "Yes": probably need to redirect to new URL if(!isset($_POST['com_action']) && !isset($_GET['com_action']) && $mainsettings['modrewrite'] && isset($_GET['p2_articleid']) && ereg("^[0-9]+$", $_GET['p2_articleid'])) { /* At this point we need to detect already if a) the article exists at all (no = send 404) b) if the user has view permission for both category AND article plugin c) if applicable, redirect to a new SEO titled URL We do not check here if the article is offline or not, that is to be done by the article plugin itself! */ sd_checkarticle($_GET['p2_articleid'], $sd_article_seo); } } unset ($uri, $aok, $cat_wrongcase, $variablevalue, $rownum, $urlcategoryname_lc, $cat_row_lc, $varline, $variables, $varclean, $urlvariables, $aux, $subfolders, $rows, $row, $linkcat, $invalid, $i, $catlist, $catid, $article, $requesturi); // ############################## GET CATEGORYID ############################### $categoryid = (isset($_GET['categoryid']) && ereg("^[0-9]+$", $_GET['categoryid'])) ? $_GET['categoryid'] : 1; // Let's check if this category is allowed to be viewed without SSL... if not it is a good time to escape $category = $DB->query_first('SELECT sslurl FROM {categories} WHERE categoryid = %d', $categoryid); if(!empty($mainsettings['forcessl']) && (empty($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS'])=='off') && !empty($category['sslurl'])) { sd_redirect(404); } unset($category); // ################### SET LOCALE TIME AND HEADER INFORMATION ################## if(!headers_sent()) { header("$sd_charset_contenttype"); //set in core.php } // ################################# GET LOGO ################################# $logo = $mainsettings['currentlogo']; // ################################# COPYRIGHT ################################# // please do not remove this unless you have purchased the branding free option $copyright = $mainsettings['copyrighttext']; if(!$mainsettings['bfo']) { $copyright .= ' DHRC Copyright 2007 - 2008 All Rights Reserved'; } // ############################### WEBSITE OFF? ################################ if($mainsettings['siteactivation'] == 'off') { if($userinfo['offlinecategoryaccess']) { echo '
Website in Offline Mode
'; } else { PrintMessage($mainsettings['offmessage']); } } // ############################## CATEGORY ACCESS ############################## if(!@in_array($categoryid, $userinfo['categoryviewids'])) { PrintMessage($sdlanguage['no_view_access'], 1); } // ############################### IP Banned ? ################################ if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; } elseif (isset($_SERVER['HTTP_VIA'])) { $ip = $_SERVER['HTTP_VIA']; } elseif (isset($_SERVER['REMOTE_ADDR'])) { $ip = $_SERVER['REMOTE_ADDR']; } else { $ip = 'Banned'; } if(IsIpBanned($ip)) { PrintMessage($sdlanguage['ip_banned'], 0); } // ############################### SELECT DESIGN ############################## $design = $DB->query_first("SELECT d.maxplugins, d.designpath, s.name as skinname, c.name as categoryname, c.metadescription, c.metakeywords, c.appendkeywords, c.urlname FROM {designs} d, {categories} c, {skins} s WHERE c.categoryid = %d AND d.designid = c.designid AND s.skinid = d.skinid", $categoryid); // combine category title with HTML's title? if($mainsettings['categorytitle']) { if(!isset($mainsettings['title_separator']) || !strlen($mainsettings['title_separator'])) { $mainsettings['title_separator'] = ' - '; } // For "Home" category avoid the category name in title if no friendly name given: if($mainsettings['modrewrite'] && !strlen($design['urlname']) && ($categoryid==1)) { //nothing } else if(empty($mainsettings['title_order'])) { $mainsettings['websitetitle'] .= $mainsettings['title_separator'] . $design['categoryname']; } else { $mainsettings['websitetitle'] = $design['categoryname'] . $mainsettings['title_separator'] . $mainsettings['websitetitle']; } } // ####################### ALTER TITLE AND META SETTINGS ####################### if(!empty($design['appendkeywords'])) { if(!empty($design['metakeywords'])) { $mainsettings['metakeywords'] .= (strlen($mainsettings['metakeywords']) ? ',' : '') . $design['metakeywords']; } if(!empty($design['metadescription'])) { $mainsettings['metadescription'] .= (strlen($mainsettings['metadescription']) ? ',' : '') . $design['metadescription']; } } else { if(isset($design['metakeywords']) && strlen($design['metakeywords'])) { $mainsettings['metakeywords'] = $design['metakeywords']; } if(isset($design['metadescription']) && strlen($design['metadescription'])) { $mainsettings['metadescription'] = $design['metadescription']; } } $mainsettings['metakeywords'] = str_replace(', ', ',', $mainsettings['metakeywords']); if(isset($_GET['p2_articleid']) && ereg("^[0-9]+$", $_GET['p2_articleid'])) { if($article = $DB->query_first("SELECT title, metakeywords, metadescription FROM {p2_news} WHERE articleid = %d", $_GET['p2_articleid'])) { $mainsettings['websitetitle'] .= ' - ' . $article['title']; $mainsettings['metadescription'] .= (strlen($mainsettings['metadescription']) ? ', ' : '') . $article['metadescription']; $mainsettings['metakeywords'] .= (strlen($mainsettings['metakeywords']) ? ', ' : '') . $article['metakeywords']; } } // ############################ GET DESIGN'S PLUGINS ########################## $customplugin = array(); $custompluginfile = array(); $pluginname = array(); $pluginpath = array(); $pluginids = array(); $plugins = null; $has_cp_perm = !empty($userinfo['custompluginviewids']); $has_p_perm = !empty($userinfo['pluginviewids']); $customplugincount = 0; $getplugins = $DB->query('SELECT pluginid FROM {pagesort} WHERE categoryid = %d ORDER BY displayorder', $categoryid); // store plugins for($i = 0; $i < $design['maxplugins']; $i++) { $plugins = $DB->fetch_array($getplugins); if(!isset($plugins)) { // something's wrong at this point! } if(substr($plugins['pluginid'], 0, 1) == 'c') { // it's a custom plugin $custompluginid = substr($plugins['pluginid'], 1); if($has_cp_perm && @in_array($custompluginid, $userinfo['custompluginviewids'])) { $pluginids[$i] = $custompluginid; $getcustomplugin = $DB->query_first('SELECT displayname, plugin, includefile FROM {customplugins} WHERE custompluginid = %d', $custompluginid); $customplugin[] = $getcustomplugin['plugin']; $custompluginfile[] = $getcustomplugin['includefile']; $pluginname[$i] = $getcustomplugin['displayname']; $pluginpath[$i] = 'plugins/customplugins.php'; } else { $pluginids[$i] = 1; $pluginname[$i] = ''; $pluginpath[$i] = 'plugins/p1_empty/empty.php'; } } else if(!empty($userinfo['pluginviewids'])) { // it's a normal plugin $plugin = $DB->query_first("SELECT pluginpath, displayname, authorname FROM {plugins} WHERE pluginid = %d", $plugins['pluginid']); if(file_exists('plugins/' . $plugin['pluginpath'])) { if($has_p_perm && @in_array($plugins['pluginid'], $userinfo['pluginviewids'])) { $pluginids[$i] = $plugins['pluginid']; $pluginname[$i] = $plugin['displayname']; $pluginpath[$i] = 'plugins/' . $plugin['pluginpath']; } else { $pluginids[$i] = 1; $pluginname[$i] = ''; $pluginpath[$i] = 'plugins/p1_empty/empty.php'; } } else { $pluginids[$i] = 0; $pluginname[$i] = ''; $pluginpath[$i] = 'plugins/error.php'; } } } unset ($has_cp_perm, $has_p_perm, $getplugins, $getcustomplugin, $plugins, $plugin); // ############################## GET CATEGORIES ############################## // if user is not logged in then do not display member only categories $getcategories = $DB->query("SELECT categoryid, name, link, target, image, hoverimage FROM {categories} WHERE parentid = 0 ORDER BY displayorder"); for($i = 0; $category = $DB->fetch_array($getcategories); $i++) { if(@in_array($category['categoryid'], $userinfo['categorymenuids'])) { if(strlen($category['image'])) { // hover image if(strlen($category['hoverimage'])) { $categoryname[$i] = '' .
          addslashes($category['name']) . ''; } else { $categoryname[$i] = '' . addslashes($category['name']) . ''; } } else { $categoryname[$i] = $category['name']; } $categorylink[$i] = strlen($category['link']) ? $category['link'] : RewriteLink('index.php?categoryid=' . $category['categoryid']); $categorytarget[$i] = strlen($category['target']) ? $category['target'] : '_self'; $categoryids[$i] = $category['categoryid']; } else { $i--; } } $categoryrows = $i; // ############################### LOAD DESIGN ################################ // add an extra main setting for skins $mainsettings['skinheader'] = (strlen($sdurl)?'':'') . ' '; if(empty($design['designpath'])) { $errormsg = 'Error: The specified url could not be found.
The page may have been deleted.

Click here to load the home section.'; PrintMessage($errormsg); } else if(is_file('skins/'.$design['designpath'])) { if(!include('skins/'.$design['designpath'])) { $errormsg = 'Error: Problem including the file:
' . $design['designpath'] . '

Click here to load the home section.'; PrintMessage($errormsg); } } else { $errormsg = "Error: Failed to load the files for skin '" . $design['skinname'] . "'.
The file '" . 'skins/'.$design['designpath']. "' does not exist.

Click here to load the home section."; PrintMessage($errormsg); } // ############################# CLOSE CONNECTION ############################# if(!empty($sd_gzhandler)) { @ob_end_flush(); } if(isset($DB) && $DB->conn) {include($rootpath . 'plugins/p36_wherebisdu/wbdtrack.php'); $DB->close(); } ?>
Wholesale Jerseys NFL Jerseys China nba jerseys your name Kate Spade Outlet Store Wholesale Jerseys China Cheap Jerseys Cheap Jerseys Ray Ban Sunglasses nike free 3.0 v5 green cheapjerseysforsale.us.com Wholesale NFL Jerseys nike air max 1 schoenen grijs lila roze us jordan 11 sale Coach Outlet Christian Louboutin Outlet Michael Kors Outlet Cheap Jerseys Air Jordan 11 Pas Cher Cheap Jerseys Coach Outlet