Dale Shields Posted August 17, 2008 Share Posted August 17, 2008 when I try to go to the admin panel on my site I get this:Fatal error: Call to a member function sql_query() on a non-object in /home/owningua/public_html/nuke/modules/Forums/common.php on line 226 I am using php-nuke with a phpbb2 forum module. This package was installed by fantastico to my siteground account. Quote Link to comment https://forums.phpfreaks.com/topic/120082-solved-no-admin-panel-on-the-site-forums/ Share on other sites More sharing options...
revraz Posted August 18, 2008 Share Posted August 18, 2008 And with the information you provided, what would you like us to do? Quote Link to comment https://forums.phpfreaks.com/topic/120082-solved-no-admin-panel-on-the-site-forums/#findComment-619145 Share on other sites More sharing options...
Dale Shields Posted August 20, 2008 Author Share Posted August 20, 2008 I can e-mail you the site and host information if you would like to see what is going on for yourself. Any help would be greatly appreciated since I am a rank NEWBIE at this website stuff. I know nothing about script..etc. Quote Link to comment https://forums.phpfreaks.com/topic/120082-solved-no-admin-panel-on-the-site-forums/#findComment-620627 Share on other sites More sharing options...
Dale Shields Posted August 24, 2008 Author Share Posted August 24, 2008 This is the common.php file. Do you see anything wrong with it? application/x-httpd-php common.php PHP script text  <?php /*************************************************************************** *                common.php *              ------------------- * begin        : Saturday, Feb 23, 2001 * copyright      : © 2001 The phpBB Group * email        : support@phpbb.com * * $Id: common.php,v 1.74.2.3 2002/05/13 13:18:17 psotfx Exp $ * * ***************************************************************************/ /*************************************************************************** * phpbb2 forums port version 2.1 © 2003 - Nuke Cops (http://nukecops.com) * * Ported by Paul Laudanski (Zhen-Xjell) to phpbb2 standalone 2.0.4. Test * and debugging completed by the Elite Nukers at Nuke Cops: ArtificialIntel, * Chatserv, MikeM, sixonetonoffun, Zhen-Xjell. Thanks to some heavy debug * work by AI in Nuke 6.5. * * You run this package at your sole risk. Nuke Cops and affiliates cannot * be held liable if anything goes wrong. You are advised to test this * package on a development system. Backup everything before implementing * in a production environment. If something goes wrong, you can always * backout and restore your backups. * * Installing and running this also means you agree to the terms of the AUP * found at Nuke Cops. * * This is version 2.1 of the phpbb2 forum port for PHP-Nuke. Work is based * on Tom Nitzschner's forum port version 2.0.6. Tom's 2.0.6 port was based * on the phpbb2 standalone version 2.0.3. Our version 2.1 from Nuke Cops is * now reflecting phpbb2 standalone 2.0.4 that fixes some major SQL * injection exploits. ***************************************************************************/ /*************************************************************************** * This file is part of the phpBB2 port to Nuke 6.0 © copyright 2002 * by Tom Nitzschner (tom@toms-home.com) * http://bbtonuke.sourceforge.net (or http://www.toms-home.com) * * As always, make a backup before messing with anything. All code * release by me is considered sample code only. It may be fully * functual, but you use it at your own risk, if you break it, * you get to fix it too. No waranty is given or implied. * * Please post all questions/request about this port on http://bbtonuke.sourceforge.net first, * then on my site. All original header code and copyright messages will be maintained * to give credit where credit is due. If you modify this, the only requirement is * that you also maintain all original copyright messages. All my work is released * under the GNU GENERAL PUBLIC LICENSE. Please see the README for more information. * ***************************************************************************/  /*************************************************************************** * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * ***************************************************************************/ $forum_admin = "1"; if ( !defined('IN_PHPBB') ) { die("Hacking attempt"); } $root_path = "./../../../"; error_reporting (E_ERROR | E_WARNING | E_PARSE); // This will NOT report uninitialized variables set_magic_quotes_runtime(0); // Disable magic_quotes_runtime  // // addslashes to vars if magic_quotes_gpc is off // this is a security precaution to prevent someone // trying to break out of a SQL statement. // if( !get_magic_quotes_gpc() ) { if( is_array($HTTP_GET_VARS) ) { while( list($k, $v) = each($HTTP_GET_VARS) ) { if( is_array($HTTP_GET_VARS[$k]) ) { while( list($k2, $v2) = each($HTTP_GET_VARS[$k]) ) { $HTTP_GET_VARS[$k][$k2] = addslashes($v2); } @reset($HTTP_GET_VARS[$k]); } else { $HTTP_GET_VARS[$k] = addslashes($v); } } @reset($HTTP_GET_VARS); }  if( is_array($HTTP_POST_VARS) ) { while( list($k, $v) = each($HTTP_POST_VARS) ) { if( is_array($HTTP_POST_VARS[$k]) ) { while( list($k2, $v2) = each($HTTP_POST_VARS[$k]) ) { $HTTP_POST_VARS[$k][$k2] = addslashes($v2); } @reset($HTTP_POST_VARS[$k]); } else { $HTTP_POST_VARS[$k] = addslashes($v); } } @reset($HTTP_POST_VARS); }  if( is_array($HTTP_COOKIE_VARS) ) { while( list($k, $v) = each($HTTP_COOKIE_VARS) ) { if( is_array($HTTP_COOKIE_VARS[$k]) ) { while( list($k2, $v2) = each($HTTP_COOKIE_VARS[$k]) ) { $HTTP_COOKIE_VARS[$k][$k2] = addslashes($v2); } @reset($HTTP_COOKIE_VARS[$k]); } else { $HTTP_COOKIE_VARS[$k] = addslashes($v); } } @reset($HTTP_COOKIE_VARS); } }  // // Define some basic configuration arrays this also prevents // malicious rewriting of language and otherarray values via // URI params // $board_config = array(); $userdata = array(); $theme = array(); $images = array(); $lang = array(); $gen_simple_header = FALSE;  include($phpbb_root_path . 'config.'.$phpEx);  if( !defined("PHPBB_INSTALLED") ) { header("Location: modules.php?name=Forums&file=install"); exit; }  include($root_path . 'includes/constants.'.$phpEx); include($root_path . 'includes/template.'.$phpEx); include($root_path . 'includes/sessions.'.$phpEx); include($root_path . 'includes/auth.'.$phpEx); include($root_path . 'includes/functions.'.$phpEx); include($root_path . 'includes/db.'.$phpEx);  // // Mozilla navigation bar // Default items that should be valid on all pages. // Defined here and not in page_header.php so they can be redefined in the code // $nav_links['top'] = array ( 'url' => append_sid($phpbb_root_dir."index.".$phpEx), 'title' => sprintf($lang['Forum_Index'], $board_config['sitename']) ); $nav_links['search'] = array ( 'url' => append_sid($phpbb_root_dir."search.".$phpEx), 'title' => $lang['Search'] ); $nav_links['help'] = array ( 'url' => append_sid($phpbb_root_dir."faq.".$phpEx), 'title' => $lang['FAQ'] ); $nav_links['author'] = array ( 'url' => append_sid($phpbb_root_dir."memberlist.".$phpEx), 'title' => $lang['Memberlist'] );  // // Obtain and encode users IP // if( getenv('HTTP_X_FORWARDED_FOR') != '' ) { $client_ip = ( !empty($HTTP_SERVER_VARS['REMOTE_ADDR']) ) ? $HTTP_SERVER_VARS['REMOTE_ADDR'] : ( ( !empty($HTTP_ENV_VARS['REMOTE_ADDR']) ) ? $HTTP_ENV_VARS['REMOTE_ADDR'] : $REMOTE_ADDR );  if ( preg_match("/^([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/", getenv('HTTP_X_FORWARDED_FOR'), $ip_list) ) { $private_ip = array('/^0\./', '/^127\.0\.0\.1/', '/^192\.168\..*/', '/^172\.16\..*/', '/^10..*/', '/^224..*/', '/^240..*/'); $client_ip = preg_replace($private_ip, $client_ip, $ip_list[1]); } } else { $client_ip = ( !empty($HTTP_SERVER_VARS['REMOTE_ADDR']) ) ? $HTTP_SERVER_VARS['REMOTE_ADDR'] : ( ( !empty($HTTP_ENV_VARS['REMOTE_ADDR']) ) ? $HTTP_ENV_VARS['REMOTE_ADDR'] : $REMOTE_ADDR ); } $user_ip = encode_ip($client_ip);  // // Setup forum wide options, if this fails // then we output a CRITICAL_ERROR since // basic forum information is not available // $sql = "SELECT * FROM " . CONFIG_TABLE; if( !($result = $db->sql_query($sql)) ) { message_die(CRITICAL_ERROR, "Could not query config information", "", __LINE__, __FILE__, $sql); }  while ( $row = $db->sql_fetchrow($result) ) { $board_config[$row['config_name']] = $row['config_value']; }  // // Show 'Board is disabled' message if needed. // if( $board_config['board_disable'] && !defined("IN_ADMIN") && !defined("IN_LOGIN") ) { message_die(GENERAL_MESSAGE, 'Board_disable', 'Information'); }  ?> Quote Link to comment https://forums.phpfreaks.com/topic/120082-solved-no-admin-panel-on-the-site-forums/#findComment-624025 Share on other sites More sharing options...
Dale Shields Posted August 24, 2008 Author Share Posted August 24, 2008 Sorry for the confusion. That is my constant state with this site at this point however. THIS IS THE CORRECT FORUM MODULE COMMON.PHP FILE. <?php /*************************************************************************** * common.php * ------------------- * begin : Saturday, Feb 23, 2001 * copyright : © 2001 The phpBB Group * email : support@phpbb.com * * Id: common.php,v 1.74.2.17 2005/02/21 19:29:30 acydburn Exp * ***************************************************************************/  /*************************************************************************** * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * ***************************************************************************/  if ( !defined('IN_PHPBB') ) { die("Hacking attempt"); }  // error_reporting (E_ERROR | E_WARNING | E_PARSE); // This will NOT report uninitialized variables set_magic_quotes_runtime(0); // Disable magic_quotes_runtime  // The following code (unsetting globals) was contributed by Matt Kavanagh  // PHP5 with register_long_arrays off? if (!isset($HTTP_POST_VARS) && isset($_POST)) { $HTTP_POST_VARS = $_POST; $HTTP_GET_VARS = $_GET; $HTTP_SERVER_VARS = $_SERVER; $HTTP_COOKIE_VARS = $_COOKIE; $HTTP_ENV_VARS = $_ENV; $HTTP_POST_FILES = $_FILES;  // _SESSION is the only superglobal which is conditionally set if (isset($_SESSION)) { $HTTP_SESSION_VARS = $_SESSION; } }  if (@phpversion() < '4.0.0') { // PHP3 path; in PHP3, globals are _always_ registered  // We 'flip' the array of variables to test like this so that // we can validate later with isset($test[$var]) (no in_array()) $test = array('HTTP_GET_VARS' => NULL, 'HTTP_POST_VARS' => NULL, 'HTTP_COOKIE_VARS' => NULL, 'HTTP_SERVER_VARS' => NULL, 'HTTP_ENV_VARS' => NULL, 'HTTP_POST_FILES' => NULL, 'phpEx' => NULL, 'phpbb_root_path' => NULL);  // Loop through each input array @reset($test); while (list($input,) = @each($test)) { while (list($var,) = @each($$input)) { // Validate the variable to be unset if (!isset($test[$var]) && $var != 'test' && $var != 'input') { unset($$var); } } } } else if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on') { // PHP4+ path $not_unset = array('HTTP_GET_VARS', 'HTTP_POST_VARS', 'HTTP_COOKIE_VARS', 'HTTP_SERVER_VARS', 'HTTP_SESSION_VARS', 'HTTP_ENV_VARS', 'HTTP_POST_FILES', 'phpEx', 'phpbb_root_path', 'name', 'admin', 'nukeuser', 'user', 'no_page_header', 'cookie', 'db', 'prefix');  // Not only will array_merge give a warning if a parameter // is not an array, it will actually fail. So we check if // HTTP_SESSION_VARS has been initialised. if (!isset($HTTP_SESSION_VARS)) { $HTTP_SESSION_VARS = array(); }  // Merge all into one extremely huge array; unset // this later $input = array_merge($HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_COOKIE_VARS, $HTTP_SERVER_VARS, $HTTP_SESSION_VARS, $HTTP_ENV_VARS, $HTTP_POST_FILES);  unset($input['input']); unset($input['not_unset']);  while (list($var,) = @each($input)) { if (!in_array($var, $not_unset)) { unset($$var); } }  unset($input); }  // // addslashes to vars if magic_quotes_gpc is off // this is a security precaution to prevent someone // trying to break out of a SQL statement. // if( !get_magic_quotes_gpc() ) { if( is_array($HTTP_GET_VARS) ) { while( list($k, $v) = each($HTTP_GET_VARS) ) { if( is_array($HTTP_GET_VARS[$k]) ) { while( list($k2, $v2) = each($HTTP_GET_VARS[$k]) ) { $HTTP_GET_VARS[$k][$k2] = addslashes($v2); } @reset($HTTP_GET_VARS[$k]); } else { $HTTP_GET_VARS[$k] = addslashes($v); } } @reset($HTTP_GET_VARS); }  if( is_array($HTTP_POST_VARS) ) { while( list($k, $v) = each($HTTP_POST_VARS) ) { if( is_array($HTTP_POST_VARS[$k]) ) { while( list($k2, $v2) = each($HTTP_POST_VARS[$k]) ) { $HTTP_POST_VARS[$k][$k2] = addslashes($v2); } @reset($HTTP_POST_VARS[$k]); } else { $HTTP_POST_VARS[$k] = addslashes($v); } } @reset($HTTP_POST_VARS); }  if( is_array($HTTP_COOKIE_VARS) ) { while( list($k, $v) = each($HTTP_COOKIE_VARS) ) { if( is_array($HTTP_COOKIE_VARS[$k]) ) { while( list($k2, $v2) = each($HTTP_COOKIE_VARS[$k]) ) { $HTTP_COOKIE_VARS[$k][$k2] = addslashes($v2); } @reset($HTTP_COOKIE_VARS[$k]); } else { $HTTP_COOKIE_VARS[$k] = addslashes($v); } } @reset($HTTP_COOKIE_VARS); } }  // // Define some basic configuration arrays this also prevents // malicious rewriting of language and otherarray values via // URI params // $board_config = array(); $userdata = array(); $theme = array(); $images = array(); $lang = array(); $nav_links = array(); $gen_simple_header = FALSE;  include($phpbb_root_path . 'config.'.$phpEx);  if( !defined("PHPBB_INSTALLED") ) { header("Location: modules.php?name=Forums&file=install"); exit; }  if (defined('FORUM_ADMIN')) { // include("../../db/db.php"); include("../../../includes/constants.php"); include("../../../includes/template.php"); include("../../../includes/sessions.php"); include("../../../includes/auth.php"); include("../../../includes/functions.php"); } else { include("includes/constants.php"); include("includes/template.php"); include("includes/sessions.php"); include("includes/auth.php"); include("includes/functions.php"); include("db/db.php"); }  // // Obtain and encode users IP // // I'm removing HTTP_X_FORWARDED_FOR ... this may well cause other problems such as // private range IP's appearing instead of the guilty routable IP, tough, don't // even bother complaining ... go scream and shout at the idiots out there who feel // "clever" is doing harm rather than good ... karma is a great thing ... // $client_ip = ( !empty($HTTP_SERVER_VARS['REMOTE_ADDR']) ) ? $HTTP_SERVER_VARS['REMOTE_ADDR'] : ( ( !empty($HTTP_ENV_VARS['REMOTE_ADDR']) ) ? $HTTP_ENV_VARS['REMOTE_ADDR'] : getenv('REMOTE_ADDR') ); $user_ip = encode_ip($client_ip);  // // Setup forum wide options, if this fails // then we output a CRITICAL_ERROR since // basic forum information is not available // $sql = "SELECT * FROM " . CONFIG_TABLE; if( !($result = $db->sql_query($sql)) ) { message_die(CRITICAL_ERROR, "Could not query config information", "", __LINE__, __FILE__, $sql); }  while ( $row = $db->sql_fetchrow($result) ) { $board_config[$row['config_name']] = $row['config_value']; }   // // Show 'Board is disabled' message if needed. // if( $board_config['board_disable'] && !defined("IN_ADMIN") && !defined("IN_LOGIN") ) { message_die(GENERAL_MESSAGE, 'Board_disable', 'Information'); }  ?> Quote Link to comment https://forums.phpfreaks.com/topic/120082-solved-no-admin-panel-on-the-site-forums/#findComment-624493 Share on other sites More sharing options...
revraz Posted August 25, 2008 Share Posted August 25, 2008 This is setup for SQL Server, not MYSQL. Which type of DB do you use?  Also, this is made for PHP4, you probably should find updated PHP5 scripts, assuming you use PHP5. Quote Link to comment https://forums.phpfreaks.com/topic/120082-solved-no-admin-panel-on-the-site-forums/#findComment-624966 Share on other sites More sharing options...
Dale Shields Posted August 27, 2008 Author Share Posted August 27, 2008 I use Mysql and php-nuke7 Quote Link to comment https://forums.phpfreaks.com/topic/120082-solved-no-admin-panel-on-the-site-forums/#findComment-626552 Share on other sites More sharing options...
Dale Shields Posted August 27, 2008 Author Share Posted August 27, 2008 restored the nuke folder from a backup and still get this: Â Warning: main(db/db.php) [function.main]: failed to open stream: No such file or directory in /home/owningua/public_html/nuke/modules/Forums/common.php on line 205 Â Warning: main(db/db.php) [function.main]: failed to open stream: No such file or directory in /home/owningua/public_html/nuke/modules/Forums/common.php on line 205 Â Warning: main() [function.include]: Failed opening 'db/db.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/owningua/public_html/nuke/modules/Forums/common.php on line 205 Â Fatal error: Call to a member function sql_query() on a non-object in /home/owningua/public_html/nuke/modules/Forums/common.php on line 226 I have read that after restoring files using filezilla ftp client that sometimes lines get moved. I don't know if that is the case tho. Quote Link to comment https://forums.phpfreaks.com/topic/120082-solved-no-admin-panel-on-the-site-forums/#findComment-626556 Share on other sites More sharing options...
revraz Posted August 27, 2008 Share Posted August 27, 2008 Well those errors point you right to their particular problem  No such file or directory means just that. Quote Link to comment https://forums.phpfreaks.com/topic/120082-solved-no-admin-panel-on-the-site-forums/#findComment-626915 Share on other sites More sharing options...
Dale Shields Posted August 29, 2008 Author Share Posted August 29, 2008 Ok I restored (overwrote)just the Forum module from a clean 7.7 zip file i downloaded from php-nuke and all is working fine now. thanks for your patience and your input. Quote Link to comment https://forums.phpfreaks.com/topic/120082-solved-no-admin-panel-on-the-site-forums/#findComment-628335 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.