htmlspecialchars($image_top_no_preview) . '">
' . $premiereCategorie . '

' . htmlspecialchars($name_nearest_places) . '

' . $display_distance . '
'; } else { $display_top_places_screen .= '
' . $premiereCategorie . '

' . htmlspecialchars($name_nearest_places) . '

' . $display_distance . '
'; $display_top_places_small_screen .= '
' . $premiereCategorie . '

' . htmlspecialchars($name_nearest_places) . '

' . $display_distance . '
'; } } } $display_places_list = '
'.$display_top_places_screen.'
'.$display_top_places_large_screen.'
'.$display_top_places_small_screen.'
'; //if($c == 0) { $display_places_list .= '
Voir plus
'; } //$latLngEncrypted = encrypt_latlng($lat,$lng); //$log .= '
latLngEncrypted : '.$latLngEncrypted.'
'; if (isset($query_nearest_places) && !empty($query_nearest_places)) { $log .= '
query_nearest_places :
'.substr($query_nearest_places,0,300).'...
'; } //$log .= '
query_nearest_places :
'.$query_nearest_places.'
'; $log .= '
Google Maps ('.$lat.' - '.$lng.')
'; // Temps de chargement (fin) $endTime = microtime(true); //$loadTime = $endTime - $startTime; $loadTime = round($endTime - $startTime, 3); $log .= "
Load time: " . number_format($loadTime, 3) . " seconds
"; if($test == 1) echo '
[function.php]
'.$log.'
'; mysqli_close($c1); return $display_places_list; } // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- // DISPLAY PLACE CONTENT // ---------------------------------------------------------------------------- // Filter les "fermé définitivement" et et attention aux "fermés temporairement" function gen_place_content_new($p, $country_code) { global $c1; global $c2; global $test; $test = 0; // 1: général - 2: hours (+ test = 1 pour completerPlagesHoraires() / clean_and_order_hours()) $content = ''; $log = ''; $langue = 'fr'; $today = date('Y-m-d H:i:s'); $places_table = 'places_min_2025'; // Déterminer la table en fonction du code pays $places_table_country = 'places_' . strtolower($country_code); // Ex: places_fr, places_us // Validation des paramètres if (empty($p) || empty($country_code)) { return '
Erreur : ID de la place ou code pays manquant.
'; } $p = mysqli_real_escape_string($c1, $p); // Sécurisation de l'ID $country_code = mysqli_real_escape_string($c1, strtoupper($country_code)); // Sécurisation du code pays // Requête SQL pour récupérer les données de la table correspondante $query = "SELECT * FROM `$places_table_country` WHERE `unique_id` = '$p'"; $result = @mysqli_query($c1, $query); if (!$result || mysqli_num_rows($result) == 0) { return '
Aucune place trouvée pour cet ID et ce pays.
'; } $row_places = mysqli_fetch_assoc($result); // --- Votre code original à partir d'ici --- $Name = @$row_places['Name']; $Name = corrigerCaracteresLatin($Name); $escapedName = mysqli_real_escape_string($c1, @$row_places['Name']); $Keyword = @$row_places['Keyword']; $Full_Address = @$row_places['Full_Address']; //$Full_Address = @mb_convert_encoding($Full_Address, 'ISO-8859-1', 'UTF-8'); $Plus_Code = @$row_places['Plus_Code']; $Website = @$row_places['Website']; if ($Website == 'facebook.com') $Website = ''; if (!@preg_match("/^(http:\/\/|https:\/\/)/", $Website) && $Website != '') { $Website = "https://" . $Website; } $WebsiteDisplay = websiteDisplay($Website); $Phone = @$row_places['Phone'] ?: @$row_places['Phone_1']; $Phonelink = convertirTelephone($Phone); $Email = @$row_places['Email']; $Facebook = @$row_places['Facebook']; $Twitter = @$row_places['Twitter']; $Instagram = @$row_places['Instagram']; $Youtube = @$row_places['Youtube']; $LinkedIn = @$row_places['LinkedIn']; $Tiktok = @$row_places['Tiktok']; $Pinterest = @$row_places['Pinterest']; // Fonction pour nettoyer les valeurs (supprime 'Lat ' ou 'Lng ') function clean_coordinate($value) { if (strpos($value, 'Lat ') === 0) { return substr($value, 4); // Supprime 'Lat ' } elseif (strpos($value, 'Lng ') === 0) { return substr($value, 4); // Supprime 'Lng ' } return $value; // Retourne inchangé si pas de préfixe } // Nettoyage et traitement des variables Lat et Lng $Lat = isset($row_places['Lat']) ? round(floatval(clean_coordinate($row_places['Lat'])), 6) : (isset($row_places['Latitude']) ? round(floatval(clean_coordinate($row_places['Latitude'])), 6) : null); $Lng = isset($row_places['Lng']) ? round(floatval(clean_coordinate($row_places['Lng'])), 6) : (isset($row_places['Longitude']) ? round(floatval(clean_coordinate($row_places['Longitude'])), 6) : null); $Rating = @$row_places['Rating'] ?: @$row_places['Average_rating']; $Reviews = @$row_places['Reviews'] ?: @$row_places['Reviews_count']; $Top_Image_URL = @$row_places['Top_Image_URL'] ?: @$row_places['Image_Top']; $Sub_Title = @$row_places['Sub_Title']; $Pricing = @$row_places['Pricing'] ?: @$row_places['Price']; $Summary = @$row_places['Summary']; function nl2br_limit($text, $maxConsecutiveNewlines = 3) { if ($text === null) { return ''; } $text = nl2br($text); $pattern = '/(\s*){' . ($maxConsecutiveNewlines + 1) . ',}/'; $replacement = str_repeat('
', $maxConsecutiveNewlines) . "\n"; return preg_replace($pattern, $replacement, $text); } function nl2br_single($text) { if ($text === null) { return ''; } $text = nl2br($text); return preg_replace('/(\s*){2,}/', '
', $text); } $query_IA = "SELECT * FROM `gemini2` WHERE `unique_id` LIKE '$p'"; $result_IA = @mysqli_query($c2, $query_IA); $row_IA = mysqli_fetch_array($result_IA); $Summary_IA = @$row_IA['Summary_IA']; $Summary_IA = nl2br_single($Summary_IA); $Description_IA = @$row_IA['Description_IA']; $Description_IA = nl2br_limit($Description_IA); $Amenities = @$row_places['Amenities']; $hours = isset($row_places['Hours']) ? $row_places['Hours'] : ''; if (is_string($hours) && trim($hours) !== '') { $hours_encoded = hours_encodeRawHoursToHex($hours); } else { $hours_encoded = ''; } $External_Urls = @$row_places['External_Urls']; $Photo_Tags = @$row_places['Photo_Tags']; $Services = @$row_places['Services']; $Located_in = @$row_places['Located_in']; $Attributes = @$row_places['Attributes']; $URL = @$row_places['URL'] ?: @$row_places['GMB_URL']; $URL = str_replace('hl=en', 'hl=' . $langue, $URL ?? ''); preg_match('/place_id:([^\/]+)/', $URL, $matches); if (isset($matches[1])) { $Place_id = $matches[1]; $URL = 'https://www.google.com/maps/search/?api=1&query=' . urlencode($Full_Address) . '&query_place_id=' . $Place_id; } else { $Place_id = ''; } $Category = @$row_places['Category']; $Category_all = @$row_places['Category_all']; $id_cat_all = @$row_places['id_cat_all']; $id_cat_all_array = explode(',', $id_cat_all); if (!empty($id_cat_all_array) && $id_cat_all_array[0] == 3660) { $deuxieme_valeur = count($id_cat_all_array) > 1 ? $id_cat_all_array[1] : 3660; $id_cat = $deuxieme_valeur; } else { $id_cat = reset($id_cat_all_array); } $nomsCategories = array(); $identifiantSpecial = 3660; $idsArray = explode(',', $id_cat_all); foreach ($idsArray as $id) { $nomCategorie = obtenirTexte($id, $langue); if ($id == $identifiantSpecial) { $nomsCategories[] = $nomCategorie; } else { array_unshift($nomsCategories, $nomCategorie); } } $unique_id = @$row_places['unique_id']; $parent_cat = obtenirParentcat($id_cat, $langue); if ($test == 1) { $log .= '
Category_all : ' . $Category_all . '
id_cat_all : ' . $id_cat_all . '
id_cat : ' . $id_cat . '
parent_cat : ' . $parent_cat . '
'; } $Category_all = idCatAllToTexte($id_cat_all, 'fr'); if (strpos($Category_all, ',') !== false) { $categoriesArray = explode(',', $Category_all); $premiereCategorie = reset($categoriesArray); $premiereCategorie = mb_strtoupper(mb_substr($premiereCategorie, 0, 1)) . mb_substr($premiereCategorie, 1); $premiereCategorie = @mb_convert_encoding($premiereCategorie, 'ISO-8859-1', 'UTF-8'); } else { $premiereCategorie = $Category_all; } $Category_all_links = idCatAllToTexteAndLinks($id_cat_all, 'fr', $Lat, $Lng); if (strpos($Category_all_links, ',') !== false) { $categoriesArray = explode(',', $Category_all_links); $premiereCategorie_link = reset($categoriesArray); $premiereCategorie_link = mb_strtoupper(mb_substr($premiereCategorie_link, 0, 1)) . mb_substr($premiereCategorie_link, 1); $premiereCategorie_link = @mb_convert_encoding($premiereCategorie_link, 'ISO-8859-1', 'UTF-8'); } else { $premiereCategorie_link = $Category_all_links; } $image_top = 'cache/places/top_images_webp/' . unique_id_to_imagepath($unique_id) . '.webp'; //image_top = unique_id_to_imagepath($unique_id).'.webp'; $no_preview = 'images/no-preview/svg/' . no_preview($parent_cat ?? $c ?? null); $exists = is_file($image_top) || is_file('../../' . $image_top); if(!$exists) { //if(file_exists($image_top) === false) { //echo 'cache/places/top_images_webp/'.$image_top; if(!@$c) $image_top = no_preview($parent_cat); else $image_top = no_preview($c); $image_top = 'images/no-preview/svg/'.$image_top; } /* if (file_exists('../../' . $image_top) === false) { if (file_exists($image_top) === false) { if (!@$c) $image_top = no_preview($parent_cat); else $image_top = no_preview($c); $image_top = 'images/no-preview/svg/' . $image_top; } } */ $date = @$row_places['date']; $date_maj = @$row_places['date_maj']; function displayHours($hours_encoded, $timeNow) { $displayHours = ''; if ($hours_encoded != '') { $displayHours .= '
' . hours_isOpenNowMinimalist($hours_encoded['hex']) . ' ' . hours_delayOpenClose($hours_encoded['hex']) . '
'; $displayHours .= '
' . hours_hoursTextualDisplay($hours_encoded['hex'], date('Y-m-d H:i:s')) . '
'; $isOpenNow = hours_displayOpeningHours($hours_encoded['hex'], null); $displayHours .= $isOpenNow; } return $displayHours; } $timeNow = date('Y-m-d H:i:s', time()); if ($hours_encoded != '') $displayHours = displayHours($hours_encoded, $timeNow); else $displayHours = ''; $display_en_savoir_plus = ''; if ($Description_IA != '') { $display_en_savoir_plus = ''; $display_en_savoir_plus .= '
' . $Description_IA . '
'; $display_en_savoir_plus .= '
'; } $display_suggestions_similaires = ' '; $log .= $query_suggestions_similaires; $display_suggestions_proximite = ' '; $log .= $query_suggestions; // Places > "En savoir plus..." // --------------------------------------------------------------------------------------------------------------------------------------------- $display_en_savoir_plus = ''; if($Description_IA != '') { $display_en_savoir_plus = ''; $display_en_savoir_plus .= '
'.$Description_IA.'
'; $display_en_savoir_plus .= ''; } // Display GetYourGuide // --------------------------------------------------------------------------------------------------- // Manual //$widget_getyourguide = '
Powered by GetYourGuide
'; // Auto //$widget_getyourguide = '
'; // Manuel $widget_getyourguide = '
Powered by GetYourGuide
'; $display_getyourguide = ''; $place_home_title = latlng_to_location($Lat,$Lng); if($place_home_title == '') $place_home_title = 'Accueil'; $content .= '
'.$place_home_title.''; $nameDisplay = $Name; $content .= '

'.$nameDisplay.' '.meteo($Lat,$Lng,2,$c1).'

Photo de '.$Name.' '; //echo 'Category_all_links:'.$Category_all_links; if($Category_all != '') { if(strlen($Category_all_links) >= 150) $Category_all_links_display = cutSentence($Category_all_links,150); else $Category_all_links_display = $Category_all_links; $content .= '
' . $Category_all_links . '
'; } else $content .= '
' . $premiereCategorie_link . '
'; $content .= '
Crédit photo : @Google Places API
'; if($displayHours != '') $content .= '
'.$displayHours.'
'; $content .= '
'; if ($Full_Address != '') { $content .= '
'; $content .= ''; $content .= '

Adresse : '.$Full_Address.'

'; $content .= '
'; } if ($Phone != '') { $content .= '

Téléphone Des frais supplémentaires peuvent s\'appliquer en fonction de votre opérateur téléphonique et de l\'origine de votre appel. : '.$Phone.'

'; } if($Website != '') $content .= '

Site Internet : '.$WebsiteDisplay.'

'; if($Facebook != '') $Facebook .= '

Facebook : '.$Facebook.'

'; if($Twitter != '') $Twitter .= '

Twitter : '.$Twitter.'

'; if($Instagram != '') $Instagram .= '

Instagram : '.$Instagram.'

'; if($Youtube != '') $Youtube .= '

Youtube : '.$Youtube.'

'; if($LinkedIn != '') $LinkedIn .= '

LinkedIn : '.$LinkedIn.'

'; if($Tiktok != '') $Tiktok .= '

Tiktok : '.$Tiktok.'

'; if($Pinterest != '') $Pinterest .= '

Pinterest : '.$Pinterest.'

'; //if($Category != '') $content .= '

Categorie : '.$cat_name_fr.'

'; //if($Category_all != '') $content .= '

Categories : '.$Category_all.'

'; // A FAIRE : s ou pas s si unique //if($Summary_IA != '') $content .= '

L\'essentiel :
'.$Summary_IA.'

