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); if($rsBGImg->fields['Image'] != '') $strImageBackground = 'url(Images/Background/Pages/' . $rsBGImg->fields['Image'] . ') no-repeat center fixed'; /********Annonce (Msg)******/ $strSQL = ''; $strSQL = 'SELECT IDAnnonce, Annonce' . $_SESSION['strLangue'] . ' AS Annonce, ' . $strSQL .= 'Description' . $_SESSION['strLangue'] . ' AS Description, '; $strSQL .= "DATE_FORMAT(DateDebut, '%d/%m/%Y') AS dDateDebut, DATE_FORMAT(DateDebut,'%d') AS dDayDebut, MONTH(DateDebut) AS dMonthDebut, YEAR(DateDebut) AS dYearDebut "; $strSQL .= 'FROM scm_annonces '; $strSQL .= 'WHERE NonActif = 0 '; $strSQL .= "AND DateDebut <= '" . date('Y-m-d') . "' "; $strSQL .= "AND DateFin >= '" . date('Y-m-d') . "' "; $strSQL .= 'ORDER BY DateDebut ASC '; $strSQL .= 'LIMIT 1'; $rsAnnonces = $objConnMySQLCA->Execute($strSQL); /**************************************************************************************************************/ function fctGetSubCategories($iIDCategory) { $strReturn = ''; $strSQL = ''; $rsSQL = ''; global $objConnMySQLCA; $strSQL = ''; $strSQL .= 'SELECT IDCategorie FROM scm_act_categories '; $strSQL .= 'WHERE IDParent = ' . intval($iIDCategory) . ' AND NonActif = 0 '; $strSQL .= 'ORDER BY Ordre '; $rsSQL = $objConnMySQLCA->Execute($strSQL); while ($rsSQL->EOF != true) { $strReturn .= $rsSQL->fields['IDCategorie'] . ','; $strReturn .= fctGetSubCategories($rsSQL->fields['IDCategorie']); $rsSQL->MoveNext(); } return $strReturn; } /*************Affichage de toutes les catégories (actives) de 1er niveau du groupe**********************/ $strReturn = ''; $rsFilter = ''; $strSQL = ''; $strSQL .= "SELECT IDCategorie "; $strSQL .= 'FROM scm_act_categories '; $strSQL .= 'WHERE NonActif = 0 '; $strSQL .= 'ORDER BY IDCategorie'; $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(); } /*************Exemples d'activités (x4 en bas de page)************/ if($strReturn != ''){ $strChaine = ''; $strChaine = substr($strReturn,0,strrpos($strReturn, ',')); $strSQL = ''; $strSQL = 'SELECT act.IDActivite, act.Activite' . $_SESSION['strLangue'] . ' AS Activite, SubTitle' . $_SESSION['strLangue'] . ' AS SubTitle, '; $strSQL .= 'act.Introduction' . $_SESSION['strLangue'] . ' AS Intro, '; $strSQL .= 'cat.IDCategorie, Categorie' . $_SESSION['strLangue'] . ' AS Categorie, Groupe' . $_SESSION['strLangue'] . ' AS Groupe, g.Page AS PageTo, '; $strSQL .= "COALESCE(dDateDebut,COALESCE(dDate1,'')) AS DateDebut, "; $strSQL .= '(SELECT Image FROM scm_images i INNER JOIN scm_rel_act_images ri ON i.IDImage = ri.IDImage WHERE ri.IDActivite = act.IDActivite AND i.NonActif = 0 ORDER BY ri.Ordre LIMIT 1) as Photo '; $strSQL .= 'FROM scm_activites act LEFT OUTER JOIN scm_rel_act_categories rel ON act.IDActivite = rel.IDActivite '; $strSQL .= 'LEFT OUTER JOIN scm_act_categories cat ON rel.IDCategorie = cat.IDCategorie '; $strSQL .= 'LEFT OUTER JOIN scm_rel_act_catgroupes rcg ON cat.IDCategorie = rcg.IDCategorie OR cat.IDParent = rcg.IDCategorie '; $strSQL .= 'LEFT OUTER JOIN scm_act_groupes g ON g.IDGroupe = rcg.IDGroupe '; $strSQL .= 'WHERE bDisplayHome = 1 '; //$strSQL .= 'AND cat.IDCategorie IN (' . $strChaine . ') '; $strSQL .= "AND dDateDebut IS NULL AND dDate1 IS NULL AND dDateFin IS NULL "; $strSQL .= 'AND act.NonActif = 0 AND cat.NonActif = 0 '; $strSQL .= 'ORDER BY DateDebut, rel.Ordre, Activite '; $strSQL .= 'LIMIT 4'; $rsExampleAct = $objConnMySQLCA->Execute($strSQL); } /*************Activités/événements (x3)************/ $strSQL = ''; $strSQL = 'SELECT act.IDActivite, act.Activite' . $_SESSION['strLangue'] . ' AS Activite, SubTitle' . $_SESSION['strLangue'] . ' AS SubTitle, '; $strSQL .= 'act.Lieu' . $_SESSION['strLangue'] . ' AS Lieu, '; $strSQL .= 'act.Introduction' . $_SESSION['strLangue'] . ' AS Intro, '; $strSQL .= 'act.Description' . $_SESSION['strLangue'] . ' AS Description, '; $strSQL .= 'cat.IDCategorie, Categorie' . $_SESSION['strLangue'] . ' AS Categorie, Groupe' . $_SESSION['strLangue'] . ' AS Groupe, g.Page AS PageTo, '; $strSQL .= '(SELECT Image FROM scm_images i INNER JOIN scm_rel_act_images ri ON i.IDImage = ri.IDImage WHERE ri.IDActivite = act.IDActivite AND i.NonActif = 0 ORDER BY ri.Ordre LIMIT 1) as Photo, '; $strSQL .= "COALESCE(dDateDebut,COALESCE(dDate1,'')) AS DateDebut, DATE_FORMAT(dDateDebut,'%d') AS dDayDebut, MONTH(dDateDebut) AS dMonthDebut, DATE_FORMAT(dDateDebut,'%Y') AS dYearDebut, "; $strSQL .= "COALESCE(dDateFin,'') AS DateFin, DATE_FORMAT(dDateFin,'%d') AS dDayFin, MONTH(dDateFin) AS dMonthFin, DATE_FORMAT(dDateFin,'%Y') AS dYearFin, "; $strSQL .= 'bSeparateDates, '; $strSQL .= "COALESCE(dDate1,'') AS Date1, DATE_FORMAT(dDate1,'%d') AS dDay1, MONTH(dDate1) AS dMonth1, DATE_FORMAT(dDate1,'%Y') AS dYear1, "; $strSQL .= "COALESCE(dDate2,'') AS Date2, DATE_FORMAT(dDate2,'%d') AS dDay2, MONTH(dDate2) AS dMonth2, DATE_FORMAT(dDate2,'%Y') AS dYear2, "; $strSQL .= "COALESCE(dDate3,'') AS Date3, DATE_FORMAT(dDate3,'%d') AS dDay3, MONTH(dDate3) AS dMonth3, DATE_FORMAT(dDate3,'%Y') AS dYear3, "; $strSQL .= "COALESCE(dDate4,'') AS Date4, DATE_FORMAT(dDate4,'%d') AS dDay4, MONTH(dDate4) AS dMonth4, DATE_FORMAT(dDate4,'%Y') AS dYear4, "; $strSQL .= "COALESCE(dDate5,'') AS Date5, DATE_FORMAT(dDate5,'%d') AS dDay5, MONTH(dDate5) AS dMonth5, DATE_FORMAT(dDate5,'%Y') AS dYear5 "; $strSQL .= 'FROM scm_activites act LEFT OUTER JOIN scm_rel_act_categories rel ON act.IDActivite = rel.IDActivite '; $strSQL .= 'LEFT OUTER JOIN scm_act_categories cat ON rel.IDCategorie = cat.IDCategorie '; $strSQL .= 'LEFT OUTER JOIN scm_rel_act_catgroupes rcg ON (cat.IDCategorie = rcg.IDCategorie OR cat.IDParent = rcg.IDCategorie) '; $strSQL .= 'LEFT OUTER JOIN scm_act_groupes g ON g.IDGroupe = rcg.IDGroupe '; $strSQL .= 'WHERE bDisplayHome = 1 '; $strSQL .= "AND ((dDateDebut <> '0000-00-00' AND dDateDebut >= DATE_FORMAT(NOW(), '%Y/%m/%d')) AND (dDate1 IS NULL OR (dDate1 <> '0000-00-00' AND dDate1 >= DATE_FORMAT(NOW(), '%Y/%m/%d'))) OR (dDateFin <> '0000-00-00' AND dDateFin >= DATE_FORMAT(NOW(), '%Y/%m/%d'))) "; $strSQL .= 'AND act.NonActif = 0 AND cat.NonActif = 0 '; $strSQL .= 'ORDER BY DateDebut ASC '; $strSQL .= 'LIMIT 3'; $rsAct = $objConnMySQLCA->Execute($strSQL); ?> 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;?>