website logo
Auteur
avatar
B-Mag

Forum » » Le coin des codeurs » » [Résolu] - Meta Mot Lastarticles


Posté : 26-11-2011 09:54 icone du post

bonjour

j'ai retrouvé un Metamot qui donne les X derniers articles du site, mais il bugue

message d'erreur suivant


Warning: Missing argument 1 for mm_lastarticles()&nb sp;in /mnt/154/sdd/d/3/npdslabo/modules/meta-lang/adv-meta_lang.php(246)&n bsp;: eval()'d code on line 1



le code est le suivant


function MM_lastarticles($maxarticles_b1) {
global $NPDS_Prefix, $site_font, $bgcolor4, $bgcolor3,&nb sp;$bgcolor2, $bgcolor1, $textcolor1, $textcolor2, $user; < br />$maxarticles_b1 = arg_filter($maxarticles_b1);   &nb sp;
$maxcount = $maxarticles_b1; 
if ($maxarticles_b1 == '') {    
$maxcount=15; 
}    
$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' ";   
$chaine_rep .= '<table id="LastArticles">';
$chaine_rep .= '<tr id="enTeteLastArticles">';
$chaine_rep .= '<td>Articles</td>';
$chaine_rep .= '<td>Actions</td>';
$chaine_rep .= '<td>Lu</td>';
$chaine_rep .= '<td>Posté le</td>';
$chaine_rep .= '</tr>'; 
$xtab = news_aff("libre", " $clausewhere ORDER  BY sid DESC limit $maxcount", 0, $maxcount);  ;
$ibid=0; 
$story_limit=0; 
while (($story_limit < $maxcount) and ($story_lim it < 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) = sql_fetch_row(sql_query("SELECT title F ROM ".$NPDS_Prefix."stories_cat 
WHERE catid='".$catid."'"));
}
$printP = '<a href="print.php?sid='.$s_sid.'"><img&nb sp;src="images/print.gif"  border="0" 
Alt="'.translate("Printer Friendly Page").' "width="15" h eight="11"></a>'; 
$sendF = '<a href="friend.php?op=FriendSend&sid='.$s_si d.'">
<img src="images/friend.gif" border="0" Alt="'.translate("S end this  Story to a Friend").'" 
width="15" height="11"></ a>'; 
setlocale (LC_TIME,$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); 
$sid = $s_sid;
$letitre = ''.translate("Posté par ").''.$informant.',&n bsp;le '.$time.'; lu '. $counter.' fois';
if ($catid != 0) { 
$resultm = sql_query("SELECT title FROM ".$NPDS_Pref ix."stories_cat WHERE catid='$catid'"); 
list($title1) = sql_fetch_row($resultm); 
$title = "<a href='article.php?sid=$sid'  title=' ".$letitre."'>".aff_langue($title)."</a>  
<a href='index.php?op=newindex&catid=$catid' title='".$letit re."'[$title1]</a>"; 
} else { 
$title = '<a href="article.php?sid='.$sid.'" title="'. $letitre.'">'.aff_langue($title).'</a>' ; 
}
if($comments) 
$title .= '('.$comments.' comment.)'; 
$class = tablos();
 
$title = str_replace('NPDS', 'npds',$title);
$chaine_rep .= '<tr '.$class.'>'; 
$chaine_rep .= '<td>'.stripslashes($title).' </td>
<td class="centreLastArticles">' .$printP.' '.$sendF.'&l t;/td>';
$chaine_rep .= '<td class="centreLastArticles">'.$counte r.'</td>';
$chaine_rep .= '<td class="centreLastArticles">'.$time.' </td>';
$chaine_rep .= '</tr>'; 

$chaine_rep .= "</table>"; 
return ($chaine_rep);
}



L'un de vous peut il me dire où est l'erreur?

Question 2: comment faire pourque l'affichage soit pris en compte sur toute la largeur?
il est "petit'
voir sur ce lien ds l'edito : http://npdslabo.free.fr/index.php?op=edito

Cet article provient de NPDS REvolution 16
https://lab.grottes-et-karsts-de-chine.org/viewtopic.php?topic=25275&forum=5