The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
New Posts - sorting first by forum then by date
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 |
#2
|
||||
|
||||
Check this out: https://vborg.vbsupport.ru/showthread.php?t=68382
|
#3
|
|||
|
|||
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 |
#4
|
||||
|
||||
Open search.php
find: PHP Code:
Replace with: PHP Code:
|
#5
|
|||
|
|||
Quote:
But I don't find the forum in the table POST. )-: p |
#6
|
||||
|
||||
Sorry. Can't sort by forum category.
|
#7
|
|||
|
|||
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: Code:
$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] "); |
#8
|
|||
|
|||
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! Peter |
#9
|
|||
|
|||
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... |
#10
|
|||
|
|||
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 |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|