PDA

View Full Version : vb3 : put closed threads down the page


Royal
01-10-2004, 10:51 AM
Hello,

im looking for a hack that will move threads to the bottom of the threadlist when they are closed. (see attach image)

thnx in advance

Royal
01-12-2004, 12:08 PM
up:)

Feran
01-12-2004, 01:43 PM
*lazy coder*

Since I'm too lazy to do it, I'll tell you how to figure out how to do it ^.~

Okay, um, if I weren't lazy, I'd go into PHPMyAdmin to check the DB for a boolean flag that triggers closed-ness.

Then I'd look for the function that outputs threads and modify the SQL query to exclude closed threads.

Then I'd copy and paste and modify the SQL query to explicitly get closed threads.

Remember that it shouldn't be hard to figure out! Programming is in english.

Something like:

SELECT * FROM thread_table WHERE closed = false; // part 1
SELECT * FROM thread_table WHERE closed = true; // part 2

Just keep in mind that.. although a simple concept you have to identify the fieldname, and filter through the fifty zillion other fields that vB also calls <.< Even then, it's not hard, so go have fun! I expect you to figure it out in no less than an hour :p

NTLDR
01-12-2004, 02:00 PM
Its a bad idea to introduce extra queries when they arn't needed at all. It should be easy enough to just change the order it selects the posts. I don't have the vB3 code with me so I'll look into it when I get home.

Feran
01-12-2004, 02:17 PM
Yeah, true.

Find the ORDER BY clause of the SQL query and throw in the closed field :p

Royal
01-13-2004, 02:37 PM
thnx guys ... ill be waiting NTLDR :)

NTLDR
01-14-2004, 10:18 AM
In forumdisplay.php find around line 637:

ORDER BY sticky DESC, $sqlsortfield $sqlsortorder

Replace With:

ORDER BY sticky DESC, thread.open = 1 DESC, $sqlsortfield $sqlsortorder

This has one small side effect that all normal open threads are listed first, then you get the closed threads and redirects together at the end.

Royal
01-15-2004, 02:32 PM
thnx ntldr im goin to try it out tonight

Kmurray
09-05-2006, 08:36 PM
i am trying this on VB 3.6 but i cant seem to get it to work properly. Does anyone have an idea how to make this work on 3.6?

Jon
03-25-2008, 11:28 AM
*bump*

Opserty
03-25-2008, 12:16 PM
Try this:

AdminCP > Plugins & Products > Add New Plugin > Use the following settings:

Product: vBulletin
Hook Location: forumdisplay_query
Title: (Anything you want, doesn't matter)
Execution Order: Leave as Default
Plugin PHP Code:

$sqlsortfield = 'open DESC, '. $sqlsortfield;

Is Active?: Yes

Jon
03-25-2008, 01:21 PM
That does the trick. Thanks!