PDA

View Full Version : Thread Maintenance v1.0


g-force2k2
12-15-2003, 10:00 PM
Well here goes nothing, my first hack at vb.org in sometime now.

Based on an idea by rooshine in this thread -
https://vborg.vbsupport.ru/showthread.php?t=59179

I built on the idea somewhat and in my opinion made a fairly nice system :)

This hack will close threads if they're not replied to within X amount of days as set per the Administrator. Also if you use a forum to archive your threads you can use that featrue and it will automatically move the thread to the specified forum. You can disable or enable this system whenever you want and can set the amount of time to check for updates so that you're not running the database down.

Screenshot and zip below. Easy Installation just run the installer in the admin directory then upload a file and one file mod and you're done.

Tested on vb2.3.3 but should work for all vb2.x.x.

If you install please click install and thanks.

Any questions, comments, etc are welcomed.

If this hack becomes somewhat popular I already have some ideas for v2.0 including automatic forum updating and bypassing sticky threads etc, but this is just a start, please do enjoy.

Thread Maintenance v1.1

Thanks to Brolly I have updated this hack. It contains the following fixes for the following bugs.

[Bug 1]Maintenance Update even though settings set for minutes updated in seconds instead. Fix Applied.

[Bug 2]Even once Thread Maintenance was ran it updated the setting, but did not updated in the special templates. Fix Applied with the reformattingsettings function.

[Bug 3]Thanks to Brolly with the existing query it selected posts but not those older then X amount of time so that is why there was the issue with closing threads that were created x amount of days ago. Anyways fix applied.

To Update to Thread Maintenance v1.1 (TM) Simply Download updated zip and upload the new threadmaintenance.php to the main directory and thats all. Enjoy.

Regards,
g-force2k2

PixelFx
12-16-2003, 07:18 AM
Kewl hack :) I'll try this soon :)

Dean C
12-16-2003, 10:29 AM
Very nice idea. Good to see you back and posting hacks :)

Vivi Ornitier
12-16-2003, 12:15 PM
i been lookin for sometrhin like this for awhile! great ta see u back gforce!

MindTrix
12-16-2003, 03:46 PM
WOOT looks brilliant, ill be sure to use this when i get my forums up again. Nice one and thanks.

lasto
12-16-2003, 09:21 PM
can we exclude certain forums from this hack as if u have a mod room and u have no replies then obviously these posts are gonna be removed to the same section as well which is deffo a no no

g-force2k2
12-16-2003, 09:30 PM
can we exclude certain forums from this hack as if u have a mod room and u have no replies then obviously these posts are gonna be removed to the same section as well which is deffo a no no

open threadmaintenace.php

find:

WHERE post.dateline <= $timenow - ( $TMClosed * 86400 ) AND open=1

replace with:

WHERE post.dateline <= $timenow - ( $TMClosed * 86400 ) AND open=1 AND thread.forumid NOT IN ( 0 )

Just replace the 0 in the parethesis with the staff forumids and seperate each one with a comma

ie:
NOT IN ( 3,25,42 )

regards,
g-force2k2

lasto
12-16-2003, 10:00 PM
thanks for quick reply g-force much appreciated the support u give to your hacks :)

Hobbes
12-17-2003, 12:00 AM
niceeeeeeeeeeeeeee *installs*

Hobbes
12-17-2003, 05:15 AM
!

found something:

change the install from



if ( $TMaintenance ) :
include_once ( "threadmaintenance.php" ) ;
endif ;



to

if ( $TMaintenance ) :
include_once ( "threadMaintenance.php" ) ;
endif ;


the file name is capitalized...so the reference in the code needs to be too :)

g-force2k2
12-17-2003, 06:36 AM
I fixed the files it should be lowercase just that when I was naming the threadmaintenance.php file I couldn't tell that I had capitalized the M because my brother uses pixel font as his default.

Regards,
g-force2k2

Dean C
12-17-2003, 03:06 PM
Your text editor is in pixel fonts - ouch ;)!

g-force2k2
12-17-2003, 09:30 PM
Your text editor is in pixel fonts - ouch ;)!

Nah my wordpad is fine, I just use regular courier, but just when naming files its all pixel font so pretty much capital and lowercase letters are the same.

Regards,
g-force2k2

gmarik
12-20-2003, 06:02 AM
Great for larger boards, not for a small one :)

Brolly
12-22-2003, 08:13 AM
I'm not sure if this is a bug, or a problem with my particular board (2.3.0).

But the hack doesn't actually close threads that have been inactive for X days, it closes down threads that were created after X days.

g-force2k2
12-22-2003, 12:32 PM
I'm not sure if this is a bug, or a problem with my particular board (2.3.0).

But the hack doesn't actually close threads that have been inactive for X days, it closes down threads that were created after X days.

Sounds rather interesting, if you can confirm that it does actuallyi close thread created after x days rather than inactive I will have to make a fix. If someone else could confirm I would be greatful.

Regards,
g-force2k2

Brolly
12-22-2003, 09:31 PM
I've got about 30 cases of closed threads on my forum. Half of my fellow admin's are running around like headless chickens because they think there's a traitor, lmao.

It definetly is true, on my board at least. I had a thread that was posted in last night, but created 35 days ago (I set the option to close threads older than 30 days). A large number of threads like this were closed. I also have a moderator log to prove that these threads weren't closed by a person.

If this problem were to be fixed, I'd make this hack have my children. Just so you know I'm not hating it;)

g-force2k2
12-23-2003, 04:43 AM
Sorry for the trouble Brolly, but thanks to your assistance I have released version 1.1 with three bug fixes. If you have any other questions or concerns feel free to use this thread, and thanks for the compliments.

Regards,
g-force2k2

Brolly
12-23-2003, 06:28 AM
Great hack, thanks for the bug fix:)

rooshine
01-02-2004, 02:58 AM
Thanks very much, g-force2k2. I will be installing this shortly!

Capt PPRuNe
01-07-2004, 01:25 PM
open threadmaintenace.php

find:

WHERE post.dateline <= $timenow - ( $TMClosed * 86400 ) AND open=1

replace with:

WHERE post.dateline <= $timenow - ( $TMClosed * 86400 ) AND open=1 AND thread.forumid NOT IN ( 0 )

Just replace the 0 in the parethesis with the staff forumids and seperate each one with a comma

ie:
NOT IN ( 3,25,42 )

regards,
g-force2k2

The above code has obviously changed in v1.1 so what is needed to be able to prevent threads in spcific forums from being closed?

g-force2k2
01-08-2004, 01:57 PM
The above code has obviously changed in v1.1 so what is needed to be able to prevent threads in spcific forums from being closed?

If you open threadmaintenance.php and find:

WHERE open=1

replace with:

WHERE open=1 AND thread.forumid NOT IN ( 0 )

And then just replace the 0 with forumids. Hope that does the trick, let me know if any problems arise.

Cheers,
g-force2k2

tiedyetoga
02-09-2004, 04:25 PM
Thanks, I have been looking for a hack like this for sometime..