debug = true ; $dbconn->PConnect($DBHOST, $DBUSER, $DBPASSWORD, $DBNAME); @mysql_query("SET NAMES 'UTF8'"); $sql = "SELECT * from settings"; $configurations = $dbconn->Execute($sql); if($configurations){ while(!$configurations->EOF) { $field = $configurations->fields['setting']; $config[$field] = $configurations->fields['value']; STemplate::assign($field, strip_mq_gpc($config[$field])); @$configurations->MoveNext(); } } if(isset($_REQUEST['nomobileview'])) { if($_REQUEST['nomobileview'] == "1"){$_SESSION['nomobileview'] = $_REQUEST['nomobileview'];} } if(!isset($_SESSION['nomobileview'])){$_SESSION['nomobileview'] = '';} if(isset($config['mobilemode'])){$mobilemode = $config['mobilemode'];}else{$mobilemode = '';} if($mobilemode == "1" && $config['m_url'] != "") { $pos = strpos($_SERVER['REQUEST_URI'], '/admin/'); if(!isset($mobile) && $_SESSION['nomobileview'] != "1" && $pos === false) { include("mobile.php"); $mcheck = is_md(); if($mcheck != "") { header("Location: ".$config['m_url'].$_SERVER['REQUEST_URI']);exit; } } } if(!isset($_SESSION['USERID'])){$_SESSION['USERID'] = '';} if(!isset($_SESSION['VERIFIED'])){$_SESSION['VERIFIED'] = '';} $mylangssql="SELECT * FROM languages WHERE lang_active='1'"; $mylangsexecutequery =$dbconn->execute($mylangssql); $mylangs = $mylangsexecutequery->getrows(); STemplate::assign('mylangs', $mylangs); if(!isset($_SESSION['MYLANG'])){$_SESSION['MYLANG'] = '';} foreach($mylangs as $mylang) { if(isset($_POST['mylang']) || isset($_REQUEST['mylang'])) { if(isset($_POST['mylang'])){$new_lang = $_POST['mylang'];}else{$new_lang = $_REQUEST['mylang'];} if($mylang['lang_folder'] == $new_lang) { $language_selected = 1; $_SESSION['MYLANG'] = $new_lang; if($_SESSION['USERID'] != "" && intval($_SESSION['USERID']) >= 0 && is_numeric($_SESSION['USERID'])) { $sql="UPDATE users SET mylang='".$new_lang."' WHERE USERID='".$_SESSION['USERID']."'"; $dbconn->Execute($sql); } break; } } if($mylang['lang_folder'] == $_SESSION['MYLANG']){$language_verified = 1;} } if((!isset($language_selected) || !isset($language_verified)) && $_SESSION['MYLANG'] == ''){$_SESSION['MYLANG'] = $config['default_language'];} include("lang/".$_SESSION['MYLANG']."/import.php"); foreach($lang as $key => $phrase) { STemplate::assign('lang'.$key, $phrase); } $mythemessql="SELECT * FROM themes WHERE theme_active='1'"; $mythemesexecutequery =$dbconn->execute($mythemessql); $mythemes = $mythemesexecutequery->getrows(); STemplate::assign('mythemes', $mythemes); if(!isset($_SESSION['MYTHEME'])){$_SESSION['MYTHEME'] = '';} foreach($mythemes as $mytheme) { if(isset($_POST['mytheme']) || isset($_REQUEST['mytheme'])) { if(isset($_POST['mytheme'])){$new_theme = cleanit($_POST['mytheme']);}else{$new_theme = cleanit($_REQUEST['mytheme']);} if($mytheme['theme_folder'] == $new_theme) { $theme_selected = 1; $_SESSION['MYTHEME'] = $new_theme; if($_SESSION['USERID'] != "" && intval($_SESSION['USERID']) >= 0 && is_numeric($_SESSION['USERID'])) { $sql="UPDATE users SET mytheme='".$new_theme."' WHERE USERID='".$_SESSION['USERID']."'"; $dbconn->Execute($sql); } $latest_theme = $mytheme['theme_folder']; break; } } elseif($mytheme['theme_folder'] == $_SESSION['MYTHEME']) { $theme_selected = 1; $latest_theme = $mytheme['theme_folder']; break; } } if(isset($latest_theme) && $latest_theme == $_SESSION['MYTHEME']){$theme_verified = 1;} if((!isset($theme_selected) || !isset($theme_verified)) || $_SESSION['MYTHEME'] == ''){$_SESSION['MYTHEME'] = $config['default_theme'];} $pages_query1 = "SELECT count(*) as total FROM pages WHERE page_active='1' limit ".$config['maximum_results']; $pages_query2 = "SELECT * FROM pages WHERE page_active='1' limit 0, ".$config['items_per_page']; $pagesexecutequery1 = $dbconn->Execute($pages_query1); $totalpages = $pagesexecutequery1->fields['total']; if ($totalpages > 0) { $pagesexecutequery2 = $dbconn->Execute($pages_query2); $pages_array = $pagesexecutequery2->getrows(); STemplate::assign('pages_array', $pages_array); } if($config['captcha_default'] == "2" && $config['ayahcaptcha_enabled'] == "1") { $ayah = new AYAH(); STemplate::assign('ayah',$ayah->getPublisherHTML()); } $config['adminurl'] = $config['baseurl'].'/admin'; $config['modcpurl'] = $config['baseurl'].'/modcp'; if($config['cdn_enabled'] == "1" && $config['cdnurl'] != "") { $the_baseurl = $config['baseurl']; $config['baseurl'] = $config['cdnurl']; } $config['cssurl'] = $config['baseurl'].'/styles/'.$_SESSION['MYTHEME'].'/css'; $config['baseimagesdir'] = $config['basedir'].'/img'; $config['baseimagesurl'] = $config['baseurl'].'/img'; $config['imagesdir'] = $config['basedir'].'/styles/'.$_SESSION['MYTHEME'].'/img'; $config['imagesurl'] = $config['baseurl'].'/styles/'.$_SESSION['MYTHEME'].'/img'; $config['usersavatardir'] = $config['basedir'].'/uploads/users/avatars'; $config['usersavatarurl'] = $config['baseurl'].'/uploads/users/avatars'; $config['userscoverdir'] = $config['basedir'].'/uploads/users/covers'; $config['userscoverurl'] = $config['baseurl'].'/uploads/users/covers'; $config['posts_dir'] = $config['basedir'].'/uploads/posts'; $config['posts_url'] = $config['baseurl'].'/uploads/posts'; if($config['cdn_enabled'] == "1" && $config['cdnurl'] != "") { $config['baseurl'] = $the_baseurl; } $config['setup_dir'] = $config['basedir']."/setup"; $config['temp_dir'] = $config['basedir'].'/temp'; $config['default_templates_dir'] = $config['basedir']."/styles/default/templates"; $config['user_templates_dir'] = $config['basedir']."/styles/".$_SESSION['MYTHEME']."/templates"; STemplate::assign('baseurl',$config['baseurl']); STemplate::assign('basedir',$config['basedir']); STemplate::assign('adminurl',$config['adminurl']); STemplate::assign('modcpurl',$config['modcpurl']); STemplate::assign('cssurl',$config['cssurl']); STemplate::assign('baseimagesdir',$config['baseimagesdir']); STemplate::assign('baseimagesurl',$config['baseimagesurl']); STemplate::assign('imagesdir',$config['imagesdir']); STemplate::assign('imagesurl',$config['imagesurl']); STemplate::assign('usersavatardir',$config['usersavatardir']); STemplate::assign('usersavatarurl',$config['usersavatarurl']); STemplate::assign('userscoverdir',$config['userscoverdir']); STemplate::assign('userscoverurl',$config['userscoverurl']); STemplate::assign('posts_dir',$config['posts_dir']); STemplate::assign('posts_url',$config['posts_url']); STemplate::assign('setup_dir',$config['setup_dir']); STemplate::assign('demo_mode',$demo_mode); STemplate::setCompileDir($config['temp_dir']); STemplate::setTplDir(array($config['user_templates_dir'], $config['default_templates_dir'])); if(file_exists($config['setup_dir']) || file_exists($config['setup_dir']."/setup.php")){STemplate::assign('setup_exists',1);} include($config['basedir']."/inc/login.php"); ?> 'Mobile Module' , 'code' => 'mobile'); $addons[] = array( 'name' => 'Bulk Upload' , 'code' => 'bulkupload'); STemplate::assign('addons',$addons); ?>