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 != '') $cont
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