VULN_CHECK_0COQYT"/@dev/ps2014", //system dyndns@nas.myebusiness.FR //"local"=>"/@dev/cassese/www/v2013/", "local"=>"http://partisocialiste/", "test"=> "http://test.ps-livry-gargan.fr/", "prod"=> "http://www.ps-livry-gargan.fr/" ); $serveur_prod=array("/home/pslivrygnw/www/"=>"prod"); $serveur_test=array("/homez.763/ps-livry-gargan/www/test/"=>"test"); $serveur_local=array("wamp/www/@dev/"=>"local"); $serveur_nas=array("wamp/www/@dev/"=>"nas"); $serveur_local2=array("wamp/www/@dev/"=>"local"); $serveurs = array($serveur_prod,$serveur_test,$serveur_local); foreach($serveurs as $valservtmp){ foreach($valservtmp as $valservloc=>$valserv){ if(stristr( $_SERVER['SCRIPT_FILENAME'], $valservloc)){ $srcbase_url = $srv_url[$valserv]; } } } if ($srcbase_url == "http://www.ps-livry-gargan.fr/") $showdepotversion = ""; $lang = isset ( $_GET ["lang"] ) ? $_GET ["lang"] : "en"; global $db_s, $lang; /* 2013 */ /* * blue:029ce6 * dlue:0a3265 * rose:f12d8c * vert:78be4a; */ class c_svn { function svn_revision() { // affichage de la revision svn $showdepotversion = "\$Revision: 233 $ - \$Date: 2015-01-29 13:02:05 +0100 (jeu., 29 janv. 2015) $"; $filename = "../svn/svn_siteweb/db/current"; if (! $fp = @fopen ( $filename, "r" )) { } else { $datelastrev = date ( "d/m/Y à H:i:s.", filemtime ( $filename ) ); while ( ! feof ( $fp ) ) { $Ligne .= fgets ( $fp, 255 ); $revnum = "v1." . $Ligne; } fclose ( $fp ); // On ferme le fichier } $showdepotversion .= @$datelastrev; return ($showdepotversion); } } class c_arr { function elus_section($id = "", $word = "", $whatpage=1) { global $db_s; $i = 0; $whatlimit = 15; $arr= ""; $ord_sql = " order by id asc"; $id_sql = ""; if (! empty ( $id )) $id_sql = " AND id='" . $id . "' "; if (! empty ( $ord )) $ord_sql = "" . $ord . ""; $req_sql = "SELECT * FROM elus_section where visible='1' " . $id_sql . " " . $ord_sql . " "; if($db_s->query($req_sql)); $arrcount = $db_s->num_rows(); $startarr = ($whatpage-1)*$whatlimit; $endarr = ($whatpage-1)*($whatlimit)+$whatlimit; $sql_limit = " LIMIT ".($whatlimit); $req_sql2 = "SELECT * FROM elus_section where visible='1' " . $id_sql . " " . $ord_sql . " LIMIT " . $startarr .", ".$endarr." "; $arr["arr"] = do_sql($req_sql2); $arr["tot"] = $arrcount; return ($arr); } function flux($urlflux){ setlocale (LC_TIME, 'fr_FR.utf8','fra'); $arr = ""; $html = "
"; $xml = simplexml_load_file($urlflux); for($i = 1; $i < 10; $i++){ $title = $xml->channel->item[$i]->title; $link = $xml->channel->item[$i]->link; $description = $xml->channel->item[$i]->description; $pubDate = $xml->channel->item[$i]->pubDate; $pubDate = ucfirst(strftime("%A %d %B %Y", strtotime($pubDate))); $html .= "

$title

"; $html .= "$pubDate

$description"; $html .= "


