vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Administrative and Maintenance Tools - Auto Delete/Move Thread After X days (https://vborg.vbsupport.ru/showthread.php?t=139646)

AtoZ 10-03-2007 05:38 AM

Quote:

Originally Posted by voclain (Post 1296678)
All I did was make a NEW SCHEDULED TASK and had it point to .php file that I uploaded into the "CRON" folder.

Just like that...it works.

Thank you for pointing this out. I wanted to emphasize it here in case anyone else is having trouble getting this set up. It was easy to overlook this important piece of information that you provided! All of the previous posts with the SQL code has incorrect syntax. :down:

Other than that, I think I am going to LOVE this plugin! I changed the replycount to > 59, so once a thread gets more than 59 posts, it will automatically be moved to my forum for long threads and debates. I am using another plugin that will automatically close those threads to further posting. It's an awesome combo!

Doctor Death 10-03-2007 09:08 AM

Have been looking for something like this for several years. Looking forward to installing it.

Update: It is installed... I want it set up to delete a specific forum (#28) with any posts older than 7 days.

I did NOT see a chron job installed with this, although I might have missed it. Other than putting in the product and the configuration via CP, do I need to do anything else to have it delete threads older than 7 days routinely?

The Options in ADMINCP are not that intuitive...

Have it set currently to:

Quote:

  • Turn on the (Auto Delete/Move Thread After X days) system "All Systems". NO
  • Turn on the (Auto Delete Thread After X days) system. YES
  • Please enter the user id that you don't want to delete there threads, Admins or Mods, comma seperated. 4
  • Turn on the (Auto Move Thread After X days) system. YES
  • Please enter the forum id that you want to apply this hack on it , comma seperated. 28
  • Please enter the forum id that you want set as archive . 28 (Although I dont want an archive)
  • Choose YES for physical delete and NO for soft delete YES
  • Thread must have been created earlier than X days. 7





Thanks!

KuJoe 10-08-2007 12:08 PM

I just finished installing this on my test board and I had to manually enter the Scheduled Task (set to run once a day) but as of now it is working perfectly. The only change I had to make was:
Code:

AND `replycount` = '0'
to
Code:

AND `replycount` > '0'
So it would leave all posts with 0 replies (mainly stickies) and would archive all posts with replies. This is perfect for my "Introduction" forum since after 30 days, a members tends to not be new anymore. :D

R1D1 10-31-2007 04:58 PM

as it seems, the cron-thing doesn't work. so i will drop it on standby the next weeks... perhaps the problem will be solved till then? :) would be wonderful... its a great mod-idea! thx.

AtoZ 10-31-2007 05:03 PM

Quote:

Originally Posted by R1D1 (Post 1372891)
as it seems, the cron-thing doesn't work. so i will drop it on standby the next weeks... perhaps the problem will be solved till then? :) would be wonderful... its a great mod-idea! thx.

This is the solution...

Quote:

Originally Posted by voclain
All I did was make a NEW SCHEDULED TASK and had it point to .php file that I uploaded into the "CRON" folder.

Just like that...it works.

R1D1 11-01-2007 04:50 PM

fascinating! :D thx ;)

perhaps worth enoug to give it a short quote at the thread's startpost? ;)

rammbs 11-05-2007 03:34 PM

need help please. i get the error below when i run the scheduled task..

Quote:

Database error in vBulletin 3.6.8:

Invalid SQL:
SELECT * FROM `thread` Where forumid IN(23) AND `replycount` = '0' AND `postuserid` NOT IN () AND `dateline` <= '1194024543';

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 ') AND `dateline` <= '1194024543'' at line 1
Error Number : 1064
i ran the query below too :

PHP Code:

INSERT INTO cron VALUES (-1100'a:1:{i:0;i:0;}''./includes/cron/cronautodelete.php'1'Auto Delete/Move Thread After X days'); 


ETDC 11-12-2007 08:06 PM

Does this work with 3.6.8 Patch Level 2?

:)

TigerWare 11-13-2007 05:25 PM

Quote:

Originally Posted by ETDC (Post 1381274)
Does this work with 3.6.8 Patch Level 2?

If you have it running on 3.6.8 already, then yup, PL1/PL2 is fine.

ETDC 11-13-2007 05:39 PM

