View Full Version : sort threads by dateline for certain forums..
ralphuk100
08-03-2004, 08:12 AM
How do I sort threads by dateline descending for individual forums? Thanks.
Andreas
08-03-2004, 11:54 AM
This might help you:
https://vborg.vbsupport.ru/showpost.php?p=535402&postcount=38
ralphuk100
08-03-2004, 12:41 PM
This might help you:
https://vborg.vbsupport.ru/showpost.php?p=535402&postcount=38
Thanks! That looks spot on...the only thing I am unsure about is part 1 - where do I add the code for the dropdown list? what page? Where...can I add a new option on the ACP?
Andreas
08-03-2004, 12:53 PM
You have to turn on debug mode:
Place $debug = 1; in config.php.
Then go to ACP / vBulletin Options / vBulletin Options / Forum Display Options (forumdisplay) and click Add Setting
ralphuk100
08-03-2004, 02:52 PM
Thanks - will install this hack now :)
ralphuk100
08-03-2004, 03:11 PM
Im about half way into this hack....can it not be applied to individual forums? Thats really what I need...to be able to have the news forum sorted by created date and all others sorted by last post.
Andreas
08-03-2004, 03:16 PM
Yes, it can be defined on a per-forum basis.
ralphuk100
08-03-2004, 03:32 PM
I completed your hack fine, all instructions followed precisely and now I get this error when I try to view a forum:
Database error in vBulletin 3.0.3:
Invalid SQL:
SELECT threadid
FROM thread AS thread
WHERE forumid = 27
AND sticky = 0
AND visible = 1
ORDER BY sticky DESC, DESC
LIMIT 0, 50
mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'DESC
LIMIT 0, 50' at line 11
mysql error number: 1064
Any ideas?
ralphuk100
08-03-2004, 03:42 PM
UPDATE: The hack works fine but not by setting an option in forumdisplay. This gets errors (thought that was for global changes). If I define a sort order in the individual forum that forum is then ok. Any ideas?
Also - what var do I need to change to have dateline displayed in the last post column on a forum? Thanks.
UPDATE 2: Although updating an individual forums default sort stops errors it does not seem to obey the sort.....url to forums is www.southportforums.com/forumsvb3/ - have a look at news spot...should be sorted by article last post at the moment...obviously is not :(
Andreas
08-03-2004, 04:15 PM
I guess there is a small mistake in the instructions :(
The default value in the database should be 0 instead of -1
ALTER TABLE forum CHANGE defsortfield defsortfield TINYINT( 1 ) DEFAULT 0 NOT NULL
UPDATE forum SET defsortfield=0 WHERE defsortfield=-1
Then edit any forum to rebuild the cache.
This should stop the SQL errors.
ralphuk100
08-04-2004, 08:05 AM
Thanks - thats sorted the errors...couple of questions:
1) Is there any way to specify whether ASC or DESC sorting or results?
2) More of an observation really. The option for "date creation" in edit forum has a value in the drop down (html) list but no printed value in the list on the forumdisplay page - I have deduced this is because no phrase has been set for date_creation.
3) If I set my individual forums with different values what happens if someone changes the default sort field in forumdisplay options? - Will this just set what the global default is or will it override my individual forum settings?
If I think of anything more will let you know :)
Andreas
08-04-2004, 06:30 PM
1) Yes, but if you want this per-forum basis too it requires a bit more hacking ;)
2) This was coded as an addon fot the "Show Thread creation Date"-Hack, so you will need this hack too if you want to sort on creation date.
3) If you spacify a default sortfile for a forum (other then default of course ;)) it will keep this, no matter what default for forumdisplay ist set.
ralphuk100
08-05-2004, 09:50 AM
Thanks kirbyDE - at the moment we only need the sort order for all forums to be descending as default so luckily don't need to hack anymore. I just added a var name date_creation to sort out the missing text.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.