Query("select * from panna_index where parent=$parent and alias=\"$z[$i]\""); if (($r)&&($s=$DB->GetArray($r))) { $path_deep++; $path_id[$path_deep]=$s['id']; $path_name[$path_deep]=$s['name']; $parent=$s['id']; $i++; } else { $stopit=1; if($path_deep==0) { $r=$DB->Query("select * from panna_index where parent=0 and pos=1"); $s=$DB->GetArray($r); $path_deep=1; $path_name[1]=$s['name']; $path_id[1]=$s['id']; $tek_id=$s['id']; } else { $tek_id=$path_id[$path_deep]; } } } if($stopit==0) { if($path_deep>0) { $tek_id=$path_id[$path_deep]; } } if(($stopit==1)&&($path_deep<$elements)) { $path_vars=NULL; $j=0; while($i<$elements) { $path_vars[$j]=$z[$i]; $i++; $j++; } $path_kolvars=$j; } else $path_kolvars=0; if (($stopit==1)&&($path_id[1]==4)) redir301('/'); if (defined ('___TIMEDEBUG___')) { $tfs=microtime(true)-$tms-$start_time; $tms=microtime(true)-$start_time; $logtimes.= '��� - search place:'.$tfs.___NEXTROW___; } //begin - redirect from old PANNA if ($superpath=='goldkits/')redir301 ('/shop/collection/goldkits/'); if ($superpath=='3d-embroidery/')redir301 ('/shop/collection/3dembroidery/'); if ($superpath=='search/stitch/')redir301 ('/shop/technic/schetny_krest/'); if ($superpath=='shop/technic/')redir301 ('/shop/'); //theme if($path_kolvars>=3) { if ( ($path_vars[0]=="themes") && (is_numeric($path_vars[1])) ) { $id = $path_vars[1]; $r=$DB->Query('SELECT translite FROM panna_theme_index WHERE id = '.$id.';'); while ($s=$DB->GetArray($r)) { if ( (is_numeric($path_vars[2])) && ($path_vars[2] > 1) ) redir301('/shop/theme/'.$s[0].'/?page='.$path_vars[2]); else redir301('/shop/theme/'.$s[0].'/'); } } } //end - redirect from old PANNA begin $r=$DB->Query("select name,tmpl,content,title,id from panna_index where parent=$tek_id and pos=1"); $f=true; if (($r)&&($s=$DB->GetRow($r))) { //echo 'zzz'; $path_deep++; $path_id[$path_deep]=$s[4]; $path_name[$path_deep]=$s[0]; $tek_id=$s[4]; $f=false; } if ($f) { $r=$DB->Query("select name,tmpl,content,title,id from panna_index where id=$tek_id"); $s=$DB->GetRow($r); } //tutorials //������ new //����� ���� � /includes/header.php if ($s[4] == 73 || $s[4] == 286) { //$s[2] .= 'test'; $lastmonth = mktime(0, 0, 0, date("m")-3, date("d"), date("Y")); //$s[2] .= 'test'.$lastmonth; //$r2=$DB->Query("select id from panna_index where parent=9 AND moment>".$lastmonth); $r2=$DB->Query("SELECT id FROM panna_index WHERE parent IN (9,282) AND moment>".$lastmonth); $js_str = ''; while ($s2=$DB->GetArray($r2)) { //var_dump($s2[0]); //$s[2] .= $s2[0]; $js_str .='$("#page_index_id_'.$s2[0].'").show();'; } if (strlen($js_str) > 0) $s[2] .= ''; } $tt=str_replace('\\\'','\'',$s[2]); $tmpl_id=$s[1]; $head=$s[0]; $titletotal=$s[3]; //var_dump($titletotal, $s[3]); if (defined ('___TIMEDEBUG___')) { $tfs=microtime(true)-$tms-$start_time; $tms=microtime(true)-$start_time; $logtimes.= '��� - fetch place:'.$tfs.___NEXTROW___; } // ��������� ������ $r=$DB->Query("select html from panna_tmpl where id=$tmpl_id"); $s=$DB->GetRow($r); $tt2=str_replace('\\\'','\'',$s[0]); $tt=str_replace("###CONTENT###","$tt","$tt2"); if(($path_deep==2)&&($path_id[2]==15)&&(is_numeric($path_vars[0]))) { $r=$DB->Query("select count(*) from panna_temp_nabor where id=".$path_vars[0]); if ($r!=NULL) { $s=$DB->GetArray($r); if($s[0]==1) { //$tt=str_replace("style_inside","style_inside_card","$tt"); } } } if(($tek_id==20)&&($path_kolvars>0)) { //$tt=str_replace("style_inside","style_inside_card","$tt"); } if (defined ('___TIMEDEBUG___')) { $tfs=microtime(true)-$tms-$start_time; $tms=microtime(true)-$start_time; $logtimes.= '��� - fetch temlate time:'.$tfs.___NEXTROW___; } require('includes/delivaction.php'); require('includes/mainmenu.php'); require('includes/news_detail.php'); require('includes/mk_nabor.php'); require('includes/catalog1.php'); require('includes/cart.php'); require('includes/sale.php'); require('includes/incart.php'); require('includes/order_post.php'); require('includes/faqask.php'); require('includes/mailer.php'); require('includes/ny.php'); require('includes/search.php'); require('includes/soon.php'); require('includes/counter.php'); require('includes/last_nabors.php'); require('includes/rating2.php'); require('includes/goldkits.php'); require('includes/livepic.php'); require('includes/teknik_nabors.php'); require('includes/years.php'); require('includes/googli.php'); require('includes/timestamp.php'); require('includes/static.php'); require('includes/likes2.php'); require('includes/action.php'); require('includes/boxberry.php'); require('includes/wholesalers.php'); require('includes/feedback.php'); require('includes/topheader.php'); require('includes/navmobile.php'); require('includes/header.php'); require('includes/leftsidebar.php'); require('includes/footer.php'); require('includes/free-delivery.php'); require('includes/new-year.php'); require('includes/kupit.php'); require('includes/wheretobyform.php'); require('includes/mainslider.php'); require('includes/outprod.php'); require('includes/gifts.php'); require('includes/sales3.php'); require('includes/quiklinks.php'); //require('includes/js.php'); //require('includes/addlink.php'); //require('includes/addlink2.php'); //require('includes/addmessage.php'); //require('includes/likes.php'); $tt=str_replace('###CATEGORY_TEXT###','',$tt); if (defined ('___TIMEDEBUG___')) { $tfs=microtime(true)-$tms-$start_time; $tms=microtime(true)-$start_time; $logtimes.= 'Static includes:'.$tfs.___NEXTROW___; } //var_dump($titletotal); $tt=str_replace("###TITLE###", $titletotal . " | Embroidery_kits_panna","$tt"); $uri = $_SERVER['REQUEST_URI']; foreach (explode('/', $uri.'/') as $val) { if ($val != '') { $url_mas[] = $val; } } if(isset($url_mas[0])&&$url_mas[0]=='konkurs') { $tt=str_replace("###DESCRIPT###","","$tt"); $tt=str_replace("###KEYS###","","$tt"); }else{ $tt=str_replace("###DESCRIPT###","","$tt"); $tt=str_replace("###KEYS###","","$tt"); } //$tt=str_replace("###TITLE###","$titletotal","$tt"); //$tt=str_replace("###TITLE###","$titletotal","$tt"); $tt=str_replace("###CANONICAL###","","$tt"); if((strpos($verbrow, "MSIE 5")!=FALSE)||(strpos($verbrow, "MSIE 4")!=FALSE)) { $tt=str_replace("style.css","style5.css","$tt"); $tt=str_replace("style_inside.css","style_inside5.css","$tt"); $tt=str_replace("style_inside_card.css","style_inside_card5.css","$tt"); echo("��������! ��� ��������� ����� ����� ��� ���������� ���������� ����� ����� ������ ��������!"); } if ($tt=='')$tt=''; $tt=str_replace('','
'.$DB->Statistic().'
',"$tt"); require('includes/language.php'); //Replace all language points $tt=match_text($tt); require_once $_SERVER['DOCUMENT_ROOT'].'/sys/mainpage.php'; /************************************* * * System cache block * ************************************/ /* //�������� ������� ���������� //LOCK ��� 1 �����, ��������� ������ ������� //$updUTCTime $r=$DB->Query("SELECT pValue FROM miscellaneous WHERE pName='CacheTime';"); $s=$DB->GetRow($r); $CacheUTCTime=strtotime($s[0]); if ($updUTCTime<$CacheUTCTime) { //echo 'updUTCTime='.$updUTCTime.' CacheUTCTime='.$CacheUTCTime; $tt=str_replace("",$DB->Statistic().'',"$tt"); echo($tt); exit;// ��� ��������. } $f1=fopen($_SERVER['DOCUMENT_ROOT'].'/cache/cache.lock','w+'); if (!$f1) { error_log('Cache lock error'); $tt=str_replace("",$DB->Statistic().'',"$tt"); echo($tt); exit; } $lockf=flock($f1,LOCK_EX); //echo $lockf; if (!$lockf) { // ���� ������������� �� ���. ������ �������. $tt=str_replace('
',$DB->Statistic().'
',"$tt"); echo($tt); exit; } else { // ����� ����������� ���������� �������. // ��� ������� �� ����� ������ ����������, ����� �������� ��������. //require_once $_SERVER['DOCUMENT_ROOT'].'/sys/search.php'; //require_once $_SERVER['DOCUMENT_ROOT'].'/sys/mainpage.php'; //require_once $_SERVER['DOCUMENT_ROOT'].'/sys/report_noimages.php'; //require_once $_SERVER['DOCUMENT_ROOT'].'/sys/rating_calc.php'; //require_once $_SERVER['DOCUMENT_ROOT'].'/sys/report_waiting_ok.php'; //require_once $_SERVER['DOCUMENT_ROOT'].'/order_nabor.php'; //��������� ����� ���� } */ /************************************* * * END System cache block * ************************************/ $tt=str_replace('','
'.$DB->Statistic().'
',"$tt"); echo($tt); /************************************** * TODO * Long long tail * Have many errors, first of this - * don't lock other processes before data update. * *************************************/ $rom=$DB->Query("select * from panna_flags"); while($som=$DB->GetArray($rom)) { if($som['a']=='morning') { $now=time(); if(($som[1]+43200)<$now) { //require('includes/report_waiting_ok.php'); $DB->Query("update panna_flags set b='$now' where a='morning'"); // �������� ����� ������� ������� �� ���� � ������ ����... ;) /* $r=$DB->Query("select id from panna_nabor where anonsed=0"); while($s=$DB->GetRow($r)) { $z=$DB->Query("select count(*) from panna_new_tomail where id=".$s[0]); $z1=$DB->GetRow($z); if($z1[0]==0) { $DB->Query("insert into panna_new_tomail (id, mailed) values (".$s[0].", 0)"); //��������� ������ ������ (��� �������� �������) ��������� ��� � ����� $DB->Query('insert into panna_akciya (id, id_nabor, akciya) values (NULL,'.$s[0].',1)'); } }*/ /* $kolnews=0; $newsnews=NULL;*/ // �������� ����� ������� � ������� �������� ����� /* $r=$DB->Query("select * from panna_new_tomail where mailed=0"); while($s=$DB->GetArray($r)) { $r1=$DB->Query("select * from panna_nabor where id=".$s[0]); $s1=$DB->GetArray($r1); if($s1['nalichie']>0) { $kolnews++; $newsnews[$kolnews]=$s['id']; $DB->Query("update panna_new_tomail set mailed=1 where id=".$s[0]); //�������� � ������� ������ ������ } }*/ /*if($kolnews>0) { $headers = "From: Panna.Ru \r\n"; $subj = "����� � ����� �������"; $headers.= "Content-Type: text/html; charset=Windows-1251\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $mailbody=' www.panna.ru - ����� ������

����� ������ �� ����� Panna.Ru (� ��������)

'; for($z=1;$z<=$kolnews;$z++) { $rr=$DB->Query("select * from panna_nabor where id=".$newsnews[$z]); $ss=$DB->GetArray($rr); $mailbody.=$ss['artname'].' �'.$ss['title'].'�
'; } $mailbody.='

������ ����������: http://www.panna.ru/admin.php

'; if(!defined('___NOMAIL___')) { //mail("ezhov@gamma.msk.ru", $subj, $mailbody, $headers); mail("yakimuk@gamma.msk.ru", $subj, $mailbody, $headers); mail('sarafanov_v@firma-gamma.ru',$subj, $mailbody, $headers); } }*/ } }/* elseif($som['a']=='evening') { $now=time(); if(($som[1]+43200)<$now) { $DB->Query("update panna_flags set b='$now' where a='evening'"); //require('includes/rating_calc.php'); } }*/ } /*function redir301 ($link) { global $DB; header('HTTP/1.1 301 Moved Permanently'); header('Location: '.$link); //echo 'header(Location: '.$link.')
'; //echo $DB->Statistic(); die(); }*/ ?>