require_once 'scripts/authorize.php'; require_once 'scripts/database_connection.php'; require_once 'scripts/ru_zone.php'; require_once 'scripts/photo_functions.php'; if (!isset($_REQUEST['city'])) { header('Location: //needguide.ru/'); exit; } $page_url = mysqli_real_escape_string($GLOBALS['link'],$_REQUEST['city']); $test_1252 = strripos($page_url, "%"); if ($test_1252 !== false) { $page_url = urldecode ( $page_url); } $page_url_1251 = $page_url; if (!in_array($page_url, $ru_cities, true)) { header("Location: https://needguide.net/view_city_tour.php?city=" . urlencode($page_url), true, 301); exit(); } if (in_array($page_url, $ru_cities, true)) { $canonical = 'https://needguide.ru/view_city_tour.php?city=' . urlencode($page_url); } else { $canonical = 'https://needguide.net/view_city_tour.php?city=' . urlencode($page_url); } $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` "; $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 = '
', '', $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 = '