$startTime = microtime();
include("vars/var_scripts.inc.php");
$l_news='';
$l_doss='';
$l_forums='';
// Création des lignes de news
$req=@mysql_query("SELECT id, titre, corps, auteur, date +0 as date, maj, aut_maj, cat, aff FROM tbl_news WHERE aff='oui' ORDER BY date DESC LIMIT 10") OR die('Notre base sql a bobo');
while($res=mysql_fetch_array($req)) {
if (substr($res['date'] , 0 , -6) == date("Ymd")) {
$l_news .= "".aff_timestamp($res['date'],'heure')."" ;
}
else {
$l_news .= "".aff_timestamp($res['date'],'extrait')."" ;
}
$l_news .= " - ";
if ($res['maj']=='o')
{
$l_news .= "[MAJ]";
}
$l_news .= substr(ucfirst($res['titre']),0,45);
if (strlen($res['titre']) > 45)
$l_news .= "...";
$l_news .= "
";
}
// Création des lignes de dossiers
$req=@mysql_query("SELECT * FROM tbl_art WHERE aff='oui' ORDER BY date DESC LIMIT 10") OR die('Notre base sql a bobo');
while($res=mysql_fetch_array($req)) {
if (substr($res['date'] , 0 , -6) == date("Ymd")) {
$l_doss .= "" . aff_timestamp($res['date'],'extrait') . "";
}
else
{
$l_doss .= "" . aff_timestamp($res['date'],'extrait') . "" ;
}
$l_doss .= " - ";
if ($res['maj']=='oui')
{
$l_doss .= "[MAJ]";
}
$l_doss .= substr(ucfirst($res['titre']),0,45);
if (strlen($res['titre']) > 45)
$l_doss .= "...";
$l_doss .= "
";
}
// CrŽation des lignes pour les soft macosx avec versiontracker.com
define('MAGPIE_DIR', './magpierss/');
require_once(MAGPIE_DIR.'rss_fetch.inc');
// On active le cache
define('MAGPIE_CACHE_ON', 1);
define('MAGPIE_CACHE_DIR', MAGPIE_DIR . 'cache/');
$vturl = 'http://www.versiontracker.com/macosx/recent.rss';
$l_softx = '';
if ( $rssvt = fetch_rss($vturl) ) {
foreach ($rssvt->items as $softx) {
$l_softx .= '- ' . $softx['title'] . ' : ' . $softx['description'] . '
';
}
}
// Création des lignes pour les forums
$sql = "SELECT p.post_id, p.topic_id, p.forum_id, p.poster_id, p.post_time, t.topic_title, u.username, f.forum_name " .
"FROM phpbb_posts p, phpbb_topics t, phpbb_users u, phpbb_forums f " .
"WHERE p.poster_id=u.user_id AND p.topic_id=t.topic_id AND p.forum_id=f.forum_id AND p.forum_id!=24 " .
"ORDER BY p.post_time DESC " .
"LIMIT 20";
$conn_forums = mysql_connect('localhost', 'macosxtech', 'ibook3');
mysql_select_db('macosxtech_forums',$conn_forums);
$req=mysql_query($sql, $conn_forums) OR die("Boohh");
while ( $row = mysql_fetch_object($req) )
{
$l_forums .= "Le " . date("d/m/Y",$row->post_time). " ";
$l_forums .= "" . $row->username ." dans le forum forum_id ."\" CLASS=\"txt9px\">[" . $row->forum_name . "]
";
$l_forums .= "Sujet post_id ."#" . $row->post_id."\" CLASS=\"txt9px\">> " . $row->topic_title . "
";
}
mysql_close($conn_forums);
?>
|
|||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||
|
"; ?> ©2002 MacOSXTech Site optimisé pour un affichage en 1024x768 sur Macintosh avec IE > 4.0 |
|||||||||||||||||||||||||||||||||||||||