I don't have it installed yet.

TigerWare 11-13-2007 06:14 PM

I had some trouble with the install, as have a few others. See my post 27 note. I don't think the author has ever come back with an answer, or an update to this one that does keep popping up. I had to create the CRON job by hand for this mod to work. As it stands, once the CRON job is set, it runs beautifully.

thepub 11-15-2007 05:54 PM

how do you create the CRON job by hand? I'd like to install this on my forum but am not sure I understand what needs to be done to make it work properly.

zappan 12-24-2007 05:06 PM

i can report strange behavior when hard delete used... server hangs..

i modified queries in the php file to match my wanted settings (not stickies and filter by last post time, instead of date created), soft delete works, physical delete hangs the httpd process. strange.

AWJunkies 01-10-2008 10:27 PM

Works on 3.6.8 P2 when you create the task yourself cause he programed it all wrong for it to auto install.

REVHEAD 01-27-2008 01:14 PM

Any news on this updated cron or whatever you guys are talking about? I am not a coder and have just installed a rss feeder to my forums and would like this to work on 3.6.8.

Help appreciated

fta2k 02-29-2008 01:41 AM

Installed...

Super simple, thanks allot

https://vborg.vbsupport.ru/external/2008/02/4.jpg

DieselMinded 03-10-2008 05:07 AM

Can this be made to Close threads in my support forum if no reply in 10 days ?

majordork82 03-21-2008 10:26 PM

i'm having the same issue as someone above and I have NO idea how to fix it....Here is what it says when i go to run the scheduled task that I created:

Quote:

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 ') AND `dateline` <= '1206141687'' at line 2
Error Number : 1064

majordork82 03-21-2008 11:02 PM

nevermind, i figured it out. The program doesn't like it if you leave the protected users blank

furnival 04-03-2008 12:39 PM

Installed and added the cron via scheduled task manager.

Would prefer excluded user groups feature to just excluded user ids, but all in all a great hack. Thank you!

AtoZ 07-03-2008 05:22 AM

Anyone have this working in 3.7 or are there plans to update? Thanks.

futuredood 07-05-2008 04:08 PM

Quote:

Originally Posted by AWJunkies (Post 1419218)
Works on 3.6.8 P2 when you create the task yourself cause he programed it all wrong for it to auto install.

Hi can you tell us more about how to get this to work, or where you found the answer? I installed it and need to know how to set up the cron job. Thanks.

AtoZ 07-06-2008 05:21 AM

futuredood, read back through the thread and you'll find the solution.

Quote:

Originally Posted by voclain (Post 1296678)
All I did was make a NEW SCHEDULED TASK and had it point to .php file that I uploaded into the "CRON" folder.


tekguru 07-10-2008 09:06 AM

Working for me on vB 3.7.1PL2. All I needed to do was set up the CRON job and modify the cronautodelete.php setting from `replycount` = '0' to `replycount` >= '0' and it now archives my 'News' into 'Old News' - superb!

AtoZ 07-10-2008 04:48 PM

Quote:

Originally Posted by tekguru (Post 1571791)
Working for me on vB 3.7.1PL2. All I needed to do was set up the CRON job and modify the cronautodelete.php setting from `replycount` = '0' to `replycount` >= '0' and it now archives my 'News' into 'Old News' - superb!

Excellent. Thanks for the info!

StreetTriple 09-13-2008 07:38 AM

hi there,
i've 3,6,8 patch level 2 and the mod not function...
i've tryed to run this query in mysql:
Code:

INSERT INTO " . TABLE_PREFIX . "cron (weekday,day,hour,minute,filename,loglevel,active,varname, volatile,product)) VALUES (-1, 10, 0, 'a:1:{i:0;i:0;}', './includes/cron/cronautodelete.php', 1, 'Auto Delete/Move  Thread After  per days')
but i've received this error:
Quote:

query SQL:
INSERT INTO forum_vbcron( weekday,
DAY , HOUR , minute, filename, loglevel, active, varname, volatile, product )
VALUES ( -1, 10, 0, 'a:1:{i:0;i:0;}', './includes/cron/cronautodelete.php', 1, 'Auto Delete/Move Thread After per days'
)
Messaggio di MySQL:
#1136 - Column count doesn't match value count at row 1
PLEASE HELP ME!

