Log in

View Full Version : Reset forum query caching


asandhanam
09-04-2008, 11:12 PM
Hi i'm trying to update the 'forum' table fields from a cfm application. But though the db shows the updated values, i don't see the changes live until i update something via the forum admin which seems like changes via admin resets the cached query while direct updating from another app doesn't do that. Can someone tell me how to reset the caching while trying to run update queries on the 'forum' table from another application?

Marco van Herwaarden
09-05-2008, 06:36 AM
Easiest would be to use the vB DataManagers instead of manual editing the database. See our Articles section on how to use the DataManagers.

asandhanam
09-05-2008, 02:58 PM
Thank you for the reply. The application from which i'm trying to update the forum table is written in coldfusion. So from within this application i have to be able to update the forum data & also update the forum data cache. Is this possible ?

asandhanam
09-21-2008, 04:36 PM
I gathered snippets of code from previous posts and came up with this to update the forum table & reset cache. Trying to make this an include from my external app. I'm passing the forumid & the field to be updated.

<?
error_reporting(E_ALL & ~E_NOTICE);
include ('./global.php');
include (DIR . '/includes/adminfunctions_template.php');
include (DIR . '/includes/adminfunctions_forums.php');

$forum_num = $vbulletin->input->clean_gpc('g', 'f', TYPE_NOTRIM);
$sponsored = $vbulletin->input->clean_gpc('g', 's', TYPE_NOTRIM);

$forumdm =& datamanager_init('Forum', $vbulletin, ERRTYPE_STANDARD, 'forum');

$foruminfo = fetch_foruminfo($forum_num);

$forumdm->set_existing($foruminfo);
$forumdm->set('sponsored', $sponsored);

if ($forumdm->save())
echo "saved";
else
echo "error";

?>

Not sure whats wrong. Can anyone help.

Thanks.