"; /* $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, ($link)); @curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_USERAGENT,'Googlebot/2.1 (+http://www.google.com/bot.html)'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $resultat = (curl_exec ($ch)); curl_close($ch); if(preg_match_all("#
(.*)
#", mysql_real_escape_string($resultat), $res)){ $html .= stripslashes(str_replace("\\n","",$res[0][0])); } */ } $html.="
"; return($html); } function articles_admin($id = "", $word = "", $whatpage=1) { global $db_s; $i = 0; $whatlimit = 999; $arr= ""; $ord_sql = " order by date desc, id desc "; $id_sql = ""; if (! empty ( $id )) $id_sql = " AND id='" . $id . "' "; if (! empty ( $ord )) $ord_sql = "" . $ord . ""; if (! empty ( $word )) $word_sql = "" . $word . ""; $req_sql = "SELECT * FROM articles where visible='1' " . $id_sql . " $word_sql " . $ord_sql . " "; if($db_s->query($req_sql)); $arrcount = $db_s->num_rows(); $startarr = ($whatpage-1)*$whatlimit; $endarr = ($whatpage-1)*($whatlimit)+$whatlimit; $sql_limit = " LIMIT ".($whatlimit); $req_sql2 = "SELECT * FROM articles where visible='1' " . $id_sql . " $word_sql " . $ord_sql . " LIMIT " . $startarr .", ".$endarr." "; $arr["arr"] = do_sql($req_sql2); $arr["tot"] = $arrcount; return ($arr); } function photos_a_jours($id = "", $word = "", $whatpage=1) { global $db_s; $i = 0; $whatlimit = 6; $arr= ""; $ord_sql = " order by id desc "; $id_sql = ""; if (! empty ( $id )) $id_sql = " AND id='" . $id . "' "; if (! empty ( $ord )) $ord_sql = "" . $ord . ""; $req_sql = "SELECT * FROM articles where visible='1' " . $id_sql . " " . $ord_sql . " "; if($db_s->query($req_sql)); $arrcount = $db_s->num_rows(); $startarr = ($whatpage-1)*$whatlimit; $endarr = ($whatpage-1)*($whatlimit)+$whatlimit; $sql_limit = " LIMIT ".($whatlimit); $req_sql2 = "SELECT * FROM articles where visible='1' " . $id_sql . " " . $ord_sql . " LIMIT " . $startarr .", ".$endarr." "; $arr["arr"] = do_sql($req_sql2); $arr["tot"] = $arrcount; return ($arr); } function tribunes($id = "", $word = "", $whatpage=1) { global $db_s; $i = 0; $whatlimit = 4; $arr= ""; $ord_sql = " order by date desc "; $id_sql = ""; $word_sql = ""; if (! empty ( $id )) $id_sql = " AND id='" . $id . "' "; if (! empty ( $word )) $word_sql = "" . $word . ""; if (! empty ( $ord )) $ord_sql = "" . $ord . ""; $req_sql = "SELECT * FROM articles where visible='1' " . $id_sql . " " . $word_sql . " " . $ord_sql . " "; if($db_s->query($req_sql)); $arrcount = $db_s->num_rows(); $startarr = ($whatpage-1)*4; $endarr = 4; $sql_limit = " LIMIT ".($whatlimit); $req_sql2 = "SELECT * FROM articles where visible='1' " . $id_sql . " " . $word_sql . " " . $ord_sql . " LIMIT " . $startarr .", ".$endarr." "; $arr["arr"] = do_sql($req_sql2); $arr["tot"] = $arrcount; return ($arr); } function tribunes_archives($id = "", $word = "", $whatpage=1) { global $db_s; $i = 0; $whatlimit = 8; $arr= ""; $ord_sql = " order by date desc "; $id_sql = ""; $word_sql = ""; if (! empty ( $id )) $id_sql = " AND id='" . $id . "' "; if (! empty ( $word )) $word_sql = "" . $word . ""; if (! empty ( $ord )) $ord_sql = "" . $ord . ""; $req_sql = "SELECT * FROM articles where visible='1' " . $id_sql . " " . $word_sql . " " . $ord_sql . " "; if($db_s->query($req_sql)); $arrcount = $db_s->num_rows(); $startarr = ($whatpage-1)*4; $endarr = 4; $sql_limit = " LIMIT ".($whatlimit); $req_sql2 = "SELECT * FROM articles where visible='1' " . $id_sql . " " . $word_sql . " " . $ord_sql . " LIMIT " . $startarr .", ".$endarr." "; $arr["arr"] = do_sql($req_sql2); $arr["tot"] = $arrcount; return ($arr); } function articles_archives($id = "", $word = "", $whatpage=1) { global $db_s; $i = 0; $whatlimit = 3; $arr= ""; $ord_sql = " order by date desc "; $id_sql = ""; $word_sql = ""; if (! empty ( $id )) $id_sql = " AND id='" . $id . "' "; if (! empty ( $word )) $word_sql = "" . $word . ""; if (! empty ( $ord )) $ord_sql = "" . $ord . ""; $req_sql = "SELECT * FROM articles where visible='1' " . $id_sql . " " . $word_sql . " " . $ord_sql . " "; if($db_s->query($req_sql)); $arrcount = $db_s->num_rows(); $startarr = ($whatpage-1)*3; $endarr = 3; $sql_limit = " LIMIT ".($whatlimit); $req_sql2 = "SELECT * FROM articles where visible='1' " . $id_sql . " " . $word_sql . " " . $ord_sql . " LIMIT " . $startarr .", ".$endarr." "; $arr["arr"] = do_sql($req_sql2); $arr["tot"] = $arrcount; return ($arr); } function articles($id = "", $word = "", $whatpage=1) { global $db_s; $i = 0; $whatlimit = 6; $arr= ""; $ord_sql = " order by date desc "; $id_sql = ""; $word_sql = ""; if (! empty ( $id )) $id_sql = " AND id='" . $id . "' "; if (! empty ( $word )) $word_sql = "" . $word . ""; if (! empty ( $ord )) $ord_sql = "" . $ord . ""; $req_sql = "SELECT * FROM articles where visible='1' " . $id_sql . " " . $word_sql . " " . $ord_sql . " "; if($db_s->query($req_sql)); $arrcount = $db_s->num_rows(); $startarr = ($whatpage-1)*3; $endarr = 3; $sql_limit = " LIMIT ".($whatlimit); $req_sql2 = "SELECT * FROM articles where visible='1' " . $id_sql . " " . $word_sql . " " . $ord_sql . " LIMIT " . $startarr .", ".$endarr." "; $arr["arr"] = do_sql($req_sql2); $arr["tot"] = $arrcount; return ($arr); } function news($id = "", $word = "", $whatpage=1) { global $db_s; $i = 0; $whatlimit = 6; $arr= ""; $ord_sql = " order by date desc "; $id_sql = ""; $word_sql = ""; if (! empty ( $id )) $id_sql = " AND id='" . $id . "' "; if (! empty ( $word )) $word_sql = "" . $word . ""; if (! empty ( $ord )) $ord_sql = "" . $ord . ""; $req_sql = "SELECT * FROM newsletters where visible='1' " . $id_sql . " " . $word_sql . " " . $ord_sql . " "; if($db_s->query($req_sql)); $arrcount = $db_s->num_rows(); $startarr = ($whatpage-1)*$whatlimit; $endarr = ($whatpage-1)*($whatlimit)+$whatlimit; $sql_limit = " LIMIT ".($whatlimit); $req_sql2 = "SELECT * FROM newsletters where visible='1' " . $id_sql . " " . $word_sql . " " . $ord_sql . " LIMIT " . $startarr .", ".$endarr." "; $arr["arr"] = do_sql($req_sql2); $arr["tot"] = $arrcount; return ($arr); } function articles_more($id = "", $word = "", $whatpage=1) { global $db_s; $i = 0; $whatlimit = 10; $arr= ""; $ord_sql = " order by id desc "; $id_sql = ""; if (! empty ( $id )) $id_sql = " AND id!='" . $id . "' "; if (! empty ( $ord )) $ord_sql = "" . $ord . ""; $req_sql = "SELECT * FROM articles where visible='1' " . $id_sql . " " . $ord_sql . " "; if($db_s->query($req_sql)); $arrcount = $db_s->num_rows(); $startarr = ($whatpage-1)*$whatlimit; $endarr = ($whatpage-1)*($whatlimit)+$whatlimit; $sql_limit = " LIMIT ".($whatlimit); $req_sql2 = "SELECT * FROM articles where (visible='1') " . $id_sql . " ORDER BY date desc, id desc LIMIT " . $startarr .", ".$endarr." "; $arr["arr"] = do_sql($req_sql2); $arr["tot"] = $arrcount; return ($arr); } function articles_flashinfos($limit=10) { global $db_s; $i = 0; $whatlimit = 3; $arr= ""; $ord_sql = " order by date desc, id desc "; $req_sql2 = "SELECT * FROM articles where (visible='1') $ord_sql LIMIT $limit "; $arr = do_sql($req_sql2); return ($arr); } } class c_affarrs { function newsletters_more_admin($i){ global $srcbase_url, $db_s; $form=""; $sql = "SELECT * FROM newsletters WHERE visible !='0' order by id desc"; if($db_s->query($sql)) if($db_s->num_rows()) while($db_s->next_record()){ $titre = utf8_encode($db_s->f("titre")); $titre_lnk = make_sortniceurl($titre,10,0,0); $id = $db_s->f("id"); $image = $db_s->f("image"); $file = $db_s->f("file"); $date= $db_s->f("date"); $i--; $form.='
Livry-Gargan passionnément n°'.$i.'