'; //if($Summary_IA != '') $content .= '
'; if($Summary_IA != '') { $content .= ''; $content .= '
'.$Summary_IA.'
'; //$content .= '
'; } $content .= '
'; $content .= ''; $content .= ''; $content .= '
'; $log .= '
Lat : '.$Lat.'
Lng : '.$Lng.'
image_top : '.$image_top.'
'; if($Email != '') $log .= '
Email : '.$Email.'
'; if($Facebook != '') $log .= '
Email : '.$Facebook.'
'; if($Twitter != '') $log .= '
Email : '.$Twitter.'
'; if($Instagram != '') $log .= '
Email : '.$Instagram.'
'; if($Youtube != '') $log .= '
Email : '.$Youtube.'
'; // Test : random place // ----------------------------------------------- if($test >= 1) { $query_random_place = "SELECT unique_id FROM $places_table ORDER BY RAND() LIMIT 0,1"; $result_random_place = mysqli_query($c1,$query_random_place); $row_random_place = mysqli_fetch_array($result_random_place); $random_place_id = $row_random_place['unique_id']; $random_place_country_code = $row_random_place['unique_id']; $log .= ''; } $log .= '
Rating : '.$Rating.'
Sub_Title : '.$Sub_Title.'
Pricing : '.$Pricing.'
Amenities : '.$Amenities.'
Summary : '.$Summary.'
Top_Image_URL : '.$Top_Image_URL.'/div>
Services : '.$Services.'
Located_in : '.$Located_in.'
Attributes : '.$Attributes.'
unique_id : '.$unique_id.'
id_cat : '.$id_cat.'
parent_cat : '.$parent_cat.'
classement : '.@$classement.'
source : '.@$source.'
'.$Name.'
Ouvert actuellementFerme à 20:00 (dans ~1:15)
'; $content .= '
'; if($display_en_savoir_plus != '') $content .= $display_en_savoir_plus; // Lieux similaires if($display_suggestions_similaires != '') $content .= $display_suggestions_similaires; // Lieux proches if($display_suggestions_proximite != '') $content .= $display_suggestions_proximite; //if($display_getyourguide != '') $content .= $display_getyourguide; $content .= '
'; // Display Test if($test == 1 or $test == 2) { //$content .= '
'.$log.'
'; } $content .= ""; //mysqli_close($c1); return $content; } // gen_place_content_new():fin // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- // DISPLAY PLACE CONTENT // ---------------------------------------------------------------------------- // Filter les "fermé définitivement" et et attention aux "fermés temporairement" function gen_place_content($p) { global $c1; global $c2; global $test; $test = 0; // 1: général - 2: hours (+ test = 1 pour completerPlagesHoraires() / clean_and_order_hours() ) $content = ''; $log = ''; $langue = 'fr'; $today = date('Y-m-d H:i:s'); $places_table = 'places_min_2025'; // places - places_online - places_min //$p = '9a44060ef8f9af490d702b0bebc2e56c5d2774887b29e123a109c1d93b362ad9'; // Tour Eiffel //$p = '898f73ee3cc7acb1c6b221a3a0a22c5214522fd51e7e456400f07943a506e836'; // Casa Pairal if(isset($_GET['p'])) { $p = $_GET['p']; $p = htmlentities($p); } //$p = 'cd1340676787d0efb6a68a2818670c47'; // Table d'orientation Cabestany // Place > content : json // ----------------------------------------------------------------- $json_path = 'cache/places/content/'.unique_id_to_jsonpath($p); if(@file_exists($json_path) === true && filesize($json_path)>0) { $log .= '
[JSON : file_exists :'.file_exists($json_path === true).' - filesize:'.filesize($json_path).']
'; $json_content = file_get_contents($json_path); $row_places = json_decode($json_content, true); $Name = @$row_places['Name']; $Name = @$row_places['Name']; //$Name = @mb_convert_encoding($Name, 'ISO-8859-1', 'UTF-8'); $Name = corrigerCaracteresLatin($Name); $escapedName = mysqli_real_escape_string($c1, @$row_places['Name']); $Keyword = @$row_places['Keyword']; $Full_Address = @$row_places['Full_Address']; $Full_Address = @mb_convert_encoding($Full_Address, 'ISO-8859-1', 'UTF-8'); $Plus_Code = @$row_places['Plus_Code']; $Website = @$row_places['Website']; if($Website == 'facebook.com') $Website = ''; if (!@preg_match("/^(http:\/\/|https:\/\/)/", $Website) && $Website != '') { $Website = "https://" . $Website; } $WebsiteDisplay = websiteDisplay($Website); $Phone = @$row_places['Phone']; $Phonelink = convertirTelephone($Phone); $Email = @$row_places['Email']; $Facebook = @$row_places['Facebook']; $Twitter = @$row_places['Twitter']; $Instagram = @$row_places['Instagram']; $Youtube = @$row_places['Youtube']; $LinkedIn = @$row_places['LinkedIn']; $Tiktok = @$row_places['Tiktok']; $Pinterest = @$row_places['Pinterest']; $Lat = $row_places['Lat'] ?? $row_places['Latitude'] ?? null; $Lng = $row_places['Lng'] ?? $row_places['Longitude'] ?? null; $Lat = $Lat !== null ? round((float)$Lat, 6) : null; $Lng = $Lng !== null ? round((float)$Lng, 6) : null; /*$Lat = isset($row_places['Lat']) ? round(floatval($row_places['Lat']), 6) : null; $Lng = isset($row_places['Lng']) ? round(floatval($row_places['Lng']), 6) : null;*/ $Rating = @$row_places['Rating']; $Reviews = @$row_places['Reviews']; $Top_Image_URL = @$row_places['Top_Image_URL']; $Sub_Title = @$row_places['Sub_Title']; //$Sub_Title = @mb_convert_encoding($Sub_Title, 'ISO-8859-1', 'UTF-8'); $Pricing = @$row_places['Pricing']; //$Pricing = @mb_convert_encoding($Pricing, 'ISO-8859-1', 'UTF-8'); /* $Description = @$row_places['Description']; $Description = nl2br($Description); $Description = @mb_convert_encoding($Description, 'ISO-8859-1', 'UTF-8'); */ $Summary = @$row_places['Summary']; //$Summary = @mb_convert_encoding($Summary, 'ISO-8859-1', 'UTF-8'); // -------------------------------------------------------------------------------------------------------------------------- // SQL Description IA + Summary_IA // -------------------------------------------------------------------------------------------------------------------------- // Limite le nombre de retours à la ligne consécutifs à $maxConsecutiveNewlines function nl2br_limit($text, $maxConsecutiveNewlines = 3) { if ($text === null) { return ''; } $text = nl2br($text); $pattern = '/(\s*){' . ($maxConsecutiveNewlines + 1) . ',}/'; $replacement = str_repeat('
', $maxConsecutiveNewlines) . "\n"; return preg_replace($pattern, $replacement, $text); } // Supprime les doubles retours à la ligne ou plus function nl2br_single($text) { if ($text === null) { return ''; } $text = nl2br($text); return preg_replace('/(\s*){2,}/', '
', $text); } $query_IA = "SELECT * FROM `gemini2` WHERE `unique_id` LIKE '$p'"; $result_IA = @mysqli_query($c2,$query_IA); $row_IA = mysqli_fetch_array($result_IA); $Summary_IA = @$row_IA['Summary_IA']; $Summary_IA = nl2br_single($Summary_IA); $Description_IA = @$row_IA['Description_IA']; $Description_IA = nl2br_limit($Description_IA); // -------------------------------------------------------------------------------------------------------------------------- $Amenities = @$row_places['Amenities']; $hours = @$row_places['Hours']; if($hours != '') $hours_encoded = hours_encodeRawHoursToHex($hours); else $hours_encoded = ''; //$hours = @mb_convert_encoding($Hours, 'ISO-8859-1', 'UTF-8'); $External_Urls = @$row_places['External_Urls']; $Photo_Tags = @$row_places['Photo_Tags']; //$Photo_Tags = @mb_convert_encoding($Photo_Tags, 'ISO-8859-1', 'UTF-8'); $Services = @$row_places['Services']; //$Services = @mb_convert_encoding($Services, 'ISO-8859-1', 'UTF-8'); $Located_in = @$row_places['Located_in']; //$Located_in = @mb_convert_encoding($Located_in, 'ISO-8859-1', 'UTF-8'); $Attributes = @$row_places['Attributes']; $URL = @$row_places['URL']; $URL = str_replace('hl=en', 'hl=' . $langue, $URL ?? ''); // Google Maps link V2 - Extract place_id (ie : https:\/\/www.google.com\/maps\/place\/?q=place_id:ChIJlRPzKwbdfkcR-IJwGf5BJcU) /*preg_match('/place_id:([^\/]+)/', $URL, $matches); $Place_id = $matches[1]; $URL = 'https://www.google.com/maps/search/?api=1&query='.urlencode($Full_Address).'&query_place_id='.$Place_id; */ preg_match('/place_id:([^\/]+)/', $URL, $matches); // Vérifier si $matches contient la clé 1 if (isset($matches[1])) { $Place_id = $matches[1]; // Utiliser $Place_id dans votre URL $URL = 'https://www.google.com/maps/search/?api=1&query='.urlencode($Full_Address).'&query_place_id='.$Place_id; } else $Place_id = ''; $Category = @$row_places['Category']; $Category_all = @$row_places['Category_all']; $id_cat_all = @$row_places['id_cat_all']; $id_cat_all_array = explode(',', $id_cat_all); if (!empty($id_cat_all_array) && $id_cat_all_array[0] == 3660) { // Si le tableau a plus d'un élément, afficher la deuxième valeur, sinon, laisser 3660 $deuxieme_valeur = count($id_cat_all_array) > 1 ? $id_cat_all_array[1] : 3660; $id_cat = $deuxieme_valeur; } else $id_cat = reset($id_cat_all_array);; /*echo 'next(id_cat_array) : '.next($id_cat_array); if($id_cat == 3660 && next($id_cat_array) != '') $id_cat = next($id_cat_array); // On prend le suivant */ // Initialiser un tableau pour stocker les noms de catégories $nomsCategories = array(); // Identifiant spécial à mettre en dernier (trop généraliste) $identifiantSpecial = 3660; $idsArray = explode(',', $id_cat_all); $nomsCategories = array(); foreach ($idsArray as $id) { $nomCategorie = obtenirTexte($id, $langue); if ($id == $identifiantSpecial) { // Mettre cet élément en dernier dans le tableau $nomsCategories[] = $nomCategorie; } else { // Mettre cet élément avant l'identifiant spécial dans le tableau array_unshift($nomsCategories, $nomCategorie); } } $unique_id = @$row_places['unique_id']; $parent_cat = obtenirParentcat($id_cat, $langue); // A FAIRE : utiliser fichier json des cat_fr /* $query_cat = "SELECT * FROM categories_google_maps WHERE id_cat=$id_cat"; $result_cat = @mysqli_query($c1,$query_cat); $row_cat = @mysqli_fetch_array($result_cat); $parent_cat = $row_cat['parent_cat']; $cat_name = $row_cat['parent_cat']; $cat_name_fr = $row_cat['cat_name_fr']; $cat_name_fr = ucfirst($cat_name_fr); if($cat_name_fr == "") { if($parent_cat == 1) $cat_name_fr = 'Site naturel'; elseif($parent_cat == 2) $cat_name_fr = 'Monument'; elseif($parent_cat == 3) $cat_name_fr = 'Musée'; elseif($parent_cat == 4) $cat_name_fr = 'Activités & Loisirs'; elseif($parent_cat == 6) $cat_name_fr = 'Sport'; else $cat_name_fr = ''; } */ if($test == 1) $log .= '
Category_all : '.$Category_all.'
id_cat_all : '.$id_cat_all.'
id_cat : '.$id_cat.'
parent_cat : '.$parent_cat.'
'; $Category_all = idCatAllToTexte($id_cat_all,'fr'); // Vérifier si $Category_all contient des virgules if (strpos($Category_all, ',') !== false) { $categoriesArray = explode(',', $Category_all); $premiereCategorie = reset($categoriesArray); $premiereCategorie = mb_strtoupper( mb_substr( $premiereCategorie, 0, 1 )) . mb_substr( $premiereCategorie, 1 ); $premiereCategorie = @mb_convert_encoding($premiereCategorie, 'ISO-8859-1', 'UTF-8'); } else { $premiereCategorie = $Category_all; } // Pour Places : link(s) sur image $Category_all_links = idCatAllToTexteAndLinks($id_cat_all,'fr',$Lat,$Lng); if (strpos($Category_all_links, ',') !== false) { $categoriesArray = explode(',', $Category_all_links); $premiereCategorie_link = reset($categoriesArray); $premiereCategorie_link = mb_strtoupper( mb_substr( $premiereCategorie_link, 0, 1 )) . mb_substr( $premiereCategorie_link, 1 ); $premiereCategorie_link = @mb_convert_encoding($premiereCategorie_link, 'ISO-8859-1', 'UTF-8'); } else { $premiereCategorie_link = $Category_all_links; } // A FAIRE : display si catégorie vide ? $classement = @$row_places['classement']; $image_top = 'cache/places/top_images_webp/'.unique_id_to_imagepath($unique_id).'.webp'; $exists = is_file($image_top) || is_file('../../' . $image_top); if(!$exists) { //if(file_exists('../../'.$image_top) === false) { if(!@$c) $image_top = no_preview($parent_cat); else $image_top = no_preview($c); $image_top = 'images/no-preview/svg/'.$image_top; } /* if(file_exists('../../'.$image_top) === false) { if(file_exists($image_top) === false) { if(!@$c) $image_top = no_preview($parent_cat); else $image_top = no_preview($c); $image_top = 'images/no-preview/svg/'.$image_top; } } */ $source = @$row_places['source']; // 1 = robots : botsol / Leadsniper - 2 = datatourisme $date = @$row_places['date']; $date_maj = @$row_places['date_maj']; function displayHours($hours_encoded,$timeNow) { $displayHours = ''; //$displayHours .= '
'; if($hours_encoded != '') { /* echo 'hours_encoded:*'.$hours_encoded.'*'; print_r($hours_encoded); */ // A FAIRE : delete deprecated function hours_nextOpeningDayAndTime $displayHours .= '
'.hours_isOpenNowMinimalist($hours_encoded['hex']).' '.hours_delayOpenClose($hours_encoded['hex']).'
'; // TEST. Bug a faire : eea64b12fa9dbeed8ec927afadddfce2 //$displayHours .= '
'.hours_isOpenNowMinimalist($hours_encoded['hex']).' '.hours_delayOpenClose($hours_encoded['hex'],'2025-03-09 1:15:00').'
'; $displayHours .= '
'.hours_hoursTextualDisplay($hours_encoded['hex'], date('Y-m-d H:i:s')).'
'; $isOpenNow = hours_displayOpeningHours($hours_encoded['hex'], null); $displayHours .= $isOpenNow; } /* //$displayHours .= '
'.isOpen($openingHoursExample, $timeNow).' '.delayOpenClose($openingHoursExample, $timeNow).'
'; $displayHours .= '
'. hoursTextualDisplay($openingHoursExample, $timeNow).'
'; $isOpenNow = displayOpeningHours($openingHoursExample, $timeNow); $displayHours .= $isOpenNow; */ return $displayHours; } $timeNow = date('Y-m-d H:i:s', time()); if($hours_encoded != '') $displayHours = displayHours($hours_encoded,$timeNow); else $displayHours = ''; //echo '
[JSON : file_exists:'.file_exists($json_path === true).' - filesize:'.filesize($json_path).' - '.$json_path.' don\'t exists.]
'; // A FAIRE : fichier n'existe pas / alerte ?. } // Places > "En savoir plus..." // --------------------------------------------------------------------------------------------------------------------------------------------- $display_en_savoir_plus = ''; if($Description_IA != '') { $display_en_savoir_plus = ''; $display_en_savoir_plus .= '
'.$Description_IA.'
'; $display_en_savoir_plus .= '
'; } // Places > Suggestions > Lieux similaires dans les environs // --------------------------------------------------------------------------------------------------------------------------------------------- $timeNow = date('Y-m-d H:i:s', time()); //$randomStart = mt_rand(0, 20); $display_suggestions_similaires = ' '; $log .= $query_suggestions_similaires; // Places > Suggestions > à proximité // --------------------------------------------------------------------------------------------------------------------------------------------- $timeNow = date('Y-m-d H:i:s', time()); //$randomStart = mt_rand(0, 20); $display_suggestions_proximite = ' '; $log .= $query_suggestions; // Places > "En savoir plus..." // --------------------------------------------------------------------------------------------------------------------------------------------- $display_en_savoir_plus = ''; if($Description_IA != '') { $display_en_savoir_plus = ''; $display_en_savoir_plus .= '
'.$Description_IA.'
'; $display_en_savoir_plus .= ''; } // Display GetYourGuide // --------------------------------------------------------------------------------------------------- // Manual //$widget_getyourguide = '
Powered by GetYourGuide
'; // Auto //$widget_getyourguide = '
'; // Manuel $widget_getyourguide = '
Powered by GetYourGuide
'; $display_getyourguide = ''; $place_home_title = latlng_to_location($Lat,$Lng); if($place_home_title == '') $place_home_title = 'Accueil'; $content .= '
'.$place_home_title.''; $nameDisplay = $Name; $content .= '

'.$nameDisplay.' '.meteo($Lat,$Lng,2,$c1).'

Photo de '.$Name.' '; if($Category_all != '') { if(strlen($Category_all_links) >= 150) $Category_all_links_display = cutSentence($Category_all_links,150); else $Category_all_links_display = $Category_all_links; $content .= '
' . $Category_all_links . '
'; } else $content .= '
' . $premiereCategorie_link . '
'; $content .= '
Crédit photo : @Google Places API
'; if($displayHours != '') $content .= '
'.$displayHours.'
'; $content .= '
'; if ($Full_Address != '') { $content .= '
'; $content .= ''; $content .= '

Adresse : '.$Full_Address.'

'; $content .= '
'; } if ($Phone != '') { $content .= '

Téléphone Des frais supplémentaires peuvent s\'appliquer en fonction de votre opérateur téléphonique et de l\'origine de votre appel. : '.$Phone.'

'; } if($Website != '') $content .= '

Site Internet : '.$WebsiteDisplay.'

'; if($Facebook != '') $Facebook .= '

Facebook : '.$Facebook.'

'; if($Twitter != '') $Twitter .= '

Twitter : '.$Twitter.'

'; if($Instagram != '') $Instagram .= '

Instagram : '.$Instagram.'

'; if($Youtube != '') $Youtube .= '

Youtube : '.$Youtube.'

'; if($LinkedIn != '') $LinkedIn .= '

LinkedIn : '.$LinkedIn.'

'; if($Tiktok != '') $Tiktok .= '

Tiktok : '.$Tiktok.'

'; if($Pinterest != '') $Pinterest .= '

Pinterest : '.$Pinterest.'

'; //if($Category != '') $content .= '

Categorie : '.$cat_name_fr.'

'; //if($Category_all != '') $content .= '

Categories : '.$Category_all.'

'; // A FAIRE : s ou pas s si unique //if($Summary_IA != '') $content .= '

L\'essentiel :
'.$Summary_IA.'

