Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-17-2005, 06:37 AM
free4ever's Avatar
free4ever free4ever is offline
 
Join Date: Apr 2004
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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 ?
Reply With Quote
  #2  
Old 08-17-2005, 09:03 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very difficult to tell by looking only at this script. What version are you running at.
Reply With Quote
  #3  
Old 08-17-2005, 09:22 PM
free4ever's Avatar
free4ever free4ever is offline
 
Join Date: Apr 2004
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

3.0.7

Only when you include the file in another php file show that problem !
Reply With Quote
  #4  
Old 08-17-2005, 09:25 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You could start by posting part of the other file.
Reply With Quote
  #5  
Old 08-18-2005, 04:40 PM
free4ever's Avatar
free4ever free4ever is offline
 
Join Date: Apr 2004
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi,

I send you a private message have a full files i worked with .
Reply With Quote
  #6  
Old 08-25-2005, 05:42 PM
free4ever's Avatar
free4ever free4ever is offline
 
Join Date: Apr 2004
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Any idea?
Reply With Quote
  #7  
Old 08-27-2005, 06:53 PM
free4ever's Avatar
free4ever free4ever is offline
 
Join Date: Apr 2004
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Please ?!
Reply With Quote
  #8  
Old 08-27-2005, 07:32 PM
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
Posts: 2,528
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:45 PM.


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.04482 seconds
  • Memory Usage 2,302KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete