1 && $z[count($z)-1]=='') unset($z[count($z)-1]); $elements=count($z); $path_id=NULL; $path_name=NULL; $path_deep=0; $i=0; $stopit=0; $parent=0; while(($i<$elements)&&($stopit==0)) { $r=$DB->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 ($elements==0){ $stopit=1; $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']; } if($stopit==0) { if($path_deep>0) { $tek_id=$path_id[$path_deep]; } } $path_vars=NULL; if(($stopit==1)&&($path_deep<$elements)) { $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 (($stopit==1)&&($path_id[1]==289)) redir301('/'); if (defined ('___TIMEDEBUG___')) { $tfs=microtime(true)-$tms-$start_time; $tms=microtime(true)-$start_time; $logtimes.= '˜˜˜ - search place:'.$tfs.___NEXTROW___; } //˜˜˜˜˜˜ ˜˜˜˜˜˜˜ /*if (strtotime("2020-11-27")time()) { if (isset($_SESSION['promocode_black']) && isset($_SESSION['promocode_black_skidka']) && isset($_SESSION['promocode_black_arr'])) { // } else { $_SESSION['promocode_black'] = true; $_SESSION['promocode_black_skidka'] = 60; $mas=array(); $s9=$DB->Query("SELECT pn.id, pn.nalichie FROM panna_detaildata pd LEFT JOIN panna_nabor pn ON (pd.id=pn.id) WHERE pd.type_id = 12173748292 AND pd.value='˜˜˜' AND pn.nalichie!='˜˜˜' AND pn.price > 0"); while ($r9=$DB->GetArray($s9)) { $mas[]=$r9['id']; if ($r9['nalichie'] == '˜˜˜˜˜˜˜˜˜ ˜ ˜˜˜˜˜˜˜ 2-5 ˜˜˜˜') $DB->Query('UPDATE `panna_nabor` SET `nalichie` = "˜˜˜˜˜˜˜˜˜˜˜˜˜" WHERE `id` = '.$r9['id']); } $_SESSION['promocode_black_arr'] = $mas; } } else { if (isset($_SESSION['promocode_black'])) unset($_SESSION['promocode_black']); if (isset($_SESSION['promocode_black_skidka'])) unset($_SESSION['promocode_black_skidka']); if (isset($_SESSION['promocode_black_arr'])) unset($_SESSION['promocode_black_arr']); }*/ //if (isset($_SESSION['promocode_black'])) unset($_SESSION['promocode_black']); //if (isset($_SESSION['promocode_black_skidka'])) unset($_SESSION['promocode_black_skidka']); //if (isset($_SESSION['promocode_black_arr'])) unset($_SESSION['promocode_black_arr']); //begin - redirect from old KLART //echo $superpath; //˜˜˜˜˜˜ $pos = strpos($superpath,'catalog/good'); if ($pos !== false) redir301 ('/'.str_replace('catalog/good','shop',$superpath)); //catalog //$pos = strpos($superpath,'catalog/'); //if ($pos !== false) redir301 ('/'.str_replace('catalog/','shop/',$superpath)); //masterklass $pos = strpos($superpath,'mc/'); if ($pos !== false) redir301 ('/'.str_replace('mc/','masterklass/mc',$superpath)); //begin - redirect from old PANNA if ($superpath=='goldkits/')redir301 ('/shop/collection/goldkits/'); if ($superpath=='livepic/')redir301 ('/shop/collection/livepic/'); 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); } //˜˜˜˜˜˜-˜˜˜˜˜˜ //˜˜˜˜˜˜ new //˜˜˜˜˜ ˜˜˜˜ ˜ /includes/header.php if (($s[4] == 73) || ($s[4] == 313)) { //$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 IN (9,289,304) AND moment>".$lastmonth); $js_str = ''; while ($s2=$DB->GetArray($r2)) { //$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]; 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/mainmenu.php'); require('includes/news_detail.php'); require('includes/mk_nabor.php'); require('includes/contests.php'); require('includes/scheme.php'); require('includes/qr_calendar_instagram.php'); require('includes/catalog1.php'); require('includes/cart.php'); require('includes/sale.php'); require('includes/sales3.php'); require('includes/incart.php'); require('includes/order_post.php'); require('includes/faqask.php'); require('includes/mailer.php'); require('includes/mails.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/js.php'); // ˜˜˜˜˜˜ ˜˜˜ ˜˜ ˜˜˜˜˜˜˜˜˜˜˜˜, ˜˜˜˜˜˜ ˜˜˜˜˜˜ ˜˜˜˜˜˜˜˜ ˜˜ ˜˜˜˜˜ "###JS###" require('includes/googli.php'); require('includes/timestamp.php'); require('includes/static.php'); require('includes/likes.php'); require('includes/likes2.php'); require('includes/action.php'); require('includes/boxberry.php'); require('includes/topdelivery.php'); require('includes/feedback.php'); require('includes/dostavka.php'); require('includes/sales.php'); require('includes/outprod.php'); require('includes/klartaction.php'); require('includes/giftsaction.php'); require('includes/files.php'); require('includes/discount.php'); require('includes/topheader.php'); require('includes/navmobile.php'); require('includes/header.php'); require('includes/leftsidebar.php'); require('includes/footer.php'); require('includes/language.php'); require('includes/kupit.php'); require('includes/postcard.php'); require('includes/onlinecatalog.php'); // require('sys/updater.php'); require('includes/new_nabor.php'); require('includes/vimeo.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___; } $tt=str_replace("###TITLE###","$titletotal","$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###","˜˜˜˜˜˜˜˜ ˜ ˜˜˜˜˜ ˜˜ ˜˜˜˜˜˜˜˜˜˜˜˜˜˜ ˜˜˜˜˜˜˜ ˜˜˜ ˜˜˜˜˜˜˜˜˜ ˜PANNA˜.","$tt"); $tt=str_replace("###KEYS###","˜˜˜˜˜˜˜ ˜˜˜˜˜˜˜˜˜, ˜˜˜˜˜˜˜ ˜ ˜˜˜˜˜˜˜, ˜˜˜˜˜˜˜ ˜˜˜˜˜˜˜˜˜, ˜˜˜˜˜˜˜ ˜˜˜˜˜˜˜, ˜˜˜˜˜˜˜, ˜˜˜˜˜˜˜ ˜˜˜˜˜˜˜, ˜˜˜˜˜˜˜˜˜, ˜˜˜˜˜˜˜ ˜˜˜˜˜˜˜, ˜˜˜˜˜˜˜ ˜˜˜˜˜˜˜","$tt"); }else{ $tt=str_replace("###DESCRIPT###","˜˜˜˜˜˜ ˜˜˜ ˜˜˜˜˜˜˜˜˜ Panna. ˜˜˜˜˜˜˜ ˜˜˜˜˜˜˜, ˜˜˜˜˜˜˜ ˜˜˜˜˜˜˜, ˜˜˜˜˜˜˜˜˜ ˜˜˜˜˜˜˜. ˜˜˜˜˜ ˜˜˜˜˜˜˜˜˜.","$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"); echo($tt); $rom=$DB->Query("select * from panna_flags"); while($som=$DB->GetArray($rom)) { if($som['a']=='morning') { $now=time(); if(($som[1]+43200)<$now) { $DB->Query("update panna_flags set b='$now' where a='morning'"); } } } function redir301 ($link) { header('HTTP/1.1 301 Moved Permanently'); header('Location: '.$link); //echo 'try to redirect'; die(); } ?>