'; //if($Summary_IA != '') $content .= '
'; if($Summary_IA != '') { $content .= ''; $content .= '
'.$Summary_IA.'
'; //$content .= '
'; } $content .= '
'; $content .= ''; $content .= ''; $content .= '
'; $log .= '
Lat : '.$Lat.'
Lng : '.$Lng.'
image_top : '.$image_top.'
'; if($Email != '') $log .= '
Email : '.$Email.'
'; if($Facebook != '') $log .= '
Email : '.$Facebook.'
'; if($Twitter != '') $log .= '
Email : '.$Twitter.'
'; if($Instagram != '') $log .= '
Email : '.$Instagram.'
'; if($Youtube != '') $log .= '
Email : '.$Youtube.'
'; // Test : random place // ----------------------------------------------- if($test >= 1) { $query_random_place = "SELECT unique_id FROM $places_table ORDER BY RAND() LIMIT 0,1"; $result_random_place = mysqli_query($c1,$query_random_place); $row_random_place = mysqli_fetch_array($result_random_place); $random_place_id = $row_random_place['unique_id']; $random_place_country_code = $row_random_place['country_code']; $log .= ''; } $log .= '
Rating : '.$Rating.'
Sub_Title : '.$Sub_Title.'
Pricing : '.$Pricing.'
Amenities : '.$Amenities.'
Summary : '.$Summary.'
Top_Image_URL : '.$Top_Image_URL.'/div>
Services : '.$Services.'
Located_in : '.$Located_in.'
Attributes : '.$Attributes.'
unique_id : '.$unique_id.'
id_cat : '.$id_cat.'
parent_cat : '.$parent_cat.'
classement : '.$classement.'
source : '.$source.'
'.$Name.'
Ouvert actuellementFerme à 20:00 (dans ~1:15)
'; $content .= '
'; if($display_en_savoir_plus != '') $content .= $display_en_savoir_plus; // Lieux similaires if($display_suggestions_similaires != '') $content .= $display_suggestions_similaires; // Lieux proches if($display_suggestions_proximite != '') $content .= $display_suggestions_proximite; //if($display_getyourguide != '') $content .= $display_getyourguide; $content .= '
'; // Display Test if($test == 1 or $test == 2) { //$content .= '
'.$log.'
'; } $content .= ""; mysqli_close($c1); return $content; } // gen_place_content():fin // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- function corrigerCaracteresLatin($string) { $replace_map = [ 'À' => 'À', 'Â' => 'Â', 'Ã' => 'Ã', 'Ä' => 'Ä', 'Ã…' => 'Å', 'Ç' => 'Ç', 'È' => 'È', 'É' => 'É', 'Ê' => 'Ê', 'Ë' => 'Ë', 'ÃŒ' => 'Ì', 'ÃŽ' => 'Î', 'Ñ' => 'Ñ', 'Ã’' => 'Ò', 'Ó' => 'Ó', 'Ô' => 'Ô', 'Ö' => 'Ö', 'Ø' => 'Ø', 'Ù' => 'Ù', 'Ú' => 'Ú', 'Û' => 'Û', 'Ü' => 'Ü', 'ß' => 'ß', 'à ' => 'à', 'á' => 'á', 'â' => 'â', 'ã' => 'ã', 'ä' => 'ä', 'Ã¥' => 'å', 'ç' => 'ç', 'è' => 'è', 'é' => 'é', 'ê' => 'ê', 'ë' => 'ë', 'ì' => 'ì', 'î' => 'î', 'ï' => 'ï', 'ñ' => 'ñ', 'ò' => 'ò', 'ó' => 'ó', 'ô' => 'ô', 'õ' => 'õ', 'ø' => 'ø', 'ù' => 'ù', 'ú' => 'ú', 'û' => 'û', 'ü' => 'ü', 'ý' => 'ý', 'ÿ' => 'ÿ', '’' => '\'', '®' => '®', 'à' => 'à', 'ó' => 'ó', ]; return strtr($string, $replace_map); } // Genere une IP aléatoire en Europe // https://chatgpt.com/c/6830a43c-f758-8002-af85-23431f136048 // V2 : https://chatgpt.com/c/6856c160-e3bc-8002-b56e-0d869016f65a?model=o3 // ============================================================================================== function generateRandomEuropeCoordinates() { $places = [ // ========================= FRANCE (villages & petites villes) ========================= [43.9475, 1.8850, 'Cordes-sur-Ciel', 'FR'], [44.8000, 1.6167, 'Rocamadour', 'FR'], [43.7417, 4.7956, 'Les Baux-de-Provence', 'FR'], [44.1231, 4.8369, 'Uzès', 'FR'], [43.6806, -0.9308, 'Saint-Jean-Pied-de-Port', 'FR'], [43.3833, -1.5667, 'Espelette', 'FR'], [43.8997, 6.6283, 'Moustiers-Sainte-Marie', 'FR'], [48.4468, -2.0409, 'Dinan', 'FR'], [44.0546, 4.8314, 'Vaison-la-Romaine', 'FR'], [48.7346, -3.4596, 'Tréguier', 'FR'], [46.4939, 4.2892, 'Cluny', 'FR'], [43.8367, 5.7867, 'Forcalquier', 'FR'], [43.3525, 3.2181, 'Pézenas', 'FR'], [48.2842, 7.4474, 'Riquewihr', 'FR'], [48.1919, 7.3064, 'Eguisheim', 'FR'], [48.1366, 7.2678, 'Kaysersberg', 'FR'], [46.1964, 6.7003, 'Yvoire', 'FR'], [45.2631, 5.9461, 'Pont-en-Royans', 'FR'], [43.9333, 3.5833, 'La Couvertoirade', 'FR'], [44.1000, 6.6333, 'Colmars-les-Alpes', 'FR'], [45.4091, 6.6340, 'Bonneval-sur-Arc', 'FR'], [44.8000, 6.8667, 'Saint-Véran', 'FR'], [43.9328, 2.1467, 'Monestiés', 'FR'], [44.3275, 3.5936, 'La Malène', 'FR'], [48.0000, 0.2000, 'Sainte-Suzanne', 'FR'], [45.0000, 0.2000, 'Aubeterre-sur-Dronne', 'FR'], [43.5667, 5.0833, 'Lourmarin', 'FR'], [42.5260, 3.0830, 'Collioure', 'FR'], [49.4194, 0.2329, 'Honfleur', 'FR'], [49.7061, 0.2042, 'Étretat', 'FR'], [43.9122, 5.2000, 'Gordes', 'FR'], [43.9030, 5.2930, 'Roussillon', 'FR'], [44.4660, 1.6670, 'Saint-Cirq-Lapopie', 'FR'], [44.6000, 2.4010, 'Conques', 'FR'], [43.2150, 5.5370, 'Cassis', 'FR'], [48.0800, 7.3550, 'Colmar', 'FR'], [49.2760, -0.7010, 'Bayeux', 'FR'], [44.8890, 1.2160, 'Sarlat-la-Canéda', 'FR'], [44.8950, -0.1550, 'Saint-Émilion', 'FR'], [45.0600, 1.6580, 'Collonges-la-Rouge', 'FR'], // ========================= BELGIQUE (communes de charme) ========================= [50.2667, 4.8833, 'Durbuy', 'BE'], [50.2531, 5.3292, 'La Roche-en-Ardenne', 'BE'], [50.4533, 5.9733, 'Malmedy', 'BE'], [50.0056, 4.6075, 'Bouillon', 'BE'], [50.3211, 4.6614, 'Dinant', 'BE'], [50.4308, 5.6842, 'Spa', 'BE'], [50.1500, 5.7167, 'Marche-en-Famenne', 'BE'], [51.2530, 3.2810, 'Damme', 'BE'], [51.2720, 3.0330, 'De Haan', 'BE'], [49.5270, 5.4930, 'Torgny', 'BE'], [50.1250, 5.1860, 'Han-sur-Lesse', 'BE'], [50.3490, 4.9510, 'Crupet', 'BE'], [50.1670, 5.2220, 'Rochefort', 'BE'], [51.0543, 3.7174, 'Bruges', 'BE'], // ========================= ITALIE (borghi / petites villes) ========================= [43.4670, 11.0430, 'San Gimignano', 'IT'], [40.6280, 14.4840, 'Positano', 'IT'], [40.6490, 14.6120, 'Ravello', 'IT'], [40.3560, 18.1760, 'Otranto', 'IT'], [40.9960, 17.2290, 'Alberobello', 'IT'], [40.9950, 17.2270, 'Locorotondo', 'IT'], [40.9956, 17.2170, 'Martina Franca', 'IT'], [40.9950, 17.2230, 'Polignano a Mare', 'IT'], [37.8510, 15.2850, 'Taormina', 'IT'], [38.0390, 12.5880, 'Erice', 'IT'], [45.8010, 8.4210, 'Orta San Giulio', 'IT'], [42.6270, 12.0930, 'Civita di Bagnoregio', 'IT'], [44.1430, 9.7060, 'Portovenere', 'IT'], [44.1350, 9.6830, 'Vernazza', 'IT'], [44.1070, 9.7270, 'Manarola', 'IT'], [39.4230, 9.6500, 'Bosa', 'IT'], // ========================= ROYAUME-UNI (villages & petites villes) ========================= [51.4910, -2.2280, 'Castle Combe', 'GB'], [51.7610, -1.8330, 'Bibury', 'GB'], [51.8850, -1.7010, 'Bourton-on-the-Water', 'GB'], [50.2110, -5.4820, 'St Ives (Cornwall)', 'GB'], [50.5770, -4.8310, 'Port Isaac', 'GB'], [50.3310, -4.5180, 'Polperro', 'GB'], [50.2860, -3.7780, 'Salcombe', 'GB'], [50.8840, -0.5430, 'Arundel', 'GB'], [50.5240, -3.7650, 'Dartmouth', 'GB'], [57.4120, -5.4730, 'Plockton', 'GB'], [56.6220, -6.0700, 'Tobermory (Mull)', 'GB'], [50.9510, 0.7340, 'Rye', 'GB'], [54.4870, -0.6140, 'Whitby', 'GB'], [52.2410, 0.7950, 'Lavenham', 'GB'], [57.4110, -6.1970, 'Portree (Isle of Skye)', 'GB'], // ========================= SUISSE (communes de charme) ========================= [46.5839, 7.0825, 'Gruyères', 'CH'], [46.0207, 7.7491, 'Zermatt', 'CH'], [46.6067, 7.9227, 'Wengen', 'CH'], [46.5589, 7.8920, 'Mürren', 'CH'], [46.1550, 8.7720, 'Ascona', 'CH'], [47.6550, 8.8580, 'Stein am Rhein', 'CH'], [47.3300, 9.4090, 'Appenzell', 'CH'], [46.3400, 9.5390, 'Soglio', 'CH'], [46.7750, 10.1500, 'Guarda', 'CH'], [47.3730, 7.1520, 'Saint-Ursanne', 'CH'], [45.9850, 8.9140, 'Morcote', 'CH'], // ========================= ESPAGNE (pueblos / petites villes) ========================= [36.7400, -5.1660, 'Ronda', 'ES'], [40.0730, -1.9990, 'Albarracín', 'ES'], [43.5630, -6.1450, 'Cudillero', 'ES'], [36.7920, -3.8970, 'Frigiliana', 'ES'], [42.2880, 3.2770, 'Cadaqués', 'ES'], [43.3890, -4.1060, 'Santillana del Mar', 'ES'], [42.1980, 2.7020, 'Besalú', 'ES'], [36.8400, -5.3920, 'Zahara de la Sierra', 'ES'], [36.8660, -5.1830, 'Setenil de las Bodegas', 'ES'], [39.7630, -0.0570, 'Peñíscola', 'ES'], [39.7050, 2.4240, 'Valldemossa (Majorque)', 'ES'], // ========================= AUTRICHE ========================= [47.5622, 13.6493, 'Hallstatt', 'AT'], [48.3965, 15.5193, 'Dürnstein (Wachau)', 'AT'], [47.3950, 11.9440, 'Alpbach', 'AT'], [47.7400, 13.4490, 'St. Wolfgang im Salzkammergut', 'AT'], [47.0460, 12.8440, 'Heiligenblut', 'AT'], [47.4030, 12.9080, 'Maria Alm', 'AT'], [47.1130, 13.1340, 'Bad Gastein', 'AT'], [47.3230, 12.7980, 'Zell am See', 'AT'], [47.5830, 12.1620, 'Kufstein', 'AT'], [47.4290, 13.5200, 'Filzmoos', 'AT'], // ========================= BÉNIN ========================= [6.3631, 2.0850, 'Ouidah', 'BJ'], [6.4710, 2.4220, 'Ganvié (Sô-Ava)', 'BJ'], [6.2880, 1.8220, 'Grand-Popo', 'BJ'], [7.1829, 1.9912, 'Abomey', 'BJ'], [10.3040, 1.3780, 'Natitingou', 'BJ'], [10.6200, 1.2670, 'Tanguiéta', 'BJ'], [7.3630, 2.6030, 'Kétou', 'BJ'], [6.6650, 2.1510, 'Allada', 'BJ'], // ========================= ALLEMAGNE ========================= [49.3780, 10.1860, 'Rothenburg ob der Tauber', 'DE'], [51.7870, 10.8130, 'Wernigerode', 'DE'], [51.7880, 11.1480, 'Quedlinburg', 'DE'], [50.2300, 6.2400, 'Monschau', 'DE'], [50.1460, 7.1670, 'Cochem', 'DE'], [50.0600, 7.7660, 'Bacharach', 'DE'], [47.6980, 9.2700, 'Meersburg', 'DE'], [47.4750, 10.9630, 'Füssen', 'DE'], [47.4420, 11.2630, 'Mittenwald', 'DE'], [47.5450, 9.6830, 'Lindau', 'DE'], [51.1510, 14.9880, 'Görlitz', 'DE'], [48.5210, 9.0550, 'Tübingen', 'DE'], // ========================= ÉGYPTE (villes/communes touristiques de charme) ========================= [28.5000, 34.5170, 'Dahab', 'EG'], [29.2040, 25.5190, 'Siwa (Oasis)', 'EG'], [25.0670, 34.8870, 'Marsa Alam', 'EG'], [27.3940, 33.6780, 'El Gouna', 'EG'], [29.0360, 34.6640, 'Nuweiba', 'EG'], [26.1060, 34.2770, 'Al-Quseir', 'EG'], [22.3370, 31.6250, 'Abu Simbel', 'EG'], [24.0880, 32.8990, 'Assouan', 'EG'], [25.6870, 32.6390, 'Louxor', 'EG'], [29.4650, 30.5040, 'Tunis (Fayoum)', 'EG'], // ========================= CROATIE ========================= [45.0812, 13.6400, 'Rovinj', 'HR'], [43.5170, 16.2516, 'Trogir', 'HR'], [43.1729, 16.4428, 'Hvar (ville)', 'HR'], [42.9612, 17.1354, 'Korčula (ville)', 'HR'], [42.5800, 18.2170, 'Cavtat', 'HR'], [45.3340, 13.8250, 'Motovun', 'HR'], [45.3310, 13.7440, 'Grožnjan', 'HR'], [43.7330, 15.8950, 'Šibenik', 'HR'], [42.8400, 17.7000, 'Ston', 'HR'], [43.5860, 15.9260, 'Primošten', 'HR'], // ========================= IRLANDE ========================= [51.7070, -8.5300, 'Kinsale', 'IE'], [52.1400, -10.2710, 'Dingle', 'IE'], [51.8830, -9.5830, 'Kenmare', 'IE'], [52.5620, -8.7950, 'Adare', 'IE'], [53.8000, -9.5170, 'Westport', 'IE'], [51.8490, -8.2940, 'Cobh', 'IE'], [53.0150, -9.3770, 'Doolin', 'IE'], [53.5420, -9.2840, 'Cong', 'IE'], [52.0590, -9.5060, 'Killarney', 'IE'], [52.6540, -7.2440, 'Kilkenny', 'IE'], // ========================= ISLANDE ========================= [63.4190, -19.0060, 'Vík í Mýrdal', 'IS'], [65.2640, -14.0100, 'Seyðisfjörður', 'IS'], [66.0440, -17.3380, 'Húsavík', 'IS'], [65.0750, -22.7330, 'Stykkishólmur', 'IS'], [66.1510, -18.9100, 'Siglufjörður', 'IS'], [64.9240, -23.2630, 'Grundarfjörður', 'IS'], [64.2530, -15.2120, 'Höfn', 'IS'], [64.0010, -21.1900, 'Hveragerði', 'IS'], // ========================= MAROC ========================= [35.1714, -5.2697, 'Chefchaouen', 'MA'], [35.4650, -6.0350, 'Asilah', 'MA'], [31.5085, -9.7595, 'Essaouira', 'MA'], [34.0540, -5.5240, 'Moulay Idriss Zerhoun', 'MA'], [33.5330, -5.1100, 'Ifrane', 'MA'], [30.4720, -8.8760, 'Tafraoute', 'MA'], [30.4700, -9.6000, 'Tiznit', 'MA'], [28.0000, -10.0000, 'Merzouga', 'MA'], [35.5710, -5.3720, 'Tétouan', 'MA'], [30.9189, -6.8934, 'Ouarzazate (Aït Ben Haddou)', 'MA'], // ========================= MONACO (quartiers/secteurs) ========================= [43.7314, 7.4204, 'Monaco-Ville', 'MC'], [43.7396, 7.4276, 'Monte-Carlo', 'MC'], [43.7360, 7.4200, 'La Condamine', 'MC'], [43.7310, 7.4150, 'Fontvieille', 'MC'], [43.7491, 7.4353, 'Larvotto', 'MC'], // ========================= MADAGASCAR ========================= [-13.4040, 48.2660, 'Andoany (Nosy Be)', 'MG'], [-20.2830, 44.3170, 'Morondava', 'MG'], [-21.8320, 46.9360, 'Ambalavao', 'MG'], [-20.5200, 47.2460, 'Ambositra', 'MG'], [-19.8650, 47.0330, 'Antsirabe', 'MG'], [-16.9820, 49.8500, 'Ambodifotatra (Sainte-Marie)', 'MG'], [-23.1330, 43.6160, 'Ifaty', 'MG'], [-25.0330, 46.9830, 'Tolagnaro (Fort-Dauphin)', 'MG'], // ========================= NIGÉRIA (villes/towns à intérêt culturel/nature) ========================= [6.4150, 2.8920, 'Badagry', 'NG'], [7.1120, 5.1100, 'Idanre', 'NG'], [7.7710, 4.5560, 'Osogbo', 'NG'], [6.6670, 9.1670, 'Obudu', 'NG'], [5.3900, 7.9300, 'Arochukwu', 'NG'], [7.5850, 5.0030, 'Ikogosi', 'NG'], [7.5800, 4.8170, 'Erin-Ijesha', 'NG'], [6.8180, 3.9170, 'Ijebu-Ode', 'NG'], // ========================= NORVÈGE ========================= [67.9330, 13.0890, 'Reine (Lofoten)', 'NO'], [68.1540, 14.2100, 'Henningsvær (Lofoten)', 'NO'], [60.9380, 6.5780, 'Undredal', 'NO'], [62.1015, 7.2058, 'Geiranger', 'NO'], [62.5680, 7.6880, 'Åndalsnes', 'NO'], [58.9860, 6.1900, 'Preikestolen (Jørpeland)', 'NO'], [60.8610, 7.1130, 'Flåm', 'NO'], [62.5740, 11.3840, 'Røros', 'NO'], [57.4110, 7.3440, 'Skudeneshavn', 'NO'], // ========================= PORTUGAL ========================= [39.3600, -9.1570, 'Óbidos', 'PT'], [38.7890, -9.3900, 'Sintra', 'PT'], [37.1270, -7.6480, 'Tavira', 'PT'], [38.4440, -7.3810, 'Monsaraz', 'PT'], [39.3940, -7.3760, 'Marvão', 'PT'], [38.9650, -9.4180, 'Ericeira', 'PT'], [39.6030, -9.0700, 'Nazaré', 'PT'], [40.0380, -7.1140, 'Monsanto (Idanha-a-Nova)', 'PT'], [40.3360, -7.2000, 'Sortelha', 'PT'], [39.4180, -7.4530, 'Castelo de Vide', 'PT'], [41.7670, -8.5830, 'Ponte de Lima', 'PT'], [41.2720, -8.0840, 'Amarante', 'PT'], // ========================= SUÈDE ========================= [57.5980, 11.2830, 'Fjällbacka', 'SE'], [55.4290, 13.8200, 'Ystad', 'SE'], [59.6170, 17.7170, 'Sigtuna', 'SE'], [57.8850, 11.5830, 'Marstrand', 'SE'], [57.6348, 18.2948, 'Visby (Gotland)', 'SE'], [58.8960, 17.5520, 'Trosa', 'SE'], [58.4500, 14.8910, 'Vadstena', 'SE'], [60.3330, 18.4330, 'Öregrund', 'SE'], [57.6670, 14.9670, 'Eksjö', 'SE'], [58.3000, 14.2830, 'Hjo', 'SE'], // ========================= TURQUIE ========================= [41.2500, 32.6900, 'Safranbolu', 'TR'], [37.9400, 27.4350, 'Şirince', 'TR'], [40.6530, 35.8330, 'Amasya', 'TR'], [38.2860, 26.3760, 'Alaçatı', 'TR'], [36.2010, 29.6370, 'Kaş', 'TR'], [37.0510, 28.3230, 'Akyaka', 'TR'], [39.8330, 26.0670, 'Bozcaada', 'TR'], [39.3250, 26.6410, 'Cunda (Ayvalık)', 'TR'], [37.9810, 38.7400, 'Mont Nemrut (Kahta)', 'TR'], [37.9210, 29.1187, 'Pamukkale (Denizli)', 'TR'], [38.6431, 34.8352, 'Göreme (Cappadoce)', 'TR'] ]; $random = $places[array_rand($places)]; return [ 'latitude' => $random[0], 'longitude' => $random[1], 'name' => $random[2], 'country_code' => $random[3] ]; } /* //------------------------------------------------------------------------- // 1) Choix des coordonnées de départ //------------------------------------------------------------------------- //$ip = '92.161.169.68'; // TEST Perpignan //$ip = '109.236.62.174'; // TEST Belgique //$ip = '45.11.80.5'; // TEST Italie //$ip = '109.236.63.10'; // TEST Belgique /* ---------------------------------------------------------------- // DEPRECATED – IP to location $ip = $_SERVER['REMOTE_ADDR']; $location = get_location_from_ip($ip); $lat = $location['latitude']; $lng = $location['longitude']; $bounding_distance = 0.5; ---------------------------------------------------------------- */ // DISPLAY HOME > QUELQUES IDEES // https://chatgpt.com/c/6830a43c-f758-8002-af85-23431f136048 // Gen listes villes taille moyennes populaires dans chaque pays : https://chatgpt.com/c/6856c160-e3bc-8002-b56e-0d869016f65a // ============================================================================================== /** * Génère la section « Quelques idées » de la page d'accueil. * • Titre dynamique – « Des lieux inspirants » ou « Des lieux inspirants : Perpignan (FR) » lorsqu’un lieu par défaut est utilisé. * • Bounding distance : 0 .5 km quand on tire un lieu par défaut, 0.2 km sinon. * • Lazy‑loading natif, sans accès disque : on tente l’image ; si elle n’existe pas le navigateur bascule sur loader17.gif grâce à onerror. * * Les blocs commentés (tests IP, méthode IP‑to‑location dépréciée, etc.) sont conservés pour mémoire. */ function gen_home_quelques_idees($lat, $lng) { global $c1; $places_table = 'places_min_2025'; $lat = 0; $lng = 0; $test = 0; // mode debug $location_label = ''; // affiché dans le titre si défini //-------------------------------------------------------------------- // 1) Choix des coordonnées de départ //-------------------------------------------------------------------- //$ip = '92.161.169.68'; // TEST Perpignan //$ip = '109.236.62.174'; // TEST Belgique //$ip = '45.11.80.5'; // TEST Italie //$ip = '109.236.63.10'; // TEST Belgique if ($lat == 0 && $lng == 0) { // → Pas de géoloc : on choisit un lieu touristique européen aléatoire $tmp = generateRandomEuropeCoordinates(); $lat = $tmp['latitude']; $lng = $tmp['longitude']; $location_label = $tmp['name'] . ' (' . $tmp['country_code'] . ')'; // ← ajouté $bounding_distance = 0.5; // 0.5 km pour cette toute première recherche } else { // Coords déjà fournies $bounding_distance = 0.2; } // Troncature simple (pas d’arrondi) $lat = floor($lat * 10000) / 10000; $lng = floor($lng * 10000) / 10000; $bd_lat = $bounding_distance; $bd_lng = $bounding_distance * cos(deg2rad($lat)); //-------------------------------------------------------------------- // 2) Générateur de requête SQL paramétrable //-------------------------------------------------------------------- $generate_query = function ($lat, $lng, $bd_lat, $bd_lng, $places_table) { return "SELECT p.unique_id, p.Name, p.truncated_lat, p.truncated_lng, p.Reviews, p.Country_Code FROM $places_table p JOIN categories_google_maps c ON FIND_IN_SET(c.id_cat, p.id_cat_all) WHERE p.truncated_lat BETWEEN ($lat - $bd_lat) AND ($lat + $bd_lat) AND p.truncated_lng BETWEEN ($lng - $bd_lng) AND ($lng + $bd_lng) AND p.Reviews > 1 AND c.yutugo_cat IN (3,4) AND c.id_cat <> 3661 GROUP BY p.unique_id ORDER BY p.Reviews DESC LIMIT 16;"; }; //-------------------------------------------------------------------- // 3) Première tentative //-------------------------------------------------------------------- $sql = $generate_query($lat, $lng, $bd_lat, $bd_lng, $places_table); $result = $c1->query($sql); //-------------------------------------------------------------------- // 4) Repli si aucun résultat //-------------------------------------------------------------------- if (!$result || $result->num_rows === 0) { $tmp = generateRandomEuropeCoordinates(); $lat = $tmp['latitude']; $lng = $tmp['longitude']; $location_label = $tmp['name'] . ' (' . $tmp['country_code'] . ')'; $bounding_distance = 0.5; // idem 0.5 km $bd_lat = $bounding_distance; $bd_lng = $bounding_distance * cos(deg2rad($lat)); $sql = $generate_query($lat, $lng, $bd_lat, $bd_lng, $places_table); $result = $c1->query($sql); } //-------------------------------------------------------------------- // 5) Construction du HTML //-------------------------------------------------------------------- $output_html = ''; if ($result && $result->num_rows > 0) { $output_html .= '
'; $output_html .= '

