", $bbtext);
$bbtext = str_replace("[color=green]", "", $bbtext);
$bbtext = str_replace("[color=red]", "", $bbtext);
$bbtext = str_replace("[color=black]", "", $bbtext);
$bbtext = str_replace("[color=orange]", "", $bbtext);
$bbtext = str_replace("[color=darkblue]", "", $bbtext);
$bbtext = str_replace("[color=blue]", "", $bbtext);
$bbtext = str_replace("[color=white]", "", $bbtext);
$bbtext = str_replace("[/color]", " ", $bbtext);
$bbtext = str_replace("[color=white]-[/color]", " ", $bbtext);
$bbtext = str_replace("- -", " ", $bbtext);
$bbtext = str_replace("[url=", "", $bbtext);
$bbtext = str_replace("[nofollow=", " ", $bbtext);
$bbtext = str_replace("[sponsored=", " ", $bbtext);
$bbcode = array("<", ">",
"[list]", "[*]", "[/list]",
"[img]", "[/img]",
"[b]", "[/b]",
"[u]", "[/u]",
"[i]", "[/i]",
'[color="', "[/color]",
"[size=\"", "[/size]",
'[url="', "[/url]",
'[nofollow="', "[/nofollow]",
'[sponsored="', "[/sponsored]",
"[mail=\"", "[/mail]",
"[code]", "[/code]",
"[strong]", "[/strong]",
"[h1]", "[/h1]",
"[h2]", "[/h2]",
"[h3]", "[/h3]",
"[noindex]", "[/noindex]",
"[r]", "[/r]",
"[c]", "[/c]",
"[pre]", "[/pre]",
"[sub]", "[/sub]",
"[alt]", "[/alt]",
"[quote]", "[/quote]",
"[OBJECT468]", "[/OBJECT468]",
"[EMBED468]", "[/EMBED468]",
"[s]", "[/s]",
"[video]", "[/video]",
"]");
$htmlcode = array("<", ">",
"",
" ",
"", " ",
"", " ",
"", " ",
"",
"",
' ",
' ",
' ",
" ",
"", "
",
"", " ",
"", " ",
"", " ",
"", " ",
"", "",
"", "
",
"", "
",
"", " ",
"", " ",
" alt=\"", "\"",
" ",
"",
"", " ",
"", " ",
">");
$newtext = str_replace($bbcode, $htmlcode, $bbtext);
// $newtext = str_replace("\r\n\r\n", " ", $newtext);
// $newtext = str_replace("\r\n\r\n", " ", $newtext);
// $newtext = str_replace("\r\n\r\n", " ", $newtext);
// $newtext = nl2br($newtext);//second pass
$newtext = preg_replace("#(^|[\n ])((www|ftp)\.[^ \"\t\n\r<]*)#is", "\\1\\2 ", $newtext);
$newtext = preg_replace("#(^|[\n ])([a-z0-9&\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i", "\\1\\2@\\3 ", $newtext);
$newtext = str_replace("", "", $newtext);
$newtext = str_replace("[/list:u>", "", $newtext);
$newtext = preg_replace("!� (.*?)\n!si","",$newtext);
$newtext = str_replace(" - ", " — ", $newtext);
$newtext=preg_replace("/([a-zA-Z�-��-�0-9])[-]\s/","\\1– ",$newtext);
$newtext = preg_replace("!- (.*?)\n!si","",$newtext);
$newtext = preg_replace("!- (.*?)\n!si","",$newtext);
$newtext = preg_replace("!alt=\"(.*?)\"!si","alt=\"\\1\" title=\"\\1\" ",$newtext);
$newtext = ' '.str_replace(PHP_EOL . PHP_EOL, '
', $newtext).'
';
$newtext = str_replace(PHP_EOL, '', $newtext);
// $newtext = str_replace("http://www.youtube.com/watch?v=", "http://www.youtube.com/v/", $newtext);
$newtext = str_replace('youtube.com/watch?v=', 'youtube.com/embed/', $newtext);
$newtext = str_replace('http://www.youtube.com/', 'https://www.youtube.com/', $newtext);
// $newtext = preg_replace("!(.*?) !si","
�������� �� YouTube ",$newtext);
$newtext = preg_replace("!(.*?) !si"," ",$newtext);
$newtext = preg_replace("!(.*?) !si","\\1 ",$newtext);
$newtext = str_replace("www.prod-prod.ru", "", $newtext);
$newtext = str_replace("prod-prod.ru", "habeas-russia.ru", $newtext);
$newtext = str_replace("habeas.ru", "habeas-russia.ru", $newtext);
$newtext = str_replace("http://www.oborud.info/img/", "/img/", $newtext);
$aa = "".ucfirst(trim($zag))." ".$newtext; }
// ���� ������ ����� - ��������� ���������� �������
// if (isset($v)) {
if (isset($_GET['v']))
//if (isset($v))
{
//$v = $_GET['v'];
$var = @$_GET['v'];
$var = htmlspecialchars($var);
// ������ ������� ������� ������ ��� "������������" �������.
$var = preg_replace("/[^-\^\w\x7F-\xFF\s]/", " ", $var);
$var = str_replace("quot", "", $var);
$var = str_replace("�", "", $var);
$var = str_replace("�", "", $var);
$trimmed = trim($var); //trim whitespace from the stored variable
// ������ ����� ���� �������� ������� ������.
$trimmed = substr($trimmed, 0, 54);
function sw (&$item1, $key) { if (strlen($item1)<2) $item1=""; }
// ��������� �� �����, ������� �����, ������ 3� ����
$trimmed=explode (" ", $trimmed);
// ��� � ������� �����������...
array_walk ($trimmed, 'sw');
// ������� ������������� �����
$trimmed=array_unique ($trimmed);
// ���������� ����� �� �����.
//require "stemmer.php";
//foreach ($trimmed as $value) {
//$stemmer = new Lingua_Stem_Ru();
//$trimmed_stemmer[] = $stemmer->stem_word($value);
// }
// ��������� �����
//if (strlen($var)>5) { $trimmed=implode (" ", $trimmed_stemmer); }
//else $trimmed=implode (" ", $trimmed);
$trimmed=implode (" ", $trimmed);
// �� ����, ������ ������ ������������ ����������� ������ �� ������� �������� ������
// ����� ����� �������, ��� ������ ��������� ������. ����, �������� ������ ������
// �� ������, ������� ������� ���� ���� (���� ����������� ������, ���� ��������
// "{1,2}" �� "{1, ���-�� ��������}").
$trimmed = trim(ereg_replace("/\s(\S{1,2})\s/", " ", ereg_replace(" +", " "," $trimmed ")));
// � ����� ������ ������ ���� - ���� ����� ������� ������� (��� ���� �������
// ���������� ��� ����������� ������ �������� ����).
$trimmed = ereg_replace(" +", " ", $trimmed);
$trimmed = strtolower($trimmed); // ������� ��������� �����
{ if (strlen($trimmed)<2) $trimmed=""; }
// ���� ����� ������ 3 �������� �� ����������
/*
function highlight_newtext($newtext, $trimmed) {
$highlight[] = str_replace(" ", "|", $trimmed);
$trimmed2 = implode("", $highlight) ;
$newtext=preg_replace("/($trimmed2)/si","\\1 ",$newtext);
return $newtext;
}
*/
// http://forum.dklab.ru/viewtopic.php?p=159111
function highlight_newtext ($newtext, $trimmed) {
$t=explode(' ', $trimmed);
// �������� ������ ����, ������� ����� ������������
// ������� �� ������ ��� ���� � ������ $tagList
preg_match_all('#<[^>]*>#', $newtext, $tags); array_unique($tags);
$tagList=array(); $k=0;
foreach($tags[0] as $i) {
$k++;
$tagList[$k]=$i;
$newtext=str_replace($i, '<' . $k . '>', $newtext);
}
// ���������� ���������� ������ -���
foreach($t as $i)
// if (!is_numeric($i))
$newtext=preg_replace('#' . $i . '#i', '$0 ', $newtext);
// ���������� ��� ���� �� �����
foreach($tagList as $k=>$i) $newtext=str_replace('<' . $k . '>', $i, $newtext);
// ������� ��� ��������� ������ ����� ...
$newtext=preg_replace_callback(
'#(.*?)<\/title>#',
create_function(
'$m',
'return preg_replace("#<span([^>]*)>#", "", str_replace("</span>", "", $m[0]));'
),
$newtext
);
return $newtext; // ���������� ������������ �����
}
if ($nf!='1') { $newtext = highlight_newtext($newtext, $trimmed); }
}
if (strlen($newtext)<100) $newtext="<h4 class=\"st\">��������, ������������� ���� �������� - �� �������</h4><br><p style=\"PADDING-BOTTOM: 0px; MARGIN-TOP: -4px; PADDING-LEFT: 12px; PADDING-RIGHT: 12px; PADDING-TOP: 0px\" align=\"left\">����������� ��������������� �������� \"�������� ����\" ��� ��������� ������� � ������������� ���� ����������</p>
<script>
setTimeout( 'location=\"http://www.oborud.info/?part_id=123\";', 0 );
</script>
";
print $newtext;
// ����� ������� ������ ������� � ����������
}
// -------------------------------------------
// ���� ������ �����
// elseif (isset($v)) {
elseif (isset($_GET['v']))
//if (isset($t))
{
$v = $_GET['v'];
$var = @$_GET['v'];
$var = htmlspecialchars($var);
// ������ ������� ������� ������ ��� "������������" �������.
$var = preg_replace("/[^-\^\w\x7F-\xFF\s]/", " ", $var);
$var = str_replace("quot", "", $var);
$var = str_replace("�", "", $var);
$var = str_replace("�", "", $var);
$trimmed = trim($var); //trim whitespace from the stored variable
// ������ ����� ���� �������� ������� ������.
$trimmed = substr($trimmed, 0, 54);
function sw (&$item1, $key) { if (strlen($item1)<2) $item1=""; }
// ��������� �� �����, ������� �����, ������ 3� ����
$trimmed=explode (" ", $trimmed);
// ��� � ������� �����������...
array_walk ($trimmed, 'sw');
// ������� ������������� �����
$trimmed=array_unique ($trimmed);
// ���������� ����� �� �����.
//require "stemmer.php";
//foreach ($trimmed as $value) {
//$stemmer = new Lingua_Stem_Ru();
//$trimmed_stemmer[] = $stemmer->stem_word($value);
// }
// ��������� �����
//if (strlen($var)>5) { $trimmed=implode (" ", $trimmed_stemmer); }
//else $trimmed=implode (" ", $trimmed);
$trimmed=implode (" ", $trimmed);
// �� ����, ������ ������ ������������ ����������� ������ �� ������� �������� ������
// ����� ����� �������, ��� ������ ��������� ������. ����, �������� ������ ������
// �� ������, ������� ������� ���� ���� (���� ����������� ������, ���� ��������
// "{1,2}" �� "{1, ���-�� ��������}").
$trimmed = trim(ereg_replace("/\s(\S{1,2})\s/", " ", ereg_replace(" +", " "," $trimmed ")));
// � ����� ������ ������ ���� - ���� ����� ������� ������� (��� ���� �������
// ���������� ��� ����������� ������ �������� ����).
$trimmed = ereg_replace(" +", " ", $trimmed);
$trimmed = strtolower($trimmed); // ������� ��������� �����
{ if (strlen($trimmed)<2) $trimmed=""; }
// ���� ����� ������ 3 �������� �� ����������
include ("../catalog/data.php");
// if (!Admin()) die;
if ($nf=='1') { $title="������� �������� ".ucfirst(trim($v))." | �������-PRO | OBORUD.INFO - ������ ������������"; }
else { $title="�����: ".$v." | �������-PRO | OBORUD.INFO - ������ ������������"; }
$description="������� ������� ��������������, �������� � ������� ��������-�������������� � ����������� ������������ ";
$detail_keywords="������� ������� ��������������, �������� � �������";
$CATNAME="������� ��������-�������������� � ����������� ������������ ";
// ����� ������ ��������
$rb=mysql_query("SELECT rubs,banners,switch FROM part2_banners WHERE rubs='1' LIMIT 1;") or die(mysql_error());
$rubs=mysql_result($rb,0,0);
$bannertop=mysql_result($rb,0,1);
$switch=mysql_result($rb,0,2);
if ($switch=='1') { $bannertop = "<noindex>
<!-- BANNERTOP -->
<div id=\"btop_03\">
".$bannertop."
</div>
<!--// BANNERTOP -->
</noindex> "; } else {$bannertop="";}
// ���������� ��� �����:
// �������� �������� �� ����������� ����������
$r=mysql_query("Select * FROM count2 WHERE 1") or die(mysql_error());
// ����������� � �����������:
$cnt1=mysql_result($r,0,1);
// ������� ������������
$cnt3=mysql_result($r,0,3);
// $counter = "<b>".$cnt1."</b> ����������� | <b>".$cnt3."</b> ������� ";
$counter = "<span style=\"color: #3A3A4B;\"><b>".$cnt1."</b></span> <span style=\"color: #5D5D5D;\">�����������</span> | <span style=\"color: #3A3A4B;\"><b>".$cnt3."</b></span> <span style=\"color: #5D5D5D;\">������� </span> ";
include "_top.php";
####################################################################
# ����� ������
#
# id - �������������
# rubs - �������
# rubs2 - ������� �������
# pubdate - ����
# link - ������
# title - ���������
# description - ����� ������
# icon - ������ ��������
# notes - ������� (�����������)
#
####################################################################
?>
<table cellspacing=0 cellpadding=0 border=0 width=100%>
<tr><td>
<?
# ��������� SQL
$portion = 16;
// if (!isset($i0)) $i0=0; // �� ������ ������� ������ ����� � ������������� ����� ������
if ((!isset($i0)) OR ($i0<0)) $i0=0;
settype($i0,"integer");
// $i1=$i0+$portion;
$i1=$portion;
// ���� ����� � �������� ������� BEGIN
if ($pr>0) {
$pr = @$_GET['pr'];
$pr = preg_replace("/[^-\^\w\x7F-\xFF\s]/", "", $pr);
$pr=intval($pr);
$QSearchp=" AND rubs2 = $pr ";
}
// ���� ����� � �������� ������� END
// �������� ����� ����� ������ �������
if ($nf=='1') {
$Search_firm = str_replace(",", "", $v);
$Search_firm = str_replace("(", "", $Search_firm);
$Search_firm = str_replace(")", "", $Search_firm);
$Search_firm = str_replace("�", "", $Search_firm);
$Search_firm = str_replace("�", "", $Search_firm);
//$Search_firm = str_replace("��������", "", $Search_firm);
//$Search_firm = str_replace("�����", "", $Search_firm);
$Search_firm = trim($Search_firm);
$Search_firm = strtolower($Search_firm); // ������� ��������� �����
$fswords = explode(' ', $Search_firm);
$fswords=array_unique ($fswords); // ������� ������������� �����
$swords = array();
for ($i=0;$i<sizeof($fswords);$i++) {
if (strlen($fswords[$i])>2) { //����� ������ ����� ��� ������ 3 ����
$swords[] = $fswords[$i];
}
}
unset($fswords);
// ����� ���������� ������ ��� �������
// print_r ($swords); // �������� ������� ������
$fieldsvar = "";
for ($i=0;$i<sizeof($swords);$i++) {
// $fieldsvarnews .= " phorum_posts.post_username REGEXP '[[:<:]]".$swords[$i]."[[:>:]]'".($i<sizeof($swords)-1?" AND ":"");
// $fieldsvarnews .= " phorum_posts.post_username LIKE '%" . $swords[$i] . "%'".($i<sizeof($swords)-1?" AND ":"");
// $fieldsvarnews .= " description LIKE '%" . $swords[$i] . "%'".($i<sizeof($swords)-1?" AND ":"");
$fieldsvarnews .= " phorum_posts.post_username LIKE '%" . $swords[$i] . "%'".($i<sizeof($swords)-1?" AND ":"");
}
// ������� �� ������ ��� �������������� ������� � ��������� �����
$nf2=mysql_query("SELECT phorum_topics.topic_id, phorum_posts_text.post_id, phorum_topics.topic_first_post_id FROM phorum_posts_text, phorum_topics, phorum_posts WHERE phorum_posts_text.post_id=phorum_topics.topic_first_post_id AND phorum_posts_text.post_id=phorum_posts.post_id AND ($fieldsvarnews) order by phorum_topics.topic_id DESC;") or die(mysql_error());
$cntnf2=mysql_num_rows($nf2);
// echo $cntnf2;
// echo '��������� ������� �������� '.mysql_num_rows($nf2).' �����<br/>'; // �������� ������� ������
while ($nf2_array = mysql_fetch_array($nf2))
{
// echo "<a href=http://www.oborud.info/news/?t=".$nf2_array[0].">$nf2_array[0]</a><BR>"; // �������� ������� ������
$nf2_link[]="'http://www.oborud.info/news/?t=".$nf2_array[0]."'";
$nf2_link1[]="'http://www.oborud.info/news/2O11/?t=".$nf2_array[0]."'";
$nf2_link2[]="'http://www.oborud.info/news/2011/?t=".$nf2_array[0]."'";
$nf2_link3[]="'http://www.oborud.info/news/2O12/?t=".$nf2_array[0]."'";
$nf2_link4[]="'http://www.oborud.info/news/2012/?t=".$nf2_array[0]."'";
$nf2_link5[]="'http://www.oborud.info/news/2010/?t=".$nf2_array[0]."'";
$nf2_link6[]="'http://www.oborud.info/news/2013/?t=".$nf2_array[0]."'";
$nf2_link7[]="'http://www.oborud.info/news/2O13/?t=".$nf2_array[0]."'";
$nf2_link8[]="'http://www.oborud.info/news/2O14/?t=".$nf2_array[0]."'";
$nf2_link9[]="'http://www.oborud.info/news/2014/?t=".$nf2_array[0]."'";
$nf2_link10[]="'http://www.oborud.info/news/2O15/?t=".$nf2_array[0]."'";
$nf2_link11[]="'http://www.oborud.info/news/2015/?t=".$nf2_array[0]."'";
$nf2_link12[]="'http://www.oborud.info/news/15/?t=".$nf2_array[0]."'";
$nf2_link13[]="'http://www.oborud.info/news/20I5/?t=".$nf2_array[0]."'";
$nf2_link14[]="'http://www.oborud.info/news/2OI5/?t=".$nf2_array[0]."'";
$nf2_link15[]="'http://www.oborud.info/news/16/?t=".$nf2_array[0]."'";
$nf2_link16[]="'http://www.oborud.info/news/2016/?t=".$nf2_array[0]."'";
$nf2_link17[]="'http://www.oborud.info/news/2O16/?t=".$nf2_array[0]."'";
$nf2_link18[]="'http://www.oborud.info/news/20I6/?t=".$nf2_array[0]."'";
$nf2_link19[]="'http://www.oborud.info/news/2OI6/?t=".$nf2_array[0]."'";
$nf2_link20[]="'http://www.oborud.info/news/17/?t=".$nf2_array[0]."'";
$nf2_link21[]="'http://www.oborud.info/news/2017/?t=".$nf2_array[0]."'";
$nf2_link22[]="'http://www.oborud.info/news/2OI7/?t=".$nf2_array[0]."'";
$nf2_link23[]="'http://www.oborud.info/news/2O17/?t=".$nf2_array[0]."'";
$nf2_link24[]="'http://www.oborud.info/news/18/?t=".$nf2_array[0]."'";
$nf2_link25[]="'http://www.oborud.info/news/2018/?t=".$nf2_array[0]."'";
$nf2_link26[]="'http://www.oborud.info/news/20I8/?t=".$nf2_array[0]."'";
$nf2_link27[]="'http://www.oborud.info/news/2OI8/?t=".$nf2_array[0]."'";
$nf2_link28[]="'http://www.oborud.info/news/2O18/?t=".$nf2_array[0]."'";
$nf2_link29[]="'http://www.oborud.info/news/19/?t=".$nf2_array[0]."'";
$nf2_link30[]="'http://www.oborud.info/news/2019/?t=".$nf2_array[0]."'";
$nf2_link31[]="'http://www.oborud.info/news/20I9/?t=".$nf2_array[0]."'";
$nf2_link32[]="'http://www.oborud.info/news/2OI9/?t=".$nf2_array[0]."'";
$nf2_link33[]="'http://www.oborud.info/news/2O19/?t=".$nf2_array[0]."'";
}
// print_r ($nf2_link); // // �������� ������� ������ � ��������-�������� �������� ��������
// ��������������� ������ ����� ������������� � ������
// $sql="SELECT DISTINCT SQL_CALC_FOUND_ROWS news2.*, phorum_posts.post_username, phorum_posts_text.post_id, phorum_topics.topic_id, phorum_topics.topic_first_post_id FROM news2, phorum_posts, phorum_posts_text, phorum_topics WHERE phorum_topics.topic_id=news2.id AND phorum_posts_text.post_id=phorum_topics.topic_first_post_id AND phorum_posts_text.post_id=phorum_posts.post_id AND ($fieldsvarnews) ORDER by news2.pubdate DESC LIMIT $i0, $i1";
// $sql="SELECT DISTINCT SQL_CALC_FOUND_ROWS * from news2 where pubdate >0 AND ($fieldsvarnews) order by pubdate DESC, id DESC LIMIT $i0, $i1";
// PHP/MYSQL using an array in WHERE clause http://stackoverflow.com/questions/907806/php-mysql-using-an-array-in-where-clause
// ������� �� ������� MySQL ��������� � ������ http://forum.php.su/topic.php?forum=71&topic=1753
foreach($status as $status_a) {
$nf2_link[] = '\''.$status_a.'\'';
}
$status = implode(',',$nf2_link);
$status1 = implode(',',$nf2_link1);
$status2 = implode(',',$nf2_link2);
$status3 = implode(',',$nf2_link3);
$status4 = implode(',',$nf2_link4);
$status5 = implode(',',$nf2_link5);
$status6 = implode(',',$nf2_link6);
$status7 = implode(',',$nf2_link7);
$status8 = implode(',',$nf2_link8);
$status9 = implode(',',$nf2_link9);
$status10 = implode(',',$nf2_link10);
$status11 = implode(',',$nf2_link11);
$status12 = implode(',',$nf2_link12);
$status13 = implode(',',$nf2_link13);
$status14 = implode(',',$nf2_link14);
$status15 = implode(',',$nf2_link15);
$status16 = implode(',',$nf2_link16);
$status17 = implode(',',$nf2_link17);
$status18 = implode(',',$nf2_link18);
$status19 = implode(',',$nf2_link19);
$status20 = implode(',',$nf2_link20);
$status21 = implode(',',$nf2_link21);
$status22 = implode(',',$nf2_link22);
$status23 = implode(',',$nf2_link23);
$status24 = implode(',',$nf2_link24);
$status25 = implode(',',$nf2_link25);
$status26 = implode(',',$nf2_link26);
$status27 = implode(',',$nf2_link27);
$status28 = implode(',',$nf2_link28);
$status29 = implode(',',$nf2_link29);
$status30 = implode(',',$nf2_link30);
$status31 = implode(',',$nf2_link31);
$status32 = implode(',',$nf2_link32);
$status33 = implode(',',$nf2_link33);
if ($cntnf2>'0') {
$sql="SELECT DISTINCT SQL_CALC_FOUND_ROWS * from news2 where link IN ($status) OR link IN ($status1) OR link IN ($status2) OR link IN ($status3) OR link IN ($status4) OR link IN ($status5) OR link IN ($status6) OR link IN ($status7) OR link IN ($status8) OR link IN ($status9) OR link IN ($status10) OR link IN ($status11) OR link IN ($status12) OR link IN ($status13) OR link IN ($status14) OR link IN ($status15) OR link IN ($status16) OR link IN ($status17) OR link IN ($status18) OR link IN ($status19) OR link IN ($status20) OR link IN ($status21) OR link IN ($status22) OR link IN ($status23) OR link IN ($status24) OR link IN ($status25) OR link IN ($status26) OR link IN ($status27) OR link IN ($status28) OR link IN ($status29) OR link IN ($status30) OR link IN ($status31) OR link IN ($status32) OR link IN ($status33) order by pubdate DESC, id DESC LIMIT $i0, $i1";
}
}
// �������� ����� ����� ����� �������
// ��� ������� �����
else {
$fswords = explode(' ', $trimmed);
$swords = array();
for ($i=0;$i<sizeof($fswords);$i++) {
$swords[] = $fswords[$i];
}
unset($fswords);
// ����� ���������� ������ ��� �������
// print_r ($swords); // �������� ������� ������
$fieldsvar = "";
for ($i=0;$i<sizeof($swords);$i++) {
$fieldsvarnews .= " phorum_posts_text.post_text LIKE '%" . $swords[$i] . "%'".($i<sizeof($swords)-1?" AND ":"");
}
// ������� �� ������ ��� �������������� ������� � ����������� ���������� �������
$nf2=mysql_query("SELECT phorum_topics.topic_id, phorum_posts_text.post_id, phorum_topics.topic_first_post_id FROM phorum_posts_text, phorum_topics, phorum_posts WHERE phorum_posts_text.post_id=phorum_topics.topic_first_post_id AND phorum_posts_text.post_id=phorum_posts.post_id AND ($fieldsvarnews) order by phorum_topics.topic_id DESC;") or die(mysql_error());
// echo '<BR><BR>��������� ������� �������� '.mysql_num_rows($nf2).' �����<br/><br/>'; // �������� ������� ������
while ($nf2_array = mysql_fetch_array($nf2))
{
// echo "<a href=http://www.oborud.info/news/?t=".$nf2_array[0].">$nf2_array[0]</a><BR>"; // �������� ������� ������
$nf2_link[]="'http://www.oborud.info/news/?t=".$nf2_array[0]."'";
$nf2_link1[]="'http://www.oborud.info/news/2O11/?t=".$nf2_array[0]."'";
$nf2_link2[]="'http://www.oborud.info/news/2011/?t=".$nf2_array[0]."'";
$nf2_link3[]="'http://www.oborud.info/news/2O12/?t=".$nf2_array[0]."'";
$nf2_link4[]="'http://www.oborud.info/news/2012/?t=".$nf2_array[0]."'";
$nf2_link5[]="'http://www.oborud.info/news/2010/?t=".$nf2_array[0]."'";
$nf2_link6[]="'http://www.oborud.info/news/2013/?t=".$nf2_array[0]."'";
$nf2_link7[]="'http://www.oborud.info/news/2O13/?t=".$nf2_array[0]."'";
$nf2_link8[]="'http://www.oborud.info/news/2O14/?t=".$nf2_array[0]."'";
$nf2_link9[]="'http://www.oborud.info/news/2014/?t=".$nf2_array[0]."'";
$nf2_link10[]="'http://www.oborud.info/news/2O15/?t=".$nf2_array[0]."'";
$nf2_link11[]="'http://www.oborud.info/news/2015/?t=".$nf2_array[0]."'";
$nf2_link12[]="'http://www.oborud.info/news/15/?t=".$nf2_array[0]."'";
$nf2_link13[]="'http://www.oborud.info/news/20I5/?t=".$nf2_array[0]."'";
$nf2_link14[]="'http://www.oborud.info/news/2OI5/?t=".$nf2_array[0]."'";
$nf2_link15[]="'http://www.oborud.info/news/16/?t=".$nf2_array[0]."'";
$nf2_link16[]="'http://www.oborud.info/news/2016/?t=".$nf2_array[0]."'";
$nf2_link17[]="'http://www.oborud.info/news/2O16/?t=".$nf2_array[0]."'";
$nf2_link18[]="'http://www.oborud.info/news/20I6/?t=".$nf2_array[0]."'";
$nf2_link19[]="'http://www.oborud.info/news/2OI6/?t=".$nf2_array[0]."'";
$nf2_link20[]="'http://www.oborud.info/news/17/?t=".$nf2_array[0]."'";
$nf2_link21[]="'http://www.oborud.info/news/2017/?t=".$nf2_array[0]."'";
$nf2_link22[]="'http://www.oborud.info/news/2OI7/?t=".$nf2_array[0]."'";
$nf2_link23[]="'http://www.oborud.info/news/2O17/?t=".$nf2_array[0]."'";
$nf2_link24[]="'http://www.oborud.info/news/18/?t=".$nf2_array[0]."'";
$nf2_link25[]="'http://www.oborud.info/news/2018/?t=".$nf2_array[0]."'";
$nf2_link26[]="'http://www.oborud.info/news/20I8/?t=".$nf2_array[0]."'";
$nf2_link27[]="'http://www.oborud.info/news/2OI8/?t=".$nf2_array[0]."'";
$nf2_link28[]="'http://www.oborud.info/news/2O18/?t=".$nf2_array[0]."'";
$nf2_link29[]="'http://www.oborud.info/news/19/?t=".$nf2_array[0]."'";
$nf2_link30[]="'http://www.oborud.info/news/2019/?t=".$nf2_array[0]."'";
$nf2_link31[]="'http://www.oborud.info/news/20I9/?t=".$nf2_array[0]."'";
$nf2_link32[]="'http://www.oborud.info/news/2OI9/?t=".$nf2_array[0]."'";
$nf2_link33[]="'http://www.oborud.info/news/2O19/?t=".$nf2_array[0]."'";
}
// print_r ($nf2_link); // // �������� ������� ������ � ��������-�������� �������� ��������
foreach($status as $status_a) {
$nf2_link[] = '\''.$status_a.'\'';
}
$status = implode(',',$nf2_link);
$status1 = implode(',',$nf2_link1);
$status2 = implode(',',$nf2_link2);
$status3 = implode(',',$nf2_link3);
$status4 = implode(',',$nf2_link4);
$status5 = implode(',',$nf2_link5);
$status6 = implode(',',$nf2_link6);
$status7 = implode(',',$nf2_link7);
$status8 = implode(',',$nf2_link8);
$status9 = implode(',',$nf2_link9);
$status10 = implode(',',$nf2_link10);
$status11 = implode(',',$nf2_link11);
$status12 = implode(',',$nf2_link12);
$status13 = implode(',',$nf2_link13);
$status14 = implode(',',$nf2_link14);
$status15 = implode(',',$nf2_link15);
$status16 = implode(',',$nf2_link16);
$status17 = implode(',',$nf2_link17);
$status18 = implode(',',$nf2_link18);
$status19 = implode(',',$nf2_link19);
$status20 = implode(',',$nf2_link20);
$status21 = implode(',',$nf2_link21);
$status22 = implode(',',$nf2_link22);
$status23 = implode(',',$nf2_link23);
$status24 = implode(',',$nf2_link24);
$status25 = implode(',',$nf2_link25);
$status26 = implode(',',$nf2_link26);
$status27 = implode(',',$nf2_link27);
$status28 = implode(',',$nf2_link28);
$status29 = implode(',',$nf2_link29);
$status30 = implode(',',$nf2_link30);
$status31 = implode(',',$nf2_link31);
$status32 = implode(',',$nf2_link32);
$status33 = implode(',',$nf2_link33);
if (mysql_num_rows($nf2)>0) {
$sql="SELECT DISTINCT SQL_CALC_FOUND_ROWS * from news2 where pubdate >0 $QSearchp AND link IN ($status) OR link IN ($status1) OR link IN ($status2) OR link IN ($status3) OR link IN ($status4) OR link IN ($status5) OR link IN ($status6) OR link IN ($status7) OR link IN ($status8) OR link IN ($status9) OR link IN ($status10) OR link IN ($status11) OR link IN ($status12) OR link IN ($status13) OR link IN ($status14) OR link IN ($status15) OR link IN ($status16) OR link IN ($status17) OR link IN ($status18) OR link IN ($status19) OR link IN ($status20) OR link IN ($status21) OR link IN ($status22) OR link IN ($status23) OR link IN ($status24) OR link IN ($status25) OR link IN ($status26) OR link IN ($status27) OR link IN ($status28) OR link IN ($status29) OR link IN ($status30) OR link IN ($status31) OR link IN ($status32) OR link IN ($status33) order by pubdate DESC, id DESC LIMIT $i0, $i1";
}
// $sql="SELECT SQL_CALC_FOUND_ROWS * from news2 where pubdate >0 $QSearchp $QSearch $QSearch2 order by pubdate DESC, id DESC LIMIT $i0, $i1";
}
$q=$db->query($sql);
// ������� ���-�� ��������� �����
$_query = "SELECT FOUND_ROWS()";
$_result = mysql_query($_query);
$numrows = mysql_result($_result,0);
// echo $numrows;
// ������� �������� ���������� ��������� �������� ���� ���������� ������� BEGIN
function highlight_vv($vv) {
// ����� ���������� ������ ��� �������
// print_r ($swords); // �������� ������� ������
$_fieldsvarnews = " phorum_posts_text.post_text LIKE '%" . $vv . "%'";
// ������� �� ������ ��� �������������� ������� � ����������� ���������� �������
$_nf2=mysql_query("SELECT phorum_topics.topic_id, phorum_posts_text.post_id, phorum_topics.topic_first_post_id FROM phorum_posts_text, phorum_topics, phorum_posts WHERE phorum_posts_text.post_id=phorum_topics.topic_first_post_id AND phorum_posts_text.post_id=phorum_posts.post_id AND $_fieldsvarnews order by phorum_topics.topic_id DESC;") or die(mysql_error());
// echo '<BR><BR>��������� ������� �������� '.mysql_num_rows($_nf2).' �����<br/><br/>'; // �������� ������� ������
while ($_nf2_array = mysql_fetch_array($_nf2))
{
// echo "<a href=http://www.oborud.info/news/?t=".$_nf2_array[0].">$_nf2_array[0]</a><BR>"; // �������� ������� ������
$_nf2_link[]="'http://www.oborud.info/news/?t=".$_nf2_array[0]."'";
$_nf2_link1[]="'http://www.oborud.info/news/2O11/?t=".$_nf2_array[0]."'";
$_nf2_link2[]="'http://www.oborud.info/news/2011/?t=".$_nf2_array[0]."'";
$_nf2_link3[]="'http://www.oborud.info/news/2O12/?t=".$_nf2_array[0]."'";
$_nf2_link4[]="'http://www.oborud.info/news/2012/?t=".$_nf2_array[0]."'";
$_nf2_link5[]="'http://www.oborud.info/news/2010/?t=".$_nf2_array[0]."'";
$_nf2_link6[]="'http://www.oborud.info/news/2013/?t=".$_nf2_array[0]."'";
$_nf2_link7[]="'http://www.oborud.info/news/2O13/?t=".$_nf2_array[0]."'";
$_nf2_link8[]="'http://www.oborud.info/news/2O14/?t=".$_nf2_array[0]."'";
$_nf2_link9[]="'http://www.oborud.info/news/2014/?t=".$_nf2_array[0]."'";
$_nf2_link10[]="'http://www.oborud.info/news/2O15/?t=".$_nf2_array[0]."'";
$_nf2_link11[]="'http://www.oborud.info/news/2015/?t=".$_nf2_array[0]."'";
$nf2_link12[]="'http://www.oborud.info/news/15/?t=".$nf2_array[0]."'";
$nf2_link13[]="'http://www.oborud.info/news/20I5/?t=".$nf2_array[0]."'";
$nf2_link14[]="'http://www.oborud.info/news/2OI5/?t=".$nf2_array[0]."'";
$nf2_link15[]="'http://www.oborud.info/news/16/?t=".$nf2_array[0]."'";
$nf2_link16[]="'http://www.oborud.info/news/2016/?t=".$nf2_array[0]."'";
$nf2_link17[]="'http://www.oborud.info/news/2O16/?t=".$nf2_array[0]."'";
$nf2_link18[]="'http://www.oborud.info/news/20I6/?t=".$nf2_array[0]."'";
$nf2_link19[]="'http://www.oborud.info/news/2OI6/?t=".$nf2_array[0]."'";
$nf2_link20[]="'http://www.oborud.info/news/17/?t=".$nf2_array[0]."'";
$nf2_link21[]="'http://www.oborud.info/news/2017/?t=".$nf2_array[0]."'";
$nf2_link22[]="'http://www.oborud.info/news/2OI7/?t=".$nf2_array[0]."'";
$nf2_link23[]="'http://www.oborud.info/news/2O17/?t=".$nf2_array[0]."'";
$nf2_link24[]="'http://www.oborud.info/news/18/?t=".$nf2_array[0]."'";
$nf2_link25[]="'http://www.oborud.info/news/2018/?t=".$nf2_array[0]."'";
$nf2_link26[]="'http://www.oborud.info/news/20I8/?t=".$nf2_array[0]."'";
$nf2_link27[]="'http://www.oborud.info/news/2OI8/?t=".$nf2_array[0]."'";
$nf2_link28[]="'http://www.oborud.info/news/2O18/?t=".$nf2_array[0]."'";
$nf2_link29[]="'http://www.oborud.info/news/19/?t=".$nf2_array[0]."'";
$nf2_link30[]="'http://www.oborud.info/news/2019/?t=".$nf2_array[0]."'";
$nf2_link31[]="'http://www.oborud.info/news/20I9/?t=".$nf2_array[0]."'";
$nf2_link32[]="'http://www.oborud.info/news/2OI9/?t=".$nf2_array[0]."'";
$nf2_link33[]="'http://www.oborud.info/news/2O19/?t=".$nf2_array[0]."'";
}
// print_r ($_nf2_link); // // �������� ������� ������ � ��������-�������� �������� ��������
foreach($_status as $_status_a) {
$_nf2_link[] = '\''.$_status_a.'\'';
}
$_status = implode(',',$_nf2_link);
$_status1 = implode(',',$_nf2_link1);
$_status2 = implode(',',$_nf2_link2);
$_status3 = implode(',',$_nf2_link3);
$_status4 = implode(',',$_nf2_link4);
$_status5 = implode(',',$_nf2_link5);
$_status6 = implode(',',$_nf2_link6);
$_status7 = implode(',',$_nf2_link7);
$_status8 = implode(',',$_nf2_link8);
$_status9 = implode(',',$_nf2_link9);
$_status10 = implode(',',$_nf2_link10);
$_status11 = implode(',',$_nf2_link11);
$status12 = implode(',',$nf2_link12);
$status13 = implode(',',$nf2_link13);
$status14 = implode(',',$nf2_link14);
$status15 = implode(',',$nf2_link15);
$status16 = implode(',',$nf2_link16);
$status17 = implode(',',$nf2_link17);
$status18 = implode(',',$nf2_link18);
$status19 = implode(',',$nf2_link19);
$status20 = implode(',',$nf2_link20);
$status21 = implode(',',$nf2_link21);
$status22 = implode(',',$nf2_link22);
$status23 = implode(',',$nf2_link23);
$status24 = implode(',',$nf2_link24);
$status25 = implode(',',$nf2_link25);
$status26 = implode(',',$nf2_link26);
$status27 = implode(',',$nf2_link27);
$status28 = implode(',',$nf2_link28);
$status29 = implode(',',$nf2_link29);
$status30 = implode(',',$nf2_link30);
$status31 = implode(',',$nf2_link31);
$status32 = implode(',',$nf2_link32);
$status33 = implode(',',$nf2_link33);
if (mysql_num_rows($_nf2)>0) {
$_sql=mysql_query("SELECT DISTINCT * from news2 where pubdate >0 AND link IN ($_status) OR link IN ($_status1) OR link IN ($_status2) OR link IN ($_status3) OR link IN ($_status4) OR link IN ($_status5) OR link IN ($_status6) OR link IN ($_status7) OR link IN ($_status8) OR link IN ($_status9) OR link IN ($_status10) OR link IN ($_status11) OR link IN ($status12) OR link IN ($status13) OR link IN ($status14) OR link IN ($status15) OR link IN ($status16) OR link IN ($status17) OR link IN ($status18) OR link IN ($status19) OR link IN ($status20) OR link IN ($status21) OR link IN ($status22) OR link IN ($status23) OR link IN ($status24) OR link IN ($status25) OR link IN ($status26) OR link IN ($status27) OR link IN ($status28) OR link IN ($status29) OR link IN ($status30) OR link IN ($status31) OR link IN ($status32) OR link IN ($status33) ");
$_numrows = mysql_num_rows($_sql);
}
return $_numrows;
}
// ������� �������� ���������� ��������� �������� ���� ���������� ������� END
$nf = preg_replace("/[^-\^\w\x7F-\xFF\s]/", "", $nf);
$nf=intval($nf);
if ($nf=='1') { $head="<BR><DIV style='margin-left:14px;margin-right:12px;margin-top:13px;*margin-top:16px;margin-bottom:17px;text-align:left;'><h3 class='cat'><a class=menu_pr href='/'>�������</a> <font color=#0D3996> » </font> <a class=menu_pr href='./'>�������-pro</a> <font color=#0D3996> » </font> <span style=' color:#333333; ' href='/news/?p=$p'>������� �������� ".ucfirst(trim($v))."</span></h3></DIV><h1 style=\"margin-left:14px;margin-bottom:5px;text-align:left;\">������� �������� ".ucfirst(trim($v))."</h1><BR>"; }
else {
$word = explode(" ", $v);
// print_r ($word); // ��������
while (list($k, $vv) = each($word)) {
if (strlen($vv)>=3) {
$stat[]="<tr><td style='height:12px; vertical-align:top; padding-top:12px;'><font style=\"font-size:9px;\">� </font><a style=\"color:blue\" href=\"http://www.oborud.info/news/?v=" . rawurlencode( $vv ) . "\"><U>$vv</U></a> [<b>".highlight_vv($vv)."</b>] </td></tr>";
}
else { $stat[]="<tr><td style='height:12px; vertical-align:top; padding-top:12px;'><font style=\"font-size:9px;\">� </font> <b>".$vv."</b> [<b>0</b>]</td></tr> "; }
};
// echo count($word); // ��������
if (count($word) >1)
{
$word_stats = "<h4 class=\"st\" style=\"margin-left:12px;margin-top:42px;margin-bottom:12px;\">�� ��������� ������ ������� �������:</h4><table style='margin-left:12px;*margin-left:0px;margin-top:-8px;*margin-top:6px;margin-bottom:14px;'>". implode("", $stat). "</table>";
}
if (strlen($v)<3) {$numrows=0;};
unset($stat);
// ���� if ($numrows > ... � ���� ������ �� ��������� ������, � ��� ����������� �� ���� ������ ������� - �� �� ��������
if (count($word) > 0) { $head="<BR><DIV style='margin-left:14px;margin-right:12px;margin-top:13px;*margin-top:16px;margin-bottom:17px;text-align:left;'><h3 class='cat'><a class=menu_pr href='/'>�������</a> <font color=#0D3996> » </font> <a class=menu_pr href='./'>�������-pro</a> <font color=#0D3996> » </font> <span style=' color:#333333; ' href='/news/?p=$p'>�����: ".strtolower(trim($v))."</span></h3></DIV><h1 style=\"margin-left:14px;\">����� � ��������</h1><p style='margin-left:14px;margin-top:18px;margin-bottom:20px;'>�� ������: �<font color=red><b>".strtolower(trim($v))."</b></font>� ������� ����������: <b>".$numrows."</b><br>".$word_stats."</p><hr style='margin-left:12px;margin-right:12px;border-top: 1px solid #FFFFFF;border-right: 1px #CCCCCC;margin-bottom:22px;' color='#CCCCCC' size='2' width='454'>"; }
if (count($word) < 1) { $head="<BR><DIV style='margin-left:14px;margin-right:12px;margin-top:13px;*margin-top:16px;margin-bottom:17px;text-align:left;'><h3 class='cat'><a class=menu_pr href='/'>�������</a> <font color=#0D3996> » </font> <a class=menu_pr href='./'>�������-pro</a> <font color=#0D3996> » </font> <span style=' color:#333333; ' href='/news/?p=$p'>�����: ".strtolower(trim($v))."</span></h3></DIV><h1 style=\"margin-left:14px;\">����� � ��������</h1><p style='margin-left:14px;margin-top:18px;margin-bottom:20px;'>�� ������: �<font color=red><b>".strtolower(trim($v))."</b></font>� ������� ����������: <b>0</b><!--<BR><BR><a href=/search.php?var=".urlencode($v).">������ ����� �����</a>--></p><hr style='margin-left:12px;margin-right:12px;border-top: 1px solid #FFFFFF;border-right: 1px #CCCCCC;margin-bottom:22px;' color='#CCCCCC' size='2' width='454'>"; }
}
function highlight_description($description, $trimmed) {
$highlight[] = str_replace(" ", "|", $trimmed);
$trimmed2 = implode("", $highlight) ;
$description=preg_replace("/($trimmed2)/si","<font color = red><b><u>\\1</u></b></font>",$description);
return $description;
}
function highlight_title($title, $trimmed) {
$highlight[] = str_replace(" ", "|", $trimmed);
$trimmed2 = implode("", $highlight) ;
$title=preg_replace("/($trimmed2)/si","<font color = red><b><u>\\1</u></b></font>",$title);
return $title;
}
if ($numrows > 0) {
# ����������� ����� �����������
$s="";$n=0;
while ($db->next_record())
{
$rubs2=$db->Record['rubs2'];
$rubs1 = "$_NewsRubrica2[$rubs2]";
$id=$db->Record['id'];
$pubdate=date("d.m.y",$db->Record["pubdate"]);
$link=$db->Record['link'];
$title=$db->Record['title'];
$description=$db->Record['description'];
$icon=$db->Record['icon'];
$notes=$db->Record['notes'];
$link = str_replace("http://www.oborud.info/news/", "/news/", $link);
if ($nf!='1') { $description = highlight_description($description, $trimmed); }
if ($nf!='1') { $title = highlight_title($title, $trimmed); }
if ($nf=='1') { $trimmed = $var; }
// ��������� ����� �� ���������� ��������, ��������� �� ����� ���������
$description = substr($description, 0, 152 - strlen($title));
$description = wordwrap($description, 142 - strlen($title));
$handle = explode ("\n", $description);
$description = $handle[0]."...";
// ������ ����� ����� ��:
$title=trim($title);
if (($title[strlen($title) - 1] == '!') OR ($title[strlen($title) - 1] == '?'))
{$title=$title." ";}
else {$title=$title.".";}
$s=$s."<DIV class=main2><br>
<DIV class=main2l><img alt=\"$pubdate\" title=\"$title\" src=".$icon." align=\"center\" border=\"0\" height=\"62\" hspace=\"0\" width=\"62\"> </DIV><BR>
<DIV class=main2r><FONT class=ndat>$pubdate</FONT> <A style=\"COLOR: #5d5d5d; TEXT-DECORATION: none\" href=\"$link&nf=".$nf."&v=". rawurlencode($trimmed). "\"><B> $title </B> $description </A></DIV></DIV><BR>"; }
}
// echo $numrows; // ������� � ���� ������ �� �������
if ($numrows==0) {
$s="<h4 class=\"st\" style=\"margin-top:-4px;\">������ �� �����? ���������!</h4><p style=\"padding:12px\">�� ������� ������� ������� ������, ������� � ������ ��� ���� �������� ����.<br><br>� ���������� ������ ����� ����� ���������, ���� ����������� �������� ������� �����.<br><br>��� ������� ���� ������ ����� � ��� ����������� �������: </p><iframe style=\"margin-left:8px;margin-top:48px;\" marginwidth=\"0\" marginheight=\"0\" src=\"/forms/_form2.php?insert=\" frameborder=\"0\" height=\"510\" scrolling=\"no\" width=\"460\"></iframe>";
}
if (strlen($v)<3) {
$s="<h4 class=\"st\" style=\"margin-top:-4px;\">������ �� �����? ���������!</h4><p style=\"padding:12px\">�� ������� ������� ������� ������, ������� � ������ ��� ���� �������� ����.<br><br>� ���������� ������ ����� ����� ���������, ���� ����������� �������� ������� �����.<br><br>��� ������� ���� ������ ����� � ��� ����������� �������: </p><iframe style=\"margin-left:8px;margin-top:48px;\" marginwidth=\"0\" marginheight=\"0\" src=\"/forms/_form2.php?insert=\" frameborder=\"0\" height=\"510\" scrolling=\"no\" width=\"460\"></iframe>";
}
if (strlen($s)>10)
{
echo $head;
echo $s;
// echo "<hr style='margin-left:0px;margin-right:12px;border-top: 1px solid #FFFFFF;border-right: 1px #CCCCCC;' size=2 width=100% color=#CCCCCC><div style='PADDING-LEFT: 6px;PADDING-RIGHT: 0px; PADDING-BOTTOM: 0px;PADDING-TOP: 0px; text-align:center; width:464; '><BR><A href='/part397.htm'><U>����������� �� ��������</U></A></DIV><BR><BR>";
}
# ��������� ������ �������
$start=intval($i0);
if ($numrows>$portion) {
if ($start!=0) $nav .= " <a href=?pr=$pr&nf=$nf&i0=".($start-$portion)."&v=".rawurlencode($trimmed).">��</a> | ";
else $nav .= "� | ";
$sstart=$start-($portion*6); if ($sstart<0) $sstart=0;
$send=$start+($portion*6);if ($send>$numrows) $send=$numrows;
for ($i=$sstart;$i<$send;$i+=$portion) {
if ($start==$i)
$nav .= "<b>".(($i/$portion)+1)."</b>";
else
$nav .= "<a href=?pr=$pr&nf=$nf&i0=$i&v=".rawurlencode($trimmed).">".(($i/$portion)+1)."</a>";
$nav .= " | ";
}
if ($start==$i-$portion)
$nav .= "��";
else
$nav .= "<a href=?pr=$pr&nf=$nf&i0=".($start+$portion)."&v=".rawurlencode($trimmed).">��</a>";
}
if ($numrows>$portion)
{
echo "<div style=\"margin-right: 12px; margin-bottom: 12px; font-family: Arial; font-size: 11px;\" align=right> ���. " . $nav . "</div>";
}
else
{
echo "<BR>";
}
// ����� ������� ������ ������
}
// -------------------------------------------
// ����� ������� ������ �������� BEGIN
else
{
include ("../catalog/data.php");
// if (!Admin()) die;
# ������� �� ��������
$_NewsRubrica2=array("0"=>"00 ��� �������",
"1"=>'01 ��� ����������� �������',
"2"=>'02 ��� ����������� ��������',
"3"=>'03 ��� ������� ��������������',
"4"=>'04 ��� ����������� �������',
"5"=>'05 ��� ��������� ��������',
"6"=>'06 ��� ������� �����������',
);
// �������������
asort($_NewsRubrica2);
// ������� ����� �� ����. ��������
$_NewsRubrica2 = preg_replace("/[0-9]/","",$_NewsRubrica2, 2);
# ���������� �� ����/����������
$_NewsRubricas=array("0"=>'01 �� ����',
"1"=>'02 �� ��������',
);
// �������������
asort($_NewsRubricas);
// ������� ����� �� ����. ��������
$_NewsRubricas = preg_replace("/[0-9]/","",$_NewsRubricas, 2);
// ��������� ����� �������� � TITLE
$pagepr = @$_GET['i0'];
if ($pagepr>1) $pagenum = "| �������� ".(($pagepr/16)+1);
$title="�������-PRO | OBORUD.INFO - ������ ������������ ".$pagenum." ";
$description="������� ������������ ��������-�������������� � ����������� ������������ ".$pagenum." ";
$detail_keywords="������� ������� ��������������, �������� � �������";
$CATNAME="������� ��������-�������������� � ����������� ������������ ";
if ($p>'0') { $description=$_NewsRubrica2[$p]. " ��������-�������������� � ����������� ������������ "; }
if ($p>'0') { $title=$_NewsRubrica2[$p] ." | �������-PRO | OBORUD.INFO - ������ ������������"; }
// ����� ������ ��������
$rb=mysql_query("SELECT rubs,banners,switch FROM part2_banners WHERE rubs='1' LIMIT 1;") or die(mysql_error());
$rubs=mysql_result($rb,0,0);
$bannertop=mysql_result($rb,0,1);
$switch=mysql_result($rb,0,2);
if ($switch=='1') { $bannertop = "<noindex>
<!-- BANNERTOP -->
<div id=\"btop_03\">
".$bannertop."
</div>
<!--// BANNERTOP -->
</noindex> "; } else {$bannertop="";}
// ���������� ��� �����:
// �������� �������� �� ����������� ����������
$r=mysql_query("Select * FROM count2 WHERE 1") or die(mysql_error());
// ����������� � �����������:
$cnt1=mysql_result($r,0,1);
// ������� ������������
$cnt3=mysql_result($r,0,3);
// $counter = "<b>".$cnt1."</b> ����������� | <b>".$cnt3."</b> ������� ";
$counter = "<span style=\"color: #3A3A4B;\"><b>".$cnt1."</b></span> <span style=\"color: #5D5D5D;\">�����������</span> | <span style=\"color: #3A3A4B;\"><b>".$cnt3."</b></span> <span style=\"color: #5D5D5D;\">������� </span> ";
include "_top.php";
####################################################################
# ����� ������
#
# id - �������������
# rubs - �������
# rubs2 - ������� �������
# pubdate - ����
# link - ������
# title - ���������
# description - ����� ������
# icon - ������ ��������
# notes - ������� (�����������)
#
####################################################################
?>
<table cellspacing=0 cellpadding=0 border=0 width=100%>
<tr><td>
<?
$p = @$_GET['p'];
$r = @$_GET['r'];
$c = @$_GET['c'];
if (!isset($p)) $p=0;
if (!isset($r)) $r=0;
$p = preg_replace("/[^-\^\w\x7F-\xFF\s]/", "", $p);
$p=intval($p);
$r = preg_replace("/[^-\^\w\x7F-\xFF\s]/", "", $r);
$r=intval($r);
$c = preg_replace("/[^-\^\w\x7F-\xFF\s]/", "", $c);
$c=intval($c);
if ($p>0)
{
$head="<DIV style='margin-left:14px;margin-right:12px;margin-top:26px;*margin-top:16px;margin-bottom:48px;text-align:left;'><h3 class='cat'><a class=menu_pr href='/'>�������</a> <font color=#0D3996> » </font> <a class=menu_pr href='./'>�������-pro</a> <font color=#0D3996> » </font> ".str_replace("��� �������", "", strtolower($_NewsRubrica2[$p]))."</font>";
}
else
{
$head="<DIV style='margin-left:14px;margin-right:12px;margin-top:26px;*margin-top:16px;margin-bottom:48px;text-align:left;'><h3 class='cat'><a class=menu_pr href='/'>�������</a> <font color=#0D3996> » </font> <font style=' color:#333333;'>�������-pro</font>";
}
$head=$head." <form style='margin-top:12px;' id='rub' method='get' action='/news/'><font color=gray>������:</font> <select id='my-select_1' style='width: 122;' name='c' onchange='this.form.submit()'>";
foreach($_NewsRubricas as $sel => $rub) {
$selr = ($rub == $_NewsRubricas[$c]) ? 'selected=selected' : '';
$head=$head."<option title='".strtolower($rub)."' value='".$sel."' ".$selr.">".strtolower($rub)."</option>";
}
$head=$head."</select><img id='img-select' src='s.png'>";
$head=$head." <select id='my-select' name='p' style='width: 192px;' onchange='this.form.submit()'>";
foreach($_NewsRubrica2 as $sel => $rub) {
$selp = ($rub == $_NewsRubrica2[$p]) ? 'selected=selected' : '';
$head=$head."<option title='".strtolower($rub)."' value='".$sel."' ".$selp.">".strtolower($rub)."</option>";
}
$head=$head."</select><img id='img-select' src='s.png'></form>";
$head=$head."</h3></DIV>";
$head=$head."<h1 style='margin-left:13px; margin-bottom:20px;text-align:left;'>�������-PRO ".str_replace("��� �������", "", strtolower($_NewsRubrica2[$p]))."</h1>";
// ����� ������ �������� �� ���� BEGIN
# ��������� SQL
$portion = 16;
// if (!isset($i0)) $i0=0; // �� ������ ������� ������ ����� � ������������� ����� ������
if ((!isset($i0)) OR ($i0<0)) $i0=0;
settype($i0,"integer");
// $i1=$i0+$portion;
$i1=$portion;
$rubs_zapros=" pubdate>0 ";
if ($p>'0') $rubs_zapros2=" and rubs2=$p ";
// ���������� �� ����/����������
$order_by=" order by pubdate DESC, id DESC ";
if ($c=='0') $order_by=" order by pubdate DESC, id DESC ";
if ($c=='1') $order_by=" order by rat DESC ";
$sql="SELECT DISTINCT SQL_CALC_FOUND_ROWS * from news2 where $rubs_zapros $rubs_zapros0 $rubs_zapros2 $order_by LIMIT $i0, $i1";
$q=$db->query($sql);
// ������� ���-�� ��������� �����
$_query = "SELECT FOUND_ROWS()";
$_result = mysql_query($_query);
$numrows = mysql_result($_result,0);
# ����������� ����� �����������
$s="";$n=0;
$t_i=0; // partner.yandex.ru
while ($db->next_record())
{
$rubs2=$db->Record['rubs2'];
$rubs1 = "$_NewsRubrica2[$rubs2]";
$id=$db->Record['id'];
$pubdate=date("d.m.y",$db->Record["pubdate"]);
$link=$db->Record['link'];
$title=$db->Record['title'];
$description=$db->Record['description'];
$icon=$db->Record['icon'];
$notes=$db->Record['notes'];
$link = str_replace("http://www.oborud.info/news/", "/news/", $link);
// ��������� ����� �� ���������� ��������, ��������� �� ����� ���������
$description = substr($description, 0, 152 - strlen($title));
$description = wordwrap($description, 142 - strlen($title));
$handle = explode ("\n", $description);
$description = $handle[0]."...";
// ������ ����� ����� ��:
$title=trim($title);
if (($title[strlen($title) - 1] == '!') OR ($title[strlen($title) - 1] == '?'))
{$title=$title." ";}
else {$title=$title.".";}
$s=$s."<DIV class=main2><br>
<DIV class=main2l><img alt=\"$pubdate\" title=\"$title\" src=".$icon." align=\"center\" border=\"0\" height=\"62\" hspace=\"0\" width=\"62\"> </DIV><BR>
<DIV class=main2r><FONT class=ndat><!--<item>--><!--<pubDate>-->$pubdate<!--</pubDate>--></FONT> <!--<link>--><A style=\"COLOR: #5d5d5d; TEXT-DECORATION: none\" href=\"$link\"><!--</link>--><B><!--<title>-->$title<!-- --> $description ";
// partner.yandex.ru_BEGIN
if($t_i++==2) {
$s=$s." ";
}
// partner.yandex.ru_END
}
if (strlen($s)>10)
{
echo $head;
echo $s;
}
# ��������� ������ �������
$start=intval($i0);
if ($p>'0') $rubs_zapros2="&p=$p";
if ($c>'0') $rubs_zapros3="&c=$c";
if ($numrows>$portion) {
if ($start!=0) $nav .= " �� | ";
else $nav .= "� | ";
$sstart=$start-($portion*6); if ($sstart<0) $sstart=0;
$send=$start+($portion*6);if ($send>$numrows) $send=$numrows;
for ($i=$sstart;$i<$send;$i+=$portion) {
if ($start==$i)
$nav .= "".floor((($i/$portion)+1))." "; // floor() �������� ������� ����� �����
else
$nav .= "".floor((($i/$portion)+1))." "; // floor() �������� ������� ����� �����
$nav .= " | ";
}
if ($start==$i-$portion)
$nav .= "��";
else
$nav .= "�� ";
}
if ($numrows>$portion)
{
echo " ���. " . $nav . "
";
}
else
{
echo " ";
}
// ����� ������ �������� �� ���� END
// ����� ������� ������ ������ �������� END
}
?>