50) die ("



".$lang[158]."






"); else { if ($type != "0") $search_type = " AND type = '".$type."' "; if ($city) { $q_city = mysql_query("SELECT city_name FROM jb_city WHERE city_translit = '".$city."' LIMIT 1"); $arr_city = mysql_fetch_array($q_city); $city = $arr_city['city_name']; $search_city = " AND city = '".$city."' "; } else $search_city = ""; if (@$get_time) { @$search_time = ""; if ($get_time == 1) $search_time = " AND TO_DAYS(NOW()) = TO_DAYS(date_add) "; elseif ($get_time == 7) $search_time = " AND TO_DAYS(NOW()) - TO_DAYS(date_add) <= 7 "; elseif ($get_time == 4) $search_time = " AND TO_DAYS(NOW()) - TO_DAYS(date_add) <= 30 "; elseif ($get_time == 6) $search_time = " AND TO_DAYS(NOW()) - TO_DAYS(date_add) <= 180 "; elseif ($get_time == 12) $search_time = " AND TO_DAYS(NOW()) - TO_DAYS(date_add) <= 365 "; } if (@$_GET['COUNT_SHOW_SEARCH']) $COUNT_SHOW_SEARCH = $_GET['COUNT_SHOW_SEARCH']; else $COUNT_SHOW_SEARCH = 10; $COUNT_SHOW_SEARCH = intval($COUNT_SHOW_SEARCH); if ($images == "1") { $result=mysql_query("SELECT A.*, B.* FROM jb_board as A, jb_photo as B WHERE A.title LIKE '%".$search."%' OR A.text LIKE '%".$search."%' OR A.keywords LIKE '%".$search."%'".$search_city.@$search_time.@$search_type." AND A.id = B.id_message GROUP BY B.id_message"); } else { $result=mysql_query("SELECT * FROM jb_board WHERE title LIKE '%".$search."%' OR text LIKE '%".$search."%' OR keywords LIKE '%".$search."%' ".$search_city.@$search_time.@$search_type); } if ($result) $total_rows = mysql_num_rows ($result); if ($total_rows) { $posts = $total_rows; $tot = ($posts - 1) / $COUNT_SHOW_SEARCH; $total = intval($tot + 1); $page = @$_GET['page']; $page = intval($page); if(!@$page or empty($page) or $page < 0) $page = 1; if($page > $total) $page = $total; $start = $page * $COUNT_SHOW_SEARCH - $COUNT_SHOW_SEARCH; echo "
".$lang[178]."
"; if ($total_rows != 0) echo "
$lang[159] - ".$total_rows." ".PluralForm($total_rows,$lang[160],$lang[31],$lang[33])."


"; if ($images == "1") $query = mysql_query("SELECT A.*, B.* FROM jb_board as A, jb_photo as B WHERE A.title LIKE '%".$search."%' OR A.text LIKE '%".$search."%' OR A.keywords LIKE '%".$search."%'".$search_city.@$search_time.@$search_type." AND A.id = B.id_message GROUP BY B.id_message ORDER by A.date_add LIMIT $start, $COUNT_SHOW_SEARCH") or die(mysql_error); else $query = mysql_query("SELECT * FROM jb_board WHERE title LIKE '%".$search."%' OR text LIKE '%".$search."%' OR keywords LIKE '%".$search."%'".$search_city.@$search_time.@$search_type." LIMIT $start, $COUNT_SHOW_SEARCH") or die(mysql_error); if (mysql_num_rows ($query)) { $ishem_dubli = mysql_num_rows(mysql_query("SELECT * FROM jb_search WHERE word = '".$search."'")); if ($ishem_dubli) $search_query = mysql_query("UPDATE jb_search SET count = '".$total_rows."', time = NOW(), date = NOW() WHERE word = '".$search."' LIMIT 1"); else $search_query = mysql_query("INSERT jb_search SET word = '".$search."', count = '".$total_rows."', time = NOW(), date = NOW()"); echo ""; while($message = mysql_fetch_array($query)) { $message['title'] = eregi_replace($search, "$search", $message['title']); $tip = str_replace("\r\n"," ", $message['text']); echo ""; echo ""; } echo "
".$lang[123]."".$lang[163]."".$lang[153]."".$lang[127]."
".$message['city'].""; $photo = mysql_query ("SELECT * FROM jb_photo WHERE id_message = '".$message['id']."'"); if ($photo) $kol_vo_photo = mysql_num_rows ($photo); echo ($kol_vo_photo)?"":""; echo "".$message['date_add']."
"; $to_get_word = "word=".urlencode($_GET['word']); $to_get_type = "&type=".$_GET['type']; $to_get_images = "&images=".$_GET['images']; $to_get_city = "&city=".urlencode($_GET['city']); $to_get_time = "&time=".urlencode($_GET['time']); $to_get_COUNT_SHOW_SEARCH = "&COUNT_SHOW_SEARCH=".urlencode(@$_GET['COUNT_SHOW_SEARCH']); $to_get = "   «    "; if ($page != $total) $nextpage = " ".$to_get.$total. " onmouseover=\"Tip('".$lang[175]."')\">   »   "; if($page - 5 > 0) $page5left = $to_get.($page - 5).">".($page - 5).""; if($page - 4 > 0) $page4left = $to_get.($page - 4).">".($page - 4).""; if($page - 3 > 0) $page3left = $to_get.($page - 3).">".($page - 3).""; if($page - 2 > 0) $page2left = $to_get.($page - 2).">".($page - 2).""; if($page - 1 > 0) $page1left = $to_get.($page - 1).">".($page - 1).""; if($page + 5 <= $total) $page5right = $to_get.($page + 5).">".($page + 5).""; if($page + 4 <= $total) $page4right = $to_get.($page + 4).">".($page + 4).""; if($page + 3 <= $total) $page3right = $to_get.($page + 3).">".($page + 3).""; if($page + 2 <= $total) $page2right = $to_get.($page + 2).">".($page + 2).""; if($page + 1 <= $total) $page1right = $to_get.($page + 1).">".($page + 1).""; echo "
       
".$lang[176]."".$lang[177]."


".$lang[173]; } else echo $lang[34]; } else echo $lang[34]; } } else { ?>