The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
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 |
#2
|
||||
|
||||
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:
|
2 благодарности(ей) от: | ||
Dave, Za4a Tuner |
#3
|
||||
|
||||
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:
|
#4
|
||||
|
||||
Yeah, I'm not sure but I would just leave the array as is because it won't hurt for it to be there.
|
#5
|
||||
|
||||
ok, i will give it a try
|
#6
|
||||
|
||||
|
#7
|
||||
|
||||
I was on tour this weekend.
The code is running in my testboard since this afternoon. Tomorrow i give you my feedback. kr Chris |
#8
|
||||
|
||||
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:
|
#9
|
||||
|
||||
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. |
#10
|
||||
|
||||
Quote:
that don't make a difference, i tried it right now. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|