include("includes/connect.php");
include("includes/inc_fonctions.inc");
include("mo_boutique/inc_variables.php");
$nom_table_news="mod_news";
$zone_id=1;
$req_news="select news_titre,news_complet,".$nom_table_news."_news_theme.theme_id,theme_lib,news_photo,".$nom_table_news."_news_news.news_id from ".$nom_table_news."_news_news, ".$nom_table_news."_news_theme, ".$nom_table_news."_correspondance_themes where ".$nom_table_news."_news_news.news_id=".$nom_table_news."_correspondance_themes.news_id and ".$nom_table_news."_correspondance_themes.theme_id=".$nom_table_news."_news_theme.theme_id and news_etat='news' and ".$nom_table_news."_news_news.news_id=".$_GET['news_id']." and ".$nom_table_news."_news_news.zone_id=".$zone_id." group by ".$nom_table_news."_news_news.news_id";
//echo $req_news;
$result_news=mysql_query($req_news);
$nb_news=@mysql_num_rows($result_news);
//exit();
if($nb_news!=1){
$req_news="select * from ".$nom_table_news."_news_news, ".$nom_table_news."_news_theme, ".$nom_table_news."_correspondance_themes where ".$nom_table."_news_news.news_id=".$nom_table_news."_correspondance_themes.news_id and ".$nom_table_news."_correspondance_themes.theme_id=".$nom_table_news."_news_theme.theme_id and news_etat='news' and ".$nom_table_news."_news_news.zone_id=4 order by news_date desc limit 0,1";
//echo $req_news;
$result_news=mysql_query($req_news);
$nb_news=@mysql_num_rows($result_news);
}
if($nb_news!=1){header("location:/"); }
/*--- Affichage de la news complète ---*/
$news_titremod=stripslashes(mysql_result($result_news,0,'news_titre'));
$news_completmod=stripslashes(mysql_result($result_news,0,'news_complet'));
$news_complet_desc=strip_tags($news_completmod);
$news_theme_id=stripslashes(mysql_result($result_news,0,'theme_id'));
$news_theme_lib=stripslashes(mysql_result($result_news,0,'theme_lib'));
$news_photo=mysql_result($result_news,0,'news_photo');
$news_id=mysql_result($result_news,0,'news_id');
$mondomaine="http://www.nova-tm.com/";
//$monUrl = "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
$monUrl = $mondomaine.$_SERVER['REQUEST_URI'];
$nom_rewriting_titre=rewrite_var($news_titremod);
$nom_rewriting_titre=strtolower($nom_rewriting_titre);
$url_ideale=$mondomaine."/nova,".$nom_rewriting_titre.",".$news_id.",".$zone_id.".html";
//echo ""."
";
//echo $monUrl;
// on check qu'on est bien sur l'url idéale
if($monUrl!=$url_ideale){
header("Status: 301 Moved Permanently", false, 301);header("location:".$url_ideale);exit();
}
$news_desc_completmod=str_replace(CHR(10),"",$news_complet_desc);
$news_desc_completmod=str_replace(CHR(13),"",$news_desc_completmod);
?>
echo $news_completmod; ?>
/******************************* traitement des photos ********************************/ $req_photo="select photo_lib, photo_desc from ".$nom_table_news."_news_photo where news_id='$news_photo' order by photo_lib"; //echo $req_photo; $result_photo=mysql_query($req_photo); $nb_photos=@mysql_num_rows($result_photo); ?> if ($nb_photos>0){ ?>Aussi dans l’actu :
/*-- Récupération des news à afficher après MAJ état --*/ $req_liste_actu_liste="select news_titre,news_complet, ".$nom_table_news."_news_news.news_id from ".$nom_table_news."_news_news, ".$nom_table_news."_news_theme, ".$nom_table_news."_correspondance_themes where ".$nom_table_news."_news_news.news_id=".$nom_table_news."_correspondance_themes.news_id and ".$nom_table_news."_correspondance_themes.theme_id=".$nom_table_news."_news_theme.theme_id and news_etat='news' and ".$nom_table_news."_news_news.zone_id=$zone_id and ".$nom_table_news."_news_news.news_id!=".$news_id." group by ".$nom_table_news."_news_news.news_id order by news_date desc, ".$nom_table_news."_news_news.news_id desc"; $result_liste_actu_liste=mysql_query($req_liste_actu_liste); while($rows_home_liste=mysql_fetch_array($result_liste_actu_liste)){ $actu_titre_liste=$rows_home_liste['news_titre']; $actu_contenu=$rows_home_liste['news_complet']; // on traite les nom pour l'url rewriting : $nom_rewriting_titre_liste=rewrite_var($actu_titre_liste); $nom_rewriting_titre_liste=strtolower($nom_rewriting_titre_liste); ?> } ?>