![]() |
HowTo? Move / Delete Threads of one forum after x days
Hello,
i'd like to do two jobs automatically: 1.) "Delete all threads in forum id=88 after 365 days" 2.) "Move all threads older than 100 days and the thread-prefix=done from forum-id=10 to forum-id=12" Can anyone show me a cronjob for this? kr Chris |
Create a plugin hooked at "cron_script_cleanup_daily" with the code:
PHP Code:
Note: I have not tested this code. Please test this first on your test installation, and then make a backup of your database before running this code the first time on your live site. I cannot emphasize enough how important this is! As the code is written, the thread deletion is soft-delete. To use a hard-delete, change the line: PHP Code:
PHP Code:
|
Hy,
thank you for the code! I'll try it on my testboard and will give you feedback. One question: If i "hard-delete" the threads, than i won't need the line for the attachments? PHP Code:
|
Yeah, I'm not sure but I would just leave the array as is because it won't hurt for it to be there. :)
|
ok, i will give it a try
|
Quote:
|
I was on tour this weekend.
The code is running in my testboard since this afternoon. Tomorrow i give you my feedback. kr Chris |
1 Attachment(s)
Hello,
today i found time to test the plugin. I don't know what's wrong, but it won't work! When the plugin is active, the cronjob (id 15 - daily clean up) didn't end correct. Attachment 156708 Is the plugin inactive, evrything is fine with the cornjob: Attachment 156709 This is the code i use fpr my testboard: - forum-id = 4 => delete threads after 365 days - forum-id = 10 => move threads with the prefix "Delete" after 100 days to forum-id = 12 - my User-ID = 1 - my Username = Chris PHP Code:
|
I don't read German, so the screenshots aren't of much use to me. Sorry :(
You don't want to edit the 'userid' and 'username' keys of the $delinfo array...that could be the cause of the issue. |
Quote:
Quote:
|
All times are GMT. The time now is 07:05 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|