Des lieux inspirants' . ($location_label ? ' : ' . htmlspecialchars(preg_replace_callback('/\(([A-Z]{2})\)/', function($m){return '(' . iso2_to_country_fr($m[1]) . ')';}, $location_label)) . '' : '') . '

'; //$output_html .= '

Des lieux inspirants' . ($location_label ? ' : ' . htmlspecialchars($location_label) . '' : '') . '

'; $output_html .= '
'; $seen_lats = $seen_lngs = []; $count = 0; while ($row = $result->fetch_assoc()) { // — Éviter doublons sur 4 décimales — $lat_key = number_format(floor($row['truncated_lat'] * 10000) / 10000, 4, '.', ''); $lng_key = number_format(floor($row['truncated_lng'] * 10000) / 10000, 4, '.', ''); if (isset($seen_lats[$lat_key]) || isset($seen_lngs[$lng_key])) continue; $seen_lats[$lat_key] = $seen_lngs[$lng_key] = true; // — Chemin image (aucune vérif disque) — $img = 'cache/places/top_images_webp/' . unique_id_to_imagepath($row['unique_id']) . '.webp'; // — Nom formaté — $Name = ajusterMajuscules(mb_strtoupper(mb_substr($row['Name'],0,1)) . mb_substr($row['Name'],1)); $uid = $row['unique_id']; $country_code = $row['Country_Code']; // — Bloc HTML avec IMG lazy et onerror fallback — $output_html .= ''; if (++$count >= 12) break; // 12 vignettes max } $output_html .= '
'; // wrappers fermants } if ($output_html === '') $output_html = '

