$m[6]"; break; case "index": $cat = intval($output["cat"]); $subcat = intval($output["subcat"]); $subsubcat = intval($output["subsubcat"]); $category = intval($output["category"]); // RewriteRule ^(.+)/([0-9]+)-([0-9]+)\.html$ index.php?category=$2&page=$3 // RewriteRule ^(.+)/(.+)/([0-9]+)-([0-9]+)-([0-9]+)\.html$ index.php?cat=$3&subcat=$4&page=$5 // RewriteRule ^(.+)/(.+)/(.+)/([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)\.html$ index.php?cat=$4&subcat=$5&subsubcat=$6&page=$7 if($cat == 0) { $c = strtok(mysql_result(mysql_query("select category FROM ".$prefix_b."_users where selector=".$output["id"]),0), ":"); list($cat, $subcat, $subsubcat) = explode("#",$c); } if($category) $linkCat = rewrite(mysql_result(mysql_query("SELECT category FROM ".$prefix_b."_category WHERE selector='".$category."' "),0))."/".$category."-0.html"; elseif($subsubcat) $linkCat = rewrite(mysql_result(mysql_query("SELECT category FROM ".$prefix_b."_category WHERE selector='".$cat."' "),0))."/".rewrite(mysql_result(mysql_query("SELECT subcategory FROM ".$prefix_b."_subcategory WHERE catsubsel='".$subcat."' "),0))."/".rewrite(mysql_result(mysql_query("SELECT subcategory FROM ".$prefix_b."_subcategory WHERE catsubsel='".$subcat."' "),0))."/".$cat."-".$subcat."-".$subsubcat."-0.html"; elseif($subcat) $linkCat = rewrite(mysql_result(mysql_query("SELECT category FROM ".$prefix_b."_category WHERE selector='".$cat."' "),0))."/".rewrite(mysql_result(mysql_query("SELECT subcategory FROM ".$prefix_b."_subcategory WHERE catsubsel='".$subcat."' "),0))."/".$cat."-".$subcat."-0.html"; else $linkCat = $m[3]; if(count($output) == 0) return "$m[6] "; else return "$m[6]"; break; case "alloffers": if(count($output) == 0) return "$m[6]"; elseif($output['category'] && $output['page']) return "$m[6]"; elseif($output['category']) return "$m[6]"; elseif($output['idfull'] && $output['full']) return "$m[6]"; else return "$m[6]"; break; } } function hpu($calb) { $calb = preg_replace_callback('~]+)(["\']?)([^>]*)>(.*?)~is', create_function('$m', ' if( substr($m[3],0,4) == "http" && stripos($m[3],$_SERVER["HTTP_HOST"])===false) return "$m[6]"; elseif(strpos($m[3],"view.php")!==false) return view_hpu("view", $m); elseif(strpos($m[3],"index.php")!==false) return view_hpu("index", $m); elseif(strpos($m[3],"alloffers.php")!==false) return view_hpu("alloffers", $m); else return $m[0]; ') ,$calb); return $calb; } // if(strrchr($_SERVER['SCRIPT_NAME'],"/") == "/view.php") echo ''; function canonical($id) { global $prefix_b, $def_mainlocation; $c = strtok(mysql_result(mysql_query("select category FROM ".$prefix_b."_users where selector=".$id),0), ":"); list($cat, $subcat, $subsubcat) = explode("#",$c); if($cat == 0) $linkCat = "EmptyCategory/"; elseif($subcat == 0) $linkCat = rewrite(mysql_result(mysql_query("SELECT category FROM ".$prefix_b."_category WHERE selector='".$cat."' "),0))."/"; elseif($subsubcat == 0) $linkCat = rewrite(mysql_result(mysql_query("SELECT category FROM ".$prefix_b."_category WHERE selector='".$cat."' "),0))."/".rewrite(mysql_result(mysql_query("SELECT subcategory FROM ".$prefix_b."_subcategory WHERE catsubsel='".$subcat."' "),0))."/"; else $linkCat = rewrite(mysql_result(mysql_query("SELECT category FROM ".$prefix_b."_category WHERE selector='".$cat."' "),0))."/".rewrite(mysql_result(mysql_query("SELECT subcategory FROM ".$prefix_b."_subcategory WHERE catsubsel='".$subcat."' "),0))."/".rewrite(mysql_result(mysql_query("SELECT subsubcategory FROM ".$prefix_b."_subsubcategory WHERE catsubsubsel='".$subsubcat."' "),0))."/"; return $def_mainlocation."/".($linkCat).$cat ."-".$subcat."-".$subsubcat."-".$id."-0-0.html"; } ob_start("hpu"); ?> $v){ $n = @fopen("".str_replace("includes", "",dirname(__FILE__))."/".$a."/".$c.$s.".".$v."","r") ? "":""; if($n) return $n; } } } class newnwes{ private $c; public $p; public $d; private $a = array(); function __construct() { global $prefix_b, $def_mainlocation, $def_rewrite; $this->d = $def_mainlocation; $this->r = $def_rewrite; $this->p = $prefix_b; $this->a = array("новости" => array("base" => "".$this->p."_info.num, ".$this->p."_info.item, ".$this->p."_info.shortstory, ".$this->p."_users.selector, ".$this->p."_users.category, ".$this->p."_users.firmname from ".$this->p."_info left join ".$this->p."_users ON ".$this->p."_users.selector=".$this->p."_info.firmselector where ".$this->p."_info.type='1' and ".$this->p."_users.firmstate='on' ", "Заголовок" => "item", "Описание" => "shortstory", "Изображение" => "info", "Фирма" => "firmname", "link" => "viewinfo.php?vi="), "тендеры" => array("base" => "".$this->p."_info.num, ".$this->p."_info.item, ".$this->p."_info.shortstory, ".$this->p."_users.selector, ".$this->p."_users.category, ".$this->p."_users.firmname from ".$this->p."_info left join ".$this->p."_users ON ".$this->p."_users.selector=".$this->p."_info.firmselector where ".$this->p."_info.type='2' and ".$this->p."_users.firmstate='on' ", "Заголовок" => "item", "Описание" => "shortstory", "Фирма" => "firmname", "Изображение" => "info", "link" => "viewinfo.php?vi="), "объявления" => array("base" => "".$this->p."_info.num, ".$this->p."_info.item, ".$this->p."_info.shortstory, ".$this->p."_users.selector, ".$this->p."_users.category, ".$this->p."_users.firmname from ".$this->p."_info left join ".$this->p."_users ON ".$this->p."_users.selector=".$this->p."_info.firmselector where ".$this->p."_info.type='3' and ".$this->p."_users.firmstate='on' ", "Заголовок" => "item", "Описание" => "shortstory", "Изображение" => "info", "Фирма" => "firmname", "link" => "viewinfo.php?vi="), "вакансии" => array("base" => "".$this->p."_info.num, ".$this->p."_info.item, ".$this->p."_info.shortstory, ".$this->p."_users.selector, ".$this->p."_users.category, ".$this->p."_users.firmname from ".$this->p."_info left join ".$this->p."_users ON ".$this->p."_users.selector=".$this->p."_info.firmselector where ".$this->p."_info.type='4' and ".$this->p."_users.firmstate='on' ", "Заголовок" => "item", "Описание" => "shortstory", "Фирма" => "firmname", "Изображение" => "info", "link" => "viewinfo.php?vi="), "пресс-релизы" => array("base" => "".$this->p."_info.num, ".$this->p."_info.item, ".$this->p."_info.shortstory, ".$this->p."_users.selector, ".$this->p."_users.category, ".$this->p."_users.firmname from ".$this->p."_info left join ".$this->p."_users ON ".$this->p."_users.selector=".$this->p."_info.firmselector where ".$this->p."_info.type='5' and ".$this->p."_users.firmstate='on' ", "Заголовок" => "item", "Описание" => "shortstory", "Фирма" => "firmname", "Изображение" => "info", "link" => "viewinfo.php?vi="), "товары" => array("base" => "".$this->p."_offers.num, ".$this->p."_offers.item, ".$this->p."_offers.message, ".$this->p."_offers.price, ".$this->p."_users.selector, ".$this->p."_users.category, ".$this->p."_users.firmname from ".$this->p."_offers left join ".$this->p."_users ON ".$this->p."_users.selector=".$this->p."_offers.firmselector where ".$this->p."_users.firmstate='on' ", "Заголовок" => "item", "Фирма" => "firmname", "Описание" => "message", "Изображение" => "offer", "Цена" => "price", "link" => "alloffers.php?idfull="), "прайсы" => array("base" => "".$this->p."_exelp.num, ".$this->p."_exelp.item, ".$this->p."_exelp.message, ".$this->p."_users.selector, ".$this->p."_users.category, ".$this->p."_users.firmname from ".$this->p."_exelp left join ".$this->p."_users ON ".$this->p."_users.selector=".$this->p."_exelp.firmselector where ".$this->p."_users.firmstate='on' ", "Заголовок" => "item", "Описание" => "message", "Фирма" => "firmname", "Изображение" => "exel", "link" => "exel/"), "галерея" => array("base" => "".$this->p."_images.num, ".$this->p."_images.item, ".$this->p."_images.message, ".$this->p."_users.selector, ".$this->p."_users.category, ".$this->p."_users.firmname from ".$this->p."_images left join ".$this->p."_users ON ".$this->p."_users.selector=".$this->p."_images.firmselector where ".$this->p."_users.firmstate='on' ", "Заголовок" => "item", "Описание" => "message", "Фирма" => "firmname", "Изображение" => "gallery", "link" => "gallery.php?id=")); } function one($a){ if($_GET['vi']){ $v = mysql_query("select firmselector from ".$a."_info where num='".(int)$_GET['vi']."' "); $vf = mysql_fetch_array($v); return $vf['firmselector']; } elseif($_GET['socials']){ $v = mysql_query("select selector from ".$a."_users where domen='".preg_replace("|([^a-zA-ZА-Яа-я0-9_-]+)|is","",$_GET['socials'])."' "); $vf = mysql_fetch_array($v); return $vf['selector']; }else { return join("",array_intersect_key($_GET,array_flip(array("id", "vi", "idfull", "firma_id")))); } } function two($a){ if($_GET['subsubcat'] and (int)$_GET['subsubcat'] > 0): return $b = " (".$a."_users.category LIKE '%#%#".(int)$_GET['subsubcat'].":%' or ".$a."_users.category LIKE '%:%#%#".(int)$_GET['subsubcat'].":%' or ".$a."_users.category LIKE '%:%#%#".(int)$_GET['subsubcat']."' or ".$a."_users.category LIKE '%#%#".(int)$_GET['subsubcat']."') "; elseif($_GET['subcat'] and (int)$_GET['subcat'] > 0): return $b = " (".$a."_users.category LIKE '%#".(int)$_GET['subcat']."#%:%' or ".$a."_users.category LIKE '%:%#".(int)$_GET['subcat']."#%:%' or ".$a."_users.category LIKE '%:%#".(int)$_GET['subcat']."#%' or ".$a."_users.category LIKE '%#".(int)$_GET['subcat']."#%') "; elseif($_GET['category'] and (int)$_GET['category'] > 0): return $b = " (".$a."_users.category LIKE '".(int)$_GET['category']."#%#%:%' or ".$a."_users.category LIKE '%:".(int)$_GET['category']."#%#%:%' or ".$a."_users.category LIKE '%:".(int)$_GET['category']."#%#%' or ".$a."_users.category LIKE '".(int)$_GET['category']."#%#%') "; elseif($_GET['cat'] and (int)$_GET['cat'] > 0): return $b = " (".$a."_users.category LIKE '".(int)$_GET['cat']."#%#%:%' or ".$a."_users.category LIKE '%:".(int)$_GET['cat']."#%#%:%' or ".$a."_users.category LIKE '%:".(int)$_GET['cat']."#%#%' or ".$a."_users.category LIKE '".(int)$_GET['cat']."#%#%') "; endif; } function new_news($m) { $m = str_replace("\"", "'", $m); if(array_intersect_key($_GET,array_flip(array("vi","socials","id", "c", "idfull","category","cat","subcat","subsubcat"))) && (strrchr($_SERVER['SCRIPT_NAME'],"/") != "/allnews.php" && strrchr($_SERVER['SCRIPT_NAME'],"/") != "/news.php")) { $and = " and "; //$and = (bool)array_search($m[1], array("тендеры","объявления","новости","вакансии","пресс-релизы")) ? " and ":" where "; }else{ $and = ""; } $sql = ("SELECT ".$this->a[$m[1]]['base'].$and.($sho = (array_intersect_key($_GET,array_flip(array("socials","id", "vi", "idfull"))) && (strrchr($_SERVER['SCRIPT_NAME'],"/") != "/allnews.php" && strrchr($_SERVER['SCRIPT_NAME'],"/") != "/news.php")) ? $this->p."_users.selector='".$this->one($this->p)."'":$this->two($this->p))." order by 1 DESC LIMIT ".$m[2].""); $r = mysql_query($sql); for($i=0; $i]*)>|is',create_function('$s', ' $net = $s[2] > 0 ? "substr(strip_tags(\$f[\$this->a[\$m[1]][$s[1]]]), 0, $s[2])":"strip_tags(\$f[\$this->a[\$m[1]][$s[1]]])"; if($s[1] == "Изображение") { return "\".imgempty::isfil(\$this->a[\$m[1]][$s[1]], \$this->d, \$f[num], \"$s[3]\",\"-small\").\""; }elseif($s[1] == "Заголовок") { return "\".(\$$s[1] = \"d.\"/\".\$this->a[\$m[1]][link].(\$it = (\$m[1] != \"товары\" && \$m[1] != \"галерея\") ? \$f[num]: \$f[selector].\"&full=\".\$f[num]).\$catis.\"\' $s[3] >\".$net.\"\").\""; }elseif($s[1] == "Фирма") { return "d.\"/view.php?id=\".\$f[selector].\$catus.\"\' $s[3]>\".$net.\""; }else { return "\".(\$$s[1] = \"\".$net.\"\").\""; }'),$m[4]); $as = preg_replace("}(\n|\r|\t)}is","",$as); eval("\$a = \"".$as."\";"); $mm .= "
".$a."
"; } return $mm; } function calb($c){ $this->c = $c; if(($_GET["id"] or $_GET["vi"] or $_GET["idfull"] or $_GET["REQ"] or $_GET['socials'] or $_GET['firma_id']) && (strrchr($_SERVER['SCRIPT_NAME'],"/") != "/allnews.php" && strrchr($_SERVER['SCRIPT_NAME'],"/") != "/news.php")) { $rteg = mysql_query("select * from ".$this->p."_users where selector='".$this->one($this->p)."' "); $fteg = mysql_fetch_array($rteg); $fteg['location'] = implode("",mysql_fetch_array(mysql_query("SELECT location FROM ".$this->p."_location where locationselector='".$fteg['location']."' "),MYSQL_NUM )); $fteg['state'] = implode("",mysql_fetch_array(mysql_query("SELECT state FROM ".$this->p."_states where stateselector='".$fteg['state']."' "),MYSQL_NUM )); $coment = mysql_fetch_array(mysql_unbuffered_query("SELECT COUNT(*) FROM ".$this->p."_reviews where company='".$fteg['selector']."' and status='on' ")); $aaa = array("<название фирмы>","<описание фирмы>","<адрес фирмы>","<индекс фирмы>", "<телефон фирмы>","<факс фирмы>", "<сотовый фирмы>", "<аська фирмы>","<представитель фирмы>", "<эл.адрес фирмы>", "", "<город фирмы>","<страна фирмы>","<область фирмы>"); $bbb = array($fteg['firmname'],$fteg['business'],$fteg['address'],$fteg['zip'],$fteg['phone'],$fteg['fax'],$fteg['mobile'],(($fteg['icq'] != '')?"\"$fteg[icq]\"$fteg[icq]":""),$fteg['manager'],$fteg['mail'],$fteg['www'],$fteg['city'],$fteg['location'],$fteg['state']); $ccc = array( '|<логотип фирмы([^>]*)>|is', '|href=(["\'])ссылка на главную(["\'])|is', '|href=(["\'])ссылка на товары и услуги(["\'])|is', '|href=(["\'])ссылка на товары(["\'])|is', '|href=(["\'])ссылка на услуги(["\'])|is', '|href=(["\'])ссылка на галерею(["\'])|is', '|href=(["\'])ссылка на прайсы(["\'])|is', '|href=(["\'])ссылка на видео(["\'])|is', '|href=(["\'])ссылка на новости(["\'])|is', '|href=(["\'])ссылка на тендеры(["\'])|is', '|href=(["\'])ссылка на объявления(["\'])|is', '|href=(["\'])ссылка на вакансии(["\'])|is', '|href=(["\'])ссылка на пресс-релизы(["\'])|is', '|href=(["\'])ссылка на комментарии(["\'])|is', '|href=(["\'])ссылка на почту(["\'])|is', '|action=(["\'])поиск по фирме(["\'])|is' ); if ($this->r == "YES") { if($fteg["category"] != "") list($cat, $subcat, $subsubcat) = split('[:#]', $fteg['category']); else $cat = $subcat = $subsubcat = 0; $cat = intval($cat); $subcat = intval($subcat); $subsubcat = intval($subsubcat); if($cat == 0) $linkCat = "EmptyCategory/"; elseif($subcat == 0) $linkCat = rewrite(mysql_result(mysql_query("SELECT category FROM ".$this->p."_category WHERE selector='".$cat."' "),0))."/"; elseif($subsubcat == 0) $linkCat = rewrite(mysql_result(mysql_query("SELECT category FROM ".$this->p."_category WHERE selector='".$cat."' "),0))."/".rewrite(mysql_result(mysql_query("SELECT subcategory FROM ".$this->p."_subcategory WHERE catsubsel='".$subcat."' "),0))."/"; else $linkCat = rewrite(mysql_result(mysql_query("SELECT category FROM ".$this->p."_category WHERE selector='".$cat."' "),0))."/".rewrite(mysql_result(mysql_query("SELECT subcategory FROM ".$this->p."_subcategory WHERE catsubsel='".$subcat."' "),0))."/".rewrite(mysql_result(mysql_query("SELECT subsubcategory FROM ".$this->p."_subsubcategory WHERE catsubsubsel='".$subsubcat."' "),0))."/"; if($fteg['domen'] == "") { $ddd = array( imgempty::isfil("logo",$this->d,$fteg["selector"],"$1",""), 'href=$1'.$this->d.'/' . $linkCat . $cat . '-' . $subcat . '-' . $subsubcat . '-' . $fteg['selector'] . '-0-0.html$2', 'href=$1'.$this->d.'/offers-'.$fteg['selector'].'-0-'.$cat.'-'.$subcat.'-'.$subsubcat.'-all.html$2', 'href=$1'.$this->d.'/offers-'.$fteg['selector'].'-0-'.$cat.'-'.$subcat.'-'.$subsubcat.'-1.html$2', 'href=$1'.$this->d.'/offers-'.$fteg['selector'].'-0-'.$cat.'-'.$subcat.'-'.$subsubcat.'-3.html$2', 'href=$1'.$this->d.'/gallery-'.$fteg['selector'].'-0-'.$cat.'-'.$subcat.'-'.$subsubcat.'.html$2', 'href=$1'.$this->d.'/excel-'.$fteg['selector'].'-0-'.$cat.'-'.$subcat.'-'.$subsubcat.'.html$2', 'href=$1'.$this->d.'/video-'.$fteg['selector'].'-0-'.$cat.'-'.$subcat.'-'.$subsubcat.'.html$2', 'href=$1'.$this->d.'/news-'.$fteg['selector'].'-0-'.$cat.'-'.$subcat.'-'.$subsubcat.'.html$2', 'href=$1'.$this->d.'/tender-'.$fteg['selector'].'-0-'.$cat.'-'.$subcat.'-'.$subsubcat.'.html$2', 'href=$1'.$this->d.'/board-'.$fteg['selector'].'-0-'.$cat.'-'.$subcat.'-'.$subsubcat.'.html$2', 'href=$1'.$this->d.'/job-'.$fteg['selector'].'-0-'.$cat.'-'.$subcat.'-'.$subsubcat.'.html$2', 'href=$1'.$this->d.'/pressrel-'.$fteg['selector'].'-0-'.$cat.'-'.$subcat.'-'.$subsubcat.'.html$2', 'href=$1'.$this->d.(($coment[0] > 0)? '/view-reviews-'.$fteg['selector'].'-'.$cat.'-'.$subcat.'-'.$subsubcat.'-0.html':'/review-'.$fteg['selector'].'-'.$cat.'-'.$subcat.'-'.$subsubcat.'-0.html').'$2', 'href=$1'.$this->d.'/mail-'.$fteg['selector'].'-'.$cat.'-'.$subcat.'-'.$subsubcat.'-0.html$2', 'action=$1'.$this->d.'/poisk.php?id='.$fteg['selector'].'$2' ); } else { $ddd = array( imgempty::isfil("logo",$this->d,$fteg["selector"],"$1",""), 'href=$1'.$this->d.'/'.$fteg['domen'].'$2', 'href=$1'.$this->d.'/offers-'.$fteg['selector'].'-0-'.$cat.'-'.$subcat.'-'.$subsubcat.'-all.html$2', 'href=$1'.$this->d.'/offers-'.$fteg['selector'].'-0-'.$cat.'-'.$subcat.'-'.$subsubcat.'-1.html$2', 'href=$1'.$this->d.'/offers-'.$fteg['selector'].'-0-'.$cat.'-'.$subcat.'-'.$subsubcat.'-3.html$2', 'href=$1'.$this->d.'/gallery-'.$fteg['selector'].'-0-'.$cat.'-'.$subcat.'-'.$subsubcat.'.html$2', 'href=$1'.$this->d.'/excel-'.$fteg['selector'].'-0-'.$cat.'-'.$subcat.'-'.$subsubcat.'.html$2', 'href=$1'.$this->d.'/video-'.$fteg['selector'].'-0-'.$cat.'-'.$subcat.'-'.$subsubcat.'.html$2', 'href=$1'.$this->d.'/news-'.$fteg['selector'].'-0-'.$cat.'-'.$subcat.'-'.$subsubcat.'.html$2', 'href=$1'.$this->d.'/tender-'.$fteg['selector'].'-0-'.$cat.'-'.$subcat.'-'.$subsubcat.'.html$2', 'href=$1'.$this->d.'/board-'.$fteg['selector'].'-0-'.$cat.'-'.$subcat.'-'.$subsubcat.'.html$2', 'href=$1'.$this->d.'/job-'.$fteg['selector'].'-0-'.$cat.'-'.$subcat.'-'.$subsubcat.'.html$2', 'href=$1'.$this->d.'/pressrel-'.$fteg['selector'].'-0-'.$cat.'-'.$subcat.'-'.$subsubcat.'.html$2', 'href=$1'.$this->d.(($coment[0] > 0)? '/view-reviews-'.$fteg['selector'].'-'.$cat.'-'.$subcat.'-'.$subsubcat.'-0.html':'/review-'.$fteg['selector'].'-'.$cat.'-'.$subcat.'-'.$subsubcat.'-0.html').'$2', 'href=$1'.$this->d.'/mail-'.$fteg['selector'].'-'.$cat.'-'.$subcat.'-'.$subsubcat.'-0.html$2', 'action=$1'.$this->d.'/poisk.php?id='.$fteg['selector'].'$2' ); } } else { $ddd = array( imgempty::isfil("logo",$this->d,$fteg["selector"],"$1",""), 'href=$1'.$this->d.'/view.php?id='.$fteg['selector'].'$2', 'href=$1'.$this->d.'/offers.php?id='.$fteg['selector'].'$2', 'href=$1'.$this->d.'/offers.php?id='.$fteg['selector'].'&type=1$2', 'href=$1'.$this->d.'/offers.php?id='.$fteg['selector'].'&type=3$2', 'href=$1'.$this->d.'/gallery.php?id='.$fteg['selector'].'$2', 'href=$1'.$this->d.'/exel.php?id='.$fteg['selector'].'$2', 'href=$1'.$this->d.'/video.php?id='.$fteg['selector'].'$2', 'href=$1'.$this->d.'/publication.php?id='.$fteg['selector'].'&type=1$2', 'href=$1'.$this->d.'/publication.php?id='.$fteg['selector'].'&type=2$2', 'href=$1'.$this->d.'/publication.php?id='.$fteg['selector'].'&type=3$2', 'href=$1'.$this->d.'/publication.php?id='.$fteg['selector'].'&type=4$2', 'href=$1'.$this->d.'/publication.php?id='.$fteg['selector'].'&type=5$2', 'href=$1'.$this->d.'/review'.($sd = ($coment[0] > 0)? "s":"").'.php?id='.$fteg['selector'].'$2', 'href=$1'.$this->d.'/mail.php?id='.$fteg['selector'].'$2', 'action=$1'.$this->d.'/poisk.php?id='.$fteg['selector'].'$2' ); } $this->c = preg_replace($ccc,$ddd,$this->c); $this->c = str_replace($aaa, $bbb, $this->c); } else { $aaa = array("<название фирмы>","<описание фирмы>","<адрес фирмы>","<индекс фирмы>", "<телефон фирмы>","<факс фирмы>", "<сотовый фирмы>", "<аська фирмы>","<представитель фирмы>", "<эл.адрес фирмы>", "", "<город фирмы>","<страна фирмы>","<область фирмы>"); $bbb = array('','','','','','','','','','','','','',''); $ccc = array('|<логотип фирмы([^>]*)>|is'); $ddd = array(''); } $this->c = preg_replace($ccc,$ddd,$this->c); $this->c = str_replace($aaa, $bbb, $this->c); return preg_replace_callback('|<([-\а-яА-Я]+)\[([0-9]+)\]([^>]*)>(.*?)|is',array('self', 'new_news'),$this->c); } } function nazad($c) { $multi = new newnwes; return $multi->calb($c); } ob_start("nazad"); ?> Главная | Новости | - Beltrade.by - Площадка электронной коммерции. ';?>

