function cat_description($info_description, $word_arr) { $descr = $info_description; $descr = str_replace("<", " <", $descr); $descr = strip_tags($descr); $descr = ereg_replace("\n", " ", $descr); $descr = ereg_replace("\r", "", $descr); $descr = ereg_replace("\t", "", $descr); $descr = ereg_replace("[[:space:]]+", " ", $descr); $info_description = ''; $max_word = 7; foreach ($word_arr as $k => $v) { $ereg_string = strlen($v) < 3 ? "(^| |[[:punct:]])" . RegExpSim(strtolower_ru($v)) . "( |[[:punct:]]|\$)" : RegExpSim(strtolower_ru($v)); if (ereg($ereg_string, strtolower_ru($info_description))) { $info_description = BoldWord($info_description, $v); continue; } if (ereg("([^ .!?]+[ ]*){0,{$max_word}}" . $ereg_string . "([ ]*[^ .!?]+){0,{$max_word}}", strtolower_ru($descr), $F)) { $pos = strpos(strtolower_ru($descr), $F[0]); $F[0] = substr($descr, $pos, strlen($F[0])); if ($pos != 0 || count($word_arr) > 1) { $info_description .= " ..."; } $info_description .= $F[0]; $info_description = BoldWord($info_description, htmlspecialchars($v, ENT_COMPAT, 'cp1251')); } } if ($info_description) { $info_description .= "..."; } return $info_description; }
$tpl['news']['data']['source'] = 'http://' . $source['host']; } /*var_dump(preg_match('#(<img\s(?>(?!src=)[^>])*?src=")(.*?)("[^>]*>)#',$tpl['news']['data']['text'],$res),$res); $name = $rows["name"]; $date = $rows["date"]; $text = $rows["text"]; $typesource = $rows["typesource"]; $source = $rows["source"]; $author = $rows["author"]; $email = $rows["email"];*/ $MainFolderMenuX = 4; $MainFolderMenuY = 2; $page = 2; if (substr_count($_SERVER['REQUEST_URI'], ".html") == 0 && $news > 0) { $namehref = strtolower_ru($name) . "_n" . $news . ".html"; header('HTTP/1.1 301 Moved Permanently'); header('Location: http://news.numizmatik.ru/' . $namehref); } function data_to_img($match) { /*<div class="image_block"> <div id="image723515" class="imageBig" style="position: absolute; display: none;"> <img class="img_hover" src="http://www.numizmatik.ru/shopcoins/images/484/484442b.jpg"> </div> <img title="СССР | 1 рубль" src="http://www.numizmatik.ru/shopcoins/smallimages/484/484442.jpg"> </div>*/ list(, $img, $src, $end) = $match; $id = str_replace('http://numizmatik.ru/news_img/', '', $src); $id = str_replace('.jpeg', '', $id); // var_dump($src);
$result_ins = mysql_query($sql_ins); //echo $sql_ins."<br>"; $nnn++; $pagenum = ceil($rows_tmp[0] / 8); if ($pagenum > 1) { for ($i = 2; $i <= $pagenum; $i++) { $sql_ins = "insert into sitemaps (`sitemaps`,`url`,`page`,`priority`,`type`,`dateinsert`,`lastmod`) \n\t\t\t\t\tvalues (NULL, 'http://www.numizmatik.ru/shopcoins/" . str_replace('_pp1', '_pp' . $i, $rehrefdubdle) . "', 'daily',0.6,'shopcoins'," . time() . ",'" . date('Y-m-d', $realtime) . "')"; $result_ins = mysql_query($sql_ins); //echo $sql_ins."<br>"; $nnn++; } } } } if ($rows['amount'] > 1 && ($rows['materialtype'] == 8 || $rows['materialtype'] == 7 || $rows['materialtype'] == 4 || $rows['materialtype'] == 2)) { $rehrefdubdle = strtolower_ru($rehref) . "_c" . $rows['shopcoins'] . "_pc" . $rows['shopcoins'] . "_m" . $rows['materialtype'] . "_pp1.html"; $sql_ins = "insert into sitemaps (`sitemaps`,`url`,`page`,`priority`,`type`,`dateinsert`,`lastmod`) \n\t\tvalues (NULL, 'http://www.numizmatik.ru/shopcoins/" . $rehrefdubdle . "', 'daily',0.7,'shopcoins'," . time() . ",'" . date('Y-m-d', $realtime) . "')"; $result_ins = mysql_query($sql_ins); //echo $sql_ins."<br>"; $nnn++; $pagenum = ceil($rows['amount'] / 8); if ($pagenum > 1) { for ($i = 2; $i <= $pagenum; $i++) { $sql_ins = "insert into sitemaps (`sitemaps`,`url`,`page`,`priority`,`type`,`dateinsert`,`lastmod`) \n\t\t\t\tvalues (NULL, 'http://www.numizmatik.ru/shopcoins/" . str_replace('_pp1', '_pp' . $i, $rehrefdubdle) . "', 'daily',0.6,'shopcoins'," . time() . ",'" . date('Y-m-d', $realtime) . "')"; $result_ins = mysql_query($sql_ins); //echo $sql_ins."<br>"; $nnn++; } } } if ($rows['theme'] > 0) {
".(sizeof($SearchTempStr)?"or ((shopcoins.metal like '%".implode("%' or shopcoins.metal like '%",$SearchTempStr)."%') and shopcoins.metal<>'')":"")." ".(sizeof($SearchTempStr)?"or ((shopcoins.condition like '%".implode("%' or shopcoins.condition like '%",$SearchTempStr)."%') and shopcoins.condition<>'')":"")." ".(sizeof($SearchTempStr)?"or (shopcoins.`name` like '%".implode("%' or shopcoins.`name` like '%",$SearchTempStr)."%')":"")." ".(sizeof($WhereThemesearch)?" or ".implode(" or ",$WhereThemesearch):"")." ".(sizeof($WhereCountryes)>0?" or shopcoins.`group` in (".implode(",",$WhereCountryes).")":"").")"; } } if ($group and !$page){ $group = intval($group); $sql = "select * from `group` where `group`='$group';"; $result = mysql_query($sql); $rows = mysql_fetch_array($result); $GroupName = $rows["name"]; $GroupNameMain = ''; $grouphref = strtolower_ru($GroupName)."_gn".$rows['group']; if ($rows["groupparent"] != 0 && $rows["groupparent"] != $rows["group"]) { $sql_g = "select name from `group` where `group`='".$rows["groupparent"]."';"; $result_g = mysql_query($sql_g); $rows_g = mysql_fetch_array($result_g); $GroupNameMain = $rows_g['name']; } if (trim($rows["description"])) { $text = substr($rows["description"], 0, 650); $text = substr($text, 0, strlen($text) - strpos(strrev($text), '.')); $pic = Array();
//while ($rows = mysql_fetch_array($result)) foreach ($MyShowArray as $key=>$rows) { $textoneclick=''; $mtype = ($materialtype>0?$materialtype:$rows['materialtype']); if ($rows['gname']) $rehref .= $rows['gname']."-"; $rehref .= $rows['name']; if ($rows['metal']) $rehref .= "-".$rows['metal']; if ($rows['year']) $rehref .= "-".$rows['year']; $rehrefdubdle = strtolower_ru($rehref)."_c".($mtype==1?$rows['parent']:$rows['shopcoins'])."_pc".($parent>0?$parent:(($mtype==7 || $mtype==8 || $mtype==6 || $mtype==4 || $mtype==2) && $rows["amount"]>1?$rows['shopcoins']:($mtype==1?$rows['parent']:0)))."_m".$rows['materialtype']."_pp1.html"; $rehref = strtolower_ru($rehref)."_c".$rows['shopcoins']."_m".$rows['materialtype'].".html"; //echo $rehref."<br>"; if ($i%2==1) { echo "<tr><td class=tboard valign=top width=50%>"; } elseif ($i%2==0) { echo "<td class=tboard valign=top width=50%>"; } $coefficient = 0; if ($rows['coefficientcoins']) $coefficient = $coefficient+$rows['coefficientcoins']; if ($rows['coefficientgroup']) $coefficient = $coefficient+$rows['coefficientgroup']*2; if ($rows['counterthemeyear']) $coefficient = $coefficient+$rows['counterthemeyear'];
function namesort($a, $b) { $x = strtolower_ru($a[0]); $y = strtolower_ru($b[0]); if ($x == $y) { return 0; } return $x > $y ? 1 : -1; }