PDA

View Full Version : New Posts - sorting first by forum then by date


crepo
08-22-2004, 05:05 PM
After moving from Snitz to vBulletin we have a lot of questions by or visitors for one option.

If we use "active postings" (same result like New Posts) on Snitz the postings are sorted by forum and then on the time of last post.

In vBulletin al the new posts are sorted by time.

Is there a way that we can use to change the "New Post" that it first sorted the forum and then the time?

Thanks,
Peter

Abe1
08-22-2004, 05:10 PM
Check this out: 68382

crepo
08-22-2004, 05:20 PM
hmm... that's a way... but not exactly what i have in mind.

When you have on top (between calendar and search) the New Post I want this always sorted by forum, and then by time.

thx, for the link to the other posting.
peter

Abe1
08-22-2004, 05:37 PM
Open search.php

find:
AND sticky IN (0,1)
ORDER BY lastpost DESC



Replace with:
AND sticky IN (0,1)
ORDER BY title ASC


I hope this helps.

crepo
08-22-2004, 06:23 PM
I hope this helps.Like this is what I want. But not sorted on title, but on forum.

But I don't find the forum in the table POST. )-:

p

Abe1
08-22-2004, 06:39 PM
Sorry. Can't sort by forum category.

CarCdr
08-22-2004, 07:58 PM
crepo,

Do you want only the "New Posts" link to:
a) sort threads
b) by forum title ascending and
c) then by last post time descending

or do you want the main listing (index.php) to sort this way as well?

If you want only "New Posts" to do it, you can just JOIN the forum table. This will slow down searches of course. Anyway, if you want *all* invocations of "New Posts" to work this way you can try this query (for 3.0.3, untested)...

Change the query on line 2133 to this: $threads = $DB_site->query("
SELECT threadid
FROM " . TABLE_PREFIX . "thread AS thread
LEFT JOIN " . TABLE_PREFIX . "deletionlog AS delthread ON(delthread.primaryid = thread.threadid AND delthread.type = 'thread')
LEFT JOIN " . TABLE_PREFIX . "forum AS forum ON (thread.forumid=forum.forumid)
WHERE thread.forumid IN(" . implode(', ', $forumids) . ")
AND thread.lastpost >= $datecut
AND visible = 1
AND delthread.primaryid IS NULL
AND sticky IN (0,1)
ORDER BY forum.title ASC, thread.lastpost DESC
LIMIT $vboptions[maxresults]
");

crepo
09-02-2004, 09:27 PM
Hello CarCdr,

You are a 'god' for a lot of or visitors. :nervous:

This was exactly what i want. I have it now more than in week in production on http://forum.belgiumdigital.com (sorry, dutch only). And I don't see extra load on or machine (dedicated server, dual Xeon 2.8Ghz, 2Gb ram, SCSI disks).

Thanks for you code! :mad:
Peter

benFF
10-20-2004, 11:17 AM
Thats CarCdr, this is fantastic, however would there be a way to order them by their display order? I've tried, but due to categories and subcategories being in the same table, just doing an Order By displayorder returns some very odd results!

I have you see a forum called 'Latest News' which I would always want at the top, but due to it starting with the letter L, this won't happen...

crepo
02-02-2005, 01:48 PM
We are using since some months the solution of CarCdr with work fine.

But now we have added a lot of new forums. And the sorting on forumname is not so nice. Therefore we want to sort the result on forum Display Order.

Is that possible?

Thanks for helping us.

peter