Pages vues depuis 25/05/2001 : 109 447 234
Index du forum »» Le coin des codeurs »» Decalage horaire et Metamot -lastarticles-
Message édité par : moupss / 16-06-2006 16:37
#autodoc !lastarticles! : Affiche des derniers articles - tient compte des groupes
$meta_mot="!lastarticles!";
global $maxarticles_b1,$site_font,$bgcolor4,$bgcolor3,$bgcolor2,$bgcolor1,$textcolor1,$textcolor2; $textcolor3;
$maxcount = $maxarticles_b1; // chaines nombres d'article affiché
if ($maxarticles_b1 =="") { $maxcount=7; } $tab_groupe=valid_group($user);
$clausewhere=" where ihome='0' or ihome='1' ";
for ($ii=0; $ii<=9; $ii++) { if($tab_groupe[$ii]) $clausewhere.=" or ihome='$tab_groupe[$ii]' "; }
if($user) $clausewhere.=" or ihome='-127' ";
global $datetime, $gmt, $site_font, $bgcolor4, $bgcolor3, $bgcolor2, $bgcolor1, $textcolor1, $textcolor2; $textcolor3;
$chaine_rep = "<table width='100%' border='1' bordercolor=".$bgcolor4." cellpadding='2' cellspacing='0' bgcolor=".$bgcolor2.">";
$chaine_rep .="<tr bgcolor=$bgcolor2> <td width='55%' align='left'><font size=2> <b> Top News</b></font></td>";
$chaine_rep .="<td align=center width='10%'><font size=2><b>Actions</b></font></td>";
$chaine_rep .="<td align='center'><font size=2 width='20%'><font size=2><strong>Posté le</font></strong></font></td></tr>";
if (!$count) { $result0 = mysql_query("SELECT sid FROM stories $clausewhere ");
$count=mysql_num_rows($result0); }
$xtab=news_aff("libre", " $clausewhere ORDER BY sid DESC limit $maxcount", 0, $maxcount);
$ibid=0; $story_limit=0; while (($story_limit<$maxcount) and ($story_limit<sizeof($xtab))) {
list($s_sid, $catid, $aid, $title, $time, $hometext, $bodytext, $comments, $counter, $topic, $informant) = $xtab[$story_limit];
$story_limit++; if ($catid!=0) {
list( $cattitle) = mysql_fetch_row(mysql_query("select title from stories_cat where catid='$catid'")); }
$printP = "<a href='print.".$p.$h."?sid=$s_sid'><img src='images/print.gif' border='0' Alt='".translate("Printer Friendly Page")."' width='15' height='11'></a>";
$sendF = "<a href='friend.".$p.$h."?op=FriendSend&sid=$s_sid'><img src='images/friend.gif' border='0' Alt='".translate("Send this Story to a Friend")."' width='15' height='11'></a>";
setlocale (LC_TIME, aff_langue($locale));
ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $time, $datetime);
$datetime = strftime("%d-%m-%Y %T", mktime($datetime[4]+$gmt,$datetime[5],$datetime[6],$datetime[2],$datetime[3],$datetime[1]));
if (cur_charset!="utf-8")
$datetime = ucfirst($datetime);
$sid = "$s_sid"; $letitre="Posté par ".$informant.", le ".$time."; lu ".$counter." fois";
if ($catid != 0) { $resultm = mysql_query("select title from stories_cat where catid='$catid'");
list( $title1) = mysql_fetch_row($resultm);
$title = "<a href='article.".$p.$h."?sid=$sid&mode=&order=0' title='".$letitre."'>".$title."</a>
<a href='index.".$p.$h."?op=newindex&catid=$catid' title='".$letitre."'&g t;[$title1]</a>";
}else{ $title = "<a href=\"article.".$p.$h."?sid=$sid&mode=&order=0\" title=\"$letitre \">$title</a>"; }
if($comments) $title.=" ($comments comment.)";
if ($ibid==0) { $ibid=1; $bcolor=$bgcolor1; } else { $ibid=0; $bcolor=$bgcolor3; }
$chaine_rep .= "<tr align='center' bgcolor='".$bcolor."'>";
$chaine_rep .= "<td align='left'><font size='1' face='tahoma,".$site_font."' color='".$textcolor1."'>";
$chaine_rep .= " ".$title."</font></td><td align=center>".$printP." ".$sendF."</td>";
$chaine_rep .= "<td align=center><font size='1' face='tahoma,".$site_font."' color='".$textcolor1."'>".$datetime."</font>";
$chaine_rep .= "</tr>"; } $chaine_rep .= "</table>";
$Xcontent=extend_meta_mot($Xcontent,$meta_mot,$chaine_rep);
Message édité par : moupss / 16-06-2006 16:34
Message édité par : moupss / 20-06-2006 22:23