vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Fatal error: Call to a member function on a non-object in (https://vborg.vbsupport.ru/showthread.php?t=94490)

free4ever 08-17-2005 06:37 AM

Fatal error: Call to a member function on a non-object in
 
Hi,


I use this file : boardstat.php


PHP Code:

<?php
error_reporting
(7);
chdir('C:\AppServ\www\new-age');
require_once(
'global.php');
//###################################################
//
// NO NEED TO EDIT ANYTHING IN THIS AREA!  PLEASE SCROLL DOWN!!
//
//###################################################
$getnewestusers=$DB_site->query_first("SELECT userid,username FROM user ORDER BY joindate DESC LIMIT 1");
$newusername=$getnewestusers['username'];
$newuserid=$getnewestusers['userid'];
$numbersmembers=$DB_site->query_first('SELECT COUNT(*) AS users,MAX(userid) AS max FROM user');
$numbermembers=number_format($numbersmembers['users']);
// get total posts
$countposts=$DB_site->query_first('SELECT COUNT(*) AS posts FROM post');
$totalposts=number_format($countposts['posts']);
$countthreads=$DB_site->query_first('SELECT COUNT(*) AS threads FROM thread');
$totalthreads=number_format($countthreads['threads']);
// Top poster
$topposters=$DB_site->query_first("SELECT username,posts,userid FROM user ORDER BY posts desc LIMIT 1");
// Top Threads starter
$toptstarter=$DB_site->query_first("SELECT COUNT(*) AS count,postuserid,postusername FROM thread GROUP BY postuserid ORDER BY count DESC LIMIT 1");
//Get Latest Posts
$getnewthread=$DB_site->query_first("SELECT COUNT(*) AS threads FROM thread WHERE lastpost > '$bbuserinfo[lastvisit]'");
$getnewpost=$DB_site->query_first("SELECT count(*) AS posts FROM post WHERE dateline > '$bbuserinfo[lastvisit]'");
//check usergroup of user to see if they can use PMs
//$permissions=getpermissions($forumid);
if ($enablepms==and $permissions['canusepm'] and $bbuserinfo['receivepm']) {
  
$ignoreusers="";
  if (
trim($bbuserinfo['ignorelist'])!="") {
    
$ignoreusers='AND fromuserid<>'.implode(' AND fromuserid<>',explode(' 'trim($bbuserinfo['ignorelist'])));
  }
  
$allpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] $ignoreusers");
  
$newpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] AND dateline>$bbuserinfo[lastvisit] AND folderid=0 $ignoreusers");
  
$unreadpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] AND messageread=0 AND folderid=0 $ignoreusers");
  if (
$newpm['messages']==0) {
    echo 
"";
  } else {
    echo 
"";
  }
} else {
  
$pminfo='';
}

