Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Forum sorting.

Asked Modified Viewed 1,253 times
B
BadBoyBubby
B
  • Newbie, joined since
  • Contributed 2 posts on the community forums.
  • Started 1 thread in the forums
  • Started this discussions
asked
Newbie

Is there any way to get the latest post first in the forums? The way it's sorted by default is not very practical in my mind.
0 replies

3 posts

C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
answered
Fusioneer

LOL You serious?
0 replies
B
BadBoyBubby
B
  • Newbie, joined since
  • Contributed 2 posts on the community forums.
  • Started 1 thread in the forums
  • Started this discussions
answered
Newbie

Yes, I'm serious. It's more interesting seeing the last activity in the thread instead of seeing the start every time you open it. Just think of the way one reads a journal. One reads the latest activity first. Most email system do as well. When you click reply you start to write on top with the history further down.
0 replies
H
Homdax
H
Homdax 10
  • Fusioneer, joined since
  • Contributed 2,247 posts on the community forums.
  • Started 108 threads in the forums
answered
Fusioneer

If you look in viewforums.php and viewthread you should find code similar to:
[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]if ($rows) {
$result = dbquery(
"SELECT t.*, tu1.user_name AS user_author, tu1.user_status AS status_author,
tu2.user_name AS user_lastuser, tu2.user_status AS status_lastuser
FROM ".DB_THREADS." t
LEFT JOIN ".DB_USERS." tu1 ON t.thread_author = tu1.user_id
LEFT JOIN ".DB_USERS." tu2 ON t.thread_lastuser = tu2.user_id
WHERE t.forum_id='".$_GET['forum_id']."' AND thread_hidden='0'
ORDER BY thread_sticky DESC, thread_lastpost DESC LIMIT ".$_GET['rowstart'].",$threads_per_page"
);[/syntaxhighlighter]

Check out the last line. "ORDER" by "DESC". Try and change that to "ASC"

Se also http://dev.mysql.com/doc/refman/5.0/en/sorting-rows.html among others places. There may by other implications to this, but just post your troubles and we will try to help.

Help. Right Craig?
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 3 posts
  • Votes 0 votes
  • Topic users 3 members

3 participants

H
H
Homdax 10
  • Fusioneer, joined since
  • Contributed 2,247 posts on the community forums.
  • Started 108 threads in the forums
C
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
B
B
  • Newbie, joined since
  • Contributed 2 posts on the community forums.
  • Started 1 thread in the forums
  • Started this discussions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet