In a search for an answer to the parsed posts disappearing, I have modified my system to preserve the parsed post cache for posts that are sticky. On my system, the only posts that would have HTML in them are sticky posts, so it was, to me, only a question of how to keep the software's maintenance from deleting posts from the parsed post cache that were stickly posts. Here's how I did it:
In includes/cron/cleanup2.php, there is a code segment that looks like:
Code:
// expired cached posts
$vbulletin->db->query_write("
DELETE FROM " . TABLE_PREFIX . "post_parsed
WHERE dateline < " . (TIMENOW - ($vbulletin->options['cachemaxage'] * 60 * 60 * 24))
);
I edited it to look like this:
Code:
// expired cached posts
$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"
);
Edit: I found I was getting a SQL error in my previous modification, and found a new way of keeping the post_parsed_cache clean. This above works.
This simply checks the thread table for the existence of a sticky post ID that matches the post ID of a post in the parsed post cache. If there is a match, it doesn't delete that post's cache, it leaves it indefinitely, or until the post is manually deleted.