
Forum » » Bugs, Probs ... » » [Résolu] - suppression suite a mauvaise manip er reinstal
Posté : 06-04-2011 09:11 
function MM_forumP()
{
global $NPDS_Prefix,$cookie,$user;
$maxcount = "5";
$mbid = sql_fetch_row(sql_query("SELECT&nbs p;uid FROM ".$NPDS_Prefix."users WHERE uname = '$ cookie[1]'"));
$MM_forumP .= '<table cellspacing=" 3" cellpadding="1" width="top" border="0">'
.'<tr align="center" class="ligna">'
.'<td width="5%">'.aff_langue('[french]Eta t[/french][english]State[/english]').'</td>'
.'<td width="20%">'.aff_langue('[french]Fo rum[/french][english]Forum[/english]').'</td>'
.'<td width="30%">'.aff_langue('[french]Su jet[/french][english]Topic[/english]').'</td>'
.'<td width="5%">'.aff_langue('[french]Ré ponse[/french][english]Replie[/english]').'</td>'
.'<td width="20%">'.aff_langue('[french]De rnier Auteur[/french][english]Last author[/english]').'</td>'
< br /> .'<td width="20%">'.aff_langue('[french]Da te[/french][english]Date[/english]').'</td>'
.'</tr>';
$result = sql_query("SELECT distinct&n bsp;topic_id FROM ".$NPDS_Prefix."posts WHERE forum_id  ;> 0 ORDER BY post_id DESC LIMIT $maxcoun t");
$count = sql_num_rows($result);
if ($count > 0)
if ($count > $maxcount) $count = $maxcount;
$ibid = 0;
$forum_limit = 0;
while ($forum_limit < $count)
{
list($topic_id) = s ql_fetch_row($result);
list($post_id, $forum_id , $poster_id, $time) = sql_fetch_row(sql_query("SELECT  ;post_id, forum_id, poster_id, post_time FROM ".$NPDS_ Prefix."posts WHERE topic_id = $topic_id ORDER BY post_id DESC LIMIT 1"));
$forum_limit++;
if ($topic_id!=0) l ist($topic_title) = sql_fetch_row(sql_query("SELECT topic_title, forum_id FROM ".$NPDS_Prefix."forumtopics WHERE topic _id=$topic_id"));
if ($forum_id!=0) l ist($forum_name,$forum_type,$forum_pass) = sql_fetch_row(sql_query("S ELECT forum_name, forum_type, forum_pass FROM ".$NPDS_ Prefix."forums WHERE forum_id = $forum_id"));
if (($forum_type == "5") or ($forum_type == "7"))
{
$ok_a ffich = false;
$tab_ groupe = valid_group($user);
$ok_a ffich = groupe_forum($forum_pass, $tab_groupe);
}
else
{
$ok_a ffich = true;
}
if ($ok_affich)
{
if&nb sp;($poster_id != 0) list($uname) = sql_fetch_row(sql_ query("SELECT uname FROM ".$NPDS_Prefix."users WHERE u id = $poster_id"));
$MM_f orumP .= '<tr class="lignb">';
$sqlR = "SELECT rid FROM ".$NPDS_Prefix."forum_read WH ERE topicid = '$topic_id' AND uid = '$mbid[0 ]' AND status != '0'";
if&nb sp;($ibid = theme_image("forum/icons/hot_red_folder.gif"))
{
  ; $imgtmpHR = $ibid;
}
else
{
  ; $imgtmpHR = "images/forum/icons/hot_red_folder.gif ";
}
if&nb sp;($ibid = theme_image("forum/icons/hot_folder.gif"))
{
  ; $imgtmpH = $ibid;
}
else
{
  ; $imgtmpH = "images/forum/icons/hot_folder.gif";
}
if&nb sp;($ibid = theme_image("forum/icons/red_folder.gif"))
{
  ; $imgtmpR = $ibid;
}
else
{
  ; $imgtmpR = "images/forum/icons/red_folder.gif";
}
if&nb sp;($ibid = theme_image("forum/icons/folder.gif"))
{
  ; $imgtmpF = $ibid;
}
else
{
  ; $imgtmpF = "images/forum/icons/folder.gif";
}
if&nb sp;($ibid = theme_image("forum/icons/lock.gif"))
{
  ; $imgtmpL = $ibid;
}
else
{
  ; $imgtmpL="images/forum/icons/lock.gif";
}
$Tabl eRep = sql_query("SELECT * FROM ".$NPDS_Prefix."posts& nbsp;WHERE topic_id = '$topic_id'");
$repl ys = sql_num_rows($TableRep)-1;
$hot_ threshold = 10;//Nbres sujets chauds
if&nb sp;($replys >= $hot_threshold)
{
  ; if (sql_num_rows(sql_query($sqlR))==0)
  ; $image = $imgtmpHR;
  ; else
  ; $image = $imgtmpH;
}
else
{
  ; if (sql_num_rows(sql_query($sqlR))==0)
  ; $image = $imgtmpR;
  ; else
  ; $image = $imgtmpF;
}
if&nb sp;($myrow[topic_status]!=0)
$imag e = $imgtmpL;
$MM_f orumP .= '<td align="center"><img src="'.$image.'" ></td>'
.'< ;td><a href="viewforum.php?forum='.$forum_id.'">'.$forum_name.'&l t;/a></td>'
.'< ;td align="left"><a href="viewtopic.php?topic='.$topic_id.'& ;forum='.$forum_id.'">'.$topic_title.'</a></td>'
.'< ;td align="center">'.$replys.'</td>'
.'< ;td align="center"><a href="user.php?op=userinfo&uname='.$u name.'">'.$uname.'</a></td>'
.'< ;td>'.$time.'</td>';
}
}
$MM_forumP .= '</tr>'
.'</table>';
return ($MM_forumP);
}
function MM_lastarticles($maxarticles_b1) {
global $NPDS_Prefix, $site_font, $bgcolor4, $bgcolor3,&nb sp;$bgcolor2, $bgcolor1, $textcolor1, $textcolor2,
$user;
$maxarticles_b1 = arg_filter($maxarticles_b1); &nb sp;
$maxcount = $maxarticles_b1;
if ($maxarticles_b1 == '') {
$maxcount=5;
}
$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);
}
Message édité par : PhilGuen / 06-04-2011 09:40
Cet article provient de NPDS REvolution 16
https://lab.grottes-et-karsts-de-chine.org/viewtopic.php?topic=25052&forum=1