Okay, a couple things.
First, the options field is a bit field. So you want to find out the bit value of the option you want to change. In your case the difference is 3 (87751 - 87748), which means more than one option is different between the two forums, because valid bit values are multiples of 2. e.g. 1, 2, 4, 8, 16, 32, etc...
The only way to get three is if the option represented by 1 and the option represented by 2 are both different between the two forums. So we can assume that one of those options is "Open" and the other "Active".
Fortunately, since you want to toggle both open and active you can just go ahead and use 3 without knowing which is which. This will allow you to change the options regardless of what other options are set. You do so with simple math: options + 3, or options - 3. To check if the options are set, use options & 3.
So your query would like this to turn on the forum:
PHP Code:
if ($subfid>0)
{
echo "ACTIVE!!";
$vbulletin->db->query_write("
UPDATE " . TABLE_PREFIX . "forum
SET options = options + 3
WHERE forumid = $subfid
");
}
And this to turn off the forum:
PHP Code:
if ($subfid>0)
{
echo "NOT ACTIVE!!";
$vbulletin->db->query_write("
UPDATE " . TABLE_PREFIX . "forum
SET options = options - 3
WHERE forumid = $subfid
");
}
Second, once you've done that you need to rebuild $vbulletin->usergroupcache and $vbulletin->forumcache.
Fortunately, there is a handy function for this already in includes/adminfunctions.php. So just call it. The php code put all together might look like this:
PHP Code:
require_once('./global.php');
require_once(DIR . '/includes/adminfunctions.php');
if ($subfid>0)
{
echo "ACTIVE!!";
$vbulletin->db->query_write("
UPDATE " . TABLE_PREFIX . "forum
SET options = options + 3
WHERE forumid = $subfid
");
}
build_forum_permissions();
Hope this helps