Parašė ereliai90· 2008 Sau. 20 00:01:02
#1
Kaip padaryt kad pvz forume ar komentaryose eitu pranesimai nuo naujausio iki seniausio, o ne nuo seniausio iki naujausio? ?|
Parašė ereliai90· 2008 Sau. 20 01:01:11
#2
Atsidarai includes/comments_include.php ir surandi:
$result = dbquery(
"SELECT tcm.*,user_name FROM ".DB_PREFIX."comments tcm
LEFT JOIN ".DB_PREFIX."users tcu ON tcm.comment_name=tcu.user_id
WHERE comment_item_id='$cid' AND comment_type='$ctype'
ORDER BY comment_datestamp ASC"
);
Keiti į:
$result = dbquery(
"SELECT tcm.*,user_name FROM ".DB_PREFIX."comments tcm
LEFT JOIN ".DB_PREFIX."users tcu ON tcm.comment_name=tcu.user_id
WHERE comment_item_id='$cid' AND comment_type='$ctype'
ORDER BY comment_datestamp DESC"
);
Atsidarai forum/viewthread.php ir surandi: (dėl šito nesu tikras, bo miegot noriu.)
$result = dbquery(
"SELECT p.*, fa.attach_id, fa.attach_name, fa.attach_ext, fa.attach_size, u.*, u2.user_name AS edit_name FROM ".$db_prefix."posts p
LEFT JOIN ".$db_prefix."forum_attachments fa USING(post_id)
LEFT JOIN ".$db_prefix."users u ON p.post_author = u.user_id
LEFT JOIN ".$db_prefix."users u2 ON p.post_edituser = u2.user_id AND post_edituser > '0'
WHERE p.thread_id='$thread_id' ORDER BY post_datestamp LIMIT $rowstart,$posts_per_page"
);
keiti į:
$result = dbquery(
"SELECT p.*, fa.attach_id, fa.attach_name, fa.attach_ext, fa.attach_size, u.*, u2.user_name AS edit_name FROM ".$db_prefix."posts p
LEFT JOIN ".$db_prefix."forum_attachments fa USING(post_id)
LEFT JOIN ".$db_prefix."users u ON p.post_author = u.user_id
LEFT JOIN ".$db_prefix."users u2 ON p.post_edituser = u2.user_id AND post_edituser > '0'
WHERE p.thread_id='$thread_id' ORDER BY post_datestamp DESC LIMIT $rowstart,$posts_per_page"
);
wa radau
Redagavo ozzWANTED· 2008 Sau. 20 02:01:08
Parašė DuRaCeLL· 2008 Sau. 20 02:01:16
#3
Gal reikėjo tiesiog, redaguoti paspausti? ;)