//###################################################
// ################     Step #2      ################
//###################################################
// ################ Avatar Functions ################
// You Have Some Things To Edit Here
// Require User Functions - Edit the path Below
//###################################################
require_once('C:\AppServ\www\new-age/includes/functions_user.php');
// ##################################################
$bbuserinfo['user_avatar']=fetch_avatar_url($bbuserinfo['userid']);
if(
$bbuserinfo['user_avatar']==""){

// ##################  Next  ########################
// Change the URL to noavatar.gif to whatever image
// you would like to set as your default avatar
// Also change any other Urls that is needed
//###################################################
$bbuserinfo['user_avatar']="<img src='/images/avatars/noavatar.gif' alt='Edit Your Avatar' border='0'>";
$bbuserinfo['user_avatar']="<a href='profile.php?{$session['sessionurl']}&do=editavatar'>{$bbuserinfo['user_avatar']}</a>";
$welcome_avatar=$bbuserinfo['user_avatar'];
} else {
$bbuserinfo['user_avatar']="<img src='new-age/{$bbuserinfo['user_avatar']}' alt='Edit Your Avatar' border='0'>";
$bbuserinfo['user_avatar']="<a href='profile.php?{$session['sessionurl']}&do=editavatar'>{$bbuserinfo['user_avatar']}</a>";

//###################################################
// Done Editing Avatar Info Please Scroll Down
//###################################################
$welcome_avatar=$bbuserinfo['user_avatar'];
}
$indexpage true;
$newposts $DB_site->query_first("
    SELECT COUNT(*) AS count
    FROM "
.TABLE_PREFIX."post
    WHERE dateline > '"
.$bbuserinfo['lastvisit']."'
"
);
$activethreads $DB_site->query_first("
    SELECT COUNT(*) AS count
    FROM "
.TABLE_PREFIX."thread
    WHERE lastpost > '"
.$bbuserinfo['lastvisit']."'
"
);
// ########## \\__> Added from Hwulex's Welcome Hack THANKS!!!<__// ########## \\
$getnewthread=$DB_site->query_first("SELECT COUNT(*) AS threads FROM thread WHERE lastpost > '$bbuserinfo[lastvisit]'");
$getnewpost=$DB_site->query_first("SELECT count(*) AS posts FROM post WHERE dateline > '$bbuserinfo[lastvisit]'");
if (
$bbuserinfo['userid']!=0) {
  
$username=$bbuserinfo['username'];


//###################################################
//###################  Step #3 ######################
//###################################################
// BEGIN HTML OUTPUT
// BE SURE TO LEAVE THE ECHO Strings in place
// Any Quotation marks need to have a \ before them
//###################################################
// THE FOLLOWING IS THE HTML.  YOU MAY CHANGE THE HTML IF YOU MUST
// Keep the strings intact and dont use quotation marks
// A \ in front of them other wise you will get PARSE ERRORS!!!!!!
// THIS SECTION IS THE NAV LINKS AND THE LEFT COLUMN FOR THE TABLE
// Leave All the ECHO tags Alone as well
//###################################################
echo "


<table width=720><tr><td width=100% colspan=3 align=center valign=top>
<font size=1 face=verdana><a href=\"http://localhost/new-age/private.php?s=
$session[sessionhash]\" target=\"_parent\"><b>Goto Your Inbox</b></a> |
<font size=1 face=verdana><a href=\"http://localhost/new-age/usercp.php?s=\" target=\"_parent\"><b>Control Panel</b></a> |
<a href=\"http://localhost/new-age/search.php?s=
$session[sessionhash]&do=getnew\" target=\"_parent\"><font size=\"1\" face=\"verdana\" target=\"_parent\">View New Posts</font></a> |
<a href=\"http://localhost/new-age/login.php?s=
$session[sessionhash]&do=logout\" target=\"_parent\"><font size=\"1\" face=\"verdana\">Proceed to Log Out</font></a>
</td></tr><tr><td width=10%>
$welcome_avatar</td><td width=50%>

<font size=1 face=verdana>Welcome Back, <b>
$username!</b><br> There have been $activethreads[count] threads and $newposts[count] posts since your last visit! <br>
<font size=1 face=verdana>There is currently: <b>
$numbermembers</b> members with a total of <b>$totalposts</b> posts and <b>$totalthreads</b> threads.<br>
<font size=1 face=verdana><b>
$bbuserinfo[username]</b> - You have $bbuserinfo[pmunread] new message(s) since your last visit.<br>
<font size=1 face=verdana>(You have 
$bbuserinfo[pmunread] unread messages and $bbuserinfo[pmtotal] total messages in all your folders.


)"
;
//###################################################
//  Leave This Alone
//###################################################
} else {
//###################################################
// STEP #4         //
//###################################################
//Unregistered Edit//
// Dont Forget to  //
// Change the Urls //
// IN the FORM     //
//###################################################
echo "


<table border=\"0\" cellspacing=\"0\" width=\"100%\" id=\"AutoNumber1\" cellpadding=\"0\" style=\"border-collapse: collapse\" bordercolor=\"#111111\">
  <tr>
    <td width=\"100%\">
            <img border=\"0\" src=\"images/sectionbar/login.gif\" width=\"164\" height=\"21\"></td>
  </tr>
  <tr>
    <td width=\"100%\"><table width=100% cellspacing=\"3\" border=\"0\"><tr><td width=100%>
<font size=1 face=verdana>
<form action=http://localhost/new-age/login.php method=\"post\" onsubmit=\"md5hash(vb_login_password,vb_login_md5password)\">
        <script type=\"text/javascript\" src=\"http:/localhost/new-age/clientscript/vbulletin_md5.js\"></script>
        <table cellpadding=\"0\" cellspacing=\"3\" border=\"0\">
        <tr>
            <td><input type=\"text\" name=\"vb_login_username\" id=\"navbar_username\" size=\"20\" accesskey=\"u\" tabindex=\"1\" value=\"??? ?????????\" onfocus=\"if (this.value == 'User Name') this.value = '';\" /></td>
        </tr>
        <tr>
            <td><input type=\"password\" class=\"button\" name=\"vb_login_password\" size=\"20\" accesskey=\"p\" tabindex=\"2\" /></td>
            </tr>
        <tr>
            <td>
            <label for=\"cb_cookieuser_navbar\">
            <input type=\"checkbox\" name=\"cookieuser\" value=\"1\" tabindex=\"3\" id=\"cb_cookieuser_navbar\" accesskey=\"c\" checked=\"checked\" size=\"20\" />
            ???????? ?</label></td>
        </tr>
        <tr>
            <td>
            <p align=\"center\">
            <input type=\"submit\" class=\"button\" value=\"Log in\" tabindex=\"4\" title=\"Enter your username and password in the boxes provided to login, or click the 'register' button to create a profile for yourself.\" accesskey=\"s\" size=\"20\" /></td>
        </tr>
        </table>
        <p>
        <input type=\"hidden\" name=\"s\" value=\"\" size=\"20\" />
        <input type=\"hidden\" name=\"do\" value=\"login\" size=\"20\" />
        <input type=\"hidden\" name=\"forceredirect\" value=\"1\" size=\"20\" />
        <input type=\"hidden\" name=\"vb_login_md5password\" size=\"20\" /></p>
</form></td>
  </tr>
</table>

"
;

//###################################################
//Leave This Alone //
//###################################################
}
//###################################################
// STEP #5                   //
// BEGIN RIGHT HTML OUTPUT   //
// NO QUOTATION MARKS PLEASE //
// You Can Edit This now     //
//###################################################

//###################################################
//Thats All!!!!!!                   //
//Once you have this Configured     //
//you can delete all these commented//
//out portions to decrease the      //
//scripts loading time              //
//###################################################
?>


and when i open the page it look good :squareeyed:



but ! when i include the file in m page , this error is show :

Fatal error: Call to a member function on a non-object in C:\AppServ\www\new-age\includes\functions.php on line 2596


any help ?

Any Help ?

Marco van Herwaarden 08-17-2005 09:03 PM

Very difficult to tell by looking only at this script. What version are you running at.

free4ever 08-17-2005 09:22 PM

3.0.7

Only when you include the file in another php file show that problem !

Marco van Herwaarden 08-17-2005 09:25 PM

You could start by posting part of the other file.

free4ever 08-18-2005 04:40 PM

Hi,

I send you a private message have a full files i worked with .

free4ever 08-25-2005 05:42 PM

Any idea?

free4ever 08-27-2005 06:53 PM

Please ?!

Adrian Schneider 08-27-2005 07:32 PM

How are you including it? Post your other file (or the section where it is included).


All times are GMT. The time now is 11:12 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01204 seconds
  • Memory Usage 1,828KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete