website logo
Auteur
avatar
Papiosaur

Forum » » Le site » » FORUM: Classement par date


Post� : 06-08-2008 16:51 icone du post

Bonjour à tous,

Je cherche un programmeur en HTML qui puisse réaliser un classement des posts dans le tableau par ordre du plus récent au plus ancien.
Si on peux mettre la ligne du dernier post d'une autre couleur (jaune ?), ça serai nickel.

Merci

voici le script:


;function MM_forumP()
;{
;
; global $NPDS_Prefix,$cookie,$user;
;
; $maxcount = "8";
;
; $mbid = sql_fetch_row(sql_query("SELECT uid FROM ".$NPDS_Prefix."users WHERE uname = '$cookie[1]'"));
;
; $MM_forumP .= ''
; .''
; .''
; .'
'
; .'
'
; .'
'
; .'
'
; .'
';
;
; $result = sql_query("SELECT distinct topic_id FROM ".$NPDS_Prefix."posts WHERE forum_id > 0 ORDER BY post_id DESC LIMIT $maxcount");
; $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) = sql_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) list($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) list($forum_name,$forum_type,$forum_pass) = sql_fetch_row(sql_query("SELECT forum_name, forum_type, forum_pass FROM ".$NPDS_Prefix."forums WHERE forum_id = $forum_id"));
;
; if (($forum_type == "5") or ($forum_type == "7"))
; {
;
; $ok_affich = false;
; $tab_groupe = valid_group($user);
; $ok_affich = groupe_forum($forum_pass, $tab_groupe);
;
; }
; else
; {
;
; $ok_affich = true;
;
; }
;
; if ($ok_affich)
; {
;
; if ($poster_id != 0) list($uname) = sql_fetch_row(sql_query("SELECT uname FROM ".$NPDS_Prefix."users WHERE uid = $poster_id"));
;
; if ($forum_limit % 2) {
; $MM_forumP .= '
';
;
; } else {
;
; $MM_forumP .= '
';
;
; }
;
; $sqlR = "SELECT rid FROM ".$NPDS_Prefix."forum_read WHERE topicid = '$topic_id' AND uid = '$mbid[0]' AND status != '0'";
;
; if ($ibid = theme_image("forum/icons/hot_red_folder.gif"))
; {
;
; $imgtmpHR = $ibid;
;
; }
; else
; {
;
; $imgtmpHR = "images/forum/icons/hot_red_folder.gif";
;
; }
;
; if ($ibid = theme_image("forum/icons/hot_folder.gif"))
; {
;
; $imgtmpH = $ibid;
;
; }
; else
; {
;
; $imgtmpH = "images/forum/icons/hot_folder.gif";
;
; }
;
; if ($ibid = theme_image("forum/icons/red_folder.gif"))
; {
;
; $imgtmpR = $ibid;
;
; }
; else
; {
;
; $imgtmpR = "images/forum/icons/red_folder.gif";
;
; }
;
; if ($ibid = theme_image("forum/icons/folder.gif"))
; {
;
; $imgtmpF = $ibid;
;
; }
; else
; {
;
; $imgtmpF = "images/forum/icons/folder.gif";
;
; }
;
; if ($ibid = theme_image("forum/icons/lock.gif"))
; {
;
; $imgtmpL = $ibid;
;
; }
; else
; {
;
; $imgtmpL="images/forum/icons/lock.gif";
;
; }
;
; $TableRep = sql_query("SELECT * FROM ".$NPDS_Prefix."posts WHERE topic_id = '$topic_id'");
; $replys = sql_num_rows($TableRep)-1;
;
; $hot_threshold = 10;//Nbres sujets chauds
;
; if ($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 ($myrow[topic_status]!=0)
; $image = $imgtmpL;
;
; $MM_forumP .= '
'
; .'
'
; .'
'
; .'
'
; .'
'
; .'
';
;
; }
;
; }
;
; $MM_forumP .= '
'
; .'
'.aff_langue('[french]Etats[/french][english]State[/english]').' ' .aff_langue('[french]Forums[/french][english]Forums[/english]').''.aff_langue('[french]Sujets[/french][english]Topic[/english]'). ''.aff_langue('[french]Réponse(s)[/french][english]Replie[/engli sh]').''.aff_langue('[french]Derniers Auteurs[/french][english]Last author[/english]').''.aff_langue('[french]Dates[/french][english]Date[/english]').'< /td>'
; .'
'.$forum_name.''.$topic_title.' a>'.$replys.''.$uname.''.$time.'
';
;
; return ($MM_forumP);
;
;}


Pour une raison inexpliquée, il n'afiche pas le code entièrement, vous pouvez le voir sur le forum d'AmigaImpact !!!

Merci

Message édité par : Webmaster / 06-08-2008 17:27



Message édité par : Webmaster / 06-08-2008 17:46



Message édité par : Webmaster / 06-08-2008 17:46


Cet article provient de Meta-MorphOS
https://www.meta-morphos.org/viewtopic.php?topic=32&forum=2