The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
|
#1
|
|||
|
|||
Want to mod cleanup2.php for post_parsed cache
I am looking for a mod to cleanup2.php in the includes/cron directory that deals with cleaning up the post_parsed cache.
The current code looks like this: Code:
$vbulletin->db->query_write(" DELETE FROM " . TABLE_PREFIX . "post_parsed WHERE dateline < " . (TIMENOW - ($vbulletin->options['cachemaxage'] * 60 * 60 * 24)) ); Is this doable? I believe I have written my own solution. If anyone sees anything wrong with this, please respond. I modified the code above to look like this: Code:
// expired cached posts $vbulletin->db->query_write(" DELETE FROM " . TABLE_PREFIX . "post_parsed WHERE dateline < " . (TIMENOW - ($vbulletin->options['cachemaxage'] * 60 * 60 * 24)) . " AND NOT EXISTS (SELECT firstpostid FROM " . TABLE_PREFIX . "thread WHERE firstpostid = postid)" ); This is my latest code: Code:
$vbulletin->db->query_write(" DELETE parsed FROM " . TABLE_PREFIX . "post_parsed AS parsed LEFT JOIN " . TABLE_PREFIX . "thread AS thread ON thread.firstpostid = parsed.postid WHERE parsed.dateline < " . (TIMENOW - ($vbulletin->options['cachemaxage'] * 60 * 60 * 24)) . " AND thread.sticky = 0" ); |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|