require("connDb.php");
require("./class.date.php");
require("./class.pub.php");
//--
$objDate = new classDate();
$objPub = new classPub();
$photoPath = "./images_art/";
$pubPath = "./images_pub/";
$publiPath = "./images_publi/";
//--
////*****************************************************//
/// FONCTION TRONCATURE //
///******************************************************//
function splitStr($str,$maxCar) {
if(strlen($str) > $maxCar) {
$str = wordwrap( $str, $maxCar, "¤", 0);
$t_str = explode("¤",$str);
//$str = $t_str[0]."...";
} else {
$t_str[] = $str;
}
return $t_str;
}
////*****************************************************//
/// FONCTION SETFORMAT //
///******************************************************//
function setFormat($str) {
$t_type = array("bold" => "b","italic" => "i","underline" => "u");
//--BOLD
reset($t_type);
while (list($key, $val) = each($t_type)) {
$str = preg_replace("/\[".$key."\](.+)\[\/".$key."\]/","<".$val.">\\1".$val.">",$str);
}
//--Gestion des URL
$str = preg_replace("/\[url([^]]+)?\](.+)\[\/url\]/Ui","\\2",$str);
//--
if(ereg("\[code\](.*)\[/code\]",$str,$regs)) {
$code = highlight_string($regs[1],true); //--Le code s'illuminue ;-)
//--On met le code dans un zolie tableau :
$code = "
".$code."
";
//--
$str = str_replace("[code]".$regs[1]."[/code]",$code,$str);
}
$str = nl2br($str);
return $str;
}
//--RUBRIQUE
$t_rubrique = array();
$query = "SELECT * FROM rubrique";
$res = mysql_query($query,$mysql_link);
if(!$res) die (mysql_error());
while($row = mysql_fetch_array($res)) {
//--on recherche la date du dernier article lié à la rubrique...
$query2 = "SELECT idnews FROM news WHERE idrubrique='".$row["idrubrique"]."' AND TO_DAYS(NOW()) - TO_DAYS(date) <= 5 AND statut='1' LIMIT 1";
$res2 = mysql_query($query2,$mysql_link);
if(!$res2) die (mysql_error());
if($row2 = mysql_fetch_array($res2)) { //--Il y'a un article de moins de 5 jours pour la rubrique...on affiche donc la rubrique
if($_GET["r"] == $row["idrubrique"]) {
$t_rubrique[] = "";
$rubTitle = strtoupper($row["nom"]);
} else {
$t_rubrique[] = "";
}
}
}
?>
= $website_title;?>
_
if(!eregi("carsnews.net",$_SERVER["HTTP_HOST"])) { //--On affiche le logo clubonetnews.com
?>
} else {
$website = "carsnews";
//--On affiche le logo "auto-news"?>
}?>
$t_pub = $objPub->getBandeau("Bandeau");
//--
$objPub->affichePub(); //--Affiche les pubs.
?>