'.$def_sort.' '.$def_sort_name.' | '.$def_sort_data.' | '.$def_sort_rating.' | '.$def_sort_hits.' | Rss


'; } //else echo '

'; if($_SESSION['d'] == 'today') { $d = ' and ((`stop` >= CURDATE() and `start` < TIMESTAMPADD(day,1,curdate())) or (`stop` = \'0000-00-00 00:00:00\' and `start` >= CURDATE() and `start` < TIMESTAMPADD(day,1,curdate()))) '; } elseif($_SESSION['d'] == 'tomorrow') { $d = ' and ( (`stop` >= TIMESTAMPADD(day,1,curdate()) and `start` < TIMESTAMPADD(day,2,curdate())) or (`stop` = \'0000-00-00 00:00:00\' and `start` >= TIMESTAMPADD(day,1,curdate()) and `start` < TIMESTAMPADD(day,2,curdate()) ) ) '; } elseif($_SESSION['d'] == 'week') { $d = ' and ( (`stop` >= TIMESTAMPADD(day,-1,curdate()) and `start` < CURDATE()) or (`stop` = \'0000-00-00 00:00:00\' and `start` >= TIMESTAMPADD(day,-1,curdate()) and `start` < CURDATE()) )'; } elseif($_SESSION['d']) { $md = explode(".",$_SESSION['d']); $d = " and ( (`stop` >= '".$md[2]."-".$md[1]."-".$md[0]."' and `start` < TIMESTAMPADD(day,1,'".$md[2]."-".$md[1]."-".$md[0]."')) or (`stop` = '0000-00-00 00:00:00' and `start` >= '".$md[2]."-".$md[1]."-".$md[0]."' and `start` < TIMESTAMPADD(day,1,'".$md[2]."-".$md[1]."-".$md[0]."') ) )"; } else $d = ' and (`stop` > CURDATE() or `stop` = \'0000-00-00 00:00:00\' )'; if($def_news_tomorrow == "NO") $d .= ' and `start` < TIMESTAMPADD(day,1,curdate()) '; @$rz = $db->query ( "SELECT * FROM $db_news WHERE ".(($category_news_get)?"category='".mysql_result(mysql_query("select selector from $db_categorynews where name='".$category_news_get."' "),0)."' and":"")." status_off=0 $d order by start desc LIMIT $page1, $def_list_news" ); @$results_amount = mysql_num_rows ( $rz ); @$result_in= mysql_result(mysql_query( "SELECT count(*) FROM $db_news WHERE ".(($category_news_get)?"category='".mysql_result(mysql_query("select selector from $db_categorynews where name='".$category_news_get."' "),0)."' and":"")." status_off=0 $d " ),0); if (!isset($_REQUEST[category] )) { ?>
query ( "SELECT * FROM $db_categorynews WHERE status_off!='1' ORDER BY category " ); if (!$r) error ("mySQL error", mysql_error() ); $results = $db->numrows ( $r ); $res = round ( $results/2 ); $template_view_news_category = implode ('', file('./template/' . $def_template . '/category_news.tpl')); for ( $i=0;$i<$res;$i++ ) { $f = $db->fetcharray ( $r ); include ("./includes/sub_component/category_news.php"); } echo "

"; for ( $x=$res;$x<$results;$x++ ) { $f = $db->fetcharray ( $r ); include ("./includes/sub_component/category_news.php"); } ?>


" method="post" id="dd"> readonly />
0 ) { echo "
    "; include ("./includes/short_news.php"); echo "
"; // Страницы if ( $result_in > $def_list_news ) { if ((($kPage*$def_list_news)-($def_list_news*5)) >= 0) $first=($kPage*$def_list_news)-($def_list_news*5); else $first=0; if ((($kPage*$def_list_news)+($def_list_news*6)) <= $result_in) $last =($kPage*$def_list_news)+($def_list_news*6); else $last = $result_in; @$z=$first/$def_list_news; if ($kPage > 0) { if (($def_rewrite_news == "YES") and (empty($_GET['sort']))) $prev_page = ''.$def_previous.' '; else $prev_page = ''.$def_previous.' '; } else $prev_page = ''; $page_news = ''; for ( $xx = $first; $xx < $last; $xx=$xx+$def_list_news ) { if ( $z == $kPage ) { $page_news .= ''.($z+1).' '; $z++; } else { if (($def_rewrite_news == "YES") and (empty($_GET['sort']))) $page_news .= ''.($z+1).' '; else $page_news .= ''.($z+1).' '; $z++; } } if ($kPage - (($result_in / $def_list_news) - 1) < 0) { if (($def_rewrite_news == "YES") and (empty($_GET['sort']))) $next_page = ''.$def_next.' '; else $next_page = ''.$def_next.' '; } else $next_page =''; include ( "./template/$def_template/pages.php" ); // подключаем обработку страниц $template_page_news = implode ('', file('./template/' . $def_template . '/pages.tpl')); $template_pages = new Template; $template_pages->load($template_page_news); $template_pages->replace("prev", $prev_page); $template_pages->replace("next", $next_page); $template_pages->replace("page", $page_news); $template_pages->replace("path_to_images", $def_mainlocation . "/template/" . $def_template . "/images"); $template_pages->publish(); } echo '
Всего - '.$result_in.'
'; include ( "./includes/tag_news.php" ); // подключаем облако тегов } else include ( "./includes/error_page.php" ); $db->freeresult ( $fz ); ?>