..

'; if ($result) $result->free(); echo $output_html; exit; } function iso2_to_country_fr($code) { static $countries = [ 'AF'=>'Afghanistan','ZA'=>'Afrique du Sud','AL'=>'Albanie','DZ'=>'Algérie','DE'=>'Allemagne', 'AD'=>'Andorre','AO'=>'Angola','AI'=>'Anguilla','AQ'=>'Antarctique','AG'=>'Antigua-et-Barbuda', 'SA'=>'Arabie saoudite','AR'=>'Argentine','AM'=>'Arménie','AW'=>'Aruba','AU'=>'Australie', 'AT'=>'Autriche','AZ'=>'Azerbaïdjan','BS'=>'Bahamas','BH'=>'Bahreïn','BD'=>'Bangladesh', 'BB'=>'Barbade','BE'=>'Belgique','BZ'=>'Belize','BJ'=>'Bénin','BM'=>'Bermudes','BT'=>'Bhoutan', 'BY'=>'Biélorussie','MM'=>'Birmanie','BO'=>'Bolivie','BA'=>'Bosnie-Herzégovine','BW'=>'Botswana', 'BR'=>'Brésil','BN'=>'Brunei','BG'=>'Bulgarie','BF'=>'Burkina Faso','BI'=>'Burundi', 'KH'=>'Cambodge','CM'=>'Cameroun','CA'=>'Canada','CV'=>'Cap-Vert','CL'=>'Chili','CN'=>'Chine', 'CY'=>'Chypre','CO'=>'Colombie','KM'=>'Comores','CG'=>'Congo','CD'=>'Congo (RDC)', 'KP'=>'Corée du Nord','KR'=>'Corée du Sud','CR'=>'Costa Rica','CI'=>'Côte d’Ivoire','HR'=>'Croatie', 'CU'=>'Cuba','DK'=>'Danemark','DJ'=>'Djibouti','DM'=>'Dominique','EG'=>'Égypte','AE'=>'Émirats arabes unis', 'EC'=>'Équateur','ER'=>'Érythrée','ES'=>'Espagne','EE'=>'Estonie','US'=>'États-Unis','ET'=>'Éthiopie', 'FJ'=>'Fidji','FI'=>'Finlande','FR'=>'France','GA'=>'Gabon','GM'=>'Gambie','GE'=>'Géorgie', 'GH'=>'Ghana','GI'=>'Gibraltar','GR'=>'Grèce','GD'=>'Grenade','GL'=>'Groenland','GP'=>'Guadeloupe', 'GU'=>'Guam','GT'=>'Guatemala','GN'=>'Guinée','GQ'=>'Guinée équatoriale','GW'=>'Guinée-Bissau', 'GY'=>'Guyana','GF'=>'Guyane','HT'=>'Haïti','HN'=>'Honduras','HU'=>'Hongrie','IN'=>'Inde', 'ID'=>'Indonésie','IQ'=>'Irak','IR'=>'Iran','IE'=>'Irlande','IS'=>'Islande','IL'=>'Israël','IT'=>'Italie', 'JM'=>'Jamaïque','JP'=>'Japon','JO'=>'Jordanie','KZ'=>'Kazakhstan','KE'=>'Kenya','KG'=>'Kirghizistan', 'KI'=>'Kiribati','KW'=>'Koweït','LA'=>'Laos','LS'=>'Lesotho','LV'=>'Lettonie','LB'=>'Liban', 'LR'=>'Liberia','LY'=>'Libye','LI'=>'Liechtenstein','LT'=>'Lituanie','LU'=>'Luxembourg', 'MK'=>'Macédoine du Nord','MG'=>'Madagascar','MY'=>'Malaisie','MW'=>'Malawi','MV'=>'Maldives', 'ML'=>'Mali','MT'=>'Malte','MA'=>'Maroc','MQ'=>'Martinique','MU'=>'Maurice','MR'=>'Mauritanie', 'MX'=>'Mexique','MD'=>'Moldavie','MC'=>'Monaco','MN'=>'Mongolie','ME'=>'Monténégro','MZ'=>'Mozambique', 'NA'=>'Namibie','NR'=>'Nauru','NP'=>'Népal','NI'=>'Nicaragua','NE'=>'Niger','NG'=>'Nigeria', 'NO'=>'Norvège','NZ'=>'Nouvelle-Zélande','OM'=>'Oman','UG'=>'Ouganda','UZ'=>'Ouzbékistan', 'PK'=>'Pakistan','PA'=>'Panama','PG'=>'Papouasie-Nouvelle-Guinée','PY'=>'Paraguay','NL'=>'Pays-Bas', 'PE'=>'Pérou','PH'=>'Philippines','PL'=>'Pologne','PF'=>'Polynésie française','PT'=>'Portugal', 'QA'=>'Qatar','CF'=>'République centrafricaine','CZ'=>'République tchèque','DO'=>'République dominicaine', 'RO'=>'Roumanie','GB'=>'Royaume-Uni','RU'=>'Russie','RW'=>'Rwanda','KN'=>'Saint-Christophe-et-Niévès', 'LC'=>'Sainte-Lucie','SM'=>'Saint-Marin','VC'=>'Saint-Vincent-et-les-Grenadines','SV'=>'Salvador', 'WS'=>'Samoa','ST'=>'Sao Tomé-et-Principe','SN'=>'Sénégal','RS'=>'Serbie','SC'=>'Seychelles', 'SL'=>'Sierra Leone','SG'=>'Singapour','SK'=>'Slovaquie','SI'=>'Slovénie','SO'=>'Somalie', 'SD'=>'Soudan','LK'=>'Sri Lanka','SE'=>'Suède','CH'=>'Suisse','SR'=>'Suriname','SY'=>'Syrie', 'TJ'=>'Tadjikistan','TW'=>'Taïwan','TZ'=>'Tanzanie','TD'=>'Tchad','TH'=>'Thaïlande','TG'=>'Togo', 'TT'=>'Trinité-et-Tobago','TN'=>'Tunisie','TM'=>'Turkménistan','TR'=>'Turquie','UA'=>'Ukraine', 'UY'=>'Uruguay','VU'=>'Vanuatu','VE'=>'Venezuela','VN'=>'Viêt Nam','YE'=>'Yémen','ZM'=>'Zambie','ZW'=>'Zimbabwe' ]; return $countries[strtoupper($code)] ?? $code; } /* function gen_home_quelques_idees($lat, $lng) { global $c1; $test = 0; //$ip = '92.161.169.68'; // TEST Perpignan //$ip = '109.236.62.174'; // TEST Belgique //$ip = '45.11.80.5'; // TEST Italie //$ip = '109.236.63.10'; // TEST Belgique // Si lat et lng sont 0, utiliser la localisation par IP if ($lat == 0 && $lng == 0) { $ip = $_SERVER['REMOTE_ADDR']; // IP en production $location = get_location_from_ip($ip); // Initialisation des variables $lat = $location['latitude']; $lng = $location['longitude']; $bounding_distance = 0.5; } else { $bounding_distance = 0.2; } function truncateToFourDecimals($number) { return floor($number * 10000) / 10000; } $lat = truncateToFourDecimals($lat); $lng = truncateToFourDecimals($lng); $bounding_distance_lat = $bounding_distance; $bounding_distance_lng = $bounding_distance * cos(deg2rad($lat)); // Fonction pour générer la requête SQL function generate_query($lat, $lng, $bounding_distance_lat, $bounding_distance_lng) { return "SELECT p.unique_id, p.Name, p.truncated_lat, p.truncated_lng, SUBSTRING_INDEX(p.id_cat_all, ',', 1) AS category_id, p.Reviews FROM places_min p JOIN categories_google_maps c ON FIND_IN_SET(c.id_cat, p.id_cat_all) WHERE p.truncated_lat BETWEEN ($lat - $bounding_distance_lat) AND ($lat + $bounding_distance_lat) AND p.truncated_lng BETWEEN ($lng - $bounding_distance_lng) AND ($lng + $bounding_distance_lng) AND p.`Reviews` > 0 AND c.yutugo_cat IN (3,4) AND c.id_cat != 3661 GROUP BY p.unique_id ORDER BY RAND() DESC LIMIT 16;"; // ORDER BY p.Reviews DESC // WHERE yutugo_cat >= 1 } /* function generate_query($lat, $lng, $bounding_distance_lat, $bounding_distance_lng) { return " SELECT unique_id, Name, truncated_lat, truncated_lng, SUBSTRING_INDEX(id_cat_all, ',', 1) AS category_id, `Reviews` * 1 AS `Reviews` FROM `places_min` WHERE ( `truncated_lat` BETWEEN ($lat - $bounding_distance_lat) AND ($lat + $bounding_distance_lat) AND `truncated_lng` BETWEEN ($lng - $bounding_distance_lng) AND ($lng + $bounding_distance_lng) AND SUBSTRING_INDEX(id_cat_all, ',', 1) IN ( SELECT id_cat FROM categories_google_maps WHERE yutugo_cat = 3 OR yutugo_cat = 4 ) ) GROUP BY `Name` ORDER BY `Reviews` DESC, RAND() LIMIT 16;"; // WHERE yutugo_cat >= 1 } */ /* // Exécuter la requête avec les coordonnées actuelles $query_nearest_places = generate_query($lat, $lng, $bounding_distance_lat, $bounding_distance_lng); $result = $c1->query($query_nearest_places); // Si aucun résultat n'est trouvé, utiliser une IP par défaut (Paris) if (!$result || $result->num_rows === 0) { // Coordonnées de Paris $lat = 48.8566; // Latitude de Paris $lng = 2.3522; // Longitude de Paris $bounding_distance_lat = $bounding_distance; $bounding_distance_lng = $bounding_distance * cos(deg2rad($lat)); // Requête pour Paris $query_nearest_places = generate_query($lat, $lng, $bounding_distance_lat, $bounding_distance_lng); $result = $c1->query($query_nearest_places); } // Vérification des résultats $output_html = ''; if ($result && $result->num_rows > 0) { $output_html = '

Quelques idées...

'; $count = 0; // Compteur pour limiter à 12 résultats avec photos while ($row = $result->fetch_assoc()) { $lat_quelques_idees = $row['truncated_lat']; $lng_quelques_idees = $row['truncated_lng']; // Troncature à 4 décimales sans arrondi $lat_key = number_format(floor((float)$lat_quelques_idees * 10000) / 10000, 4, '.', ''); $lng_key = number_format(floor((float)$lng_quelques_idees * 10000) / 10000, 4, '.', ''); // Vérifie si déjà vu (lat OU lng) if (isset($seen_lats[$lat_key]) || isset($seen_lngs[$lng_key])) { if($test == 1) echo "
Ignoré (doublon lat/lng) : $lat_key / $lng_key
"; continue; } // Stocker les valeurs tronquées comme déjà vues $seen_lats[$lat_key] = true; $seen_lngs[$lng_key] = true; // Récupération de l'image $image_top_nearest_places = unique_id_to_imagepath($row['unique_id']); $image_top_nearest_places = 'cache/places/top_images_webp/' . $image_top_nearest_places . '.webp'; // Vérification si l'image existe if (!file_exists('../../' . $image_top_nearest_places) && !file_exists($image_top_nearest_places)) { continue; // Ignorer les lieux sans image } $Name = $row['Name']; //$Name = @mb_convert_encoding($Name, 'ISO-8859-1', 'UTF-8'); //$Name = mb_convert_encoding($Name, 'UTF-8'); $Name = mb_strtoupper(mb_substr($Name, 0, 1)) . mb_substr($Name, 1); $Name = ajusterMajuscules($Name); $unique_id = @$row['unique_id']; // Générer le HTML pour chaque lieu $output_html .= ''; //
$count++; // Incrémenter le compteur // Arrêter après avoir trouvé 12 lieux avec photos if ($count >= 12) { break; } } $output_html .= '
'; } // Si aucun lieu valide n'a été trouvé if ($output_html === '') { $output_html = '

..

'; // Message personnalisé } // Libérer les résultats if ($result) $result->free(); // Afficher le HTML echo $output_html; exit; } */ // ============================================================================================== // DISPLAY HOME > Que faire, quoi faire : afficher les catégories les plus populaires en Reviews // https://chatgpt.com/c/684535f9-f0a8-8002-bf51-822133a53d9a // ============================================================================================== function gen_home_cat_suggestions($parent_cat = 0, $nb_suggestions = 10) { $parent_cat = intval($parent_cat); $json_path = "cache/places/content/cat_popular/cat_{$parent_cat}.json"; if (!file_exists($json_path)) return ''; $json_content = file_get_contents($json_path); $categories = json_decode($json_content, true); if (!$categories || !is_array($categories)) return ''; /*

*/ $output = ''; return $output; } // ============================================================================================== // Test page header : 200 / 404 / 500 ... // ============================================================================================== function get_http_response_code($url) { $headers = get_headers($url); return substr($headers[0], 9, 3); } // Generate unique_id i.e. (64 car.) : 57e1722b207c3ffe13c8cf0d0301ab042b8cc912f99fcb0cc2749ac2b451266a // ============================================================================================== function str_rand(int $length = 64){ // 64 = 32 $length = ($length < 4) ? 4 : $length; return bin2hex(random_bytes(($length-($length%2))/2)); } // Image > symétrie horizontale // ============================================================================================== function image_flip(&$filename) { $test = 0; // Activez avec $test = 1 pour débogage // Vérification si le fichier existe
Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/yutugo.com/httpdocs/include/functions.php:1) in /var/www/vhosts/yutugo.com/httpdocs/index.php on line 34

Fatal error: Uncaught Error: Call to undefined function latlng_to_location() in /var/www/vhosts/yutugo.com/httpdocs/index.php:293 Stack trace: #0 {main} thrown in /var/www/vhosts/yutugo.com/httpdocs/index.php on line 293