Index du Forum » » Bugs, Probs ...

Auteur

[Résolu] - suppression suite a mauvaise manip er reinstal
B-Mag
2386       
 

  Posté : 06-04-2011 06:51

le code pour Forump



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ép onse[/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 forum_id > 0 AND topic_id& nbsp;= $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 forum_id > 0 AND 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.
'</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);

}




Cet article provient de NPDS

http://www.npds.org/viewtopic.php?topic=25052&forum=1