setupClass("Statics"); $objCatalogs = $setup->setupClass("Catalogs"); //////////////////////////// if(trim($_GET['rubID'])!='') $_GET['rubID'] = str_replace("/","",$_GET['rubID']); if(trim($_GET['productID'])!='') $_GET['productID'] = str_replace("/","",$_GET['productID']); if(!@is_numeric(@$_GET['rubID'])) $_GET['rubID'] = $objCatalogs->db->getOne("SELECT id FROM catalogs_rubrics WHERE translit=?",array(trim($_GET['rubID']))); elseif(trim(@$_GET['productID'])==''){ $rrrr = $objCatalogs->db->getOne("SELECT translit FROM catalogs_rubrics WHERE id=?",array(trim($_GET['rubID']))); @header("HTTP/1.1 301 Moved Permanently"); @header("Location: /".$rrrr."-catalogs/"); exit; } if(!@is_numeric(@$_GET['productID'])){ //echo $_GET['productID2']; $_GET['productID'] = $objCatalogs->db->getOne("SELECT id FROM catalogs_products WHERE translit=?",array(trim($_GET['productID']))); $_GET['productID'] = str_replace("/","",$_GET['productID2']); }else{ $rrrr = $objCatalogs->db->getOne("SELECT translit FROM catalogs_rubrics WHERE id=?",array(trim($_GET['rubID']))); $rrrr2 = $objCatalogs->db->getOne("SELECT translit FROM catalogs_products WHERE id=?",array(trim($_GET['productID']))); $_GET['productID'] = str_replace("/","",$_GET['productID2']); @header("HTTP/1.1 301 Moved Permanently"); @header("Location: /".$rrrr."-catalogs/".$rrrr2."-".$_GET['productID']."/"); exit; } if(@$_GET['productID']){ $_GET['rating'] = $objCatalogs->db->getOne("SELECT rating FROM catalogs_products WHERE id=?",array(trim($_GET['productID']))); $_GET['vote_num'] = $objCatalogs->db->getOne("SELECT vote_num FROM catalogs_products WHERE id=?",array(trim($_GET['productID']))); $_GET['rating'] = (trim(@$_GET['rating'])=='') ? "0" : trim(@$_GET['rating']); $_GET['vote_num'] = (trim(@$_GET['vote_num'])=='') ? "0" : trim(@$_GET['vote_num']); $objCatalogs->tpl->assign("rates",ShowRating(@$_GET['productID'],$_GET['rating'],$_GET['vote_num'])); if(@$_GET['t']) echo ShowRating(@$_GET['productID'],$_GET['rating'],$_GET['vote_num']); } //////////////////////////// if(trim(@$_SESSION['user']['id'])!="" && trim(@$_GET['productID'])!=''){ $sql = "INSERT INTO `catalogs_stat` (`uid`,`pid`,`cat_id`,`hits`) VALUES ('".$_SESSION['user']['id']."','".$_GET['productID']."','".$_GET['rubID']."','1');"; $result0 = mysql_query($sql) or die(mysql_error()); } $objForum = $setup->setupClass('Forum'); $objArticles = $setup->setupClass('Articles'); $objNews = $setup->setupClass('News'); $objAdvices = $setup->setupClass('Advices'); $objAdvices2 = $setup->setupClass('Advices2'); $objGallery = $setup->setupClass('Gallery'); $objOrders = $setup->setupClass('Orders'); $objRubrics = $setup->setupClass('Rubrics'); $objBanners = $setup->setupClass('Banners'); $objGalleryList = $setup->setupClass('GalleryList'); $objVideo = $setup->setupClass('Video'); $objAkcii = $setup->setupClass('Akcii'); $objSale = $setup->setupClass('Sale'); $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'catalogs'; $banner_id = (isset($_GET['rubID']) && $_GET['rubID']>0)?$_GET['rubID']:(isset($_GET['akcii'])?'akcii':$action); //if(!@is_numeric(@$_GET['rubID'])) //$_GET['rubI'] = $objCatalogs->db->getOne("SELECT id FROM catalogs_rubrics WHERE translit=?",array(trim($_GET['rubID']))); //if(trim(@$_GET['rubID'])!='') //$banner_id = trim($_GET['rubI']); $objBanners->viewBannerBlock($banner_id,1,1); $objBanners->viewBannerBlock($banner_id,1,2); $objBanners->viewBannerBlock($banner_id,1,4); $objBanners->viewBannerBlock($banner_id,1,5); $objBanners->viewBannerBlock($banner_id,1,6); $objBanners->viewBannerBlock($banner_id,1,7); $objBanners->viewBannerBlock($banner_id,1,8); $objBanners->viewBannerBlock($banner_id,1,9); $objBanners->viewBannerBlock($banner_id,1,10); $objBanners->viewBannerBlock($banner_id,1,11); $objBanners->viewBannerBlock($banner_id,1,12); /* if(!isset($_SESSION['counter'])){$_SESSION['counter']=0;} $_SESSION['counter']++; */ if(!isset($_SESSION['curs']))$_SESSION['curs'] = "uah"; if(isset($_GET['curs'])){ $_SESSION['curs'] = $_GET['curs']; } $curs = $_SESSION['curs']; if(isset($_POST['exit'])){unset($_SESSION['catalog_user']);} elseif(isset($_POST['login'],$_POST['psw']) && $objCatalogs->isUser($_POST['login'],$_POST['psw'])){$_SESSION['catalog_user'] = array('login'=>$_POST['login'],'psw'=>$_POST['psw']);} if(isset($_SESSION['catalog_user']) && $userID=$objCatalogs->isUser($_SESSION['catalog_user']['login'],$_SESSION['catalog_user']['psw'])){}else{$userID = 0;} $rule = $setup->getRulesOne($action); if($rule['modul']!=null)include($_SERVER['DOCUMENT_ROOT'] . "/modules/{$rule['modul']}"); $dir = "./includes/"; $includes_dir = opendir($dir); while ( ($inc_file = readdir($includes_dir)) != false ) if (strstr($inc_file,".php")) { include($dir . $inc_file); } $setup->meta(); $setup->error(); $setup->display(); $path=explode("/",$_SERVER['REQUEST_URI']); //echo $banner_id; function ShowRating($id, $rating, $vote_num, $allow = true) { global $lang; if( $rating ) $rating = round( ($rating / $vote_num), 0 ); else $rating = 0; $rating = $rating * 17; $rated = '