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==1 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 ?