1 ? current($parts) : 'pbl'; $module = end($parts); $href = $_SERVER['PHP_SELF'] . ($_SERVER['QUERY_STRING'] ? '?'.$_SERVER['QUERY_STRING'] : ''); $popup = @intval($_GET['popup']); // $searchWhere = @$_GET['searchwhere']; // echo $_SERVER['QUERY_STRING']; // echo $_SERVER['REQUEST_URI']; // /section/lang/controller/action/key1/value1/key2/value2 /*$parts = explode('/', substr($_SERVER['REQUEST_URI'], 1, strlen($_SERVER['REQUEST_URI'])) ); echo current($parts); foreach($parts as $key=>$val){ echo $val."
"; }*/ $upUrl = '/home/mobayyenpa/domains/mobayyen.ir/public_html/'; $subdomain = array_shift(explode(".",$_SERVER['HTTP_HOST'])); if (isset($subdomain) && $subdomain != 'mobayyen'&& $subdomain != 'www'){ require_once($upUrl.'mahdekoodak'."/index.php"); die(''); } @require_once("lib/config.php"); $time_start = microtime_float(); SetConfig(); if(file_exists("lib/messages-$Lang.php")){ @require_once("lib/messages-$Lang.php"); $smarty->assign('Message', $Message); } $a = InpStr($_REQUEST); $ajax = InpStr($ajax); $action = InpStr($action); $id = InpStr($id); $option = InpStr($option); $popup = InpStr($popup); $ipaddress = $_SERVER['REMOTE_ADDR']; $now = time(); define ('TIMEOUT', 10*60); if($ipaddress != '127.0.0.1'){ $smarty->assign('remote', 1); SetVisit(); } if($_SESSION['userid']){ UpdateUserActivity(); }elseif ( isset($_COOKIE["SerajUserName"]) AND isset($_COOKIE["SerajPassWord"]) ){ //CheckRememberMe(); } $_SESSION['segment']['time'] = time(); $_SESSION['segment']['sentence'] = $_SERVER['REMOTE_ADDR']; $aip = $db->getOne("SELECT xip FROM xxattack WHERE xip = '$ipaddress'"); if ($aip) die("You are INVALID"); if($_POST["FormUse"]){ SetForm(); } $sortby = @$_GET['sortby'] ? $_GET['sortby'] : ( $_COOKIE["sortby"]["$option"] ? $_COOKIE["sortby"]["$option"] : '' ); $sortorder = @$_GET['sortorder'] ? $_GET['sortorder'] : (@$_COOKIE["sortorder"]["$option"] ? $_COOKIE["sortorder"]["$option"] : 'DESC'); if(@$_GET['sortby']){ setcookie("sortby[$option]", $sortby, 0, '/'); setcookie("sortorder[$option]", $sortorder, 0, '/'); } $recPerPage = @$_GET['recperpage'] ? $_GET['recperpage'] : ( $_COOKIE["recPerPage"]["$option"] ? $_COOKIE["recPerPage"]["$option"] : $config[$section]['recPerPage'] ); if(@$_GET['recperpage']){ setcookie("recPerPage[$option]", $recPerPage, 0, '/'); } if(@$_GET['AdminLangId']){ setcookie("AdminLangId", $_GET['AdminLangId'], 0, '/'); redirect(URL."/index.php?option=adm_home"); } if(@$_GET['AdminYearId']){ setcookie("AdminYearId", $_GET['AdminYearId'], 0, '/'); redirect(URL."/index.php?option=adm_home"); } $page = @intval($_GET['page']) ? intval($_GET['page']) : 1; $offset = ($page-1)*$recPerPage; switch($section){ case 'adm': //$module = "login"; $site_referer = $_SERVER["HTTP_REFERER"]; if ($site_referer){ if ( (strpos($site_referer,URL) !== false) ) { }else{ session_destroy(); redirect(URL. "fa/login/"); } } $AdminLangId = $_COOKIE["AdminLangId"] ? $_COOKIE["AdminLangId"] : "1"; $AdminLang = $db->getOne("SELECT xlanguage FROM xxlanguage WHERE xlanguageid='$AdminLangId'"); $AdminTheme = $db->getOne("SELECT xtheme FROM xxlanguage WHERE xlanguageid='$AdminLangId'"); $smarty->assign('ShowBox', $db->getRow("SELECT * FROM xxtheme WHERE xtheme = '$AdminTheme' LIMIT 1") ); $AdminYearId = $_COOKIE["AdminYearId"] ? $_COOKIE["AdminYearId"] : $db->getOne("SELECT xyearid FROM _xxyear WHERE xyearactive='1'"); $smarty->assign('AllYear', $db->getAll("SELECT * FROM _xxyear ORDER BY xyearid DESC") ); $sql = "SELECT xthemeid,xtheme FROM xxtheme ORDER BY xthemeid DESC"; $AllTheme = $db->getAll($sql); $sql = "SELECT xversion FROM xxadmin LIMIT 1"; $smarty->assign('Version', $db->getOne($sql)); $sql = "SELECT xmenushow FROM xxadmin LIMIT 1"; $res = explode('#', $db->getOne($sql)); foreach($res as $key=>$val){ $MenuShow[$val]=1; } $smarty->assign('MenuShow', $MenuShow); $tplMain = "_index-admin.tpl"; $dir = 'admin'; break; case 'usr': $UserYearId = $db->getOne("SELECT xyearid FROM _xxyear WHERE xyearactive='1'"); $tplMain = "_index.tpl"; $dir = 'user'; break; default: $tplMain = $SHOP ? '_index.tpl' : "_index.tpl"; $dir = 'public'; $module = $module ? $module : 'home'; } if(@$popup){ $tplMain = "_popup.tpl"; } if($searchWhere) { $searchWhere = base64_decode($searchWhere); $searchDefault = unserialize(base64_decode($_GET['searchdefault'])); $smarty->assign('searchDefault', $searchDefault); } if(file_exists("$dir/$module.php")) { if(($section == 'adm' && $_SESSION['userid']) || ($section=='usr' && $_SESSION['userid'])){ require_once("$dir/$module.php"); }else{ if($section == 'adm'){ //require_once("$dir/login.php"); //require_once("public/login.php"); redirect(URL."/$Lang/login/"); }elseif($section == 'usr'){ require_once("public/login.php"); }else require_once("$dir/$module.php"); } }else{ $tplModule = "_error.tpl"; } if($section != 'adm' and !$_GET[ajax]){ //-----------------------------------------------------------------advertisment $sql = "SELECT * FROM xxadvertisment WHERE xlanguageid = '$LangId' OR xlanguageid='0' ORDER BY xorder ASC, xadvertismentid DESC"; $Adv = $db->getAll($sql); $smarty->assign('Adv', @$Adv); //-----------------------------------------------------------------bar //-----------------------------------------------------------------box if($id){ GetBoxBar($id, $module); } GetBoxBar('0', $module); //$smarty->assign('Box', $Box); //$smarty->assign('Bar', $Bar); //-----------------------------------------------------------------Marquee $sql = "SELECT * FROM xxlink WHERE xlanguageid = '$LangId' OR xlanguageid='0' ORDER BY xorder ASC"; //$Marquee = $db->getAll($sql); //$smarty->assign('Marquee', $Marquee); // اسلاید بزرگ $sql = "SELECT * FROM xxlink WHERE (xlanguageid = '$LangId' OR xlanguageid = '0') AND xslidebighome = '1' ORDER BY xorder ASC"; //$slidebighome = $db->getAll($sql); //$smarty->assign('slidebighome', $slidebighome); $sql = "SELECT * FROM xxhadith WHERE xactive = '1' AND xtype = 'rahnamood' ORDER BY xid DESC LIMIT 0,1"; $Hadith = $db->getAll($sql); $smarty->assign('Hadith', @$Hadith); //-----------------------------------------------------------------slide1 //-----------------------------------------------------------------slide2 $sql = "SELECT * FROM xxgallery INNER JOIN xxnews ON xxnews.xnewsid = xxgallery.xnewsid WHERE xslideshow='1' ORDER BY xxgallery.xorder ASC, xgalleryid DESC LIMIT 0,20"; //$slide1 = $db->getAll($sql); $sql = "SELECT * FROM xxgallery INNER JOIN xxnews ON xxnews.xnewsid = xxgallery.xnewsid WHERE xslideshow2='1' ORDER BY xxgallery.xorder ASC, xgalleryid DESC LIMIT 0,20"; //$slide2 = $db->getAll($sql); //$smarty->assign('slide1', $slide1); //$smarty->assign('slide2', $slide2); //اسلاید تصاویر صفحه نخست $sql = "SELECT xxgallery . * , xxnews2.xnews FROM xxgallery LEFT JOIN xxnews2 ON xxnews2.xnewsid = xxgallery.xnewsid WHERE xxnews2.xpermission = 'public' AND xxnews2.xstatus = '1' AND xxgallery.xslideshow = '1' group by xxgallery.xnewsid ORDER BY xxgallery.xgalleryid DESC LIMIT 0,4"; $newsLeftslide = $db->getAll($sql); $smarty->assign('newsLeftslide', $newsLeftslide); @require_once("lib/_seraj.php"); } $sql = "SELECT xnewsid, xnews, xdate,xregtime FROM xxnews2 WHERE xpermission = 'public' AND xstatus = '1' AND xmarquee = '1' AND xlanguageid = '$LangId' ORDER BY xnewsid DESC LIMIT 0,5"; //$newstrick = $db->getAll($sql); $sql = "SELECT * FROM xxhadith WHERE xactive = '1' AND xtype = 'hadith' ORDER BY xid DESC LIMIT 0,5"; $newstrick = $db->getAll($sql); //foreach($newstrick as $key=>$val){ //$newstrick[$key]['xdate'] = jdate("D d M Y", 0, 0, strtotime($val['xdate'])); //} $smarty->assign('newstrick', @$newstrick); $smarty->assign('TodayFa', jdate("D d M Y")); $smarty->assign('TodayEn', date("D d M Y")); $AR = new ArDate(1); $smarty->assign('TodayAr', $AR->date('l dS F Y', time())); $smarty->assign('tplModule', @$tplModule); $smarty->assign('listPrimary', @$listPrimary); $smarty->assign('listTable', @$listTable); $smarty->assign('fieldList', @$fieldList); $smarty->assign('adminPage', @$adminPage); $smarty->assign('list', @$list); $smarty->assign('default', @$default); $smarty->assign('id', @$id); $smarty->assign('section', $section); $smarty->assign('module', $module); $smarty->assign('href', @$href); $smarty->assign('title', @$title[$section][$module]); $smarty->assign('email', $config['email']); $smarty->assign('recPerPage', $recPerPage); $smarty->assign('numrows', @$numrows); $smarty->assign('page', @$page); $smarty->assign('backurl', @$backurl); $smarty->assign('printBtn', @$printBtn); $smarty->assign('printFields', @$printFields); $smarty->assign('sortorder', $sortorder); $smarty->assign('sortby', $sortby); $smarty->assign('popup', @$popup); $smarty->assign('join', @$join); //$smarty->assign('as', @$as); $smarty->assign('keyword', @$keyword); $smarty->assign('description', @$description); $smarty->assign('REQUEST_URI', substr($_SERVER['REQUEST_URI'], 1, strlen($_SERVER['REQUEST_URI'])) ); $smarty->assign('comment', $comment); $smarty->assign('AdminLang', $AdminLang); $smarty->assign('AdminLangId', $AdminLangId); $smarty->assign('AdminTheme', $AdminTheme); $smarty->assign('AdminYearId', $AdminYearId); $smarty->assign('tag', $tag); $smarty->assign('AllTheme', $AllTheme); $smarty->assign('SiteMessages', @$_SESSION['SiteMessages']); $smarty->assign('SiteDanger', @$_SESSION['SiteDanger']); $smarty->assign('SiteRegisterMessages', @$_SESSION['SiteRegisterMessages']); $smarty->assign('userid', @$_SESSION['userid']); $smarty->assign('username', @$_SESSION['username']); $smarty->assign('NameFamily', @$_SESSION['name']); $smarty->assign('usertype', @$_SESSION['usertype']); if(@$_SESSION['admin']){ $smarty->assign('admin', 1); } if(@$_SESSION["SiteMessages"]){ unset($_SESSION['SiteMessages']); } if(@$_SESSION["SiteDanger"]){ unset($_SESSION['SiteDanger']); } if(@$_SESSION["SiteRegisterMessages"]){ unset($_SESSION['SiteRegisterMessages']); } if(@$numrows){ $smarty->assign('numrows', $numrows); $numpage = ceil($numrows/$recPerPage); $smarty->assign('numpage', $numpage); } $func = $href; $sql ="INSERT INTO xxactive (xip, xuserid, xfunction, xtime, xtype2) VALUES ('$ipaddress', '$tempid', '$func' ,'$now' ,'4')"; $db->query($sql); //$smarty->debugging=true; $smarty->display($tplMain); if( $section != 'adm' && $section != 'usr' && $option != 'cerem'){ @require_once('analytics.php'); } //$time_end = microtime_float(); //$time = $time_end - $time_start; //echo $time; $db->disconnect(); ?>