josiespencer
11-16-2006, 03:18 PM
if (!is_demo_mode())
{
@ob_start();
($hook = vBulletinHook::fetch_hook('global_start')) ? eval($hook) : false;
$phpinclude_output = @ob_get_contents();
@ob_end_clean();
}
The $hook evaluation is this piece of code throws an error:
Fatal error: Call to a member function on a non-object in /home/sapsuper/public_html/forums/global.php(356) : eval()'d code on line 125
Why?
Adrian Schneider
11-16-2006, 03:24 PM
The error is actually happening in a plugin, can you check which plugins you have that are using the global_start hook?
josiespencer
11-16-2006, 03:33 PM
Thanks, Sir Adrian.
I would have said that my website wasn't heavily modded, but there are six plugins using the global_start hook:
Cyb - Advanced Forum Rules - BB&Link&Accept
Custom Links
Cyb - Forumhome Sub-Forums Manager 1
Miserable Users
[Component] Invites System
Alternating Row Color for ForumBits Function
Adrian Schneider
11-16-2006, 03:41 PM
Disable one at a time until you figure out which is causing the error, then post the code for it here.
josiespencer
11-16-2006, 04:59 PM
It looks like there are two bad ones - Custom Links and Advanced Forum Rules. If you turn either of them "off", there is no problem. But leave either of them "on", and the error occurs. After looking at them a bit, should I change those "$db->"s to "$vbulletin->db->"s?
The code for Advanced Forum Rules is:
if ($vbulletin->options['cybfrules_enable'])
{
require_once(DIR . '/includes/class_bbcode.php');
$parser =& new vB_BbCodeParser($vbulletin, fetch_tag_list());
$vbulletin->options['cybfrules_rules'] = $parser->do_parse($vbulletin->options['cybfrules_rules'],1, 1, 1, 1, 1);
$vbulletin->options['cybfrules_note1'] = $parser->do_parse($vbulletin->options['cybfrules_note1'],1, 1, 1, 1, 1);
$vbulletin->options['cybfrules_note2'] = $parser->do_parse($vbulletin->options['cybfrules_note2'],1, 1, 1, 1, 1);
if ($vbulletin->options['cybfrules_show_link'])
{
$cyb_frules_sr1 = ('vbphrase[user_cp]</a></td>');
$vbulletin->templatecache['navbar'] = str_replace($cyb_frules_sr1,$cyb_frules_sr1.$vbull etin->templatecache['cyb_frules_link'],$vbulletin->templatecache['navbar']);
eval('$cyb_frules_link = "' . fetch_template('cyb_frules_link') . '";');
}
if ($_POST['cfrulesagree'] == '1')
{
$db->query_write(" UPDATE " . TABLE_PREFIX . "user SET cfrules_read_status = 1 WHERE userid = " . $vbulletin->userinfo['userid'] . " ");
if (!$vbulletin->userinfo['userid'])
{
vbsetcookie('cfrrs', '1');
}
$vbulletin->url = $_COOKIE[COOKIE_PREFIX . 'cybbacktolocation'];
exec_header_redirect($vbulletin->url);
}
$cfrules_check_user = $db->query_read(" SELECT cfrules_read_status FROM " . TABLE_PREFIX . "user AS user WHERE userid = " . $vbulletin->userinfo['userid'] . " ");
while ($cfrules_force = $db->fetch_array($cfrules_check_user))
{
$cfrulesagreed = $cfrules_force['cfrules_read_status'];
}
if (!$vbulletin->userinfo['userid'])
{
$cfrulesagreed = $_COOKIE[COOKIE_PREFIX . 'cfrrs'];
if (!$_COOKIE[COOKIE_PREFIX . 'cfrrs'])
{
$cfrulesagreed = "0";
}
}
}
The code for Custom Links is:
$getdroplinks = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "custom_droplinks WHERE linkid ORDER BY number ASC");
while($dlink = $db->fetch_array($getdroplinks))
{
if($dlink['new_window'] == 1)
{
$new = "_blank";
}
else
{
$new = "";
}
if(!empty($dlink['image']))
{
$img = "<img src='".$dlink['image']."' width='16' height='16' />";
}
else
{
$img = "";
}
$dlink['link_perms'] = explode(",", $dlink['link_perms']);
if(in_array($vbulletin->userinfo['usergroupid'], $dlink['link_perms']) )
{
$custom_droplinks .= "<tr><td class='vbmenu_option'>$img<a href='".$dlink['url']."' target='$new' title='".$dlink['alt']."'>".$dlink['name']."</a></td></tr>";
}
eval('$custom_droplinks = "' . fetch_template('custom_droplinks') . '";');
}
$getsinglelinks = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "custom_singlelinks WHERE linkid");
while($slink = $db->fetch_array($getsinglelinks))
{
if($slink['new_window'] == 1)
{
$new = "_blank";
}
else
{
$new = "";
}
if(!empty($slink['image']))
{
$img = "<img src='".$slink['image']."' width='16' height='16' />";
}
else
{
$img = "";
}
$slink['link_perms'] = explode(",", $slink['link_perms']);
if(in_array($vbulletin->userinfo['usergroupid'], $slink['link_perms']) )
{
$custom_singlelinks .= "<td class='vbmenu_control'>$img<a href='".$slink['url']."' target='$new' title='".$slink['alt']."'>".$slink['name']."</a></td>";
}
eval('$custom_singlelinks = "' . fetch_template('custom_singlelinks') . '";');
}
$search_text = '$vbphrase[calendar]</a></td>';
$vbulletin->templatecache['navbar'] = str_replace($search_text,
$search_text.fetch_template('customlinks1'),$vbull etin->templatecache['navbar']);
$search_text2 = '<!-- / NAVBAR POPUP MENUS -->';
$vbulletin->templatecache['navbar'] = str_replace($search_text2,
$search_text2.fetch_template('customlinks2'),$vbul letin->templatecache['navbar']);
Replacing the $db0> with $vbulletin->db-> seems to have resolved the issue for both plugins - now I just need to see if they still work!
Well, everything seems to work fine after the changes. Except my program which doesn't seem to be doing anything at all - it runs without error but does not change the data in the password column of the forums table:
<?php
// ######################## Set up PHP Environment ###########################
error_reporting(E_ALL & ~E_NOTICE);
@set_time_limit(0);
define('CVS_REVISION', '$RCSfile: misc.php,v $ - $Revision: 1.220 $');
define('NOZIP', 1);
// ########################## Required Includes ############################
require_once('./global.php');
require_once(DIR . '/includes/functions_databuild.php');
// ############################# Rebuild the 757 Forum ###############################
log_admin_action();
$pwdate = vbdate('Ymd',TIMENOW);
$vbulletin->db->query_write("UPDATE " .TABLE_PREFIX. "forum SET password = 'george{$pwdate}' WHERE forumid = 757");
build_forum_permissions($forum['757']);
vbflush();
unset($forum['757'], $vbulletin->forumcache);
?>
Actually, that isn't true - it is working but only partially. I looked in the database itself and the password george20061116 is there. But looking at the forums manager in my vBulletin website the password is still blank. So it looks like the update query is working fine but not the "build_forum_permissions($forum['757']);" statement. I am not sure what to do now.
OK, it works now. You can close this thread.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.