include"confcms2.php";
$db = mysql_connect("$dbchemin","$dbuser","$dbpass") or mysql_die("Connexion impossible");
$err = mysql_error();
if ($err) {
echo "Uh oh! There's an error! newsplanning Here it is: ";
echo "$err";
}
mysql_select_db("$dbname");
$err = mysql_error();
if ($err) {
echo "Uh oh! There's an error! basenews Here it is: ";
echo "$err";
}
$authors = mysql_query("SELECT ID, Name FROM authors");
$cats = mysql_query("SELECT id, Name FROM categories");
$ans = mysql_query("SELECT ID, Name FROM an");
$moi = mysql_query("SELECT ID, Name FROM mois");
$mot = mysql_query("SELECT ID, Name FROM motcle3");
// Allow the user to edit the author with ID=$id
$premier=""; $deux=""; $trois=""; $quatre=""; $cinq=""; $six=""; $sept="";
$prem=""; $ddeux=""; $ttrois=""; $qquatre=""; $ccinq=""; $ssix=""; $ssept="";
$page="";
$nb=0;
$Selecti="";
if (isset($_GET['article']))
{
$article =$_GET['article'];}
else{
$article =$_GET['id'];
}
$resul=mysql_query("SELECT * FROM breves WHERE ID='$article' ");
$rech = mysql_fetch_array($resul);
$idbr = $rech["ID"];
$tete = $rech["titre"];
/*
$tete = ereg_replace("é","é",$tete);
$tete = ereg_replace("à","à",$tete);
$tete = ereg_replace("ê","ê",$tete);
$tete = ereg_replace("î","î",$tete);
$tete = ereg_replace("Ï","ï",$tete);
$tete = ereg_replace("è","è",$tete);
$tete = ereg_replace("ç","ç",$tete);
$tete = ereg_replace("û","û",$tete);
$tete = ereg_replace("ù","ù",$tete);
$tete = ereg_replace("ô","ô",$tete);
$tete = ereg_replace("â","â",$tete);
*/
$joketext = $rech["texte_long"];
/*
$joketext = ereg_replace("é","é",$joketext);
$joketext = ereg_replace("à","à",$joketext);
$joketext = ereg_replace("ê","ê",$joketext);
$joketext = ereg_replace("î","î",$joketext);
$joketext = ereg_replace("Ï","ï",$joketext);
$joketext = ereg_replace("è","è",$joketext);
$joketext = ereg_replace("ç","ç",$joketext);
$joketext = ereg_replace("û","û",$joketext);
$joketext = ereg_replace("ù","ù",$joketext);
$joketext = ereg_replace("ô","ô",$joketext);
$joketext = ereg_replace("â","â",$joketext);
*/
$ref = $rech["reference"];
$item = $rech["item"];
$dte = $rech["date"];
$year1=substr($dte,0,4);
$mois1=substr($dte,5,2);
$jour1=substr($dte,8,2);
$jokedt = "$jour1-$mois1-$year1";
$key1 = $rech["key1"];
$plus=" ," ." ,". " ,". " ," ." ,"." ,";
$key1= "$key1" . "$plus";
list($premier, $deux, $trois, $quatre, $cinq, $six, $sept)=split('[,]',$key1,7);
$explode = explode(",", "$key1");
if ($premier != "" )
{
$explode1 = explode(" ", "$premier");
$premier = trim($premier);
$prem= "$premier";
}
if ($deux != "" )
{$ddeux= trim($deux);
}
if ($item =="") {
$item= trim($prem);
$item .= "+";
$item .= trim($ddeux);
if (!empty($item))
{
$mots = str_replace(" ", "+", $item); // on remplace les , par des espaces
$mots = str_replace(" de ", "", $mots); // on remplace les : par des espaces
$mots = str_replace(" des ", "", $mots); // on remplace les : par des espaces
$mots = str_replace(" le ", "", $mots); // on remplace les : par des espaces
$mots = str_replace(" les ", "", $mots); // on remplace les : par des espaces
$mots = str_replace(" la ", "", $mots); // on remplace les : par des espaces
//echo " $mots mot1";
$mots = str_replace("+++", "+", $mots); // on remplace les +++ par un +
$mots = str_replace("++", "+", $mots); // on remplace les ++ par un +
$item=$mots;
//echo " $item item";
}
}
/*
$joketext = eregi_replace("\[b]","",$joketext);
$joketext = eregi_replace("\[eb]","",$joketext);
$joketext = eregi_replace("\[i]","",$joketext);
$joketext = eregi_replace("\[ei]","",$joketext);
// Paragraphs and line breaks
$joketext = ereg_replace("\r","",$joketext);
$joketext = ereg_replace("\n\n","",$joketext);
$joketext = ereg_replace("\n"," ",$joketext);
// Hyperlinks
$joketext = ereg_replace(
"\[L]([-_./a-zA-Z0-9!&%#?,'=:~]+)\[EL]",
"\\1", $joketext);
$joketext = ereg_replace(
"\[L=([-_./a-zA-Z0-9!&%#?,'=:~]+)]".
"([-_./a-zA-Z0-9 !&%#?,'=:~]+)\[EL]",
"\\2", $joketext);
*/
echo("
$tete
");
echo("$joketext ");
echo (" Publié le $jokedt ");
if ($premier != "," )
{
$explode1 = explode(" ", "$premier");
$premier = trim($premier);
$prem= "$premier , ";
}
if (trim($deux) == "," )
{
$deux = str_replace(",", "", $deux);
$deux = trim($deux);
$ddeux= "$deux";
}
if (trim($trois) == "," )
{
$trois = str_replace(",", "", $trois);
$trois = trim($trois);
$ttrois= "$trois , ";
}
if (trim($quatre) == "," )
{
$quatre = str_replace(",", "", $quatre);
$quatre = trim($quatre);
$qquatre= "$quatre , ";
}
if (trim($cinq) == "," )
{
$cinq = str_replace(",", "", $cinq);
$ccinq= "$cinq ,";
}
if (trim($six) == "," )
{
$six = str_replace(",","", $six);
$ssix= "$six ,";
}
if (trim($sept) == "," )
{
$sept = str_replace(",", "", $sept);
$ssept= "$sept";
}
echo "";
if (!empty($item))
{
$FRecherche ="$item";
if (!empty($FRecherche))
{
$FRecherche=strtolower($FRecherche); // on passe les mots recherchés en minuscules
$mots = str_replace("+", " ", trim($FRecherche)); // on remplace les + par des espaces
$mots = str_replace("\"", " ", $mots); // on remplace les " par des espaces
$mots = str_replace(",", " ", $mots); // on remplace les , par des espaces
$mots = str_replace(":", " ", $mots); // on remplace les : par des espaces
$mots = str_replace(" de", "", $mots); // on remplace les : par des espaces
$mots = str_replace(" des", "", $mots); // on remplace les : par des espaces
$mots = str_replace(" le", "", $mots); // on remplace les : par des espaces
$mots = str_replace(" les", "", $mots); // on remplace les : par des espaces
$mots = str_replace(" la", "", $mots); // on remplace les : par des espaces
$tab=explode(" " , $mots); // on place les differents mots dans un tableau
$nbref=count($tab); // on compte le nbr d'élément du tableau.
//$FRecherche=rawurlencode($FRecherche);
//echo "$nbref ";
}
$operateur ="AND";
$Nb_msg_page = "3";
// Traitement de la chaine
$FRecherche = trim($FRecherche);
$affi_page = "$Nb_msg_page";
// Gestionnaire de pages
if ($page == "" or $page == "1")
{
$page = "1";
$debut = "0";
}
else
{
$debut = ($page - 1) * $affi_page;
}
// The basic SELECT statement
$select = "SELECT * ";
$from = " FROM breves";
$where = " WHERE ID > 0";
//echo "where $where";
if ($FRecherche != "") { // Some search text was specified
//if ($searchtext != "") { // Some search text was specified
//$where .= " AND texte_long LIKE '%$FRecherche%' ";
$where .= " AND texte_long like '%$tab[0]%' ";
for($i=1 ; $i<$nb; $i++)
{
$where .="$operateur texte_long like \"%$tab[$i]%\" ";
$where .= " ORDER BY ID DESC ";
// on boucle pour integrer tous les mots dans la requête
}
}
$mysql_result = mysql_query($select . $from . $where);
// Nb total d'articles trouvés
$nb_t = mysql_num_rows($mysql_result);
$test = $page * $affi_page;
if ($test > $nb_t)
{
$page_c = $page - 1;
$affi_page = $nb_t - ($affi_page * $page_c);
}
$select = "SELECT * ";
$from = " FROM breves";
$where = " WHERE ID > 0";
if ($FRecherche != "") { // Some search text was specified
$where .= " AND texte_long like '%$tab[0]%' ";
for($i=1 ; $i<$nbref; $i++)
{
$where .="$operateur texte_long like \"%$tab[$i]%\" ";
// on boucle pour integrer tous les mots dans la requête
}
$Selecti .= "&FRecherche=$FRecherche";
}
$where .= " ORDER BY ID DESC ";
$where .= " LIMIT $debut,$affi_page ";
//echo( " $nb_t article(s) trouvé(s).");
/*
$selecto1= str_replace(" ", "+", trim($FRecherche)); // on remplace les + par des espaces ;
$Selecto="FRecherche=$selecto1&TRecherche=$TRecherche&ARecherche=$ARecherche&operateur=AND&LuRecherche=&$LuRecherche&IDRecherche=$IDRecherche&VXRecherche=$VXRecherche¶ut=$paraut&partit=$partit&submit=Search";
*/
//if (!empty($jokes))
$jokes = mysql_query($select . $from . $where);
// Nb total d'articles trouvés
$nb_tar = mysql_num_rows($jokes);
$nb_tar = $nb_tar -1;
if (!$jokes) {
echo("Error retrieving jokes from database! ".
"Error: " . mysql_error());
exit();
}
if ($nb_tar > 0) {
echo "
Fichier(s) complémentaire(s) ou connexe(s) ";
}
while ($joke = mysql_fetch_array($jokes)) {
echo(" \n");
$id = $joke["ID"];
$tite = $joke["tit"];
$titre = $joke["titre"];
$joketext1 = $joke["petit"];
$joketext = $joke["texte_long"];
$text2= $joke["texte_court"];
$idte = $joke["ID"];
//echo "$id $qui";
//echo " $FRecherche FRecherche";
if($id != "$idbr"){
echo("$titre Lire | \n");
/*
echo(" \n");
echo("\n");
echo(" | \n");
echo(" ");
*/
}
}
}
if (!empty($item))
{
$FRecherche ="$item";
if (!empty($FRecherche))
{
$FRecherche=strtolower($FRecherche); // on passe les mots recherchés en minuscules
$mots = str_replace("+", " ", trim($FRecherche)); // on remplace les + par des espaces
$mots = str_replace("\"", " ", $mots); // on remplace les " par des espaces
$mots = str_replace(",", " ", $mots); // on remplace les , par des espaces
$mots = str_replace(":", " ", $mots); // on remplace les : par des espaces
$mots = str_replace(" de", "", $mots); // on remplace les : par des espaces
$mots = str_replace(" des", "", $mots); // on remplace les : par des espaces
$mots = str_replace(" le", "", $mots); // on remplace les : par des espaces
$mots = str_replace(" les", "", $mots); // on remplace les : par des espaces
$mots = str_replace(" la", "", $mots); // on remplace les : par des espaces
$tab=explode(" " , $mots); // on place les differents mots dans un tableau
$nbref=count($tab); // on compte le nbr d'élément du tableau.
//$FRecherche=rawurlencode($FRecherche);
}
$operateur ="AND";
$Nb_msg_page = "3";
// Traitement de la chaine
$FRecherche = trim($FRecherche);
$affi_page = "$Nb_msg_page";
// Gestionnaire de pages
if ($page == "" or $page == "1")
{
$page = "1";
$debut = "0";
}
else
{
$debut = ($page - 1) * $affi_page;
}
// The basic SELECT statement
$select = "SELECT * ";
$from = " FROM feed";
$where = " WHERE ID > 0";
if ($FRecherche != "") { // Some search text was specified
$where .= " AND texte_long like '%$tab[0]%' ";
for($i=1 ; $i<$nb; $i++)
{
$where .="$operateur texte_long like \"%$tab[$i]%\" ";
$where .= " ORDER BY ID DESC ";
// on boucle pour integrer tous les mots dans la requête
}
}
$mysql_result = mysql_query($select . $from . $where);
// Nb total d'articles trouvés
$nb_t = mysql_num_rows($mysql_result);
$test = $page * $affi_page;
if ($test > $nb_t)
{
$page_c = $page - 1;
$affi_page = $nb_t - ($affi_page * $page_c);
}
$select = "SELECT * ";
$from = " FROM feed";
$where = " WHERE ID > 0";
if ($FRecherche != "") { // Some search text was specified
$where .= " AND texte_long like '%$tab[0]%' ";
for($i=1 ; $i<$nbref; $i++)
{
$where .="$operateur texte_long like \"%$tab[$i]%\" ";
// on boucle pour integrer tous les mots dans la requête
}
$Selecti .= "&FRecherche=$FRecherche";
}
$where .= " ORDER BY ID DESC ";
$where .= " LIMIT $debut,$affi_page ";
/*
$selecto1= str_replace(" ", "+", trim($FRecherche)); // on remplace les + par des espaces ;
$Selecto="FRecherche=$selecto1&TRecherche=$TRecherche&ARecherche=$ARecherche&operateur=AND&LuRecherche=&$LuRecherche&IDRecherche=$IDRecherche&VXRecherche=$VXRecherche¶ut=$paraut&partit=$partit&submit=Search";
*/
$jokes = mysql_query($select . $from . $where);
// Nb total d'articles trouvés
$nb_tf = mysql_num_rows($jokes);
if (!$jokes) {
echo("Error retrieving jokes from database! ".
"Error: " . mysql_error());
exit();
}
if ($nb_tar < 1) {
if ($nb_tf > 0) {
echo "
Fichier(s) complémentaire(s) ou connexe(s) ";
}}
while ($joke = mysql_fetch_array($jokes)) {
echo(" | \n");
$id = $joke["ID"];
$tite = $joke["tit"];
$titre = $joke["titre"];
$joketext1 = $joke["petit"];
$joketext = $joke["texte_long"];
$text2= $joke["texte_court"];
$idte = $joke["ID"];
if($id != "$idbr"){
echo("$titre Lire | \n");
/*
echo(" \n");
echo("\n");
echo(" | \n");
echo(" ");
*/
}
}
}
echo(" |
");
echo ("Si vous souhaitez faire une recherche complémentaire, copiez-collez un ou plusieurs ( recherche plus restreinte ) des mots ci-dessous dans google search ci-dessous
Voici les Mots clefs de cet article : ");
if ($premier != "," )
{
$explode1 = explode(" ", "$premier");
$premier = trim($premier);
$prem= "$premier , ";
}
if (trim($deux) == "," )
{
$deux = str_replace(",", "", $deux);
$deux = trim($deux);
$ddeux= "$deux";
}
if (trim($trois) == "," )
{
$trois = str_replace(",", "", $trois);
$trois = trim($trois);
$ttrois= "$trois , ";
}
if (trim($quatre) == "," )
{
$quatre = str_replace(",", "", $quatre);
$quatre = trim($quatre);
$qquatre= "$quatre , ";
}
if (trim($cinq) == "," )
{
$cinq = str_replace(",", "", $cinq);
$ccinq= "$cinq ,";
}
if (trim($six) == "," )
{
$six = str_replace(",","", $six);
$ssix= "$six ,";
}
if (trim($sept) == "," )
{
$sept = str_replace(",", "", $sept);
$ssept= "$sept";
//echo "sept $sept";
}
/*
if ($premier != "" )
{
$explode1 = explode(" ", "$premier");
$premier = trim($premier);
$prem= "$premier , ";
}
if ($deux != "" )
{
$deux = trim($deux);
$ddeux= "$deux , ";
}
if ($trois != "" )
{
$trois = trim($trois);
$ttrois= "$trois , ";
}
if ($quatre != "" )
{
$quatre = trim($quatre);
$qquatre= "$quatre , ";
}
if ($cinq != "" )
{$ccinq= "$cinq ,";
}
if ($six != "" )
{$ssix= "$six ,";
}
if ($sept != "" )
{$ssept= "$sept";
}
*/
echo ("$prem $ddeux $ttrois $qquatre $ccinq $ssix $ssept ");
echo (' | | ');
echo " | Version pour Impression [Zoom]";
$resultat = mysql_query("select * from feed");
$nombre2 = mysql_num_rows($resultat);
$succ = mysql_data_seek($resultat,$nombre2-1);
$idnew2 ="$nombre2" -10;
$requete2 = "SELECT * FROM feed LIMIT $idnew2 , 10";
//$requete2="select * from articles where ID >='$idnew2' ";
$jokes = mysql_query($requete2);
/*
$requete="select max(ID) from feed";
$result1 = mysql_query($requete);
if ($result1){
//echo "$result1";
$idmax=mysql_result($result1,0,"max(ID)");
//echo " Maxi $idmax";
$idnew="$idmax" -7;
}
echo("Les dernières Brèves: ");
$requete2="select * from feed where ID >='$idnew' ";
$jokes = mysql_query($requete2);
//$jokes = mysql_query(select * from artbrnew where ID > "$idnew");
*/
while ($joke = mysql_fetch_array($jokes)) {
$titre = $joke["titre"];
/*
$titre = ereg_replace("é","é",$titre);
$titre = ereg_replace("à","à",$titre);
$titre = ereg_replace("ê","ê",$titre);
$titre = ereg_replace("î","î",$titre);
$titre = ereg_replace("Ï","ï",$titre);
$titre = ereg_replace("è","è",$titre);
$titre = ereg_replace("ç","ç",$titre);
$titre = ereg_replace("û","û",$titre);
$titre = ereg_replace("ù","ù",$titre);
$titre = ereg_replace("ô","ô",$titre);
$titre = ereg_replace("â","â",$titre);
*/
$id = $joke["ID"];
$dtt = $joke["date"];
$dte = $joke["date"];
$year1=substr($dte,0,4);
$mois1=substr($dte,5,2);
$jour1=substr($dte,8,2);
$jokedt = "$jour1-$mois1-$year1";
$dtit = $joke["tit"];
/*
if($id<79){
echo ("$jokedt - $titre Lire ");
}
if ($id>78 and $id < 203) {
echo ("$jokedt - $titre Lire ");
}
if($id>203){
echo ("$jokedt - $titre Lire ");
}
}
if($id<79){
echo ("$jokedt - $titre Lire ");
}else{
echo ("$jokedt - $titre Lire ");
}
}
*/
echo ("$jokedt - $titre Lire ");
}
echo ('Plus de brèves');
echo' |