Execute("SELECT * FROM scm_langues WHERE NAPublic = 0 AND CodeLangue = '" . $strBufLng . "'"); if ($rsIfLangExist->EOF == true) $_SESSION['strLangue'] = CstrDefaultLanguage; else $_SESSION['strLangue'] = $strBufLng; } } $bPagePreviewBeforeSave = false; if (isset($_GET['bpagepreview'])) { if ($_GET['bpagepreview'] == '1') $bPagePreviewBeforeSave = true; } /********* Récupère les traductions de texte (contenu de page au format HTML, longs textes) *********/ function GetContent($strCodeText) { $strSQLContent = ''; $rsContent = ''; $strReturn = ''; $bNA = 0; global $objConnMySQLCA; global $bPagePreviewBeforeSave; if ($bPagePreviewBeforeSave == true) { if (isset($_POST['cbContentNA_' . $strCodeText . '_' . $_SESSION['strLangue']])) $bNA = 0; else $bNA = 1; if ($bNA == 0 && isset($_POST['txtContent_' . $strCodeText . '_' . $_SESSION['strLangue']])) $strReturn = stripslashes($_POST['txtContent_' . $strCodeText . '_' . $_SESSION['strLangue']]); else $strReturn = ''; } else { $strSQLContent = ''; $strSQLContent .= 'SELECT Content FROM scm_contenttexts t INNER JOIN scm_pages p '; $strSQLContent .= 'ON t.IDPage = p.IDPage '; $strSQLContent .= "WHERE NonActif = 0 AND UCASE(t.CodeLangue) = '" . strtoupper($_SESSION['strLangue']) . "' "; $strSQLContent .= "AND UCASE(p.PageName) = '" . fctSQLSlashes(strtoupper(CstrCurrentPageName)) . "' "; $strSQLContent .= "AND t.CodeText = '" . fctSQLSlashes($strCodeText) . "' "; $rsContent = $objConnMySQLCA->Execute($strSQLContent); if ($rsContent != false) $strReturn = $rsContent->fields['Content']; else $strReturn = ''; } return $strReturn; } /********* Récupère les traductions de messages d'informations ou d'erreurs *********/ function GetMessage($strCodeMessage) { $strSQLMessage = ''; $rsMessage = ''; $strReturn = ''; global $objConnMySQLCA; $strSQLMessage = ''; $strSQLMessage .= 'SELECT Message FROM scm_transmessages '; $strSQLMessage .= "WHERE UCASE(CodeLangue) = '" . strtoupper($_SESSION['strLangue']) . "' "; $strSQLMessage .= "AND CodeMessage = '" . fctSQLSlashes($strCodeMessage) . "' "; $rsMessage = $objConnMySQLCA->Execute($strSQLMessage); if ($rsMessage != false) $strReturn = $rsMessage->fields['Message']; else $strReturn = ''; return $strReturn; } /********* Récupère les traductions de libellé (textes succincts) *********/ function Label($strLabel) { $strSQLLabel = ''; $rsLabel = ''; $strReturn = ''; global $objConnMySQLCA; $strSQLLabel = ''; $strSQLLabel .= 'SELECT Label FROM scm_translabels '; $strSQLLabel .= "WHERE UCASE(CodeLangue) = '" . strtoupper($_SESSION['strLangue']) . "' "; $strSQLLabel .= "AND CodeLabel = '" . fctSQLSlashes($strLabel) . "' "; $rsLabel = $objConnMySQLCA->Execute($strSQLLabel); if ($rsLabel != false) { if ($rsLabel->fields['Label'] != '') $strReturn = $rsLabel->fields['Label']; else $strReturn = $strLabel; } else $strReturn = $strLabel; return $strReturn; } /********* Récupère le texte de référencement de la page en cours et l'affiche dans le tag TITLE *********/ function GetTitle() { $strSQLTitle = ''; $rsTitle = ''; $strReturn = ''; global $objConnMySQLCA; $strSQLTitle = ''; $strSQLTitle .= 'SELECT PageReference FROM scm_pages '; $strSQLTitle .= "WHERE UCASE(CodeLangue) = '" . strtoupper($_SESSION['strLangue']) . "' "; $strSQLTitle .= "AND UCASE(PageName) = '" . fctSQLSlashes(strtoupper(CstrCurrentPageName)) . "'"; $rsTitle = $objConnMySQLCA->Execute($strSQLTitle); if ($rsTitle != false) $strReturn = $rsTitle->fields['PageReference']; else $strReturn = ''; return $strReturn; } /********* Récupère les images pour une page *********/ function GetImage($strCodeImage) { $strSQLImage = ''; $rsImage = ''; $strReturn = ''; global $objConnMySQLCA; $strSQLImage = ''; $strSQLImage .= 'SELECT Image FROM scm_contentimages t INNER JOIN scm_pages p '; $strSQLImage .= 'ON t.IDPage = p.IDPage '; $strSQLImage .= "WHERE NonActif = 0 AND UCASE(t.CodeLangue) = '" . strtoupper($_SESSION['strLangue']) . "' "; $strSQLImage .= "AND UCASE(p.PageName) = '" . fctSQLSlashes(strtoupper(CstrCurrentPageName)) . "' "; $strSQLImage .= "AND t.CodeImage = '" . fctSQLSlashes($strCodeImage) . "' "; $rsImage = $objConnMySQLCA->Execute($strSQLImage); if ($rsImage != false) $strReturn = $rsImage->fields['Image']; else $strReturn = ''; return $strReturn; } /********* Récupère les traductions de texte (contenu de page au format HTML, longs textes) *********/ function GetFooterText($strCodeText) { $strSQLContent = ''; $rsContent = ''; $strReturn = ''; global $objConnMySQLCA; global $bPagePreviewBeforeSave; if ($bPagePreviewBeforeSave == true) { if (isset($_POST['txtContent_' . $strCodeText . '_' . $_SESSION['strLangue']])) $strReturn = stripslashes($_POST['txtContent_' . $strCodeText . '_' . $_SESSION['strLangue']]); else $strReturn = ''; } else { $strSQLContent = ''; $strSQLContent .= 'SELECT Content FROM scm_footer_texts '; $strSQLContent .= "WHERE UCASE(CodeLangue) = '" . strtoupper($_SESSION['strLangue']) . "' "; $strSQLContent .= "AND CodeText = '" . fctSQLSlashes($strCodeText) . "' "; $rsContent = $objConnMySQLCA->Execute($strSQLContent); if ($rsContent != false) $strReturn = $rsContent->fields['Content']; else $strReturn = ''; } return $strReturn; } ?>Execute($strSQL); while ($rsSQL->EOF != true) { $strReturn .= $rsSQL->fields['IDCategorie'] . ','; $strReturn .= fctGetSubCategories($rsSQL->fields['IDCategorie']); $rsSQL->MoveNext(); } return $strReturn; } /**************************************************************************************************************/ if($iIDCatWhois == 0){ $bIsFirstVisit = 1; // 1ère visite de la page pour affichage du titre simplifié (on n'affiche pas la catégorie) // Check si une catégorie doit être affichée par défaut au chargement de la page $strSQL = ''; $rsDefaultCat = ''; $strSQL .= "SELECT IDCategorie "; $strSQL .= 'FROM scm_whois_categories '; $strSQL .= 'WHERE NonActif = 0 AND IDParent = 0 '; $strSQL .= 'AND bDefaultSelected = 1'; $rsDefaultCat = $objConnMySQLCA->Execute($strSQL); if(is_object($rsDefaultCat)){ if($rsDefaultCat->EOF != true) $iIDCatWhois = $rsDefaultCat->fields['IDCategorie']; } } if($iIDCatWhois > 0){ if($iIDSubCatWhois == 0) { $strSQL = ''; $strSQL .= "SELECT COALESCE(IF(MetaTitle" . $_SESSION['strLangue'] . "='',NULL,MetaTitle" . $_SESSION['strLangue'] . "), Categorie" . $_SESSION['strLangue'] . ") AS Titre, "; $strSQL .= "COALESCE(IF(MetaDesc" . $_SESSION['strLangue'] . "='',NULL,MetaDesc" . $_SESSION['strLangue'] . "), Description" . $_SESSION['strLangue'] . ") AS Description, "; $strSQL .= "Categorie" . $_SESSION['strLangue'] . " AS Categorie, Intro" . $_SESSION['strLangue'] . " AS IntroPage, "; $strSQL .= "Content" . $_SESSION['strLangue'] . " AS ContentText, IncludeName, "; $strSQL .= "Content2" . $_SESSION['strLangue'] . " AS ContentText2 "; $strSQL .= "FROM scm_whois_categories "; $strSQL .= 'WHERE IDCategorie = ' . $iIDCatWhois; $rsTemp = $objConnMySQLCA->Execute($strSQL); } else { $strSQL = ''; $strSQL .= "SELECT COALESCE(IF(MetaTitle" . $_SESSION['strLangue'] . "='',NULL,MetaTitle" . $_SESSION['strLangue'] . "), Categorie" . $_SESSION['strLangue'] . ") AS Titre, "; $strSQL .= "COALESCE(IF(MetaDesc" . $_SESSION['strLangue'] . "='',NULL,MetaDesc" . $_SESSION['strLangue'] . "), Description" . $_SESSION['strLangue'] . ") AS Description, "; $strSQL .= "Categorie" . $_SESSION['strLangue'] . " AS Categorie, Intro" . $_SESSION['strLangue'] . " AS IntroPage, "; $strSQL .= "Content" . $_SESSION['strLangue'] . " AS ContentText, IncludeName, "; $strSQL .= "Content2" . $_SESSION['strLangue'] . " AS ContentText2 "; $strSQL .= "FROM scm_whois_categories "; $strSQL .= 'WHERE IDCategorie = ' . $iIDSubCatWhois; $rsTemp = $objConnMySQLCA->Execute($strSQL); } if($rsTemp->EOF != true){ if($rsTemp->fields['IntroPage'] != '') $strIntroPage = $rsTemp->fields['IntroPage']; if($rsTemp->fields['ContentText'] != '') $strContentText = $rsTemp->fields['ContentText']; if($rsTemp->fields['ContentText2'] != '') $strContentText2 = $rsTemp->fields['ContentText2']; if($rsTemp->fields['IncludeName'] != '') $strInclude = $rsTemp->fields['IncludeName']; // Référencement if($rsTemp->fields['Titre'] != '') $strTitlePageComplement = $rsTemp->fields['Titre']; if($rsTemp->fields['Description'] != '') $strDescriptionPageComplement = html_entity_decode(strip_tags($rsTemp->fields['Description']),ENT_QUOTES,'UTF-8'); // Fil d'Ariane if($rsTemp->fields['Categorie'] != '') { if($bIsFirstVisit == 0) $strWhoisTitle = $rsTemp->fields['Categorie']; } // Filtre catégories (actives) de 1er niveau $strReturn = ''; $strSQL = ''; $strSQL .= "SELECT IDCategorie, COALESCE(IF(Filter" . $_SESSION['strLangue'] . "='',NULL,Filter" . $_SESSION['strLangue'] . "), "; $strSQL .= "Categorie" . $_SESSION['strLangue'] . ") AS Categorie, bHighlight "; $strSQL .= 'FROM scm_whois_categories '; $strSQL .= 'WHERE NonActif = 0 AND IDParent = 0 '; $strSQL .= 'ORDER BY Ordre '; $rsFilter = $objConnMySQLCA->Execute($strSQL); /* Filtres pour niveau suivant */ $strSQL = ''; $strSQL .= "SELECT IDCategorie, COALESCE(IF(Filter" . $_SESSION['strLangue'] . "='',NULL,Filter" . $_SESSION['strLangue'] . "), Categorie" . $_SESSION['strLangue'] . ") AS Categorie "; $strSQL .= "FROM scm_whois_categories "; $strSQL .= 'WHERE IDParent = ' . intval($iIDCatWhois) . ' AND NonActif = 0 '; $strSQL .= 'ORDER BY Ordre '; $rsFilter1 = $objConnMySQLCA->Execute($strSQL); } } else { // Affichage de toutes les catégories (actives) de 1er niveau $strReturn = ''; $strSQL = ''; $strSQL .= "SELECT IDCategorie, COALESCE(IF(Filter" . $_SESSION['strLangue'] . "='',NULL,Filter" . $_SESSION['strLangue'] . "), "; $strSQL .= "Categorie" . $_SESSION['strLangue'] . ") AS Categorie, bHighlight "; $strSQL .= 'FROM scm_whois_categories '; $strSQL .= 'WHERE NonActif = 0 AND IDParent = 0 '; $strSQL .= 'ORDER BY Ordre '; $rsFilter = $objConnMySQLCA->Execute($strSQL); if($rsFilter->EOF != true){ while($rsFilter->EOF != true){ // Récupération de toutes les catégories actives pour affichage des activités $strReturn .= $rsFilter->fields['IDCategorie'] . ','; $strReturn .= fctGetSubCategories($rsFilter->fields['IDCategorie']); $rsFilter->MoveNext(); } $rsFilter->MoveFirst(); } } ?> Execute($strSQLInfo); if ($rsTitlePage->EOF != true) { $strTitlePage = $rsTitlePage->fields['MetaTitle']; $strDescriptionPage = $rsTitlePage->fields['MetaDesc']; if($rsTitlePage->fields['Image'] != '' && CstrCurrentPageName != 'index.php') $strImageBackground = 'url(Images/Background/Pages/' . $rsTitlePage->fields['Image'] . ') no-repeat center fixed'; } else $strTitlePage = CstrTitlePage; ?> <?($strTitlePageComplement != '') ? print $strTitlePageComplement : print $strTitlePage;?>