'.$titre.'

'.human_date($date).'

modifier | supprimer

'; } return($form); } function newsletter_center(){ global $srcbase_url, $db_s; $form=""; $sql = "SELECT * FROM newsletters WHERE visible !='0' order by id desc limit 3;"; if($db_s->query($sql)) if($i = ($db_s->num_rows()+1)) while($db_s->next_record()){ $titre = utf8_encode($db_s->f("titre")); $titre_lnk = make_sortniceurl($titre,10,0,0); $id = $db_s->f("id"); $image = $db_s->f("image"); $file = $db_s->f("file"); $i--; $form.='
'.$titre.'

'.$titre.'

télécharger

'; } $form.='
toutes les lettres des socialistes
'; return $form; } function newsletter_center_archives(){ global $srcbase_url, $db_s; $form=""; $sql = "SELECT * FROM newsletters WHERE visible !='0' order by id desc;"; if($db_s->query($sql)) $total_arraycount = $db_s->num_rows(); $page = isset($_GET["page"])?$_GET["page"]:1; $wpage = "section-lettres"; $nb_show = $limitarr = "3"; $startarr = ($page-1)*$limitarr; $sql = "SELECT * FROM newsletters WHERE visible !='0' order by id desc limit $startarr, $limitarr;"; if($db_s->query($sql)) if($i = ($db_s->num_rows()+1)) while($db_s->next_record()){ $titre = utf8_encode($db_s->f("titre")); $titre_lnk = make_sortniceurl($titre,10,0,0); $id = $db_s->f("id"); $image = $db_s->f("image"); $file = $db_s->f("file"); $i--; $form.='
'.$titre.'

'.$titre.'

télécharger

'; } //PPP $i = 0; $totalpages = ceil(($total_arraycount)/($nb_show)); $return.='
'; $disabledleft = "disabled"; if($wpage<=1)$disabledleft =""; if($totalpages>0){ $return.=' '; } $return.='
'; $form.=$return; return $form; } function liste_elus_section($arrtot){ $i = 0; $form = ""; foreach($arrtot["arr"] as $arr){ $id = ($arr ['id']); $nom = utf8_encode($arr ['nom']); $fonction = utf8_encode($arr ['fonction']); $image = utf8_encode($arr ['image']); $visible= utf8_encode($arr ['visible']); //$form.='
$form.='
'.$nom.' '.$fonction.'

'.$nom.'

'; } return($form); } function article_fullfiew($arr) { global $srcbase_url, $db_s; $return = ""; $total_arraycount = ($arr['tot']); if ($arr == "" || $arr == "err") return ("Cet article n'existe pas"); else { $return = ""; $i = 0; $id = ($arr ['arr'][$i] ['id']); $pdf = ""; if($db_s->query("SELECT * FROM pdf WHERE id_art = '".$id."'")) while($db_s->next_record()){ if($i==0) $pdf.="fichier(s) attaché(s) à télécharger : "; $pdf.= "".$db_s->f("titre_pdf").", "; $i++; } $i = 0; $pdf = substr($pdf,0, strlen($pdf)-2); $titre = utf8_encode($arr ['arr'][$i] ['titre']); $image_presa = utf8_encode($arr ['arr'][$i] ['image_presa']); $date = utf8_encode($arr ['arr'][$i] ['date']); $description_courte = utf8_encode($arr ['arr'][$i] ['texte_court']); $description_entier = utf8_encode($arr ['arr'][$i] ['texte_long']); $titre_lnk = make_sortniceurl ( $titre, 10, 3, 0, "sw" ); $theme = utf8_encode($arr ['arr'][$i] ['theme']); switch ($theme){ case "autres-publications": $themelnk = "section#section4"; $themetitle = "Autres publications"; break; case "tribunes": $themelnk = "tribunes"; $themetitle = "Tribunes"; break; case "cm": $themelnk = "conseil-municipal"; $themetitle = "Conseil municipal"; break; case "section": $themelnk = "section"; $themetitle = "Section"; break; case "actus": $themelnk = "section"; $themetitle = "Actus"; break; } $return .='

'.$titre.'

'.nl2br(($description_entier)).'
'.$pdf.'

Article publié le '.human_date($date).'
'; } $return.=''; return ($return); } function article_fullfiew_admin($arr) { global $srcbase_url, $db_s; $return = ""; $total_arraycount = ($arr['tot']); $message = ""; if(isset($_FILES) && !empty($_FILES)){ $dossier = '../images/'; $fichier = basename($_FILES['fichier']['name']); $taille_maxi = 100000000; $taille = filesize($_FILES['fichier']['tmp_name']); $extensions = array('.png', '.gif', '.jpg', '.jpeg'); $extension = strrchr($_FILES['fichier']['name'], '.'); //Début des vérifications de sécurité... if(!in_array($extension, $extensions)) //Si l'extension n'est pas dans le tableau { $erreur = 'Vous devez uploader un fichier de type png, gif, jpg, jpeg, txt ou doc...'; } if($taille>$taille_maxi) { $erreur = 'Le fichier est trop gros...'; } if(!isset($erreur)) //S'il n'y a pas d'erreur, on upload { //On formate le nom du fichier ici... $fichier = date("ymd-his",time()).strtr($fichier, 'ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÒÓÔÕÖÙÚÛÜÝàáâãäåçèéêëìíîïðòóôõöùúûüýÿ', 'AAAAAACEEEEIIIIOOOOOUUUUYaaaaaaceeeeiiiioooooouuuuyy'); $fichier = preg_replace('/([^.a-z0-9]+)/i', '-', $fichier); if(move_uploaded_file($_FILES['fichier']['tmp_name'], $dossier . $fichier)) //Si la fonction renvoie TRUE, c'est que ça a fonctionné... { //echo $fichier.' vers Upload effectué avec succès !'; $db_s->query("UPDATE articles SET image_presa = '".$fichier."' WHERE id='".$_GET["id_art"]."'"); header("Location:".$_SERVER[REQUEST_URI].""); } else //Sinon (la fonction renvoie FALSE). { echo 'Echec de l\'upload !'; } } else { echo $erreur; } } if ($arr == "" || $arr == "err") return ("Cet article n'existe pas"); else { $return = ""; $i = 0; $id = isset($arr ['arr'][$i] ['id'])?($arr ['arr'][$i] ['id']):uniqid(); $titre = utf8_encode($arr ['arr'][$i] ['titre']); $image_presa = utf8_encode($arr ['arr'][$i] ['image_presa']); $theme = utf8_encode($arr ['arr'][$i] ['theme']); $selactus=$selbilletshumeur=$selinfo=$seltribunes=$selcm=""; switch ($theme){ case "actus": $selactus = "selected"; break; case "billets-humeur": $selbilletshumeur="selected"; break; case "autres-publications": $selinfo="selected"; break; case "tribunes": $seltribunes="selected"; break; case "cm": $selcm="selected"; break; } if($db_s->query("SELECT * FROM pdf WHERE id_art = '".$id."';")) while($db_s->next_record()){ $pdf.="".$db_s->f("titre_pdf")." - f("id")."')>[x] supprimer"; } $date = utf8_encode($arr ['arr'][$i] ['date']); $description_courte = utf8_encode($arr ['arr'][$i] ['texte_court']); $description_entier = utf8_encode($arr ['arr'][$i] ['texte_long']); $titre_lnk = make_sortniceurl ( $titre, 10, 3, 0, "sw" ); $return .='
theme
titre :

  • date de publication

'.$pdf.'

 
'; } return ($return); } function news_fullfiew_admin($arr) { global $srcbase_url, $db_s; $return = ""; $total_arraycount = ($arr['tot']); $message = ""; if(isset($_FILES) && !empty($_FILES)){ $dossier = '../img/'; $fichier = basename($_FILES['fichier']['name']); $taille_maxi = 100000000; $taille = filesize($_FILES['fichier']['tmp_name']); $extensions = array('.png', '.gif', '.jpg', '.jpeg'); $extension = strrchr($_FILES['fichier']['name'], '.'); //Début des vérifications de sécurité... if(!in_array($extension, $extensions)) //Si l'extension n'est pas dans le tableau { $erreur = 'Vous devez uploader un fichier de type png, gif, jpg, jpeg, txt ou doc...'; } if($taille>$taille_maxi) { $erreur = 'Le fichier est trop gros...'; } if(!isset($erreur)) //S'il n'y a pas d'erreur, on upload { //On formate le nom du fichier ici... $fichier = date("ymd-his",time()).strtr($fichier, 'ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÒÓÔÕÖÙÚÛÜÝàáâãäåçèéêëìíîïðòóôõöùúûüýÿ', 'AAAAAACEEEEIIIIOOOOOUUUUYaaaaaaceeeeiiiioooooouuuuyy'); $fichier = preg_replace('/([^.a-z0-9]+)/i', '-', $fichier); if(move_uploaded_file($_FILES['fichier']['tmp_name'], $dossier . $fichier)) //Si la fonction renvoie TRUE, c'est que ça a fonctionné... { //echo $fichier.' vers Upload effectué avec succès !'; $db_s->query("UPDATE newsletters SET image = '".$fichier."' WHERE id='".$_GET["id_art"]."'"); header("Location:".$_SERVER[REQUEST_URI].""); } else //Sinon (la fonction renvoie FALSE). { echo 'Echec de l\'upload !'; } } else { echo $erreur; } } if ($arr == "" || $arr == "err") return ("Cet article n'existe pas"); else { $return = ""; $i = 0; $id = isset($arr ['arr'][$i] ['id'])?($arr ['arr'][$i] ['id']):uniqid(); $titre = utf8_encode($arr ['arr'][$i] ['titre']); $image_presa = utf8_encode($arr ['arr'][$i] ['image']); if($db_s->query("SELECT * FROM pdf WHERE id_art = '".$id."';")) while($db_s->next_record()){ $pdf.="".$db_s->f("titre_pdf")." - f("id")."')>[x] supprimer"; } $date = utf8_encode($arr ['arr'][$i] ['date']); $titre_lnk = make_sortniceurl ( $titre, 10, 3, 0, "sw" ); $return .='
titre :

  • date de publication

'.$pdf.'

 
'; } return ($return); } function article_new_admin($arr) { global $srcbase_url, $db_s; $return = ""; $total_arraycount = ($arr['tot']); $message = ""; if(isset($_FILES) && !empty($_FILES)){ $dossier = '../images/'; $fichier = basename($_FILES['fichier']['name']); $taille_maxi = 100000000; $taille = filesize($_FILES['fichier']['tmp_name']); $extensions = array('.png', '.gif', '.jpg', '.jpeg'); $extension = strrchr($_FILES['fichier']['name'], '.'); //Début des vérifications de sécurité... if(!in_array($extension, $extensions)) //Si l'extension n'est pas dans le tableau { $erreur = 'Vous devez uploader un fichier de type png, gif, jpg, jpeg, txt ou doc...'; } if($taille>$taille_maxi) { $erreur = 'Le fichier est trop gros...'; } if(!isset($erreur)) //S'il n'y a pas d'erreur, on upload { //On formate le nom du fichier ici... $fichier = strtr($fichier, 'ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÒÓÔÕÖÙÚÛÜÝàáâãäåçèéêëìíîïðòóôõöùúûüýÿ', 'AAAAAACEEEEIIIIOOOOOUUUUYaaaaaaceeeeiiiioooooouuuuyy'); $fichier = preg_replace('/([^.a-z0-9]+)/i', '-', $fichier); if(move_uploaded_file($_FILES['fichier']['tmp_name'], $dossier . $fichier)) //Si la fonction renvoie TRUE, c'est que ça a fonctionné... { //echo $fichier.' vers Upload effectué avec succès !'; $db_s->query("UPDATE articles SET image_presa = '".$fichier."' WHERE id='".$_GET["id_art"]."'"); header("Location:".$_SERVER[REQUEST_URI].""); } else //Sinon (la fonction renvoie FALSE). { echo 'Echec de l\'upload !'; } } else { echo $erreur; } } if ($arr == "" || $arr == "err") return ("Cet article n'existe pas"); else { $return = ""; $i = 0; $id = uniqid(); $titre = utf8_encode($arr ['arr'][$i] ['titre']); $image_presa = utf8_encode($arr ['arr'][$i] ['image_presa']); $date = date("Y-m-d h:i:s", time()); $description_courte = utf8_encode($arr ['arr'][$i] ['texte_court']); $description_entier = utf8_encode($arr ['arr'][$i] ['texte_long']); $titre_lnk = make_sortniceurl ( $titre, 10, 3, 0, "sw" ); $selactus=$selbilletshumeur=$selinfo=$seltribunes=$selcm=""; switch ($_GET["v"]){ case "actus": $selactus = "selected"; break; case "billets-humeur": $selbilletshumeur="selected"; break; case "autres-publications": $selinfo="selected"; break; case "tribunes": $seltribunes="selected"; break; case "cm": $selcm="selected"; break; } $return .='
Thème
Titre

 
'; } return ($return); } function photos_a_jour($arr = "", $nb_show = 6, $order = "", $limit=9999, $total_arraycount=6) { global $srcbase_url; $return = ""; $total_arraycount = ($arr['tot']); if ($arr == "" || $arr == "err") return ("Cet article n'existe pas"); else { $return = ""; $i = 0; if(count($arr['arr'])>=1) while ( (@$arr ['arr'][$i]) && $nb_show != $i ) { if($i > $limit) break; $id = ($arr ['arr'][$i] ['id']); $titre = utf8_encode($arr ['arr'][$i] ['titre']); $image_presa = utf8_encode($arr ['arr'][$i] ['image_presa']); $date = utf8_encode($arr ['arr'][$i] ['date']); $description_courte = utf8_encode($arr ['arr'][$i] ['texte_court']); $description_entier = utf8_encode($arr ['arr'][$i] ['texte_long']); $titre_lnk = make_sortniceurl ( $titre, 10, 3, 0, "sw" ); $return .='
  • '.$titre.'

  • '; $i++; } //PPP $i = 0; $totalpages = ceil(($total_arraycount)/($limit)); $return.=' '; } return ($return); } function tribunes_center_elus($arr = "", $nb_show = "5", $order = "", $limit=9999, $total_arraycount=5, $wpage="") { global $srcbase_url; $return = ""; $total_arraycount = ($arr['tot']); if ($arr == "" || $arr == "err") return ("Cet article n'existe pas"); else { $return = "
    "; $i = 0; if(count($arr['arr'])>=1) while ( (@$arr ['arr'][$i]) && $i<=$nb_show ) { $id = ($arr ['arr'][$i] ['id']); $titre = utf8_encode($arr ['arr'][$i] ['titre']); $image_presa = utf8_encode($arr ['arr'][$i] ['image_presa']); if($image_presa =="") $image_presa = "logo.jpg"; $date = utf8_encode($arr ['arr'][$i] ['date']); $description_entier = utf8_encode(substr($arr ['arr'][$i] ['texte_long'], 0, 142)); $description_entier = substr($description_entier, 0, strrpos($description_entier, " "))." ..."; $titre_lnk = make_sortniceurl ( $titre, 10, 3, 0, "sw" ); $return .='
    '.$titre.'
    '.human_date($date).'

    '.$titre.'




    lire
    '; $i++; } //PPP $i = 0; $return.='
    '; $return.='
    toutes les archives des tribunes
    '; } return ($return); } function tribunes_center_elus_cm($arr = "", $nb_show = "5", $order = "", $limit=9999, $total_arraycount=5, $wpage="") { global $srcbase_url; $return = ""; $total_arraycount = ($arr['tot']); if ($arr == "" || $arr == "err") return ("Cet article n'existe pas"); else { $return = "
    "; $i = 0; if(count($arr['arr'])>=1) while ( (@$arr ['arr'][$i]) && $i<=$nb_show ) { $id = ($arr ['arr'][$i] ['id']); $titre = utf8_encode($arr ['arr'][$i] ['titre']); $image_presa = utf8_encode($arr ['arr'][$i] ['image_presa']); $date = utf8_encode($arr ['arr'][$i] ['date']); $description_entier = utf8_encode(substr($arr ['arr'][$i] ['texte_long'], 0, 150)); $description_entier = substr($description_entier, 0, strrpos($description_entier, " "))." ..."; $titre_lnk = make_sortniceurl ( $titre, 10, 3, 0, "sw" ); if($image_presa=="") $image_presa="../img/logo.png"; $return .='
    '.$titre.'
    '.human_date($date).'

    '.$titre.'




    lire
    '; $i++; } //PPP $i = 0; $return.='
    '; $return.='
    toutes les archives du conseil municipal
    '; } return ($return); } function tribunes_center($arr = "", $nb_show = "5", $order = "", $limit=5, $total_arraycount=5, $wpage="") { global $srcbase_url; $return = ""; $total_arraycount = ($arr['tot']); if ($arr == "" || $arr == "err") return ("Cet article n'existe pas"); else { $return = "
    "; $i = 0; if(count($arr['arr'])>=1) while ( (@$arr ['arr'][$i]) ) { $id = ($arr ['arr'][$i] ['id']); $titre = utf8_encode($arr ['arr'][$i] ['titre']); $image_presa = utf8_encode($arr ['arr'][$i] ['image_presa']); $date = utf8_encode($arr ['arr'][$i] ['date']); $description_entier = utf8_encode(substr($arr ['arr'][$i] ['texte_long'], 0, 150)); $description_entier = substr($description_entier, 0, strrpos($description_entier, " "))." ..."; $titre_lnk = make_sortniceurl ( $titre, 10, 3, 0, "sw" ); $return .='
    '.$titre.'

    '.$titre.'

    '.$description_entier.'


    lire
    '; $i++; } //PPP $i = 0; $totalpages = ceil(($total_arraycount)/($nb_show)); $return.='
    '; $disabledleft = "disabled"; if($wpage<=1)$disabledleft =""; if($totalpages>0){ $return.=' '; } $return.='
    '; } return ($return); } function tribunes_center_archives($arr = "", $nb_show = "5", $order = "", $limit=9999, $total_arraycount=5, $wpage="") { global $srcbase_url; $return = ""; $total_arraycount = ($arr['tot']); if ($arr == "" || $arr == "err") return ("Cet article n'existe pas"); else { $return = "
    "; $i = 0; if(count($arr['arr'])>=1) while ( (@$arr ['arr'][$i]) ) { $id = ($arr ['arr'][$i] ['id']); $titre = utf8_encode($arr ['arr'][$i] ['titre']); $image_presa = utf8_encode($arr ['arr'][$i] ['image_presa']); $date = utf8_encode($arr ['arr'][$i] ['date']); $description_entier = utf8_encode(substr($arr ['arr'][$i] ['texte_long'], 0, 150)); $description_entier = substr($description_entier, 0, strrpos($description_entier, " "))." ..."; $titre_lnk = make_sortniceurl ( $titre, 10, 3, 0, "sw" ); $return .='
    '.$titre.'

    '.$titre.'

    '.$description_entier.'


    lire
    '; $i++; } //PPP $i = 0; $totalpages = ceil(($total_arraycount)/($nb_show)); $return.='
    '; $disabledleft = "disabled"; if($wpage<=1)$disabledleft =""; if($totalpages>0){ $return.=' '; } $return.='
    '; } return ($return); } function articles_center($arr = "", $nb_show = 5, $order = "", $limit=9999, $total_arraycount=5, $wpage="") { global $srcbase_url, $db_s; $return = ""; $total_arraycount = ($arr['tot']); if ($arr == "" || $arr == "err") return ("Cet article n'existe pas"); else { $return = "
    "; $i = 0; if(count($arr['arr'])>=1) while ( (@$arr ['arr'][$i]) && $nb_show != $i ) { if($i > $limit) break; $id = ($arr ['arr'][$i] ['id']); $titre = utf8_encode($arr ['arr'][$i] ['titre']); $image_presa = utf8_encode($arr ['arr'][$i] ['image_presa']); $date = utf8_encode($arr ['arr'][$i] ['date']); $description_entier = utf8_encode(substr($arr ['arr'][$i] ['texte_long'], 0, 150)); $description_entier = substr($description_entier, 0, strrpos($description_entier, " "))." ..."; $titre_lnk = make_sortniceurl ( $titre, 10, 3, 0, "sw" ); $return .='
    '.$titre.'

    '.$titre.'

    '.$description_entier.'


    lire
    '; $i++; } //PPP $i = 0; $totalpages = ceil(($total_arraycount)/($limit))-$limit; $return.='
    '; $disabledleft = "disabled"; if($wpage<=1)$disabledleft =""; if($totalpages>0){ $return.=' '; } $return.='
    '; } return ($return); } function articles_center_humeur($arr = "", $nb_show = 5, $order = "", $limit=9999, $total_arraycount=5, $wpage="") { global $srcbase_url, $db_s; $return = ""; $limit = "3"; $total_arraycount = ($arr['tot']); if ($arr == "" || $arr == "err") return ("Cet article n'existe pas"); else { $return = "
    "; $i = 0; if(count($arr['arr'])>=1) while ( (@$arr ['arr'][$i])) { if($i >= $limit) break; $id = ($arr ['arr'][$i] ['id']); $titre = utf8_encode($arr ['arr'][$i] ['titre']); $image_presa = utf8_encode($arr ['arr'][$i] ['image_presa']); $date = utf8_encode($arr ['arr'][$i] ['date']); $description_entier = utf8_encode(substr($arr ['arr'][$i] ['texte_long'], 0, 150)); $description_entier = substr($description_entier, 0, strrpos($description_entier, " "))." ..."; $titre_lnk = make_sortniceurl ( $titre, 10, 3, 0, "sw" ); $return .='
    '.$titre.'

    '.$titre.'

    '.$description_entier.'


    lire
    '; $i++; } //PPP $i = 0; $totalpages = ceil(($total_arraycount)/($limit)); $return.='
    '; $disabledleft = "disabled"; if($wpage<=1)$disabledleft =""; if($totalpages>0){ $return.='
    • «
    • '; } while($i != ($totalpages) && $totalpages>0){ if($i!=0){ if(@$_GET["page"]==($i+1)){ $return.='
    • '.($i+1).'
    • '; } else{ $return.='
    • '.($i+1).'
    • '; } } elseif(@!$_GET["page"]|| $_GET["page"]==(1)) $return.='
    • '.($i+1).'
    • '; else $return.='
    • '.($i+1).'
    • '; $i++; } if($totalpages>0){ $return.='
    • »
    '; } $return.='
    '; } return ($return); } function articles_center_section_archives($arr = "", $nb_show = 5, $order = "", $limit=9999, $total_arraycount=5, $wpage="") { global $srcbase_url; $return = ""; $total_arraycount = ($arr['tot']); if ($arr == "" || $arr == "err") return ("Cet article n'existe pas"); else { $return = "
    "; $i = 0; if(count($arr['arr'])>=1) while (@$arr ['arr'][$i] ) { $id = ($arr ['arr'][$i] ['id']); $titre = utf8_encode($arr ['arr'][$i] ['titre']); $image_presa = utf8_encode($arr ['arr'][$i] ['image_presa']); $date = utf8_encode($arr ['arr'][$i] ['date']); $description_entier = utf8_encode(substr($arr ['arr'][$i] ['texte_long'], 0, 150)); $description_entier = substr($description_entier, 0, strrpos($description_entier, " "))." ..."; $titre_lnk = make_sortniceurl ( $titre, 10, 3, 0, "sw" ); $return .='
    '.$titre.'

    '.$titre.'

    '.$description_entier.'


    lire
    '; $i++; } //PPP $i = 0; $totalpages = ceil(($total_arraycount)/($nb_show)); $return.='
    '; $disabledleft = "disabled"; if($wpage<=1)$disabledleft =""; if($totalpages>0){ $return.=' '; } $return.='
    '; } return ($return); } function articles_center_section($arr = "", $nb_show = 5, $order = "", $limit=9999, $total_arraycount=5, $wpage="") { global $srcbase_url; $return = ""; $total_arraycount = ($arr['tot']); if ($arr == "" || $arr == "err") return ("Cet article n'existe pas"); else { $return = "
    "; $i = 0; if(count($arr['arr'])>=1) while ( (@$arr ['arr'][$i]) && $i <3 ) { $id = ($arr ['arr'][$i] ['id']); $titre = utf8_encode($arr ['arr'][$i] ['titre']); $image_presa = utf8_encode($arr ['arr'][$i] ['image_presa']); $date = utf8_encode($arr ['arr'][$i] ['date']); $description_entier = utf8_encode(substr($arr ['arr'][$i] ['texte_long'], 0, 150)); $description_entier = substr($description_entier, 0, strrpos($description_entier, " "))." ..."; $titre_lnk = make_sortniceurl ( $titre, 10, 3, 0, "sw" ); $return .='
    '.$titre.'

    '.$titre.'

    '.$description_entier.'


    lire
    '; $i++; } //PPP $return.='
    toutes les archives de la section
    '; } return ($return); } function articles_more_admin($arr){ global $srcbase_url; $form=""; if(count($arr["arr"])>=1 && !empty($arr["arr"])) foreach(@$arr["arr"] as $ar){ $id = ($ar ['id']); $titre = utf8_encode($ar['titre']); $image_presa = utf8_encode($ar ['image_presa']); $date = utf8_encode($ar ['date']); $description_entier = utf8_encode($ar ['texte_long']); //$description_courte = substr($description_entier, 0, 125)."..."; $description_courte =$description_courte; $titre_lnk = make_sortniceurl ( $titre, 10, 3, 0, "sw" ); $form.='

    '.$titre.'

    '.human_date($date).'

    '.$description_courte.'

    modifier supprimer

    '; } $form.=' ' ; return($form); } function articles_more($arr){ global $srcbase_url; $form="
    "; $i = 0; foreach($arr["arr"] as $ar){ $id = ($ar ['id']); $titre = utf8_encode($ar['titre']); $image_presa = utf8_encode($ar ['image_presa']); $date = utf8_encode($ar ['date']); $description_entier = utf8_encode($ar ['texte_long']); $description_courte = substr($description_entier, 0, 250)."..."; $titre_lnk = make_sortniceurl ( $titre, 10, 3, 0, "sw" ); if($image_presa) if(strlen($description_entier)>100){ $form.='
    '.$titre.'

    '.($titre).'

    '.$description_courte.'

    lire

    '; $i++; } if($i>=3) break; } $form.="
    "; return($form); } function article_flashinfos($arr) { global $srcbase_url; $return=""; foreach($arr as $ar){ $id = ($ar ['id']); $titre = utf8_encode($ar['titre']); $date = utf8_encode($ar ['date']); $theme = utf8_encode($ar ['theme']); $image_presa = utf8_encode($ar ['image_presa']); $titre_lnk = make_sortniceurl ( $titre, 10, 3, 0, "sw" ); $description_entier = make_sortnicedescr(utf8_encode($ar ['texte_long'])."...",10,0,0)."..."; if($image_presa) if(strlen($ar ['texte_long'])>100) $return .= '
    '.$titre.'

    '.$titre.'

    le '.human_date($date).' dans "'.ucfirst($theme).'"

    '; } return($return); } } class c_funcs { function __construct() { ob_clean (); } function have_to_wait($mins_to_wait = "1") { // antispamm (1min) if (! isset ( $_SESSION ["send_mess"] ) || $_SESSION ["send_mess"] > time ()) { $_SESSION ["send_mess"] = time () + ($mins_to_wait * 60); return (false); } else { return (true); } } function sendmail($Destinataire="", $repondreaqui, $Sujet, $Message) { global $lang; $boundary = md5(uniqid(microtime(),TRUE)); $liste_bcc = "nicolas@my-eBusiness.fr"; //headers $From = "From: ps-livry-gargan.fr \n"; $From .= "MIME-version: 1.0\n"; if($Destinataire=="") $From .= "To: contact form. \n"; else $From .= "To: ".$Destinataire."\n"; if ($repondreaqui != "") { $From .= "Reply-To: " . $repondreaqui . "" . "\n"; } $From .= "Bcc: " . $liste_bcc . "\n"; $From .= "X-Priority: 1\n"; $From .= "Content-Type: multipart/mixed;boundary=".$boundary."\n"; $From .= "\n"; $msg = 'Texte affiché par des clients mail ne supportant pas le type MIME.'."\n\n"; $msg .= '--'.$boundary."\n"; $msg .= 'Content-type: text/html; charset=utf-8'."\n\n"; $msg .= $Message."\n"; $antispam = $this->have_to_wait (); if ($antispam==false) { //mail ( $Destinataire, $Sujet, $Message, $From ); mail ( $Destinataire, $Sujet, $msg, $From ); return (1); } else { if($lang=="fr") echo ("Antispam : merci d'attendre 1min.."); else echo ("Antispam : Thanks to wait 1min before sending another message (last sent to ".$Destinataire.")."); return (0); } } function form_contact() { global $srcbase_url, $lang; switch($lang){ case "fr"; $mess_selobj=" "; $mailformathtml = "

    Demandez-nous plus d'information au sujet de votre besoin. Complétez ce formulaire puis cliquez sur \"Envoyer\" pour nous faire parvenir votre requête. Nous vous répondrons dans les meilleurs délais. Sujet de votre message ".$mess_selobj." Prénom / Nom Nom entreprise eMail - pour vous répondre    

    Cassese.com -
    8 rue Denis Papin,
    77390 Verneuil l'Etang
    France

    Cassese.com -
    8 rue Denis Papin,
    77390 Verneuil l'Etang
    France

    Cassese.com -
    8 rue Denis Papin,
    77390 Verneuil l'Etang
    France

    "; break; case "en"; $mess_selobj=" "; $mailformathtml = "

    Ask us more information about what you need. Feel-in this form and click \"Send\" to submit your query.
    We'll answer you as quick as possible. Subject of your message ".$mess_selobj." First Name Family Name eMail - to receive our answer    

    Cassese.com -
    8 rue Denis Papin,
    77390 Verneuil l'Etang
    France

    Cassese.com -
    8 rue Denis Papin,
    77390 Verneuil l'Etang
    France

    Cassese.com -
    8 rue Denis Papin,
    77390 Verneuil l'Etang
    France

    "; break; case "es"; $mess_selobj=" "; $mailformathtml = "

    Ask us more information about what you need. Feel-in this form and click \"Send\" to submit your query.
    We'll answer you as quick as possible. Subject of your message ".$mess_selobj." First Name Family Name eMail - to receive our answer    

    Cassese.com -
    8 rue Denis Papin,
    77390 Verneuil l'Etang
    France

    Cassese.com -
    8 rue Denis Papin,
    77390 Verneuil l'Etang
    France

    Cassese.com -
    8 rue Denis Papin,
    77390 Verneuil l'Etang
    France

    "; break; case "de"; $mess_selobj=" "; $mailformathtml = "

    Ask us more information about what you need. Feel-in this form and click \"Send\" to submit your query.
    We'll answer you as quick as possible. Subject of your message ".$mess_selobj." First Name Family Name eMail - to receive our answer    

    Cassese.com -
    8 rue Denis Papin,
    77390 Verneuil l'Etang
    France

    Cassese.com -
    8 rue Denis Papin,
    77390 Verneuil l'Etang
    France

    Cassese.com -
    8 rue Denis Papin,
    77390 Verneuil l'Etang
    France

    "; break; case "it"; $mess_selobj=" "; $mailformathtml = "

    Ask us more information about what you need. Feel-in this form and click \"Send\" to submit your query.
    We'll answer you as quick as possible. Subject of your message ".$mess_selobj." First Name Family Name eMail - to receive our answer    

    Cassese.com -
    8 rue Denis Papin,
    77390 Verneuil l'Etang
    France

    Cassese.com -
    8 rue Denis Papin,
    77390 Verneuil l'Etang
    France

    Cassese.com -
    8 rue Denis Papin,
    77390 Verneuil l'Etang
    France

    "; break; case "zn"; $mess_selobj=" "; $mailformathtml = "

    Ask us more information about what you need. Feel-in this form and click \"Send\" to submit your query.
    We'll answer you as quick as possible. Subject of your message ".$mess_selobj." First Name Family Name eMail - to receive our answer    

    Cassese.com -
    8 rue Denis Papin,
    77390 Verneuil l'Etang
    France

    Cassese.com -
    8 rue Denis Papin,
    77390 Verneuil l'Etang
    France

    Cassese.com -
    8 rue Denis Papin,
    77390 Verneuil l'Etang
    France

    "; break; } return ($mailformathtml); } } class c_admin { function articles_show($arr = "", $nb_show = 10, $order = "") { global $srcbase_url; $return = ""; if ($arr == "") return ("Cet article n'existe pas"); else { $return = "
    "; $i = 0; while ( (@$arr [$i]) && $nb_show != $i ) { $id = ($arr [$i] ['id']); $titre = ($arr [$i] ['titre']); $description_courte = nl2br ( $arr [$i] ['texte'] ); $description_entier = nl2br ( $arr [$i] ['texte_entier'] ); $titre_lnk = make_sortniceurl ( $titre, 10, 3, 0, "sw" ); if (1) $return .= "

    " . $titre . "

    " . $description_entier . ""; else $return .= "

    " . $titre . "

    " . $description . "

    "; $i ++; } $return .= "
    "; } return ($return); } } ?>