RayJohns 10-30-2008 05:08 AM

Very handy, thanks. A couple of notes about installation. I'm running on 3.7.3 PL1. I moved the files to the proper locations, and imported the XML. However, I had to manually add a cron job in order to get it working. It appears there is install code in the package to install a cron job, but I don't think it worked (at least not on my vb). I could be wrong, but after uploading the .php file and importing the XML, I did not see a scheduled task listed in the cron job section.

For anyone who has the same problem, here is how I setup my cron job (see attached).

Also, I wanted to point out that because the PHP code uses 86,400 (the number of seconds in a full day) as a multiplier when figuring out how old the threads are, you can actually specify something like .5 days if you want to delete/move threads every 12 hours. Or you could use .25 to delete threads every 6 hours for example. I was just about to hack the code to do this, because I needed to remove threads (once a day) that were older than 12 hours. However, since the code uses the # of seconds to figure it out, you can fine tune the time frame using a fractional value for the number of days in the settings. Very handy!

Nice job on the product - I just clicked the "installed" button for you :-)

Ray

M.C. 01-19-2009 11:55 AM

Thanks, Ray! I had same problem on 3.8 and after addin cron job manually it seems it working... ;)

xlguy 01-25-2009 11:23 PM

So this is working ok in 3.8 then?

BlueNinjaGo 04-15-2009 07:45 PM

Nvm

R1lover 05-07-2009 01:57 AM

can we get this fixed / ported to 3.8.2 please

KevinL 05-07-2009 02:16 AM

It works fine on 3.8

Allen 05-10-2009 07:07 PM

Is there anything like this hack but for posts?

I want users to have an option to auto delete their post after a set (by them or Admin) period of time.

kyle 07-11-2009 07:10 AM

Can this hack be setup to move/delete thread if the original poster doesn’t respond within a x amount of time?

xlguy 08-18-2009 02:46 PM

Quote:

Originally Posted by rammbs (Post 1376367)
need help please. i get the error below when i run the scheduled task..

Quote:

Originally Posted by majordork82 (Post 1471146)
nevermind, i figured it out. The program doesn't like it if you leave the protected users blank

Ah interesting, thanks. I was getting an error in 3.8.x and think it might because I left out any input in the protected users part.

danyz81 10-15-2009 04:35 PM

mmmh not working for me.
I've 3.84. Created the cron manually with the modific by AtoZ (`replycount` = '0' to `replycount` >= '0' ) but nothing.
I try to run the cron, straight afterwards it tells me "Done" but nothing happends on the forum.

Any help?

tonyzhou 11-02-2009 07:21 PM

I have modified this hack to exclude stickies and to delete threads that haven't gotten replies in X days rather than ones that have been opened x days ago. It also disregards the amount of posts in that thread.

PHP Code:

$check=$vbulletin->db->query_read("
            SELECT * from `" 
TABLE_PREFIX "thread` 
                        Where  forumid  IN(
$from) AND `postuserid` NOT IN (".$vbulletin->options['Admin'].") AND `sticky` = '0' AND `lastpost` <= '" . (TIMENOW - ($vbulletin->options['created'] * 86400)) . "'"); 

PHP Code:

$deletedthreads $vbulletin->db->query_read("SELECT * FROM `" TABLE_PREFIX "thread` Where  forumid  IN($from) AND `sticky` = '0'  AND `postuserid` NOT IN (".$vbulletin->options['Admin'].") AND `lastpost` <= '" . (TIMENOW - ($vbulletin->options['created'] * 86400)) . "'"); 

these are the modifications to the queries for anyone who needs this as well.

Reef Man 07-14-2010 07:53 PM

Does this work on vb 4.0.x ???

MagicThemeParks 09-11-2010 04:37 PM

Just to confirm: Do you have to add the manual cron to get this work?

HolyKiller 11-10-2010 09:57 PM

Quote:

Originally Posted by Reef Man (Post 2069214)
Does this work on vb 4.0.x ???

Same question ... anyone tryed this on vB 4.0.x ? (4.0.8 for me..)


All times are GMT. The time now is 12:54 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01344 seconds
  • Memory Usage 1,838KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (3)bbcode_php_printable
  • (14)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete