$v) { $result=@mysql_query("select id, name FROM catalog_types where parent=$parent and alias='{$v}' and pabl='1' LIMIT 1"); if (mysql_num_rows($result) == 0) include('404.php'); $parent = mysql_result($result,0,'id'); $unames[$k] = mysql_result($result,0,'name'); $url = $_GET['ss']; } $_GET['s'] = $parent; //отдаем параметры движку (эмуляция стрых урлов) $HTTP_GET_VARS['s'] = $parent; //это ваще жесть unset($_GET['ss']); unset($HTTP_GET_VARS['ss']); } // /Tamer edition // print_r($uri); // print_r($unames); // echo $_GET['s']; // print_r($_GET); //============================================================================= session_start(); // header("Last-modified: ".gmdate("D, d M Y H:i:s", time()-3600)." GMT"); header("Content-Language: ru"); include($moduls_root.'/catalog/scripts/basket.php'); if ($page>"") { $page_result=@mysql_query("select * from $site_table where page='$page' and section='0' and pabl='1'"); $page_num=@mysql_num_rows($page_result); } if (!$page_num) { $page_result=@mysql_query("select * from $site_table where page='index'"); $page_num=@mysql_num_rows($page_result); $page='index'; header("HTTP/1.1 404 Not Found"); } // этот код выдает id раздела для каталога (в каталоге этот код дублируется - не кайф было вычищать) if (($page=='index')&&(isset($_GET['sect']))) { $ex=explode('/',$_GET['sect']); $sect_id=1; for ($i=0; $imenu_html; } else if ($param=='kamaz_news') { echo file_get_contents($document_root.'/kamaz/mpnews.txt'); } if ($param=='p_caption') { if (isset($_GET['id'])) echo ''.stripslashes(mysql_result($tempres,0,'caption')).''; else echo stripslashes(mysql_result($tempres,0,'caption')); } else if ($param=='meta') { if ($page=='order') echo ''; } else if ($param=='p_page') { echo stripslashes(mysql_result($tempres,0,'page')); } else if ($param=='order_cnt') { $o_cnt=count($order); $t_str='товаров'; if ($o_cnt%100>20 || $o_cnt%100<5) { if ($o_cnt%10==1) $t_str='товар'; elseif ($o_cnt%10!=0) $t_str='товара'; } echo $o_cnt.' '.$t_str; } else if ($param=='sled') { $xres=@mysql_query('select count(*) from '.$site_table.' where parent="'.mysql_result($page_result,0,'parent').'" and menu="1" and pabl="1"'); if (@mysql_result($xres,0,0)>1) { echo stripslashes(mysql_result($tempres,0,'caption'));//.' / '; /*if (isset($_GET['id'])) echo ''.stripslashes(mysql_result($page_result,0,'caption')).''; else echo mysql_result($page_result,0,'caption');*/ } else { if (isset($_GET['id'])||isset($_GET['sect'])||($page=='order')||($page=='send_order')) echo ''.stripslashes(mysql_result($tempres,0,'caption')).''; else echo stripslashes(mysql_result($tempres,0,'caption')); } } else if ($param[0]=='(') { eval(substr($param,1,-1)); } else if ($param=='p_sort') { echo stripslashes(mysql_result($tempres,0,'sort'))+1; } else if ($param=='img') { if (@mysql_result($page_result,0,$param)>'') { echo ''; } } else if ($param=='sect_id' || $param=='logo_txt') { if (isset($$param)) echo $$param; } else if ($param=='caption') { if ($page=='catalog') { $sect=0; if (isset($_GET['sect'])) $sect=$_GET['sect']; $id=0; if (isset($_GET['id'])) $id=$_GET['id']; if ($id>0) { $res=mysql_query('select parent from catalog_items where id="'.$id.'"'); $sect=intval(mysql_result($res,0,'parent')); } if ($sect>1) { while ($sect>1) { if ($res=mysql_query('select * from catalog_types where id="'.$sect.'"')) $sect=@mysql_result($res,0,'parent'); } //$sres=mysql_query('select name from catalog_types where id="'.$sect.'"'); echo htmlspecialchars(stripslashes(mysql_result($res,0,'name'))); } else echo stripslashes(mysql_result($page_result,0,$param)); } else echo stripslashes(mysql_result($page_result,0,$param)); } else if (($param=='page')||($param=='sort')) { echo stripslashes(mysql_result($page_result,0,$param)); } else if ($param=='top_text') { if ($page=='catalog' && isset($name)) echo $name; else echo stripslashes(mysql_result($page_result,0,$param)); } else if ($param=='art') { $ares=mysql_query('select * from articles where main=1 and parent!=0 and pabl=1 order by date_ desc limit 4'); $an=mysql_num_rows($ares); for ($i=0; $i<$an; $i++) { echo ''.date('d.m.Y',mysql_result($ares,$i,'date_')). ' | '.htmlspecialchars(stripslashes(mysql_result($ares,$i,'name'))).''; } } else if (($param=='title')or($param=='keywords')or($param=='description')) { if ( ($page=='catalog') && ( isset($_GET['s']) || isset($_GET['i']) ) ) { echo htmlspecialchars(stripslashes($$param)); } else echo htmlspecialchars(stripslashes(@mysql_result($page_result,0,$param))); } else { $comand=@mysql_result($page_result,0,$param); if ($comand>"") { $ex=explode(";",stripslashes($comand)); for ($main_i=0; $main_i