The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
[SLOVED] The difference between today's date and the date of the creation of Thread
HELLO ...
i make new filed in table thread .. and i want SET or UPDATE data of this filed After some days LIKE THIS : PHP Code:
Do I need to use SQL QUERY OR there is a simple code for that and what's name of hook to this plugin ... i use this code but not work ... in global_start hook PHP Code:
I have another question here about same filed https://vborg.vbsupport.ru/showthread.php?t=296543 Thank you ! |
#2
|
|||
|
|||
You have a couple of problems with that code. Try this:
Code:
$cutoff = TIMENOW - (60 * 60 * 24 * $vbulletin->options['user_contact_time']); $vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "thread SET user_contact = 'anything' WHERE dateline <= $cutoff "); As for where to put it, it might work at global_start, but I don't think you want it to run every time anyone accesses any page. You could use cron_script_cleanup_hourly and have it run once per hour, if that works for you. |
#3
|
||||
|
||||
Exactly , I do not want it running SQL QUERY all day , that's Will happen over load to Server
but I do not know much about the cron of vb ... can u help me for that (Is there any thread link talk about explanation run this code once every 24 hours or every hour) and i Ask from you to consider on this topic, there is simple question but important for me https://vborg.vbsupport.ru/showthread.php?t=296543 thnx u very much the code now Works well PHP Code:
|
#4
|
|||
|
|||
You should be able to have it run once per hour or day just by changing the hook location of your plugin: cron_script_cleanup_daily = once per day, cron_script_cleanup_hourly = once per hour. Note that those don't run at exact times, it will depend on how much activity your forum has.
|
#5
|
||||
|
||||
Quote:
Well, i will use this hooks ... Thanks again Do not forget to consider this topic https://vborg.vbsupport.ru/showthread.php?t=296543 |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|