Author |
Message |
mrfisho
New Member


Joined: Feb 04, 2005
Posts: 20
|
Posted:
Fri Feb 04, 2005 8:39 pm |
|
Quote: | Fatal error: Call to a member function on a non-object in /var/www/html/mainfile.php on line 648
| This is the error I get when trying to run cnbya.php install script.. The current install in standard Your_Account.. I made all the mods and uploaded all files as per install.txt .. |
|
|
|
 |
sixonetonoffun
Spouse Contemplates Divorce

Joined: Jan 02, 2003
Posts: 2496
|
Posted:
Fri Feb 04, 2005 10:20 pm |
|
Ok thats a new one on me too.
Are you running the new sec fix reported here:
http://www.techgfx.com/modules.php?name=Forums&file=viewtopic&p=20233
If so the code for the CNB YA install would have to be changed in the same way.
Example:
Code:
if (defined('FORUM_ADMIN')) {
include_once("../../../modules/Your_Account/includes/mainfileend.php");
} elseif ($inside_mod == 1) {
include_once("../../modules/Your_Account/includes/mainfileend.php");
} else {
include_once("modules/Your_Account/includes/mainfileend.php");
}
|
I know the installer can be a pain once in a while on certain configs. Myself I have to change my admin.php and modules.php in order to run the installer because of my own checks that interfere with the process. |
_________________ [b][size=5]openSUSE 11.4-x86 | Linux 2.6.37.1-1.2desktop i686 | KDE: 4.6.41>=4.7 | XFCE 4.8 | AMD Athlon(tm) XP 3000+ | MSI K7N2 Delta-L | 3GB Black Diamond DDR
| GeForce 6200@433Mhz 512MB | Xorg 1.9.3 | NVIDIA 270.30[/size:2b8 |
|
|
 |
mrfisho

|
Posted:
Sat Feb 05, 2005 1:21 am |
|
Quote: | Fatal error: Call to a member function on a non-object in /var/www/html/mainfile.php on line 649
| New error.. this time when i go to index.php that all I get.. nothing.. website won't load.. Made suggested changes to mainfile.php |
|
|
|
 |
mrfisho

|
Posted:
Sat Feb 05, 2005 1:41 am |
|
Line 649   >: $result = $db->sql_query("SELECT * FROM ".$user_prefix."_users WHERE username='$user3[1]' AND user_password='$user3[2]'"); |
|
|
|
 |
sixonetonoffun

|
Posted:
Sat Feb 05, 2005 7:01 am |
|
mrfisho wrote: | Quote: | Fatal error: Call to a member function on a non-object in /var/www/html/mainfile.php on line 649
| New error.. this time when i go to index.php that all I get.. nothing.. website won't load.. Made suggested changes to mainfile.php |
This change is only to be made if your using the path disclosure fix posted by tech or if you downloaded the chatserv patched 2.8 files within the past few days as it has been added to those recently.
For a none "fixed" site use the normal method
Code:
if ($forum_admin == 1) {
include_once("../../../modules/Your_Account/includes/mainfileend.php");
} elseif ($inside_mod == 1) {
include_once("../../modules/Your_Account/includes/mainfileend.php");
} else {
include_once("modules/Your_Account/includes/mainfileend.php");
}
|
But to get past this error apply which ever lines to the mainfile.php are right for your site.
Then open cnbya.php and delete the line at the begining
if (!is_admin($admin)) { die ("Sorry you are not an administrator, You can not install this module"); }
Run the installer this way without the admin protection then delete it as soon as the install is complete. |
|
|
|
 |
PHrEEkie
Subject Matter Expert

Joined: Feb 23, 2004
Posts: 358
|
Posted:
Sat Feb 05, 2005 1:59 pm |
|
mrfisho wrote: | Fatal error: Call to a member function on a non-object in /var/www/html/mainfile.php on line 649Code:Line 649:
$result = $db->sql_query("SELECT * FROM ".$user_prefix."_users WHERE username='$user3[1]' AND user_password='$user3[2]'");
| |
As has been discussed many times, this error is caused by $db->sql_query. Somehow, $db is losing its scope as an object, so therefore it cannot bring its attributes to the function sql_query. If this sql call is within a function, then simply add $db to the global line in the beginning of the function. If it's already in the global line, then it's losing its scope before that.
PHrEEk |
|
|
|
 |
mrfisho

|
Posted:
Sat Feb 05, 2005 2:27 pm |
|
Okay sorry .. I got it installed using the first suggestion.. Quote: | if (defined('FORUM_ADMIN')) { | yet I am not running any patches.. It is standard install running Sentinel 2.1.3 .. so only changes I have made to mainfile.php is the Sentinel adition.. which is similar to CNB changes.
Quote: | if ($forum_admin == 1) {
include("../../../includes/sentinel.php");
} elseif ($inside_mod == 1) {
include("../../includes/sentinel.php");
} else {
include("includes/sentinel.php");
} |
I am running a different block_user_info as well ... also sommaire navigation..
Once I ran the install script.. I uploaded the CNB_Your_Account files.. Thats when things go wrong.. before that I get the errors to do with mainfileend.php , They leave once I upload the files and make the change to constants.php . That when things go all white.. nothing but the error Quote: | Fatal error: Call to a member function on a non-object in /var/www/html/mainfile.php on line 649 |
PHrEEkie it has the $db in the first line of the fuction on line 649 . this shows the full function Quote: | function getusrinfo($user) {
global $userinfo, $user_prefix, $db;
$user = addslashes($user);
$user2 = base64_decode($user);
$user3 = explode(":", $user2);
$result = $db->sql_query("SELECT * FROM ".$user_prefix."_users WHERE username='$user3[1]' AND user_password='$user3[2]'");
if ($db->sql_numrows($result) == 1) {
$userinfo = $db->sql_fetchrow($result);
}
return $userinfo;
} |
So thats where I am atm.. Hope this gives a full description of whats happening.. if not sixonetonoffun let me know.. maybe you can actually take a closer look if you have the time or inclination.. I am very interested to find the problem.. website in http://www.mrfisho.com |
|
|
|
 |
sixonetonoffun

|
Posted:
Sat Feb 05, 2005 3:08 pm |
|
I would take a look at it directly if you want. I'd need ftp access and an admin account with permissions on Your Account.
Phreekie is right but the source is a mystery to me. |
|
|
|
 |
sixonetonoffun

|
Posted:
Sun Feb 06, 2005 8:34 pm |
|
I never did run into the error you had but it is just as well I took a closer look because your server uses PHP in CGI mode and there is an minor issue that I fixed that only shows up when used under this type of PHP install. |
|
|
|
 |
|