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.
|