= 4.3 ini_set('session.use_trans_sid', '0'); ini_set('url_rewriter.tags', ''); } else include('inc/PHP/fonctions/session_aol.inc.php'); session_start(); if (isset($_GET['language'])) { //Les internautes non AOL $_SESSION['language'] = $_GET['language']; //header("Location: index.php?rubrique_id=".$rubrique_id); } // ////////////////////////////////////////////////////// ////////////////////////////////////////////////////// /* les variables automatiques */ $VARIABLES = array(); $VARIABLES['language'] = (isset($_SESSION['language'])) ? $_SESSION['language'] : "fr"; $VARIABLES['nom_page'] = substr($_SERVER['PHP_SELF'], 1 + strrpos($_SERVER['PHP_SELF'], "/")); if ($VARIABLES['nom_page'] == "aide.php" && !isset($_SESSION['admin_infos']['id'])) { header("Location: index.php"); exit; } $_SESSION['url_avant_page'] = (substr($_SERVER['HTTP_HOST'], 0, 3) != 192 ) ? "/" : substr($_SERVER['PHP_SELF'], 0, strrpos($_SERVER['PHP_SELF'], "/") + 1); //echo $_SESSION['url_avant_page']; $VARIABLES['nbre_requette'] = 1; $VARIABLES['DEBUG'] = (isset($_SESSION['admin_infos']) && isset($_GET['debug'])) ? true : false; //($_SERVER['HTTP_HOST'] != "192.168.0.2") ? false : true; $VARIABLES['today'] = date("Y-m-d"); $VARIABLES['today_and_now'] = date("Y-m-d H:i:s"); $VARIABLES['today_month'] = date("m"); $VARIABLES['today_year'] = date("Y"); $VARIABLES['prefixe_tbl'] = ($VARIABLES['nom_page'] == "aide.php") ? "aide_" : "sgc" . $VARIABLES['language'] . "_"; $VARIABLES['suffixe_img'] = ($VARIABLES['nom_page'] == "aide.php") ? "_aide" : "_" . $VARIABLES['language']; $VARIABLES['autoriser'] = array(); $VARIABLES['options'] = array(); $VARIABLES['derniere_maj'] = array(); //tableau des types de pages accessibles en admin dans "dernières mise a jour" $VARIABLES['derniere_maj'][] = "pages"; $VARIABLES['session_permanante'] = TRUE; $VARIABLES['droits_affichage'] = array(); // ////////////////////////////////////////////////////// ////////////////////////////////////////////////////// /* A CONTROLER = tous les chemins et tailles max... */ // $VARIABLES['chemin_upload'] = array(); $VARIABLES['chemin_upload']['images'] = array(); $VARIABLES['chemin_upload']['images']['illu_paragraphe'] = "images/illustrations/"; $VARIABLES['chemin_upload']['images']['logos_liens'] = "images/logos_liens" . $VARIABLES['suffixe_img'] . "/"; $VARIABLES['chemin_upload']['images']['boutique'] = "images/imagesFCK/image/boutique/"; $VARIABLES['chemin_upload']['images']['publications'] = "images/imagesFCK/image/CS/"; $VARIABLES['chemin_upload']['images']['illu_pages'] = "images/illustrations" . $VARIABLES['suffixe_img'] . "/"; $VARIABLES['chemin_upload']['images']['illu_ref'] = "images/illustrations/"; $VARIABLES['chemin_upload']['images']['logo_str'] = "images/logos/"; $VARIABLES['chemin_upload']['images']['diaporama'] = "images/imagesFCK/image/diaporamas/"; $VARIABLES['chemin_upload']['images']['illustration_mp3'] = "images/illu_listemp3" . $VARIABLES['suffixe_img'] . "/"; $VARIABLES['chemin_upload']['images']['galerie'] = "images/galeries" . $VARIABLES['suffixe_img'] . "/"; $VARIABLES['chemin_upload']['images']['photos_bandeau'] = "images/photos_bandeau/"; $VARIABLES['chemin_upload']['images']['logos_partenaires'] = "images/logos_partenaires/"; $VARIABLES['chemin_upload']['images']['logo_section'] = "images/logos_sections/"; $VARIABLES['chemin_upload']['images']["photos_annonces"] = "images/photos_annonces/"; $VARIABLES['chemin_upload']['doc'] = array(); $VARIABLES['chemin_upload']['doc']['coll_droite'] = "docs/col_droite/"; $VARIABLES['chemin_upload']['doc']['rdv'] = "docs/rdv/"; $VARIABLES['chemin_upload']['doc']['paragraphe'] = "docs/paragraphe/"; $VARIABLES['chemin_upload']['doc']['articles_boutique'] = "images/imagesFCK/file/boutique/"; $VARIABLES['chemin_upload']['doc']['publications'] = "images/imagesFCK/file/CS/"; $VARIABLES['chemin_upload']['doc']['annonce'] = "images/imagesFCK/file/Annonces/"; // $VARIABLES['max_size_upload'] = array(); $VARIABLES['max_size_upload']['images'] = array(); $VARIABLES['max_size_upload']['images']['illu_paragraphe'] = 60000; //60Ko max $VARIABLES['max_size_upload']['images']['illu_lien'] = 30000; //30Ko max $VARIABLES['max_size_upload']['images']['logo_str'] = 40000; //40Ko max $VARIABLES['max_size_upload']['images']['galerie'] = 2000000; // 2 Mo car image redimenssionnee, de toute façon... // $VARIABLES['options_images'] = array(); $VARIABLES['options_images']['imagemagik'] = false; // /* */ // ////////////////////////////////////////////////////// require_once('variables_spec.inc.php'); $VARIABLES['classification']['fr'] = "Syndicat,agriculture"; $VARIABLES['mots_intactes_url']['fr'] = array( "agricole", "agriculture", "semence", "paysan", "paysanne", "biodiversite", "variete", "cereale", "potagere", "selection", "participative", "condamnation", "resistance", "derogation", "utilisation", "boulangerie", "definition", "conservation", "mouvement", "confederation", "changement", "climatique", "solidarite", "renovation", "alimentaire", "organisation", "autorisation", "pnpp", "interprofession", "conference", "travailleur", "saisonnier", "agricoles", "agricultures", "semences", "paysans", "paysannes", "biodiversites", "varietes", "cereales", "potageres", "selections", "participatives", "definitions", "condamnations", "mouvements", "changements", "climatiques", "solidarites", "renovations", "alimentaires", "organisations", "autorisations", "conferences", "travailleurs", "saisonniers" ); ////////////////////////////////////////////////////// /* VARIABLES GENERALES A PARAMETRER */ // // // MENUS DE NAVIGATIONS // // $les_barres_nav = array(); $les_barres_nav[1] = "haut"; $les_barres_nav[2] = "gauche 1"; //$les_barres_nav[3]="gauche 2"; $les_barres_nav[101] = "bas_page"; // // // // LE SITE DIFFUSE UN FLUX RSS ? // // $VARIABLES['autoriser']['flux_css'] = true; $VARIABLES['afficher_agenda_flux'] = true; $VARIABLES['afficher_actu_flux'] = true; // // // TITRES @ CLASSIFICATION // // // STATISTIQUES // // $VARIABLES['autoriser']['google-analytics'] = true; if ($VARIABLES['_uacct'] != "UA-xxxxxxx-xx" // si j'ai renseigné le _uacct && substr($_SERVER['HTTP_HOST'], 0, 3) != 192 // si je suis pas en local && !isset($_SESSION['admin_infos']['id'])) //si je suis pas en mode admin $VARIABLES['autoriser']['google-analytics'] = true; //alors j'affiche le code google-analytics $VARIABLES['autoriser']['statistiques'] = false; //statistiques internes // // // UTILISATION DU CACHE // // $VARIABLES['autoriser']['cache'] = false; $VARIABLES['options']['cache'] = array(); $VARIABLES['options']['cache']['rep_cache'] = "MauRycacHe"; //repertoire des pages cachees $VARIABLES['options']['cache']['duree_cache'] = 7200; //duree de vide des pages cachees en seconde // // // REGLAGES DES POSSIBILITÉS D'ADMIN // // $VARIABLES['autoriser']['deplacerpage'] = true; $VARIABLES['autoriser']['nouvellespages'] = true; $VARIABLES['autoriser']['MultiAdminist'] = true; $VARIABLES['options']['gestion_meta'] = true; // // // COLONNE DE DROITE // // $VARIABLES['autoriser']['ColoDroi'] = true; if ($VARIABLES['autoriser']['ColoDroi']) { $imprime_coldroite = true; $VARIABLES['options']['ColoDroi'] = array(); $VARIABLES['options']['ColoDroi']['coldroite_multiple'] = true; //autorise l'affichage d'une info coldroite sur d'autres pages $VARIABLES['options']['ColoDroi']['facultative'] = true; //autorise le reglage par page de l'affichage ou non de la colonne de droite $VARIABLES['options']['ColoDroi']['ignorer_titre'] = array("sans titre", "photo"); //ignore certain titres de colDroite // // SYNDICATION DANS COLDROITE ? // $VARIABLES['autoriser']['Syndicat'] = true; $VARIABLES['options']['Syndicat']['titre_coldroite'] = "Flux RSS ..."; } // // // REGLAGE MODE ADMIN // // $modif_cachee = false; // = autorise les modifs anonymes $modif_panel = true; // = affiche le cartouche de droite dans menu admin // ////////////////////////////////////////////////////// // $VARIABLES['sitesize'] = array(); $VARIABLES['sitesize']['corps'] = 520; $VARIABLES['sitesize']['diapo_width'] = $VARIABLES['sitesize']['corps']; $VARIABLES['sitesize']['video_width'] = $VARIABLES['sitesize']['corps']; $VARIABLES['sitesize']['video_height'] = (0.8 * $VARIABLES['sitesize']['corps']); $VARIABLES['sitesize']['galerie_width'] = round(($VARIABLES['sitesize']['corps'] - 22) / 3); $VARIABLES['sitesize']['galerie_height'] = round($VARIABLES['sitesize']['galerie_width'] * 3 / 4); ////////////////////////////////////////////////////// /* FONCTIONNALITÉS (HORS TYPES DE PAGES) */ // // // // LES ACTUALITES // // $VARIABLES['autoriser']['Actualite'] = ($VARIABLES['nom_page'] == "aide.php") ? false : true; if ($VARIABLES['autoriser']['Actualite']) { $VARIABLES['options']['Actualite'] = array(); $VARIABLES['options']['Actualite']['id_page'] = 0; //laisser 0 pour permettre les actus partout dans le site $VARIABLES['options']['Actualite']['picto'] = 'picto_actu'; $VARIABLES['options']['Actualite']['nbr_coldroite_theme'] = 5; //nombre d'actualites dans col droite du meme theme $VARIABLES['options']['Actualite']['nbr_coldroite_diff'] = 5; //nombre d'actualite dans col droite d'autres themes $VARIABLES['options']['Actualite']['types'] = array("cdp" => "Communiqué de presse", "aam" => "Appel à mobilisation", "" => "Actualité"); //les types d'actualites //$VARIABLES['options']['Actualite']['types']["defaut"] = "Actualité"; $VARIABLES['options']['Actualite']['themes'] = true; // donne t-on des thèmes aux actus ? //$VARIABLES['options']['Actualite']["titre_coldroite"] = "Actualités"; $VARIABLES['derniere_maj'][] = "actualités"; } // // // PARAGRAPHES SPÉCIAUX : DIAPORAMAS // // $VARIABLES['autoriser']['DiapoPage'] = true; if ($VARIABLES['autoriser']['DiapoPage']) { $VARIABLES['options']['DiapoPage'] = array(); $VARIABLES['options']['DiapoPage']['photos_clicable'] = true; $VARIABLES['options_images']['diaporama_photos'] = array(); $VARIABLES['options_images']['diaporama_photos']['max_size_image'] = array("1" => $VARIABLES['sitesize']['diapo_width'] . "x" . $VARIABLES['sitesize']['diapo_width'], "2" => "920x600"); $VARIABLES['options_images']['diaporama_photos']['rep_images'] = "diaporama"; $VARIABLES['options_images']['diaporama_photos']['nom_images'] = "photo"; $VARIABLES['options_images']['diaporama_acc_photos'] = array(); $VARIABLES['options_images']['diaporama_acc_photos']['max_size_image'] = array("1" => "f325x165", "2" => "920x600"); $VARIABLES['options_images']['diaporama_acc_photos']['rep_images'] = "diaporama"; $VARIABLES['options_images']['diaporama_acc_photos']['nom_images'] = "photodiapacc"; } // // PARAGRAPHES SPÉCIAUX : GALERIES // // $VARIABLES['autoriser']['GaleriePhoto'] = true; if ($VARIABLES['autoriser']['GaleriePhoto']) { $VARIABLES['options']['GaleriePhoto'] = array(); $VARIABLES['options']['GaleriePhoto']['photos_clicable'] = true; $VARIABLES['options']['GaleriePhoto']['nbr_colonne'] = 3; $VARIABLES['options_images']['galerie_photos'] = array(); $VARIABLES['options_images']['galerie_photos']['max_size_image'] = array("1" => $VARIABLES['sitesize']['galerie_width'] . "x" . $VARIABLES['sitesize']['galerie_height'], "2" => "920x600"); $VARIABLES['options_images']['galerie_photos']['rep_images'] = "diaporama"; $VARIABLES['options_images']['galerie_photos']['nom_images'] = "galeriePage"; } // // // PARAGRAPHES SPÉCIAUX : VIDEO PARTAGEE (YOU-TUBE OU DAILYMOTION) // // $VARIABLES['autoriser']['Video'] = true; if ($VARIABLES['autoriser']['Video']) { $VARIABLES['options']['Video'] = array(); $VARIABLES['options']['Video']['largeur_max1'] = $VARIABLES['sitesize']['video_width']; $VARIABLES['options']['Video']['hauteur_max1'] = $VARIABLES['sitesize']['video_height']; } // // // PARAGRAPHES SPÉCIAUX : LISTES MP3 // // $VARIABLES['autoriser']['ListeMp3'] = true; if ($VARIABLES['autoriser']['ListeMp3']) { $VARIABLES['options']['infos_disque'] = array(); $VARIABLES['options']['infos_disque']['photos_clicable'] = false; $VARIABLES['options']['infos_disque']['autoriser_illustration'] = false; $VARIABLES['chemin_upload']['doc']['liste_mp3'] = "images/mp3" . $VARIABLES['suffixe_img'] . "/"; } // // // LE MOTEUR DE RECHERCHE // // Si true, penser à configurer : // [la_page.php] > emplacement du formulaire dans une des nav // [inc/PHP/affichage/articles.inc.php] > format $VARIABLES['autoriser']['recherche'] = true; // // // EXTRANET // // Si true, penser à configurer : // [inc/PHP/pages/form_extranet.inc.php] > format $VARIABLES['autoriser']['ajouterextranet'] = false; // // // LA PAGE INFOS LEGALES // $VARIABLES['id_page_infos_legales'] = 11; // // // LETTRE ELECTRONIQUE MAILLING LIST // // $VARIABLES['options']['MailList'] = array(); $VARIABLES['options']['MailList']['menuG'] = false; $VARIABLES['options']['MailList']['titre'] = $VARIABLES['titre_mailing-list']; // <- a personnaliser $VARIABLES['options']['MailList']['sleep'] = 4; $VARIABLES['options']['MailList']['max_slepp'] = 80; $VARIABLES['options']['MailList']['qtranche'] = 125; // // // PHOTOS BANDEAUX DU HAUT ADMINISTRABLES // // $VARIABLES['autoriser']['bandeau'] = false; //$VARIABLES['options']['bandeau'] = array(); //$VARIABLES['options']['bandeau']['type_page'] = array(1); if ($VARIABLES['autoriser']['bandeau']) { $VARIABLES['options']['bandeau'] = array(); $VARIABLES['options']['bandeau']['hspace'] = 3; $VARIABLES['options']['bandeau']['largeur_max'] = 770; $VARIABLES['options']['bandeau']['hauteur_max'] = 100; $VARIABLES['options_images']['photos_bandeau'] = array(); $VARIABLES['options_images']['photos_bandeau']['max_size_image'] = array("1" => $VARIABLES['options']['bandeau']['largeur_max'] . "x" . $VARIABLES['options']['bandeau']['hauteur_max']); $VARIABLES['options_images']['photos_bandeau']['rep_images'] = "photos_bandeau"; $VARIABLES['options_images']['photos_bandeau']['nom_images'] = "photo"; } // // // LOGOS PARTENAIRES ADMINISTRABLES // // $VARIABLES['autoriser']['logos_partenaire'] = true; if ($VARIABLES['autoriser']['logos_partenaire']) { $VARIABLES['options_images']['logos_partenaires'] = array(); $VARIABLES['options_images']['logos_partenaires']['max_size_image'] = array("1" => "140x140"); $VARIABLES['options_images']['logos_partenaires']['rep_images'] = "logos_partenaires"; $VARIABLES['options_images']['logos_partenaires']['nom_images'] = "photo"; } // // // illustrations des pages // // $VARIABLES['autoriser']['illu_pages'] = true; if ($VARIABLES['autoriser']['illu_pages']) { $VARIABLES['options_images']['groupes_pages'] = array(); $VARIABLES['options_images']['groupes_pages']['max_size_image'] = array("1" => "f100x100"); $VARIABLES['options_images']['groupes_pages']['rep_images'] = "illu_pages"; $VARIABLES['options_images']['groupes_pages']['nom_images'] = "photo"; } // ////////////////////////////////////////////////////// ////////////////////////////////////////////////////// /* LES MENUS ADMIN : A CONTROLER */ // if (isset($_SESSION['admin_infos'])) { $VARIABLES['ParaPage'] = array(); $VARIABLES['ElemPage'] = array(); $VARIABLES['Administ'] = array(); // $VARIABLES['ElemPage'][0] = array(); $VARIABLES['ElemPage'][0]['MenuAdminAjout'] = array(); if ($VARIABLES['autoriser']['Actualite'] && ($VARIABLES['options']['Actualite']['id_page'] == 0 || $rubrique_id == $VARIABLES['options']['Actualite']['id_page'])) $VARIABLES['ElemPage'][0]['MenuAdminAjout']['Actualite'] = "Une actualité"; $VARIABLES['ElemPage'][0]['MenuAdminAjout']['Paragrap'] = "Une zone de texte"; if ($VARIABLES['autoriser']['DiapoPage']) $VARIABLES['ElemPage'][0]['MenuAdminAjout']['PhotoDiapo'] = "Un diaporama"; if ($VARIABLES['autoriser']['GaleriePhoto']) $VARIABLES['ElemPage'][0]['MenuAdminAjout']['PhotoGalerie'] = "Une galerie photo"; if ($VARIABLES['autoriser']['Video']) $VARIABLES['ElemPage'][0]['MenuAdminAjout']['UrlVideo'] = "Une vidéo"; if ($VARIABLES['autoriser']['ListeMp3']) $VARIABLES['ElemPage'][0]['MenuAdminAjout']['ListeMp3'] = "Une liste de mp3"; if ($VARIABLES['autoriser']['ColoDroi']) $VARIABLES['ElemPage'][0]['MenuAdminAjout']['ColoDroi'] = "Une info colonne de droite"; if ($VARIABLES['autoriser']['Syndicat']) $VARIABLES['ElemPage'][0]['MenuAdminAjout']['Syndicat'] = "Un Flux RSS (Col. droite)"; // $VARIABLES['Administ'][0] = array(); $VARIABLES['Administ'][0]['MenuSupAdminAjout'] = array(); if ($VARIABLES['autoriser']['Extranet'] && $VARIABLES['INFOS_SITE']['type_extranet'] == "multi" && $_SESSION['admin_infos']['statut'] == "sadmin") $VARIABLES['Administ'][0]['MenuSupAdminAjout']['ProfilExtra'] = "Un profil espace privé"; if ($VARIABLES['autoriser']['MultiAdminist']) $VARIABLES['Administ'][0]['MenuSupAdminAjout']['Administ'] = "Un administrateur"; if ($VARIABLES['autoriser']['MailList']) { $VARIABLES['Administ'][0]['MenuSupAdminAjout']['MailList'] = "Une lettre électronique"; $VARIABLES['Administ'][0]['MenuSupAdminAjout']['EmailML'] = "Des abonnés à la lettre"; } $VARIABLES['ParaPage'][0] = array(); $VARIABLES['ParaPage'][0]['MenuAdminModif'] = array(); //$VARIABLES['ParaPage'][0]['MenuAdminModif']['MiniFich&modif_id=[T>ididid "150x150", "2" => "600x600"); $VARIABLES['options_images']['articles_boutique']['colonne_image'] = 150; $VARIABLES['options_images']['articles_boutique']['rep_images'] = "boutique"; $VARIABLES['options_images']['articles_boutique']['nom_images'] = "photo"; $VARIABLES['derniere_maj'][] = "boutique"; } // // // 5- PAGES PUBLICATION // // $VARIABLES['GrouPage'][4] = array(); $VARIABLES['GrouPage'][4]['autoriser'] = true; // <- A regler autorisation if ($VARIABLES['GrouPage'][4]['autoriser']) { $VARIABLES['GrouPage'][4]['autoriser_nouveau'] = false; // <- A regler autorisation $VARIABLES['GrouPage'][4]['typegroupe'] = false; $VARIABLES['GrouPage'][4]['denomination'] = "Page Publication"; $VARIABLES['GrouPage'][4]['MenuAdminAjout'] = "Une " . strtolower($VARIABLES['GrouPage'][4]['denomination']); $VARIABLES['GrouPage'][4]['MenuAdminModif'] = "Les paramètres de cette page"; $VARIABLES['GrouPage'][4]['genre'] = "e"; $VARIABLES['GrouPage'][4]['picto'] = 'picto_page'; $VARIABLES['ElemPage'][4] = array(); $VARIABLES['ElemPage'][4]['MenuAdminAjout'] = array(); $VARIABLES['ElemPage'][4]['MenuAdminAjout']['Publicat'] = "Un n° CS"; $VARIABLES['ParaPage'][4] = array(); $VARIABLES['ParaPage'][4]['autoriser_ColoDroi'] = true; $VARIABLES['ParaPage'][4]['autoriser_Actu'] = true; $VARIABLES['ParaPage'][4]['MenuAdminModif'] = array(); $VARIABLES['ParaPage'][4]['MenuAdminModif']['Publicat&modif_id=[T>id_cs "f110x156"); $VARIABLES['options_images']['publications']['rep_images'] = "publications"; $VARIABLES['options_images']['publications']['nom_images'] = "couv"; } // // // 5- PAGES DE CONTENU // // $VARIABLES['GrouPage'][5] = array(); $VARIABLES['GrouPage'][5]['autoriser'] = true; // <- A regler autorisation if ($VARIABLES['GrouPage'][5]['autoriser']) { $VARIABLES['GrouPage'][5]['autoriser_nouveau'] = true; // <- A regler autorisation $VARIABLES['GrouPage'][5]['typegroupe'] = false; $VARIABLES['GrouPage'][5]['denomination'] = "Page"; $VARIABLES['GrouPage'][5]['MenuAdminAjout'] = "Une " . strtolower($VARIABLES['GrouPage'][5]['denomination']); $VARIABLES['GrouPage'][5]['MenuAdminModif'] = "Les paramètres de cette page"; $VARIABLES['GrouPage'][5]['genre'] = "e"; $VARIABLES['GrouPage'][5]['picto'] = 'picto_page'; $VARIABLES['ParaPage'][5] = array(); $VARIABLES['ParaPage'][5]['autoriser_ColoDroi'] = true; $VARIABLES['ParaPage'][5]['autoriser_Actu'] = true; } // // // 6- PAGES AGENDA // // $VARIABLES['GrouPage'][6] = array(); $VARIABLES['GrouPage'][6]['autoriser'] = ($VARIABLES['nom_page'] == "aide.php") ? false : true; // <- A regler autorisation if ($VARIABLES['GrouPage'][6]['autoriser']) { $VARIABLES['GrouPage'][6]['autoriser_nouveau'] = true; // <- A regler autorisation $VARIABLES['GrouPage'][6]['typegroupe'] = false; $VARIABLES['GrouPage'][6]['denomination'] = "Agenda"; $VARIABLES['GrouPage'][6]['MenuAdminAjout'] = "Un " . strtolower($VARIABLES['GrouPage'][6]['denomination']); $VARIABLES['GrouPage'][6]['MenuAdminModif'] = "Les paramètres de cette page"; $VARIABLES['GrouPage'][6]['genre'] = ""; $VARIABLES['GrouPage'][6]['picto'] = 'picto_agenda'; $VARIABLES['ElemPage'][6] = array(); $VARIABLES['ElemPage'][6]['MenuAdminAjout'] = array(); $VARIABLES['ElemPage'][6]['MenuAdminAjout']['DateRdv'] = "Une date agenda"; $VARIABLES['ParaPage'][6] = array(); $VARIABLES['ParaPage'][6]['autoriser_ColoDroi'] = true; $VARIABLES['ParaPage'][6]['autoriser_Actu'] = true; $VARIABLES['ParaPage'][6]['MenuAdminModif'] = array(); $VARIABLES['ParaPage'][6]['MenuAdminModif']['ThemRdv'] = "Les thèmes de cet agenda"; // // les options // $VARIABLES['options']['Agenda'] = array(); $VARIABLES['options']['Agenda']['proposer_themes'] = true; $VARIABLES['options']['Agenda']['masquer_afficher'] = true; $VARIABLES['options']['Agenda']['commentaire_dates'] = true; $VARIABLES['options']['Agenda']['afficher_jour_semaine'] = true; $VARIABLES['options']['Agenda']['afficher_annee'] = true; $VARIABLES['options']['Agenda']['horaires'] = true; $VARIABLES['options']['Agenda']['sous_titre'] = true; $VARIABLES['options']['Agenda']['lieu_detail'] = true; $VARIABLES['options']['Agenda']['nbre_min_fiche_pour_menu'] = 2; //nb de dates a partir duquel on affiche le sommaire (false pour aucun) $VARIABLES['options']['Agenda']['signaler_cold_pages'] = true; $VARIABLES['options']['Agenda']['titre_coldroite'] = "Agenda"; $VARIABLES['options']['Agenda']['nbre_jour_perimee'] = 0; $VARIABLES['derniere_maj'][] = "rendez-vous"; } // // // 7- PAGES LIENS // // $VARIABLES['GrouPage'][7] = array(); $VARIABLES['GrouPage'][7]['autoriser'] = ($VARIABLES['nom_page'] == "aide.php") ? false : true; // <- A regler autorisation if ($VARIABLES['GrouPage'][7]['autoriser']) { $VARIABLES['GrouPage'][7]['autoriser_nouveau'] = true; // <- A regler autorisation $VARIABLES['GrouPage'][7]['typegroupe'] = false; $VARIABLES['GrouPage'][7]['denomination'] = "Page Liens"; $VARIABLES['GrouPage'][7]['MenuAdminAjout'] = "Une " . strtolower($VARIABLES['GrouPage'][7]['denomination']); $VARIABLES['GrouPage'][7]['MenuAdminModif'] = "Les paramètres de cette page"; $VARIABLES['GrouPage'][7]['genre'] = "e"; $VARIABLES['GrouPage'][7]['picto'] = 'picto_liens'; $VARIABLES['ParaPage'][7] = array(); $VARIABLES['ParaPage'][7]['autoriser_ColoDroi'] = true; $VARIABLES['ParaPage'][7]['autoriser_Actu'] = true; $VARIABLES['ElemPage'][7] = array(); $VARIABLES['ElemPage'][7]['MenuAdminAjout'] = array(); $VARIABLES['ElemPage'][7]['MenuAdminAjout']['Lien'] = "Un nouveau lien"; // // les options // $VARIABLES['options']['Liens'] = array(); $VARIABLES['options']['Liens']['proposer_themes'] = true; // le système doit-il proposer le choix d'un thème par lien ? if ($VARIABLES['options']['Liens']['proposer_themes']) { $VARIABLES['options']['Liens']['ranger_par_theme'] = false; //doit-on pouvoir ranger les liens dans des thèmes $VARIABLES['options']['Liens']['menu_themes_detaille'] = false; // le système doit-il afficher la liste des titres dans le menu des themes ? $VARIABLES['options']['Liens']['nbre_min_fiche_pour_menu'] = 2; // nombre de fiche minimum pour afficher le menu des thèmes $VARIABLES['ParaPage'][7]['MenuAdminModif'] = array(); $VARIABLES['ParaPage'][7]['MenuAdminModif']['ThemLiens'] = "Les thèmes de liens"; } $VARIABLES['options']['Liens']['logos_liens'] = true; //doit-on pouvoir uploader une image par lien if ($VARIABLES['options']['Liens']['logos_liens']) { $VARIABLES['options_images']['liens'] = array(); $VARIABLES['options_images']['liens']['max_size_image'] = array("1" => "150x150"); $VARIABLES['options_images']['liens']['rep_images'] = "logos_liens"; $VARIABLES['options_images']['liens']['nom_images'] = "photo"; $VARIABLES['options_images']['liens']['colonne_image'] = 150; //<- a renseigner sert à indiquer la largeur de la colonne des images pour les liens } } // // // 8- PAGES LIENS EXTERNES DIRECTS // // $VARIABLES['GrouPage'][8] = array(); $VARIABLES['GrouPage'][8]['autoriser'] = true; // <- A regler autorisation if ($VARIABLES['GrouPage'][8]['autoriser']) { $VARIABLES['GrouPage'][8]['autoriser_nouveau'] = true; // <- A regler autorisation $VARIABLES['GrouPage'][8]['typegroupe'] = false; $VARIABLES['GrouPage'][8]['denomination'] = "Lien direct"; $VARIABLES['GrouPage'][8]['MenuAdminAjout'] = "Un " . strtolower($VARIABLES['GrouPage'][8]['denomination']); $VARIABLES['GrouPage'][8]['MenuAdminModif'] = "Les paramètres de ce lien"; $VARIABLES['GrouPage'][8]['genre'] = ""; $VARIABLES['GrouPage'][8]['picto'] = 'picto_lien_ext'; $VARIABLES['ParaPage'][8] = array(); $VARIABLES['ParaPage'][8]['autoriser_ColoDroi'] = false; $VARIABLES['ParaPage'][8]['autoriser_Actu'] = false; } // // // 9- F.A.Q. // // $VARIABLES['GrouPage'][9] = array(); $VARIABLES['GrouPage'][9]['autoriser'] = true; // <- A regler autorisation if ($VARIABLES['GrouPage'][9]['autoriser']) { $VARIABLES['GrouPage'][9]['autoriser_nouveau'] = true; // <- A regler autorisation $VARIABLES['GrouPage'][9]['typegroupe'] = false; $VARIABLES['GrouPage'][9]['denomination'] = "F.A.Q."; $VARIABLES['GrouPage'][9]['MenuAdminAjout'] = "Une " . strtolower($VARIABLES['GrouPage'][9]['denomination']); $VARIABLES['GrouPage'][9]['MenuAdminModif'] = "Les paramètres de cette page"; $VARIABLES['GrouPage'][9]['genre'] = "e"; $VARIABLES['GrouPage'][9]['picto'] = 'picto_faq'; $VARIABLES['ParaPage'][9] = array(); $VARIABLES['ParaPage'][9]['autoriser_ColoDroi'] = true; $VARIABLES['ParaPage'][9]['autoriser_Actu'] = false; $VARIABLES['ElemPage'][9] = array(); $VARIABLES['ElemPage'][9]['MenuAdminAjout'] = array(); $VARIABLES['ElemPage'][9]['MenuAdminAjout']['Faq'] = "Une nouvelle question"; } // // // 11 - ANNUAIRE // // $VARIABLES['GrouPage'][11] = array(); $VARIABLES['GrouPage'][11]['autoriser'] = ($VARIABLES['nom_page'] == "aide.php") ? false : false; // <- A regler autorisation if ($VARIABLES['GrouPage'][11]['autoriser']) { $VARIABLES['GrouPage'][11]['autoriser_nouveau'] = false; // <- A regler autorisation $VARIABLES['GrouPage'][11]['typegroupe'] = false; $VARIABLES['GrouPage'][11]['denomination'] = "Page Annuaire"; $VARIABLES['GrouPage'][11]['MenuAdminAjout'] = "Une " . strtolower($VARIABLES['GrouPage'][11]['denomination']); $VARIABLES['GrouPage'][11]['MenuAdminModif'] = "Les paramètres de cette page"; $VARIABLES['GrouPage'][11]['genre'] = "e"; $VARIABLES['GrouPage'][11]['picto'] = 'picto_annu'; $VARIABLES['ElemPage'][11] = array(); $VARIABLES['ElemPage'][11]['MenuAdminAjout'] = array(); $VARIABLES['ElemPage'][11]['MenuAdminAjout']['Annu'] = "Une fiche annuaire"; $VARIABLES['ParaPage'][11] = array(); $VARIABLES['ParaPage'][11]['autoriser_ColoDroi'] = true; $VARIABLES['ParaPage'][11]['autoriser_Actu'] = true; $VARIABLES['options']['Annu'] = array(); $VARIABLES['options']['Annu']['nomprenom'] = true; $VARIABLES['options']['Annu']['civilite'] = true; $VARIABLES['options']['Annu']['googlemaps'] = true; $VARIABLES['options']['Annu']['googlemaps-key'] = "ABQIAAAA5gJ6ciCNCk0kXDj8bGP84RSCkb7-pPM6nGqvmG7GQY3WPtYQWxSzM_7UCHYDZS9PqKB4z-O4gcURyA"; $VARIABLES['options']['Annu']['googlemaps-centrer-X'] = 46.55; $VARIABLES['options']['Annu']['googlemaps-centrer-Y'] = 2.54; $VARIABLES['options']['Annu']['googlemaps-zoom'] = 5; $VARIABLES['options']['Annu']['order_by'] = "ordre"; //le champs par lequel on ordonne les fiche ? odre ? designation ? $VARIABLES['options']['Annu']['proposer_themes'] = false; // le système doit-il proposer le choix d'un thème par fiche annuaire ? if ($VARIABLES['options']['Annu']['proposer_themes']) { $VARIABLES['options']['Annu']['ranger_par_theme'] = true; // le système doit-il afficher les fiches annuaires rangées par thème ? $VARIABLES['options']['Annu']['menu_themes_detaille'] = true; // le système doit-il afficher la liste des nom dans le menu des themes ? $VARIABLES['options']['Annu']['nbre_min_fiche_pour_menu'] = 10; // nombre de fiche minimum pour afficher le menu des thèmes $VARIABLES['options']['Annu']['intitule_themes'] = "Thème"; $VARIABLES['options']['Annu']['genre_intitule_themes'] = "M"; // le genre de l'intitule theme M ou F (ex UN theme / UNE région...) $VARIABLES['ParaPage'][11]['MenuAdminModif'] = array(); $VARIABLES['ParaPage'][11]['MenuAdminModif']['ThemAnnu'] = "Les thèmes d'annuaire"; $VARIABLES['options']['Annu']['detail_theme'] = false; $VARIABLES['options']['Annu']['intitule_detail_themes'] = "précisez le thème"; $VARIABLES['options']['Annu']['size_detail_themes'] = 38; //taille du champ de formulaire } } // // // 11 - Contacts / département // // $VARIABLES['GrouPage'][12] = array(); $VARIABLES['GrouPage'][12]['autoriser'] = ($VARIABLES['nom_page'] == "aide.php") ? false : true; // <- A regler autorisation if ($VARIABLES['GrouPage'][12]['autoriser']) { $VARIABLES['GrouPage'][12]['autoriser_nouveau'] = false; // <- A regler autorisation $VARIABLES['GrouPage'][12]['typegroupe'] = false; $VARIABLES['GrouPage'][12]['denomination'] = "Page Contacts foncier"; $VARIABLES['GrouPage'][12]['MenuAdminAjout'] = "Une " . strtolower($VARIABLES['GrouPage'][12]['denomination']); $VARIABLES['GrouPage'][12]['MenuAdminModif'] = "Les paramètres de cette page"; $VARIABLES['GrouPage'][12]['genre'] = "e"; $VARIABLES['GrouPage'][12]['picto'] = 'picto_annu'; $VARIABLES['ElemPage'][12] = array(); $VARIABLES['ElemPage'][12]['MenuAdminAjout'] = array(); $VARIABLES['ElemPage'][12]['MenuAdminAjout']['Foncier'] = "Un contact foncier"; $VARIABLES['ParaPage'][12] = array(); $VARIABLES['ParaPage'][12]['autoriser_ColoDroi'] = true; $VARIABLES['ParaPage'][12]['autoriser_Actu'] = true; } // // // // 19- PAGES D'ANNONCEs // // $VARIABLES['GrouPage'][19] = array(); $VARIABLES['GrouPage'][19]['autoriser'] = true; // <- A regler autorisation if ($VARIABLES['GrouPage'][19]['autoriser']) { $VARIABLES['GrouPage'][19]['autoriser_nouveau'] = true; // <- A regler autorisation $VARIABLES['GrouPage'][19]['typegroupe'] = false; $VARIABLES['GrouPage'][19]['denomination'] = "Page Annonces"; $VARIABLES['GrouPage'][19]['MenuAdminAjout'] = "Une " . strtolower($VARIABLES['GrouPage'][19]['denomination']); $VARIABLES['GrouPage'][19]['MenuAdminModif'] = "Les paramètres de cette page"; $VARIABLES['GrouPage'][19]['genre'] = "e"; $VARIABLES['GrouPage'][19]['picto'] = 'picto_page'; $VARIABLES['ParaPage'][19] = array(); $VARIABLES['ParaPage'][19]['autoriser_ColoDroi'] = true; $VARIABLES['ParaPage'][19]['autoriser_Actu'] = false; $VARIABLES['ElemPage'][19] = array(); $VARIABLES['ElemPage'][19]['MenuAdminAjout'] = array(); $VARIABLES['ElemPage'][19]['MenuAdminAjout']['Annonce'] = "Une nouvelle annonce"; $VARIABLES['options']['PhotoAnnonces'] = array(); $VARIABLES['options']['PhotoAnnonces']['photos_clicable'] = true; $VARIABLES['options']['PhotoAnnonces']['largeur_max1'] = 90; $VARIABLES['options']['PhotoAnnonces']['hauteur_max1'] = 90; $VARIABLES['options']['PhotoAnnonces']['largeur_max2'] = 500; $VARIABLES['options']['PhotoAnnonces']['hauteur_max2'] = 500; $VARIABLES['options']['TypesAnnonces'] = array(); $VARIABLES['options']['TypesAnnonces'][1] = "Emploi-stages-formation"; $VARIABLES['options']['TypesAnnonces'][2] = "Association, Installation, transmission"; $VARIABLES['options']['TypesAnnonces'][3] = "Matériel-Animaux"; $VARIABLES['options']['TypesAnnonces'][4] = "Autre"; $VARIABLES['options']['Annonces'] = array(); $VARIABLES['options']['Annonces']['doc_telechargeable'] = true; } // // // // 19- PAGES D'ANNONCES FONCIER // // $VARIABLES['GrouPage'][20] = array(); $VARIABLES['GrouPage'][20]['autoriser'] = true; // <- A regler autorisation if ($VARIABLES['GrouPage'][20]['autoriser']) { $VARIABLES['GrouPage'][20]['autoriser_nouveau'] = true; // <- A regler autorisation $VARIABLES['GrouPage'][20]['typegroupe'] = false; $VARIABLES['GrouPage'][20]['denomination'] = "Page Annonces Foncier"; $VARIABLES['GrouPage'][20]['MenuAdminAjout'] = "Une " . strtolower($VARIABLES['GrouPage'][20]['denomination']); $VARIABLES['GrouPage'][20]['MenuAdminModif'] = "Les paramètres de cette page d'Annonces Foncier"; $VARIABLES['GrouPage'][20]['genre'] = "e"; $VARIABLES['GrouPage'][20]['picto'] = 'picto_page'; $VARIABLES['ParaPage'][20] = array(); $VARIABLES['ParaPage'][20]['autoriser_ColoDroi'] = true; $VARIABLES['ParaPage'][20]['autoriser_Actu'] = false; $VARIABLES['ElemPage'][20] = array(); $VARIABLES['ElemPage'][20]['MenuAdminAjout'] = array(); $VARIABLES['ElemPage'][20]['MenuAdminAjout']['AnnonFoncier'] = "Une nouvelle annonce"; $VARIABLES['options']['TypesAnnoncesFoncier'] = array(); $VARIABLES['options']['TypesAnnoncesFoncier'][1] = "Terres nécessitant une autorisation d'exploiter (AAE)"; $VARIABLES['options']['TypesAnnoncesFoncier'][2] = "Terres à vendre susceptibles d'être préemptées par la Safer"; $VARIABLES['options']['TypesAnnoncesFoncier'][3] = "Autre offre foncière"; } // // ////////////////////////////////////////////////////// ////////////////////////////////////////////////////// /* LES MENUS ADMIN : complément */ if (isset($VARIABLES['options']['bandeau']['type_page']) && count($VARIABLES['options']['bandeau']['type_page']) > 0) foreach ($VARIABLES['options']['bandeau']['type_page'] as $key) $VARIABLES['ParaPage'][$key]['MenuAdminModif']['Bandeau'] = 'Le bandeau photos'; if (isset($VARIABLES['options']['logos_partenaire']['type_page']) && count($VARIABLES['options']['logos_partenaire']['type_page']) > 0) foreach ($VARIABLES['options']['logos_partenaire']['type_page'] as $key) $VARIABLES['ParaPage'][$key]['MenuAdminModif']['Partenair'] = 'Les partenaires'; // ////////////////////////////////////////////////////// require_once('variables_comp.inc.php'); require_once('variables_dept.inc.php'); ?> aaaa-mm-jj function DateFrToUs($date) { if($date=="") return ""; else { $this_annee = substr($date,6,4); $this_mois = substr($date,3,2); $this_jour = substr($date,0,2); return $this_annee . "-" . $this_mois . "-" . $this_jour; } } //formatage des dates aaaa-mm-jj => jj/mm/aaaa function DateUsToFr($date) { if($date=="") return ""; else { $this_annee = substr($date,0,4); $this_mois = substr($date,5,2); $this_jour = substr($date,8,2); return $this_jour . "/" . $this_mois . "/" . $this_annee; } } //formatage des dates aaaa-mm-jj => jj/mm function DateUsToFr2($date) { if($date=="") return ""; else { $this_annee = substr($date,2,2); $this_mois = abs(substr($date,5,2)); $this_jour = abs(substr($date,8,2)); return $this_jour . "/" . $this_mois . "/" . $this_annee; } } //formatage des dates aaaa-mm-jj => mm/aaaa function DateUsToFr3($date) { if($date=="") return ""; else { $this_annee = substr($date,0,4); $this_mois = substr($date,5,2); $this_jour = substr($date,8,2); return $this_mois . "/" . $this_annee; } } //formatage des dates 33/aaaa => aaaa-mm-31 function DateFr3ToUs($date) { if($date=="") return ""; else { $this_annee = (strlen($date)==7) ? substr($date,3,4) : "20".substr($date,3,2); $this_mois = substr($date,0,2); return $this_annee . "-" . $this_mois . "-28"; } } //formatage des dates aaaa-mm-jj hh:mm:ss => le jj/mm/aaaa à hh:mm:ss function DateHeureUsToFr($date) { if($date=="") return " "; else { $this_annee = substr($date,0,4); $this_mois = substr($date,5,2); $this_jour = substr($date,8,2); return "le " . $this_jour . "/" . $this_mois . "/" . $this_annee . " à " . substr($date,11,9); } } function DateUsToPubli($date) { if($date=="") return ""; else { $this_annee = substr($date,0,4); $this_mois = substr($date,5,2); return $this_mois . "/" . $this_annee; } } function DateUsToCamp($date) { if($date=="") return ""; else { $this_annee = substr($date,0,4); $this_mois = substr($date,5,2); return $this_mois . "/" . $this_annee; } } function DateUsToCamp2($date) { $mois_francais = array(); $mois_francais[1] = "janv"; $mois_francais[2] = "fév"; $mois_francais[3] = "mars"; $mois_francais[4] = "avril"; $mois_francais[5] = "mai"; $mois_francais[6] = "juin"; $mois_francais[7] = "juil"; $mois_francais[8] = "août"; $mois_francais[9] = "sept"; $mois_francais[10] = "oct"; $mois_francais[11] = "nov"; $mois_francais[12] = "déc"; if($date=="") return ""; else { $this_annee = substr($date,0,4); $this_mois = substr($date,5,2); if($this_mois=="07") return $mois_francais[abs($this_mois)] . "/" .$mois_francais[abs($this_mois+1)] . " " . $this_annee; else return $mois_francais[abs($this_mois)] . " " . $this_annee; } } function age($date_naissance) { if($date_naissance == NULL || $date_naissance == "0000-00-00") { return "?"; } else { $this_annee = date("Y",strtotime($date_naissance)); $this_mois = date("m",strtotime($date_naissance)); $this_jour = date("d",strtotime($date_naissance)); $annee = date("Y"); $mois = date("m"); $jour = date("d"); $this_age=$annee-$this_annee-((($this_mois>$mois) || ($this_mois==$mois && $this_jour>$jour)) ? 1 : 0); return $this_age; } } function DateUsToPubli2($date) { $mois_francais = array(); $mois_francais[1] = "janv"; $mois_francais[2] = "fév"; $mois_francais[3] = "mars"; $mois_francais[4] = "avril"; $mois_francais[5] = "mai"; $mois_francais[6] = "juin"; $mois_francais[7] = "juil"; $mois_francais[8] = "août"; $mois_francais[9] = "sept"; $mois_francais[10] = "oct"; $mois_francais[11] = "nov"; $mois_francais[12] = "déc"; if($date=="") return ""; else { $this_annee = substr($date,0,4); $this_mois = substr($date,5,2); return $mois_francais[abs($this_mois)] . " " . $this_annee; } } function affiche_affichage_admin($date_de,$date_a) { global $VARIABLES; if($date_de=="0000-00-00") return "masqué"; else { if($date_de != "" && diff_dates_cal_greg($VARIABLES['today'],$date_de)>0) { return "masqué jusqu'au ".dateUsToFr($date_de); break; } if($date_a != "" && diff_dates_cal_greg($VARIABLES['today'],$date_a)<=-1) { return "masqué depuis le ".dateUsToFr($date_a); break; } if($date_de != "" && $date_a == "") { return "affiché depuis le ".dateUsToFr($date_de); break; } return "affiché depuis le ".dateUsToFr($date_de) . " et jusqu'au ".dateUsToFr($date_a); } } function recup_lien_menu($element) { global $database_ma_connexion, $ma_connexion, $prefixe_url, $VARIABLES; $element['titre'] = (isset($element['meta_titre']) && $element['meta_titre']!="") ? $element['meta_titre'] : $element['titre']; $element['titre'] = ($element['titre']=="") ? "page" : $element['titre']; //$prefixe_url = ($VARIABLES['nom_page']=="aide.php") ? "aide-" : ""; unset($to_return_id); if($element['gr_acces_direct']=="oui") { mysql_select_db($database_ma_connexion, $ma_connexion); $query_infos = "SELECT id, afficher_le, afficher_jusque, intitule_menu, titre FROM " . $VARIABLES['prefixe_tbl'] . "groupes_pages WHERE id_parent = " . $element['id'] . " AND (url_externe ='' OR url_externe IS NULL) ORDER BY ordre "; if($VARIABLES['DEBUG']) echo "
" . $VARIABLES['nbre_requette']++ . " - Je cherche le premier element du groupe acces direct ? ... : ".$query_infos."
"; $quels_enfants = mysql_query($query_infos, $ma_connexion) or die(mysql_error()); while($row_quels_enfants = mysql_fetch_assoc($quels_enfants)) if(affiche_en_cour($row_quels_enfants['afficher_le'],$row_quels_enfants['afficher_jusque'])) { if($VARIABLES['DEBUG']) echo "
" . $VARIABLES['nbre_requette']++ . " - Je trouve la page : ".$row_quels_enfants['id']."
"; $to_return_id = $row_quels_enfants['id']; $to_return_intitule = $row_quels_enfants['titre']; break; } $lien_menu = (isset($to_return_id)) ? "\"".$prefixe_url.secure_name_url($to_return_intitule)."_".$to_return_id.".php\"" : "\"".$prefixe_url.secure_name_url($element['titre'])."_".$element['id'].".php\""; } elseif($element['url_externe'] != "" && (!isset($_SESSION['admin_infos']['id']) || $_SESSION['admin_pref']['affiche_panel']=="non")) { $lien_menu = ($element['url_externe_target']=="_blank") ? "\"" . valid_url_ext($element['url_externe']) . "\" target=\"_blank\"" : "\"" . valid_url_ext($element['url_externe']) . "\""; } else $lien_menu = ($element['titre']!="") ? "\"".$prefixe_url.secure_name_url($element['titre'])."_".$element['id'].".php\"" : "\"".$prefixe_url.secure_name_url($element['intitule_menu'])."_".$element['id'].".php\""; if($element['section_sousdomaine']!="") $lien_menu = "\"http://".$element['section_sousdomaine'].".confederationpaysanne.fr/\""; return $lien_menu; } function valid_url_ext($url) { global $database_ma_connexion, $ma_connexion, $prefixe_url, $VARIABLES; //echo $mon_maitre->infos['id']; if(substr($url,0,5)=="page=") { $page = substr($url,5); mysql_select_db($database_ma_connexion, $ma_connexion); $query_infos = "SELECT meta_titre, titre, intitule_menu FROM " . $VARIABLES['prefixe_tbl'] . "groupes_pages WHERE id = '" . $page . "'"; if($VARIABLES['DEBUG']) echo "
" . $VARIABLES['nbre_requette']++ . " - Je cherche (dans la fonctions_publics > valid_url_ext) le rewrite url ? ... : ".$query_infos."
"; $quels_enfants = mysql_query($query_infos, $ma_connexion) or die(mysql_error()); $row_quels_enfants = mysql_fetch_assoc($quels_enfants); if($VARIABLES['options']['gestion_meta'] && $row_quels_enfants['meta_titre'] != "") $meta_titre = $row_quels_enfants['meta_titre']; else $meta_titre = ($row_quels_enfants['titre']!="") ? $row_quels_enfants['titre'] : $row_quels_enfants['intitule_menu']; return $prefixe_url.secure_name_url($meta_titre)."_".$page.".php"; } elseif($url=="deconnexion.php") return $url; else return ($url=="" || substr($url,0,7)=="http://") ? $url : "http://".$url; } function url_sans_http($url) { //echo $mon_maitre->infos['id']; return (substr($url,0,7)=="http://") ? substr($url,7) : $url; } function jeParcours($tab_contenu) { global $VARIABLES; //print_r($tab_contenu); //echo count($tab_contenu)."
"; if(count($tab_contenu)>0) { foreach($tab_contenu as $enfant) { $enfant->recup_chemin(true); if(($_GET['id_groupe']==0) || ($enfant->infos['id']!=$_GET['id_groupe'])) echo jafficheleplan($enfant); if ($VARIABLES['GrouPage'][$enfant->infos['id_type']]['typegroupe']) { $je_descend = new groupes_pages($enfant->infos['id'],'groupes_pages','*',TRUE); $div_display = "block"; echo '
'; if($je_descend->nombre_enfants['groupes_pages']>0) echo jeParcours($je_descend->enfant['groupes_pages']); echo '
'; } } } } // // ////////////////////////////////////// Securiser un nom (sans espace, sans accent, ...) // // function secure_name($name,$ext=false) { $secure_name=trim($name); $secure_name=str_replace("'","-",$secure_name); $secure_name=str_replace("-"," ",$secure_name); $secure_name=str_replace("_"," ",$secure_name); $secure_name=fullLower($secure_name); $secure_name=str_replace(" ","-",$secure_name); if(!$ext) $secure_name=str_replace(".","-",$secure_name); $secure_name=str_replace("(","",$secure_name); $secure_name=str_replace(")","",$secure_name); //les accents $secure_name=str_replace("œ","oe",$secure_name); $secure_name=str_replace("à","a",$secure_name); $secure_name=str_replace("â","a",$secure_name); $secure_name=str_replace("ä","a",$secure_name); $secure_name=str_replace("é","e",$secure_name); $secure_name=str_replace("è","e",$secure_name); $secure_name=str_replace("ê","e",$secure_name); $secure_name=str_replace("ë","e",$secure_name); $secure_name=str_replace("ô","o",$secure_name); $secure_name=str_replace("ö","o",$secure_name); $secure_name=str_replace("û","u",$secure_name); $secure_name=str_replace("ü","u",$secure_name); $secure_name=str_replace("ù","u",$secure_name); $secure_name=str_replace("î","i",$secure_name); $secure_name=str_replace("--","-",$secure_name); //enfin, on vire tous les signes non alphanum en dehors de '_' et de '.' $secure_name=ereg_replace("[^[:alnum:].-]","",$secure_name); $secure_name=str_replace("--","-",$secure_name); return $secure_name; } function secure_name_url($name,$limit=45) { global $VARIABLES; $mot_supp = array( "le","la","les", "il","ils","elle","elles", "un","une","des", "et","ou", "de","l","d","du", "que","quelle","quelles","quel","quels", "me","ma","mes","nos", "se","sa","ses","son", "ce","cette","cet","ces","ça","pour", "a","aux","sur","par","avec","qui","est","beaucoup" ); $mot_intact = $VARIABLES['mots_intactes_url'][$VARIABLES['language']]; $secure_name=str_replace("?","",$name); $secure_name=str_replace(":","",$name); $secure_name=str_replace("!","",$name); $secure_name=str_replace("'","-",$secure_name); $secure_name=str_replace("’","-",$secure_name); $secure_name=trim($secure_name); $secure_name=fullLower($secure_name); $secure_name=str_replace(" ","-",$secure_name); $secure_name=str_replace(".","",$secure_name); $secure_name=str_replace("(","",$secure_name); $secure_name=str_replace(")","",$secure_name); //les accents $secure_name=str_replace("à","a",$secure_name); $secure_name=str_replace("œ","oe",$secure_name); $secure_name=str_replace("â","a",$secure_name); $secure_name=str_replace("ä","a",$secure_name); $secure_name=str_replace("é","e",$secure_name); $secure_name=str_replace("è","e",$secure_name); $secure_name=str_replace("ê","e",$secure_name); $secure_name=str_replace("ë","e",$secure_name); $secure_name=str_replace("ô","o",$secure_name); $secure_name=str_replace("ö","o",$secure_name); $secure_name=str_replace("û","u",$secure_name); $secure_name=str_replace("ü","u",$secure_name); $secure_name=str_replace("ù","u",$secure_name); $secure_name=str_replace("î","i",$secure_name); $secure_name=str_replace("ç","c",$secure_name); $secure_name=str_replace("ï","i",$secure_name); $secure_name=str_replace("&","et",$secure_name); //enfin, on vire tous les signes non alphanum en dehors de '_' et de '.' $secure_name=ereg_replace("[^[:alnum:]-]","",$secure_name); $secure_name=str_replace("--","-",$secure_name); if(strlen($secure_name)>$limit) { $les_mot = explode("-", $secure_name); foreach ($les_mot as $key=>$value) if(in_array($value,$mot_supp)) unset($les_mot[$key]); else $les_mot[$key] = $value; $secure_name=implode($les_mot, "-"); } if(strlen($secure_name)>$limit) { $les_mot = explode("-", $secure_name); foreach ($les_mot as $key=>$value) $les_mot[$key] = (in_array($value,$mot_intact)) ? $value : substr($value,0,9); $secure_name=implode($les_mot, "-"); } $secure_name=trim($secure_name); if(strlen($secure_name)>$limit) $secure_name = substr($secure_name,0,$limit); if(substr($secure_name, -1, 1) == "-") $secure_name=substr($secure_name,0,(strlen($secure_name)-1)); return $secure_name; } function ok_mail($email, &$err) { if ($email == "") { $err = "L'email est vide"; return false; } if (!preg_match("/^[-a-z0-9\._]+@[-a-z0-9\.]+\.[a-z]{2,4}$/i", $email)) { $err = "Le format de l'email n'est pas valide"; return false; } list($nom, $dom) = explode("@", $email); // On récupère le nom de domaine dans la variable $dom if(!checkdnsrr($dom, 'MX')) { $err = "Le nom de domaine ".$dom." n'existe pas"; return false; } return true; } function droit_admin($page=NULL) { global $ma_page; $page_admin = ($page==NULL) ? $ma_page : $page; //echo $page_admin->infos['id']; /*print_r($page_admin->ailleux); print_r(explode("-",$_SESSION['admin_infos']['droits_acces'])); echo "
".count(array_intersect(explode("-",$_SESSION['admin_infos']['droits_acces']),$page_admin->ailleux))."
"; */ if(isset($_SESSION['admin_infos']) && ((is_array($page_admin->ailleux) && count(array_intersect(explode("-",$_SESSION['admin_infos']['droits_acces']),$page_admin->ailleux))>0) || in_array($page_admin->infos['id'],explode("-",$_SESSION['admin_infos']['droits_acces'])))) return true; else return false; } function affiche_aprofondi($afficher_le,$afficher_jusque,$extranet,$id,$id_parent) { global $database_ma_connexion, $ma_connexion, $VARIABLES; if($VARIABLES['DEBUG']) { echo "
- DEBUT FONCTION affiche_aprofondi() "; echo " : " .$my_query."
"; } $to_return = affiche($afficher_le,$afficher_jusque,$extranet,$id); if($id_parent !=1) { $mon_origine = $id_parent; while($to_return && $mon_origine!=1) { //On recupere les infos de cette rubrique/page mysql_select_db($database_ma_connexion, $ma_connexion); $query_QuiEstMaMere = sprintf("SELECT id, id_type, ordre, id_parent, intitule_menu, afficher_le, afficher_jusque, extranet FROM " . $VARIABLES['prefixe_tbl'] . "groupes_pages WHERE id = %s", $mon_origine); if($VARIABLES['DEBUG']) echo "
" . $VARIABLES['nbre_requette']++ . " - qui est ma mère ? ... : ".$query_QuiEstMaMere."
"; $QuiEstMaMere = mysql_query($query_QuiEstMaMere, $ma_connexion) or die(mysql_error()); $row_QuiEstMaMere = mysql_fetch_assoc($QuiEstMaMere); if($to_return) $to_return = affiche($row_QuiEstMaMere['afficher_le'],$row_QuiEstMaMere['afficher_jusque'],$row_QuiEstMaMere['extranet'],$row_QuiEstMaMere['id']); $mon_origine = $row_QuiEstMaMere['id_parent']; } } if($VARIABLES['DEBUG']) { echo "
- FIN FONCTION affiche_aprofondi() "; echo " : " .$my_query."
"; } return $to_return; } //cette page/rubrique est-elle affichee aujourd'hui ? function affiche($date_de,$date_a,$extranet="non",$id=NULL) { global $VARIABLES; // cas n° 1 => je suis en admin, et j'ai les droits d'admin -> retour = true // if(isset($_SESSION['admin_infos']['id']) && $_SESSION['admin_pref']['affiche_panel']=="oui" && $VARIABLES['droits_affichage']['admin']) { //echo "cool"; return true; } // cas n°2 => date d'affichage = "masqué" -> retour = false elseif($date_de=="0000-00-00") return false; else { // cas n°3 => date d'affichage = pas encore -> retour = false if($date_de != "" && diff_dates_cal_greg($VARIABLES['today'],$date_de)>0) { return false; break; } // cas n°4 => date d'affichage = dépassée -> retour = false elseif($date_a != "" && $date_a != "0000-00-00" && diff_dates_cal_greg($VARIABLES['today'],$date_a)<=-1) { return false; break; } // cas n°5 => date d'affichage = ok -> on regarde si extranet... else { if($extranet=="non") return true; else { //echo "
tiens ? "; if($VARIABLES['INFOS_SITE']['type_extranet']=="simple" && isset($_SESSION['extranet_user']) && $_SESSION['extranet_user']['statut']==1) return true; elseif($VARIABLES['INFOS_SITE']['type_extranet']=="multi" && isset($_SESSION['extranet_user']) && (in_array($id,$_SESSION['extranet_user']['droits']) || $VARIABLES['INFOS_SITE']['id_extranet']==$id)) { //echo $id. " : cool"; return true; } else { //echo $id. " : boohh"; return false; } } } } } //ce rdv est-il encore affiché aujourd'hui ? function affiche_rdv($date_debut,$date_fin) { global $VARIABLES; if(isset($_SESSION['admin_infos']['id']) && $_SESSION['admin_pref']['affiche_panel']=="oui") return true; else { $date_limit = ($date_fin != NULL) ? $date_fin : $date_debut; if(diff_dates_cal_greg($date_limit,$VARIABLES['today'])<=$VARIABLES['options']['Agenda']['nbre_jour_perimee']) return true; else return false; } } //cette page/rubrique est-elle affichee aujourd'hui ? function affiche_en_cour($date_de,$date_a,$debug=false) { if($debug) echo $date_de."->".$date_a; global $VARIABLES; if($date_de=="0000-00-00") return false; else { if($date_de != "" && diff_dates_cal_greg($VARIABLES['today'],$date_de)>0) { return false; break; } if($date_a != "" && $date_a != "0000-00-00" && diff_dates_cal_greg($VARIABLES['today'],$date_a)<=-1) { return false; break; } return true; } } //combien de jour entre deux dates ? function diff_dates_cal_greg($date1 , $date2) { $jour1 = substr($date1,8,2); $mois1 = substr($date1,5,2); $annee1 = substr($date1,0,4); $jour2 = substr($date2,8,2); $mois2 = substr($date2,5,2); $annee2 = substr($date2,0,4); $diff = facteur($jour2 , $mois2 , $annee2)-facteur($jour1 , $mois1 , $annee1); return $diff; } function facteur($jour , $mois , $annee) { $b=365*$annee; $c=31*($mois-1); if (($mois==1) || ($mois==2)){ $d= 0; $e = intval(($annee -1)/4); $h = intval(0.75*(intval(($annee-1)/100)+1)); } else { $d= intval(0.4*$mois+2.3); $e = intval($annee/4); $h = intval(0.75*(intval($annee/100)+1)); } $result = $jour + $b+ $c - $d +$e -$h; return $result; } function dernieres_modifs($type,$limit) { global $database_ma_connexion, $ma_connexion, $VARIABLES; // Les pages et groupes de pages // if($type=="pages") { $query_mesInfos = sprintf(" SELECT id FROM " . $VARIABLES['prefixe_tbl'] . "groupes_pages" . " WHERE date_maj > '".$limit."' ORDER BY date_maj DESC", $VARIABLES['today'], $VARIABLES['today']); $mesInfos = mysql_query($query_mesInfos, $ma_connexion) or die(mysql_error()); while($row = mysql_fetch_assoc($mesInfos)) { $ma_page = new groupes_pages($row['id'],NULL); $ma_page->recup_chemin(true); ligne_dernieres_modifs($ma_page,$VARIABLES['GrouPage'][$ma_page->infos['id_type']]['picto'],$ma_page->rewrite_url,strip_tags($ma_page->chemin),$ma_page->infos['date_maj'],$ma_page->infos['id_maj'],$ma_page->infos['id_crea']); } } // Les articles de la boutique // if($type=="articles boutique") { $query_mesInfos = " SELECT GP.id , I.id as id_arti, I.titre, I.afficher_le, I.date_maj , I.id_maj, I.id_crea FROM " . $VARIABLES['prefixe_tbl'] . "groupes_pages GP, " . $VARIABLES['prefixe_tbl'] . "articles_boutique I, " . $VARIABLES['prefixe_tbl'] . "theme_arti_boutique T WHERE T.id_page = GP.id AND I.id_theme = T.id AND I.date_maj > '".$limit."' AND I.afficher_le IS NOT NULL AND I.afficher_le != '0000-00-00' AND I.afficher_le >= '".$VARIABLES['today']."' ORDER BY date_maj DESC"; $mesInfos = mysql_query($query_mesInfos, $ma_connexion) or die(mysql_error()); while($row = mysql_fetch_assoc($mesInfos)) { $ma_page = new groupes_pages($row['id'],NULL); $ma_page->recup_chemin(true); ligne_dernieres_modifs($ma_page,$VARIABLES['GrouPage'][$ma_page->infos['id_type']]['picto'],$ma_page->rewrite_url."#article".$row['id_arti'],strip_tags($ma_page->chemin . " > " . $row['titre']),$row['date_maj'],$row['id_maj'],$row['id_crea']); } } // Les rendez-vous // if($type=="rendez-vous") { $query_mesInfos = " SELECT GP.id , I.id as id_rdv, I.titre, I.date_maj, I.id_maj, I.id_crea FROM " . $VARIABLES['prefixe_tbl'] . "groupes_pages GP, " . $VARIABLES['prefixe_tbl'] . "rendez_vous I, " . $VARIABLES['prefixe_tbl'] . "theme_rendez_vous T WHERE T.id_page = GP.id AND I.id_theme = T.id AND I.date_maj > '".$limit."' AND (I.masquer != 'oui' OR I.masquer IS NULL) ORDER BY date_maj DESC"; //echo $query_mesInfos; $mesInfos = mysql_query($query_mesInfos, $ma_connexion) or die(mysql_error()); while($row = mysql_fetch_assoc($mesInfos)) { $ma_page = new groupes_pages($row['id'],NULL); $ma_page->recup_chemin(true); ligne_dernieres_modifs($ma_page,$VARIABLES['GrouPage'][$ma_page->infos['id_type']]['picto'],$ma_page->rewrite_url."#date".$row['id_rdv'],strip_tags($ma_page->chemin . " > " . $row['titre']),$row['date_maj'],$row['id_maj'],$row['id_crea']); } } // Les actualités // if($type=="actualités") { $query_mesInfos = " SELECT GP.id , I.id as id_actu, I.titre, I.date_maj, I.id_maj, I.id_crea , I.afficher_le, I.afficher_jusque FROM " . $VARIABLES['prefixe_tbl'] . "groupes_pages GP, " . $VARIABLES['prefixe_tbl'] . "actualites I WHERE I.id_page = GP.id AND I.date_maj > '".$limit."' ORDER BY date_maj DESC"; //echo $query_mesInfos; $mesInfos = mysql_query($query_mesInfos, $ma_connexion) or die(mysql_error()); while($row = mysql_fetch_assoc($mesInfos)) { //echo $row['afficher_le'].$row['afficher_jusque']; if(affiche($row['afficher_le'],null,"non")) { $ma_page = new groupes_pages($row['id'],NULL); $ma_page->recup_chemin(true); ligne_dernieres_modifs($ma_page,$VARIABLES['options']['Actualite']['picto'],"index.php?rubrique_id=".$ma_page->infos['id']."&actualite_id=".$row['id_actu'],strip_tags($ma_page->chemin . " > " . $row['titre']),$row['date_maj'],$row['id_maj'],$row['id_crea']); } } } } function ligne_dernieres_modifs($ma_page,$Pictos,$url,$intitule,$date_maj,$id_maj, $id_crea ) { global $VARIABLES; if(isset($_SESSION['admin_infos']['id'])) { $jaffiche = (!affiche($ma_page->infos['afficher_le'],$ma_page->infos['afficher_jusque'],$ma_page->infos['extranet'],$ma_page->infos['id'])) ? "_masque" : ""; if(droit_admin($ma_page) || affiche($ma_page->infos['afficher_le'],$ma_page->infos['afficher_jusque'],$ma_page->infos['extranet'],$ma_page->infos['id'])) { if($id_crea != $id_maj) echo '['.dateUsToFr($date_maj).'] '.$intitule.'
'; else echo '['.dateUsToFr($date_maj).'] '.$intitule.'
'; } } else { if(affiche($ma_page->infos['afficher_le'],$ma_page->infos['afficher_jusque'],$ma_page->infos['extranet'],$ma_page->infos['id'])) echo '['.dateUsToFr($date_maj).'] '.$intitule.'
'; } } function crypt_email($email) { return ereg_replace("([^<>[:space:]]+[[:alnum:]/])@([^<>[:space:]]+[[:alnum:]/])\.([^<>[:space:]]+[[:alnum:]/])","javascript:;\" onClick=\"this.href=envoi_courriel('\\1','\\2','\\3')\"",$email); } function presaisie($id,$valeur) { if($id != NULL) return htmlentities($valeur); } function presaisieSelected($id,$valeur,$option) { if($id != NULL) if($valeur == $option) return " selected=\"selected\""; } function presaisieCheked($id,$valeur,$option) { if($id != NULL) if($valeur == $option) return " checked=\"checked\""; } function do_image($src, $dest, $size, $show=0, $del=0, $upload = true) { //echo "c parti !"; if($upload) { $mon_fichier = $src['tmp_name']; $mon_fichier_name = $src['name']; } else { $mon_fichier = $src; $mon_fichier_name = $src; } // Extension du fichier $ext = strtolower( substr( strrchr( $mon_fichier_name, '.' ), 1 ) ); // Si l'extension est reconnue //if( !in_array( $ext, array( 'jpg', 'jpeg', 'gif', 'png' ) ) ) //{ //return FALSE; //} // // Propriété du fichier list( $width, $height, $type, $attr ) = getimagesize($mon_fichier); switch( $type ) { case 1: $ext='gif';break; case 2: $ext='jpg'; break; case 3: $ext='png'; break; default : $ext='jpg'; } // echo "ext : ".$ext; // Contrôle du type d'image /* if( !in_array( $type, array( 1,2,3 ) ) ) { if( $del == 1 ) unlink( $src ); return FALSE; } */ //taille fixe ou pas ? $taillefixe = false; if(substr($size,0,1)=="f") { //taille fixe $size = str_replace("f","",$size); $taillefixe = true; } if(substr($size,0,1)=="h") { //taille fixe $size = str_replace("h","0x",$size); $hauteurfixe = true; } // Infos des taillles maximum //$size = empty( $size ) || strpos( strtolower( $size ), 'x' ) === FALSE ? (100x100) : $size; list( $max_width, $max_height ) = explode('x', $size); //echo $max_width."x".$max_height; // Calcul des tailles proportionnelles if($taillefixe) { //traitement de l'image pour qu'elle ai pile la taille demandée //exec("convert ".$mon_fichier." -quality 65 -resize '".$max_width."x".$max_height."' ".$dest.".".$ext); $rapport = $max_height/$max_width; $width_img = $max_width; $height_img = $max_height; $src_x = 0; $src_y = 0; if(($height/$width) < $rapport) { //la photo est plus applatie $src_x = round(($width-$height/$rapport)/2); $width = $height/$rapport; } elseif(( $height/$width) > $rapport) { //la photo est plus allongée $src_y = round(($height-$width*$rapport)/2); $height = $width*$rapport; } //echo $max_width."x".$max_height; // Calcul des tailles proportionnelles // Création d'une images a partir de l'original switch( $type ) { case 1: $tmp = imagecreatefromgif($mon_fichier);$ext='gif';break; case 2: $tmp = imagecreatefromjpeg($mon_fichier);$ext='jpg'; break; case 3: $tmp = imagecreatefrompng($mon_fichier);$ext='png'; break; default : return FALSE; } //echo $width_img."x".$height_img; // Création de l'image trueColor $img = imagecreatetruecolor($width_img, $height_img); imagecopyresampled($img, $tmp, 0, 0, $src_x, $src_y, $width_img, $height_img, $width, $height); switch( $type ) { case 1 : imagegif($img, $dest.".gif"); break; case 2 : imagejpeg($img, $dest.".jpg", 80); break; case 3 : imagepng($img, $dest.".png"); break; default: return FALSE; } } elseif($hauteurfixe) { // Si l'image est trop grande, on rééchantillonne $height_img = $max_height; $width_img = round(($width*$max_height)/$height); if(substr($_SERVER['HTTP_HOST'],0,3) != 192 && substr($_SERVER['HTTP_HOST'],0,9) != "localhost" && $VARIABLES['options_images']['imagemagik']) exec("convert ".$mon_fichier." -quality 80 -resize '".$width_img."x".$height_img."!' ".$dest.".".$ext); else { // Création d'une images a partir de l'original switch( $type ) { case 1: $tmp = imagecreatefromgif($mon_fichier);$ext='gif';break; case 2: $tmp = imagecreatefromjpeg($mon_fichier);$ext='jpg'; break; case 3: $tmp = imagecreatefrompng($mon_fichier);$ext='png'; break; default : return FALSE; } //echo $width_img."x".$height_img; // Création de l'image trueColor $img = imagecreatetruecolor($width_img, $height_img); // Copie d'un contenu vers un autre, rééchantillonnage if( imagecopyresampled($img, $tmp, 0, 0, 0, 0, $width_img, $height_img, $width, $height) !== false ) { // Enregistrement switch( $type ) { case 1 : imagegif($img, $dest.".gif"); break; case 2 : imagejpeg($img, $dest.".jpg", 80); break; case 3 : imagepng($img, $dest.".png"); break; default: return FALSE; } } } } else { if($width > $max_width || $height > $max_height) { //echo "convert ".$mon_fichier." -resize '".$max_width."x".$max_height."' ".$dest.".".$ext; if(substr($_SERVER['HTTP_HOST'],0,3) != 192 && substr($_SERVER['HTTP_HOST'],0,9) != "localhost" && $VARIABLES['options_images']['imagemagik']) exec("convert ".$mon_fichier." -quality 80 -resize '".$max_width."x".$max_height."' ".$dest.".".$ext); else { // Si l'image est trop grande, on rééchantillonne $width_img = $max_width; $height_img = round(($max_width*$height)/$width); if($height_img>$max_height) { $width_img = round(($width_img*$max_height)/$height_img); $height_img = $max_height; } // Création d'une images a partir de l'original switch( $type ) { case 1: $tmp = imagecreatefromgif($mon_fichier);$ext='gif';break; case 2: $tmp = imagecreatefromjpeg($mon_fichier);$ext='jpg'; break; case 3: $tmp = imagecreatefrompng($mon_fichier);$ext='png'; break; default : return FALSE; } //echo $width_img."x".$height_img; // Création de l'image trueColor $img = imagecreatetruecolor($width_img, $height_img); // Copie d'un contenu vers un autre, rééchantillonnage if( imagecopyresampled($img, $tmp, 0, 0, 0, 0, $width_img, $height_img, $width, $height) !== false ) { // Enregistrement switch( $type ) { case 1 : imagegif($img, $dest.".gif"); break; case 2 : imagejpeg($img, $dest.".jpg", 80); break; case 3 : imagepng($img, $dest.".png"); break; default: return FALSE; } } } } else { // Si l'image entre dans les dimension max, on la copie telle quelle //copy($mon_fichier,$dest.".".$ext); //echo "convert ".$mon_fichier." ".$dest.".".$ext; if(substr($_SERVER['HTTP_HOST'],0,3) != 192 && substr($_SERVER['HTTP_HOST'],0,9) != "localhost" && $VARIABLES['options_images']['imagemagik']) exec("convert ".$mon_fichier." -quality 80 ".$dest.".".$ext); else copy($mon_fichier,$dest.".".$ext); } } // Suppression des variables unset($img, $tmp, $src); return($ext); } ?> $value) { $result = ereg_replace(addslashes($value),$key,$result); } return(strtoupper($result)); } function fullLower($str){ // convert to entities $str = str_replace("'","_",$str); $subject = htmlentities($str,ENT_QUOTES); $pattern = '/&([A-Za-z])(uml|acute|circ'; $pattern.= '|tilde|ring|elig|grave|slash|horn|cedil|th);/e'; $replace = "'&'.strtolower('\\1').'\\2'.';'"; $result = preg_replace($pattern, $replace, $subject); // convert from entities back to characters $htmltable = get_html_translation_table(HTML_ENTITIES); foreach($htmltable as $key => $value) { $result = ereg_replace(addslashes($value),$key,$result); } return(strtolower($result)); } //formatage du texte function texte_formate($chaine) { $to_return=$chaine; $to_return=htmlentities($chaine); $to_return = str_replace("style="","style=\"",$to_return); $to_return = str_replace("href="","href=\"",$to_return); $to_return = str_replace("">","\">",$to_return); $to_return = str_replace("%22","\"",$to_return); $to_return = str_replace(""","\"",$to_return); $to_return = str_replace("%20"," ",$to_return); $to_return = str_replace("<","<",$to_return); $to_return = str_replace(">",">",$to_return); /*$to_return = str_replace("==","
  • ",$to_return); $to_return = str_replace("","",$to_return); $to_return = str_replace("","",$to_return); $to_return = str_replace("","",$to_return); $to_return = str_replace("
    \r\n
    ","

    ",nl2br($to_return)); $to_return = str_replace("","",$to_return);*/ return $to_return; } function coupetroplong($chaine,$long_max=20) { if(strlen(html_entity_decode($chaine))>$long_max) return substr($chaine,0,$long_max) . "-
    " . coupetroplong(substr($chaine,$long_max),$long_max); else return $chaine; } function phrase_mots_trop_longs($texte,$taille=20){ if (strlen($texte)>$taille){ // Séléction du maximum de caractères $texte = substr($texte, 0, $taille); // Récupération de la position du dernier espace (afin déviter de tronquer un mot) $position_espace = strrpos($texte, " "); $texte = substr($texte, 0, $position_espace) . ' (...)'; } return $texte; } function prenom_formate($leprenom) { if($leprenom=="") return ""; else { $tab_prenom[0]=explode("-",$leprenom); foreach($tab_prenom[0] as $key0=>$value0) { $tab_prenom[1]=explode(" et ",$value0); foreach($tab_prenom[1] as $key1=>$value1) { $tab_prenom[2]=explode(" & ",$value1); foreach($tab_prenom[2] as $key2=>$value2) { $tab_prenom[2][$key2]=ucwords(strtolower($value2)); // echo $tab_prenom[2][$key2]."
    "; } $tab_prenom[1][$key1]=implode($tab_prenom[2]," & "); } //echo ">deb>".$tab_prenom[1].">fin>"; $tab_prenom[0][$key0]=implode($tab_prenom[1]," et "); } } return implode($tab_prenom[0],"-"); } /* function prenom_formate($str, $is_name=false) { // exceptions to standard case conversion if ($is_name) { $all_uppercase = ''; $all_lowercase = 'De La|De Las|Der|Van De|Van Der|Vit De|Von|Or|And|Et|Ou'; } else { // addresses, essay titles ... and anything else $all_uppercase = 'Po|Rr|Se|Sw|Ne|Nw'; $all_lowercase = 'A|And|As|By|In|Of|Or|To|Et|Ou'; } $prefixes = 'Mc'; $suffixes = "'S"; // captialize all first letters $str = preg_replace('/\\b(\\w)/e', 'strtoupper("$1")', strtolower(trim($str))); if ($all_uppercase) { // capitalize acronymns and initialisms e.g. PHP $str = preg_replace("/\\b($all_uppercase)\\b/e", 'strtoupper("$1")', $str); } if ($all_lowercase) { // decapitalize short words e.g. and if ($is_name) { // all occurences will be changed to lowercase $str = preg_replace("/\\b($all_lowercase)\\b/e", 'strtolower("$1")', $str); } else { // first and last word will not be changed to lower case (i.e. titles) $str = preg_replace("/(?<=\\W)($all_lowercase)(?=\\W)/e", 'strtolower("$1")', $str); } } if ($prefixes) { // capitalize letter after certain name prefixes e.g 'Mc' $str = preg_replace("/\\b($prefixes)(\\w)/e", '"$1".strtoupper("$2")', $str); } if ($suffixes) { // decapitalize certain word suffixes e.g. 's $str = preg_replace("/(\\w)($suffixes)\\b/e", '"$1".strtolower("$2")', $str); } return $str; } */ //formatage d'une liste function liste_formate($chaine) { return str_replace("
    ","

  • \n
  • ",nl2br(htmlentities($chaine))); } function paragraphe($texte) { return (substr($texte,0,2)=="".$texte."

    "; } //Formatage des date "du jj au jj mmm aaaa" $mois_francais = array(); $mois_francais[1] = "janv"; $mois_francais[2] = "fév"; $mois_francais[3] = "mars"; $mois_francais[4] = "avril"; $mois_francais[5] = "mai"; $mois_francais[6] = "juin"; $mois_francais[7] = "juil"; $mois_francais[8] = "août"; $mois_francais[9] = "sept"; $mois_francais[10] = "oct"; $mois_francais[11] = "nov"; $mois_francais[12] = "déc"; $mois_francais_full = array(); $mois_francais_full[1] = "janvier"; $mois_francais_full[2] = "février"; $mois_francais_full[3] = "mars"; $mois_francais_full[4] = "avril"; $mois_francais_full[5] = "mai"; $mois_francais_full[6] = "juin"; $mois_francais_full[7] = "juillet"; $mois_francais_full[8] = "août"; $mois_francais_full[9] = "septembre"; $mois_francais_full[10] = "octobre"; $mois_francais_full[11] = "novembre"; $mois_francais_full[12] = "décembre"; $jours_semaine=array(); $jours_semaine["Mon"]="lundi"; $jours_semaine["Tue"]="mardi"; $jours_semaine["Wed"]="mercredi"; $jours_semaine["Thu"]="jeudi"; $jours_semaine["Fri"]="vendredi"; $jours_semaine["Sat"]="samedi"; $jours_semaine["Sun"]="dimanche"; function format_date($date) { global $mois_francais ; if(strstr($date, "-") != "") //efface les eventuel "-" $date=str_replace("-","",$date); $annee=substr($date, 0, 4); $mois=substr($date, 4, 2); $jour=substr($date, 6, 2); $TheDate = array(); $TheDate['j'] = abs($jour); //Date .= valeur absolue des deux derniers chiffres $TheDate['m'] = $mois_francais[abs($mois)]; //Date .= mois[absolue des chiffres 4à5] $TheDate['a'] = $annee; //Date .= deux derniers chiffres de l'annee return $TheDate; //retourne la date } function montant_formate($prix) { return number_format($prix, 2, '.', ' '); //retourne la date } function prix_formate($prix,$codage=true) { if($codage) return number_format($prix, 2, '.', ' ') . " €"; //retourne la date else return number_format($prix, 2, '.', ' ') . " €"; //retourne la date } function prix_formateHT($prix,$codage=true) { if($codage) return number_format($prix, 3, '.', ' ') . " €"; //retourne la date else return number_format(100*$prix/105.5, 3, '.', ' ') . " €"; //retourne la date } function prix_formateTVA($prix,$codage=true) { if($codage) return number_format($prix, 3, '.', ' ') . " €"; //retourne la date else return number_format($prix-(100*$prix/105.5), 3, '.', ' ') . " €"; //retourne la date } function numbc_formate($num) { if($num<10) return "000".$num; elseif($num<100) return "00".$num; elseif($num<1000) return "0".$num; else return $num; //retourne la date } function affiche_periode($date_du, $date_au, $joursem=false, $annee = true) { global $jours_semaine; if($date_au=="") { $the_Date_le = format_date($date_du); if($the_Date_le['j'] == 0) return $the_Date_le['m'] . " " . $the_Date_le['a']; else if($joursem) return ($annee) ? $jours_semaine[date("D",strtotime($date_du))] . " " . $the_Date_le['j'] . " " . $the_Date_le['m'] . " " . $the_Date_le['a'] : $jours_semaine[date("D",strtotime($date_du))] . " " . $the_Date_le['j'] . " " . $the_Date_le['m']; else return ($annee) ? $the_Date_le['j'] . " " . $the_Date_le['m'] . " " . $the_Date_le['a'] : $the_Date_le['j'] . " " . $the_Date_le['m']; } else { $the_Date_du = format_date($date_du); $the_Date_au = format_date($date_au); if($joursem) { if($the_Date_du['m'] == $the_Date_au['m'] && $the_Date_du['a'] == $the_Date_au['a']) return ($annee) ? "du " . $jours_semaine[date("D",strtotime($date_du))] . " " .$the_Date_du['j'] . " au ". $jours_semaine[date("D",strtotime($date_au))] . " " .$the_Date_au['j'] . " " . $the_Date_au['m'] . " " . $the_Date_au['a'] : "du " . $jours_semaine[date("D",strtotime($date_du))] . " " .$the_Date_du['j'] . " au ". $jours_semaine[date("D",strtotime($date_au))] . " " .$the_Date_au['j'] . " " . $the_Date_au['m']; else if ($the_Date_du['a'] == $the_Date_au['a']) return ($annee) ? "du " . $jours_semaine[date("D",strtotime($date_du))] . " " .$the_Date_du['j'] . " " . $the_Date_du['m'] . " au ". $jours_semaine[date("D",strtotime($date_au))] . " " .$the_Date_au['j'] . " " . $the_Date_au['m'] . " " . $the_Date_au['a'] : "du " . $jours_semaine[date("D",strtotime($date_du))] . " " .$the_Date_du['j'] . " " . $the_Date_du['m'] . " au ". $jours_semaine[date("D",strtotime($date_au))] . " " .$the_Date_au['j'] . " " . $the_Date_au['m']; else return ($annee) ? "du " . $jours_semaine[date("D",strtotime($date_du))] . " " . $the_Date_du['j'] . " " . $the_Date_du['m'] . " " . $the_Date_du['a'] . " au ". $jours_semaine[date("D",strtotime($date_au))] . " " . $the_Date_au['j'] . " " . $the_Date_au['m'] . " " . $the_Date_au['a'] : "du " . $jours_semaine[date("D",strtotime($date_du))] . " " . $the_Date_du['j'] . " " . $the_Date_du['m'] . " au ". $jours_semaine[date("D",strtotime($date_au))] . " " . $the_Date_au['j'] . " " . $the_Date_au['m']; } else { if($the_Date_du['m'] == $the_Date_au['m'] && $the_Date_du['a'] == $the_Date_au['a']) return ($annee) ? "du " . $the_Date_du['j'] . " au ". $the_Date_au['j'] . " " . $the_Date_au['m'] . " " . $the_Date_au['a'] : "du " . $the_Date_du['j'] . " au ". $the_Date_au['j'] . " " . $the_Date_au['m']; else if ($the_Date_du['a'] == $the_Date_au['a']) return ($annee) ? "du " . $the_Date_du['j'] . " " . $the_Date_du['m'] . " au ". $the_Date_au['j'] . " " . $the_Date_au['m'] . " " . $the_Date_au['a'] : "du " . $the_Date_du['j'] . " " . $the_Date_du['m'] . " au ". $the_Date_au['j'] . " " . $the_Date_au['m']; else return ($annee) ? "du " . $the_Date_du['j'] . " " . $the_Date_du['m'] . " " . $the_Date_du['a'] . " au ". $the_Date_au['j'] . " " . $the_Date_au['m'] . " " . $the_Date_au['a'] : "du " . $the_Date_du['j'] . " " . $the_Date_du['m'] . " au ". $the_Date_au['j'] . " " . $the_Date_au['m']; } } } function coupen3mail($email) { $parties = array(); $pos_at = strcspn($email,"@"); $parties[1]=substr($email,0,$pos_at); //to $after_to=substr($email,$pos_at+1); $pos_dot = strrpos($after_to,"."); $parties[2]=substr($after_to,0,$pos_dot); $parties[3]=substr($after_to,$pos_dot+1); return "'".$parties[1]."','".$parties[2]."','".$parties[3]."'"; } function doc_size($size) { if($size<1000000) return round($size/100)/10 . " Ko"; else return round($size/10000)/100 . " Mo"; } function affiche_poids($size) { if($size>=1000) return abs($size/1000) . " kg"; else return abs($size) . " g"; } function affiche_si_et_saute($test_vide,$chaine=NULL) { $chaine = ($chaine == NULL) ? $test_vide : $chaine; if($test_vide!="") return $chaine."
    "; } function saute_et_affiche_si($test_vide,$chaine=NULL) { $chaine = ($chaine == NULL) ? $test_vide : $chaine; if($test_vide!="") return "
    ".$chaine; } function affiche_si($test_vide,$chaine=NULL) { $chaine = ($chaine == NULL) ? $test_vide : $chaine; if($test_vide!="") return $chaine; } function affiche_fiche($key,$type){ global $ma_page, $racine, $mode, $i, $my_num_fiche, $phrase_go; if($type=="liens" || $type=="ref") $type="page"; if(isset($_SESSION['affiche']) && $_SESSION['affiche']['icones_admin']=="on" && $mode=="admin") { $icone_admin=1; if($ma_page->contenu[$key]['ordre']>1) { $url_ordonner_up[$key] = "index.php?rubrique_id=" . $ma_page->champs['id'] . "&action=ordonner&ordre=" .$ma_page->contenu[$key]['ordre'] . "&sens=up&table=groupes_pages&parent=id_parent&id_parent=" . $ma_page->champs['id']; } if(isset($ma_page->contenu[$key]['ordre']) && $ma_page->contenu[$key]['ordre']<$ma_page->next_ordre-1) { $url_ordonner_down[$key] = "index.php?rubrique_id=" . $ma_page->champs['id'] . "&action=ordonner&ordre=" .$ma_page->contenu[$key]['ordre'] . "&sens=down&table=groupes_pages&parent=id_parent&id_parent=" . $ma_page->champs['id']; } $url_supp[$key] = "javascript:alert_supp(" . $ma_page->champs['id'] . ",'groupes_pages',".$key.",'ce (cette) ".$type."')"; //$url_supp[$key] = "index.php?rubrique_id=" . $ma_page->champs['id'] . "&action=supprimer&table=groupes_pages&id_supp=" .$key; } else { $icone_admin=0; } $jaffiche = ($ma_page->contenu[$key]['afficher']) ? "" : "_masque"; include($racine."inc/PHP/affichage/fiche_".$type.".inc.php"); } function affiche_texte_limite($chaine,$limit) { if(strlen($chaine)>$nbre_car_max) { $separateur=array(" ", ",", ".", ";"); for($ca=$limit;$ca<($limit+50);$ca++) if(in_array(substr($chaine,$ca,1),$separateur)) { $chaine=substr($chaine,0,$ca)." [...]"; break; } } return $chaine; } function resume_recherche($resultat,$mots_recherches) { $maxchar = 180; if($resultat['description']!="") return (strlen($resultat['description'])>$maxchar) ? affiche_texte_limite($resultat['description'],$maxchar) : $resultat['description']; else return (strlen($resultat['texte'])>$maxchar) ? affiche_texte_limite($resultat['texte'],$maxchar) : $resultat['texte']; } // retourne le texte avec les mails masques function afficher_paragraphes($texte) { $texte1 = ereg_replace("mailto:([^<>[:space:]]+[[:alnum:]/])@([^<>[:space:]]+[[:alnum:]/])\.([^<>[:space:]]+[[:print:]/])\"","javascript:;\" onClick=\"this.href=envoi_courriel('\\1','\\2','\\3')\"",$texte); $texte2 = ereg_replace("([^<>[:space:]]+[[:alnum:]/])@([^<>[:space:]]+[[:alnum:]/])\.([^<>[:space:]]+[[:alnum:]/])","\\1(at)\\2(point)\\3",$texte1); return $texte2; } function afficher_video($url,$vw=NULL,$vh=NULL) { global $VARIABLES; $site = false; $videow = ($vw==NULL) ? $VARIABLES['options']['Video']['largeur_max1'] : $vw; $videoh = ($vh==NULL) ? $VARIABLES['options']['Video']['hauteur_max1'] : $vh; $http = ((substr_count($url,"https")>0)) ? "https" : "http"; if(substr_count($url,"youtube.com")>0) { $site = "youtube.com"; $code = substr($url,strpos($url,'v=')+2); if(strpos($code,'&')>0) $code = substr($code,0,strpos($code,'&')); $object = ""; } if(substr_count($url,"dailymotion.com")>0) { $site = "dailymotion.com"; $code = substr($url,strpos($url,'video/')+6); if(strpos($code,'_')>0) $code = substr($code,0,strpos($code,'_')); $object = ""; } if(substr_count($url,"video.google.fr")>0) { $site = "video.google.fr"; $code = substr($url,strpos($url,'docid=')+6); if(strpos($code,'#')>0) $code = substr($code,0,strpos($code,'#')); $object = " "; } if(substr_count($url,"vimeo.com")>0) { $site = ((substr_count($url,"www")>0)) ? $http."://www.vimeo.com/" : $http."://vimeo.com/"; $code = substr($url,strlen($site)); if(strpos($code,'#')>0) $code = substr($code,strpos($code,'#')+1); $object = ""; //$object = ""; } if(isset($object)) echo "
    ".$object."
    "; else echo "attention !!! Impossible d'afficher la vidéo ".$url; } //Texte dans la colonne de droite pour les actus function txt_coldroite_actu($row_mesInfos) { global $VARIABLES; $max_caracteres = 150; $prefixe_url = ($VARIABLES['nom_page']=="aide.php") ? "aide-" : ""; $to_return = ""; //intitule $to_return .= ($row_mesInfos['actu_type']=="cdp") ? " ".dateUsToFr($row_mesInfos['afficher_le'])."
    " : ""; //$to_return .= "".$row_mesInfos['intitule_theme']."
    "; //texte $to_return .= "".$row_mesInfos['titre']."
    "; $to_return .= affiche_texte_limite(strip_tags($row_mesInfos['description']),$max_caracteres); if($row_mesInfos['plusdinfos'] != "" || $row_mesInfos['plusdinfoslien'] != "" || affiche_texte_limite(strip_tags($row_mesInfos['description']),$max_caracteres) != $row_mesInfos['description']) { $url = ($row_mesInfos['plusdinfos'] != "" || affiche_texte_limite(strip_tags($row_mesInfos['description']),$max_caracteres) != $row_mesInfos['description']) ? $prefixe_url.secure_name_url($row_mesInfos['titre'])."_".$row_mesInfos['id_page']."-actu_".$row_mesInfos['id'].".php" : valid_url_ext($row_mesInfos['plusdinfoslien']); $intitule_lien = ($row_mesInfos['plusdinfos'] != "") ? "[+ d'infos]" : "[+ d'infos]"; //$to_return .= "
    [+ d'infos]"; $to_return .= ""; } //$to_return .= "
    [+ d'infos]"; //$to_return .= ""; return $to_return; } //Texte dans la colonne de droite pour les dates agenda function txt_coldroite_agenda($row_mesInfos) { global $VARIABLES; $prefixe_url = ($VARIABLES['nom_page']=="aide.php") ? "aide-" : ""; $to_return = ""; //intitule $to_return .= "". $row_mesInfos['titre']."
    "; //date et lieu $to_return .= "".affiche_periode($row_mesInfos['date_debut'],$row_mesInfos['date_fin']); $to_return .= ($row_mesInfos['lieu_court']!="") ? " - ".$row_mesInfos['lieu_court'] : ""; $to_return .= ""; //$to_return .= "
    [+ d'infos]"; $plus_dinfos = ($row_mesInfos['lien_web'] != "") ? "Toutes les infos" : "Toutes les infos"; $to_return .= "
    " . $plus_dinfos. "
    "; return $to_return; } function txt_coldroite_publication($row_mesInfos) { $to_return =$row_mesInfos['dossier_titre']; $to_return .= ""; $to_return .= "
    CS n° " . $row_mesInfos['id'] . " | " . DateUsToCamp2($row_mesInfos['date']); $to_return .= "
    "; return $to_return; } //une ligne de tab si champ pas vide function newligne($style,$test,$champ) { if($test!="") return ' '.$champ.' '; } ?>Table 'conf_latelier7.publications' doesn't exist