The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
auto task: clear MySQL table
how can i make corn that clean 2 tables in the datebase? im talking about the chat messages, i want it be cleared evrey nigh on 00:00..
they called: Code:
iwt_chatroom_messages iwt_chat_convos |
#2
|
|||
|
|||
Probably the easiest thing to do is piggy back on the existing "Daily Cleanup" task by creating a plugin using hook cron_script_cleanup_daily and code like this:
Code:
$vbulletin->db->query_write("TRUNCATE TABLE iwt_chatroom_messages"); $vbulletin->db->query_write("TRUNCATE TABLE iwt_chat_convos"); I'm assuming those are the actual names of the tables and that you don't need to add TABLE_PREFIX to the beginning like you would with the vb tables. The daily cleanup task is set by default to run at 00:10. If you really want it to happen at exactly 00:00 you could change that by editing the scheduled task and changing the "10" to "0" (although it's triggered by activity on your site, so if there's no activity at that time it won't happen until someone visits). You could also just make a separate task for this by copying one of the existing php files in includes/cron to a different name, replace that task's code with the above code, then create a new scheduled task. |
Благодарность от: | ||
SuperDude |
#3
|
|||
|
|||
thank you!!! its working great
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|