View Full Version : Administrative and Maintenance Tools - Expired Threads
Logikos
10-06-2004, 10:00 PM
Expired Threads
====================
Author: Ken 'LiveWire' Iovino
Site: www.initialz.com (http://www.initialz.com/)
Version: 1.1
====================
Updates
Threads expired in days not seconds
Exitising Users Please Read
Open the file update_1.0_to_1.1.txt
WetWired (https://vborg.vbsupport.ru/member.php?u=14793) Gets credit for the original idea, i saw this created on his forums long ago, and finaly decided to code it. and share with vBulletin.
What this does
This will allow you as the admin to set a time limit till a thread is considered expired. If the thread happens to be expired, the user will see a error message. But a staff member (ie, mod, sup-mod, and admin) can unexpire the thread by posting in it, then the counter will start over again. This will prevent those anoyying thread digger members we all seem to dislike.
This works as a per forum basis. You can turn on/off any forum you want.
To do list...
Time to install: 5-10 minutes
Queries to run: 1
File Mods: 2
/admincp/forum.php
/forums/newreply.php
Templates to edit: 0
Templates to add: 0
New Phrases: 4
Please read carefully and make all the necessary changes as stated. This is will work if installed properly.
PLEASE REMEMBER TO BACKUP BEFORE YOU BEGIN! If you like this hack
Click It
https://vborg.vbsupport.ru/ (https://vborg.vbsupport.ru/vborg_miscactions.php?do=installhack&threadid=70302)
Help & Support
Before asking for support Please make sure you have done all necessary changes! If you still need support please post a reply here.
Please post bugs and errors here. Hope you like, feedback welcomed.
Special Thanks to:
-nexialys
https://vborg.vbsupport.ru/external/2004/12/1.gif (https://www.paypal.com/xclick/business=iovinojr%40msn.com&item_name=Initial+Z+Free+Scripts&no_note=1&tax=0¤cy_code=USD)
Paul M
10-07-2004, 03:23 PM
Looks good - but I really would prefer the time to expire in days, not seconds.
thanks for sharing with the community Live Wire :)
nexialys
10-07-2004, 04:17 PM
@Live_Wire: Xdays = XX*60*60*24 == Xseconds... do it at a per days setting, not seconds.. ;)
Logikos
10-07-2004, 05:54 PM
Looks good - but I really would prefer the time to expire in days, not seconds.
Unless you don't know math, you can have it expire in any amount of days
Thanks nexialys i look into it :)
// ### CHECK IF ALLOWED TO POST ###
Can't find that line. Where exactly should it be?
Logikos
10-07-2004, 07:28 PM
// ### CHECK IF ALLOWED TO POST ###
Can't find that line. Where exactly should it be?
Should be in newreply.php around line 107. If you still can't find it, look for this:
if (!$threadinfo['visible'] OR $threadinfo['isdeleted'])
{
$idname = $vbphrase['thread'];
eval(print_standard_error('invalidid'));
}
And add it above that.
Works great! You should modify your install directions to let people know where that modification takes place. :)
BTW, great mod... very happy to see this, this was exactly what I was looking for.
Logikos
10-07-2004, 10:17 PM
Works great! You should modify your install directions to let people know where that modification takes place. :)
BTW, great mod... very happy to see this, this was exactly what I was looking for.
Thanks, well i would hope people look at the screenshot to see where the mod works. ^^
I did, but I wasn't sure if it displayed that when the thread was opened or if it did that when it was replied to. Was hoping the latter, but wasn't sure. :)
Yahhoon23
10-08-2004, 11:12 AM
Just quick question. Does this take the last post date as the start of the counter or the date of the threadstarter?
For example. The counter is set for 30 days. User makes a thread on my site June 1st 2004. There are a few more posts added on, last post in that thread is June 23rd 2004. So would the thread expire on June 1st when it was first started, or June 23rd when the last post?
Logikos
10-08-2004, 03:54 PM
The last post date.
ChurchMedia
10-09-2004, 06:08 AM
I've been needing a hack like this for specials that expire, classifieds, etc. I would love to be able to set the expiration at the thread level instead the whole forum -- since some specials expire in, say, 4 days and some in 30 days... possible or too much work?
Logikos
10-09-2004, 07:48 AM
i wouldn't have time to fix something like that up. :(
ChurchMedia
10-09-2004, 07:59 AM
I understand. Maybe I can learn from your code and come up with something. Great hack! :)
Logikos
10-09-2004, 08:23 AM
It shouldn't be that hard to do, if i was going to do it i would give the thread starter the option to put how many days till thread is considered "expired". When he submits that thread, it will submit the amount the thread starter specifed into a new feild in the post table in the database, then you would have to add a query to check that feild when someone goes to reply.
Basicly when someone goes and clicks on reply, the query will check the database to see if the thread has expired, and goes from there. If i have the time i might be able to do this, but im going to be moving to a new home next weekend, so im trying to finish up some clients before i go with no DSL for a couple of days.
I did, but I wasn't sure if it displayed that when the thread was opened or if it did that when it was replied to. Was hoping the latter, but wasn't sure. :)
Does the warning display when the user tries to open the thread, or when they try to reply to the thread?
Omega Prime
10-09-2004, 04:47 PM
Does the warning display when the user tries to open the thread, or when they try to reply to the thread?
That's what I'm wondering as well. It'd be awesome if this shows up when someone tries to make a reply to an old thread ;)
Logikos
10-09-2004, 05:57 PM
Thats what this hack does, when a user trys to make a 'reply' to an old thread, it will show this error.
Thanks for the clarification Live Wire, that's what I was looking for.
/me clicks install
Logikos
10-09-2004, 06:06 PM
Np, glad you find this useful.
Kenneth Pilo
10-15-2004, 10:24 AM
I've been needing a hack like this for specials that expire, classifieds, etc. I would love to be able to set the expiration at the thread level instead the whole forum -- since some specials expire in, say, 4 days and some in 30 days... possible or too much work?
***snip***
It shouldn't be that hard to do, if i was going to do it i would give the thread starter the option to put how many days till thread is considered "expired". When he submits that thread, it will submit the amount the thread starter specifed into a new feild in the post table in the database, then you would have to add a query to check that feild when someone goes to reply.
Basicly when someone goes and clicks on reply, the query will check the database to see if the thread has expired, and goes from there. If i have the time i might be able to do this, but im going to be moving to a new home next weekend, so im trying to finish up some clients before i go with no DSL for a couple of days.
As ChurchMedia mentioned it would be great to apply to classifieds (threads where people can?t reply). Looking forward to the next step :)
Skyline_GT
10-22-2004, 01:01 AM
is it possible to set it only a certain forums only.?
Logikos
10-22-2004, 04:03 PM
@Kenneth Pilo - I'm going to release something like that very soon.
@Skyline_GT - Yes this hack works as per forum basis, means you can set that threads to expire on certain forums only.
pjgoncalves
10-24-2004, 03:37 PM
This is great!
How can i activate only on forums/categories of my choice?
Logikos
10-24-2004, 03:59 PM
This is great!
How can i activate only on forums/categories of my choice?
You will see an option when you edit or create a new forum.
Logikos
10-31-2004, 06:08 PM
New update, no longer have to do seconds, now you can do it by days. Exitising User Please read the update.txt file for a simple update. All others download install.txt file.
NetRover
11-05-2004, 12:05 AM
Hi there, nice one!
I downloaded the install hack as I have not used before and therefore avoided the update one.
I'm a total newbie and don't know what any of the code does but managed to solve a typo.
print_input_row($vbphrase['how_many_Days_till_expire'],forum[daysexpired]', $forum['daysexpired']);
after _expire'], I had to put a space and ' to get it to work. :)
Does this hide the quick reply if a thread is expired? If not, is this possible? I'd hate for someone to write out a long post and submit it, only to get the error message.
thanks :)
Freezerator
12-29-2004, 06:59 AM
Does this hide the quick reply if a thread is expired? If not, is this possible? I'd hate for someone to write out a long post and submit it, only to get the error message.
thanks :)
Indeed, that would be even nicer. I am installing this one.
clearchannel
02-11-2005, 05:09 PM
I'd like to remove this hack. I installed this hack in VB 3.06 and am now receiving database errors. How do I remove the database quary?
database error.
Database error in vBulletin 3.0.6:
Invalid SQL:
SELECT
thread.threadid, thread.title, thread.replycount, postusername, postuserid, thread.dateline AS postdateline, IF(views <= thread.replycount, thread.replycount+1, views) AS views, thread.lastposter, thread.lastpost, pollid
, thread.iconid AS threadiconid, iconpath AS threadiconpath
,thread.forumid, forum.title AS forumtitle
, post.pagetext AS preview
, NOT ISNULL(subscribethread.subscribethreadid) AS subscribed
FROM thread as thread
LEFT JOIN icon USING (iconid)
LEFT JOIN forum AS forum ON (thread.forumid = forum.forumid)
LEFT JOIN post AS post ON (post.postid = thread.firstpostid)
LEFT JOIN deletionlog AS deletionlog ON (thread.threadid = deletionlog.primaryid AND type = 'thread')
LEFT JOIN subscribethread AS subscribethread ON (subscribethread.threadid = thread.threadid AND subscribethread.userid = 12243)
WHERE open <> '10' AND thread.visible = 1 AND thread.forumid NOT IN(70,3,23,14,16,102,103,15,20,17,10,122,13,11,9,1 2,21,104,25,68,55,4,19,100,27,123,5,52,99,8,121,69 ,29,22,124,125,120,105,117,119,108,114,118,107,109 ,113,116,7,110,30,54,47,111,60,65,61,66,64,62,63,7 2,112,90,75,85,84,86,87,93,92,48,115,101,83,91,97, 98,78,79,80,81,82,95,94,96,88,51,53,49,50,28,24,18 ,71,26,56,73,69,29,22,124,125) Array AND deletionlog.primaryid IS NULL
ORDER BY lastpost DESC
LIMIT 10
mysql error: You have an error in your SQL syntax near 'Array AND deletionlog.primaryid IS NULL
ORDER BY lastpost DESC
LIMIT 10
' at line 15
mysql error number: 1064
Date: Friday 11th of February 2005 08:49:58 AM
Script: http://www.yourdomain.com/
Referer:
Username: anonymous
IP Address: xxx.x.xxx.xx
Logikos
02-11-2005, 06:41 PM
I'd like to remove this hack. I installed this hack in VB 3.06 and am now receiving database errors. How do I remove the database quary?
database error.
Database error in vBulletin 3.0.6:
Invalid SQL:
SELECT
thread.threadid, thread.title, thread.replycount, postusername, postuserid, thread.dateline AS postdateline, IF(views <= thread.replycount, thread.replycount+1, views) AS views, thread.lastposter, thread.lastpost, pollid
, thread.iconid AS threadiconid, iconpath AS threadiconpath
,thread.forumid, forum.title AS forumtitle
, post.pagetext AS preview
, NOT ISNULL(subscribethread.subscribethreadid) AS subscribed
FROM thread as thread
LEFT JOIN icon USING (iconid)
LEFT JOIN forum AS forum ON (thread.forumid = forum.forumid)
LEFT JOIN post AS post ON (post.postid = thread.firstpostid)
LEFT JOIN deletionlog AS deletionlog ON (thread.threadid = deletionlog.primaryid AND type = 'thread')
LEFT JOIN subscribethread AS subscribethread ON (subscribethread.threadid = thread.threadid AND subscribethread.userid = 12243)
WHERE open <> '10' AND thread.visible = 1 AND thread.forumid NOT IN(70,3,23,14,16,102,103,15,20,17,10,122,13,11,9,1 2,21,104,25,68,55,4,19,100,27,123,5,52,99,8,121,69 ,29,22,124,125,120,105,117,119,108,114,118,107,109 ,113,116,7,110,30,54,47,111,60,65,61,66,64,62,63,7 2,112,90,75,85,84,86,87,93,92,48,115,101,83,91,97, 98,78,79,80,81,82,95,94,96,88,51,53,49,50,28,24,18 ,71,26,56,73,69,29,22,124,125) Array AND deletionlog.primaryid IS NULL
ORDER BY lastpost DESC
LIMIT 10
mysql error: You have an error in your SQL syntax near 'Array AND deletionlog.primaryid IS NULL
ORDER BY lastpost DESC
LIMIT 10
' at line 15
mysql error number: 1064
Date: Friday 11th of February 2005 08:49:58 AM
Script: http://www.yourdomain.com/
Referer:
Username: anonymous
IP Address: xxx.x.xxx.xx
That query error isn't caused by my hack.
clearchannel
02-11-2005, 07:50 PM
That query error isn't caused by my hack.
I'm not claiming it is. This is the only hack I installed before I started receiving the error messages.
I contacted support at vbulletin and was told they could not provide support with a hack installed.
I would like to uninstall this hack and see if I can duplicate the error. If I can duplicate the database error, I can go back to support at vbulletin, but first, I have to uninstall the hack.
I can make the file changes, I need help removing the table I added to the database in order to install this hack.
Thank you in advance.
ThePimp
03-21-2005, 06:00 AM
Installed, and all I get is a blank screen when I go to Forum Manager.
ThePimp
03-30-2005, 09:39 AM
Installed, and all I get is a blank screen when I go to Forum Manager.
Nevermind, I fixed the problem. Your syntax was off, and you had a misspelling in your instructions with capitalization.
Anyhow, I installed this, and set the days to expire, as well as turned it on. However, it didn't seem to do anything. I set the expire time to be 7 days, and then went to the very first thread ever started (nearly 7 months ago) and could still reply.
Does anyone have an explaination for this?
ThePimp
03-30-2005, 09:42 AM
Nevermind... as "Admin" you can still reply to old threads.
There is a pretty bad typo in the forums.php instructions. It should be:
print_input_row($vbphrase['how_many_days_till_expire'], 'forum[daysexpired]', $forum['daysexpired']);
Other than that everything works fine.
* 007 licks the install button! :p
kobescoresagain
05-02-2005, 03:31 PM
Do you actually get to pick the thread that you want to expire or do you have to do it to all in a certain forum? Also how easy would it be to change it to a certain day. For instance, I would want it to expire on 3/1/06 Instead of having to figure out how many days it is until then (which would be an extreme hassel, I would like to just type in that date and it would show up expired on the beinging (or end) of that day?
Logikos
05-02-2005, 04:14 PM
Do you actually get to pick the thread that you want to expire or do you have to do it to all in a certain forum? Also how easy would it be to change it to a certain day. For instance, I would want it to expire on 3/1/06 Instead of having to figure out how many days it is until then (which would be an extreme hassel, I would like to just type in that date and it would show up expired on the beinging (or end) of that day?
No you can't pick which thread can expire on a certain date. This allows all threads in a certain fourm to expire after x days of no replies. If there is a thread that no has replied to for 90 days, chances are its done with and this hack is to stop thread diggers from bummping old threads.
rjordan
05-02-2005, 09:26 PM
No you can't pick which thread can expire on a certain date. This allows all threads in a certain fourm to expire after x days of no replies. If there is a thread that no has replied to for 90 days, chances are its done with and this hack is to stop thread diggers from bummping old threads.
Darn, I was hoping it would do this too. We post messages with time limits on responses, but not all and not all for the same time frame.
Logikos
05-02-2005, 11:43 PM
I might be able to do something like that for you. Give me a day and i'll have something like that up for you.
Thanks for the useful hack and thanks to 007 for pointing out the typo. I had the same blank screen as mentioned previously and the typo was the problem.
Thanks again.
gizmosheretwo
06-26-2005, 06:40 PM
am I right in assuming it will not work on 3.0.7?
Exitilus
06-26-2005, 08:11 PM
I'm running 3.07 and it works perfectly fine.
gizmosheretwo
07-01-2005, 11:54 PM
Well I get a parse error
Parse error: parse error, unexpected '[' in /home/xxxxxx/public_html/e/admincp/forum.php on line 134
Within my admin area, when clicking on
FORUM MANAGER
ADD NEW FORUM
after adding:
print_yes_no_row($vbphrase['do_threads_expire'], 'forum[expired]', $forum['expired']);
print_input_row($vbphrase['how_many_Days_till_expire'],forum[daysexpired]', $forum['daysexpired']);
All phrases have been added
Using 3.0.7
gizmosheretwo
07-02-2005, 12:01 AM
There is a pretty bad typo in the forums.php instructions. It should be:
print_input_row($vbphrase['how_many_days_till_expire'], 'forum[daysexpired]', $forum['daysexpired']);
Other than that everything works fine.
* 007 licks the install button! :p
It's ok thanks to above users post:
Thanks that's why I was getting parse errors
Maybe this should be corrected for other users trying to implement code
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.