99 AND g.user_id = t.owner_id ORDER BY `rand` "; $result_tours = mysqli_query($GLOBALS['link'], $select_tours); $row_cnt = mysqli_num_rows($result_tours); if ($row_cnt < 9) { $select_tours = "SELECT t.description, t.tour_id , t.caption, t.price, RAND() AS `rand` FROM tours t, guides g WHERE t.tour_city = '$page_url_1251' AND t.moderator = 1 AND g.user_id = t.owner_id ORDER BY `rand` "; $result_tours = mysqli_query($GLOBALS['link'],$select_tours); } else if ($row_cnt > 120) { $select_tours = "SELECT t.description, t.tour_id , t.caption, t.price, RAND() AS `rand` FROM tours t, guides g WHERE t.tour_city = '$page_url_1251' AND t.moderator = 1 AND g.recomendation > 99 AND g.user_id = t.owner_id ORDER BY `rand` LIMIT 120 "; $result_tours = mysqli_query($GLOBALS['link'],$select_tours); } /* include_once 'scripts/reklam_row.php'; $poster_str = get_reklam_row($page_url); */ include_once 'scripts/correct_name.php'; $city_string = name_it($page_url); $title = 'Экскурсии '.$city_string; $description = "Индивидуальные и групповые экскурсии $city_string от частных гидов на русском языке"; $tour_row = '
'; $tour_row .= '
'; while ($row_tours = mysqli_fetch_array($result_tours)) { $ex_content_row = implode(array_slice(explode('
',wordwrap($row_tours['description'],180,'
',false)),0,1)); if($ex_content_row!=$row_tours['description'])$ex_content_row .='...'; $ex_content_row = str_replace('

', '', $ex_content_row); $ex_content_row = str_replace('

', '', $ex_content_row); $ex_content_row = str_replace('

', '', $ex_content_row); $ex_content_row = str_replace('

', '', $ex_content_row); $pic_str = get_upload_image_url($row_tours['tour_id'], 'Tour_pic'); if ($row_tours['price']) $price_row = '
'.$row_tours['price'].'
'; else $price_row = ''; $tour_row.='
'.$price_row.'

'.$row_tours['caption'].'

'.$ex_content_row.'

подробнее
'; } $tour_row.='
'; ?> <? echo $title; ?>