The Arcive of vBulletin Modifications Site. |
|
|
#1
|
|||
|
|||
|
I want to automate a task to run once a day. This task should look at the last time a thread was posted in a section. If no thread was posted in the last 30 days, that forum needs to be turned off and closed. How can I implement this?
Thanks in advance, Keyser520 |
|
#2
|
||||
|
||||
|
You can create a vBulletin Scheduled Task to do what you want.
|
|
#3
|
|||
|
|||
|
That's what I'm asking: how do I do that? I don't see the options in the scheduled task to do any of the things I asked in the first post. Can you give me specifics of how to do this? Or point me to a place where examples are posted?
|
|
#4
|
||||
|
||||
|
You will need to create your own task using PHP. I don't believe there are any examples relevant to this task.
|
|
#5
|
|||
|
|||
|
Could you help me at all? I know php, but I don't know the way vbulletin is programmed, so creating such a task is knowledge that I don't have.
|
|
#6
|
||||
|
||||
|
I've written a couple of cron jobs/Scheduled Tasks for my site. Here is the basic template I use:
Code:
<?php
// ######################## SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
if (!is_object($vbulletin->db))
{
exit;
}
// ########################################################################
// ######################### START MAIN SCRIPT ############################
// ########################################################################
Queries and Stuff Here
$vbulletin->db->query("Your Query"
);
log_cron_action('', $nextitem, 1);
?>
|
|
#7
|
|||
|
|||
|
To be more specific:
I have sections on my forum for instructors/djs. Each of them is the moderator of their own specific forum. I want to have the script check to see if that user has posted in their forum in the last month. If they have not, i want it to close and hide that forum. |
|
#8
|
||||
|
||||
|
This requires more knowledge of MySQL than PHP. All the PHP you need has been posted by Lynne. You just need to craft an SQL query to delete the posts/threads/forums. You need to compare dateline (in the database) to the current time. dateline is UNIX time (seconds from epoch).
|
|
#9
|
|||
|
|||
|
That's the part I don't have knowledge of... :-(
|
|
#10
|
|||
|
|||
|
Well, you can always request to someone make the mod (unpaid). Or, you can post in the "Request for paid services" forum and see if someone will create it you.
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|