sub_name; $sub_url[] = $row->sub_url; } //ON RECUPERE L'ARTICLE/DESCRIPTION/CORP DE LA PAGE $sql = "SELECT * FROM pages WHERE '$go' = id_page"; $res = mysql_query($sql); if (mysql_num_rows($res)==0) { $error = "Pas de texte pour cette page connectez-vous a votre espace admin"; @mysql_close($db); } else { $titre_page = mysql_result ($res,$i,"titre_page"); $texte_page = mysql_result ($res,$i,"texte_page"); $key_word = mysql_result ($res,$i,"key_word"); } // RECUPERE LES NEWS $sql = "SELECT * FROM news ORDER BY date_news DESC limit 0,4"; $res = mysql_query($sql); while ( $row=mysql_fetch_object($res)) { $date_news[] = $row->date_news; $titre_news[] = $row->titre_news; $text_news[] = $row->text_news; $url_news[] = $row->url_news; $id_news[] = $row->id_news; } //DEF DANS LE TEMPLATE $smarty->assign("titre_page","$titre_page"); $smarty->assign("texte_page","$texte_page"); $smarty->assign("key_word","$key_word"); $smarty->assign("error","$error"); $smarty->assign("go","$go"); $smarty->assign("nom_page","$nom_page"); $smarty -> assign (array("sub_name" => $sub_name)); $smarty -> assign (array("sub_url" => $sub_url)); $smarty -> assign (array("date_news" => $date_news)); $smarty -> assign (array("titre_news" => $titre_news)); $smarty -> assign (array("text_news" => $text_news)); $smarty -> assign (array("url_news" => $url_news)); $smarty -> assign (array("id_news" => $id_news)); // VERSION UNIVERSEL POUR LES META TAG DANS LE HEADER $smarty -> assign (array("meta_title" => $titre_page)); $smarty -> assign (array("meta_desc" => $texte_page)); // assignation de la page template $smarty->display('pages.tpl'); ?>