Its still not showing Welcome Back, Username! any ideas?
http://www.liquid-core.net/user2.php
That is the page im testing the code on. You can login but when it redirects you you get the same Guest message.
Here is the code I am currently using.
PHP Code:
<?php
error_reporting(7);
//////////////////////////////////////
// You need to EDIT your PATHS or this will not WORK properly
//////////////////////////////////////
chdir('/home/*****/public_html/forums');
require_once('/home/*****/public_html/forums/global.php');
?>
<?php
//////////////////////////////////////
// No need to edit anything just yet 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 #1
//////////////////////////////////////////////////////////////////
//Please Enter the Full Path to the functions_user.php file
//////////////////////////////////////////////////////////////////
//
require_once('/home/*****/public_html/forums/includes/functions_user.php');
//
//////////////////////////////////////////////////////////////////
$indexpage = true;
$bbuserinfo['avatarurl'] =
fetch_avatar_url($bbuserinfo['userid']);
$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 #2 //
//////////////////////////////////////////////////////////////////
//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://www.liquid-core.net/forums/private.php?s=$session[sessionhash]\" target=\"_parent\"><b>Goto Your Inbox</b></a> |
<font size=1 face=verdana><a href=\"http://www.liquid-core.net/usercp.php?s=\" target=\"_parent\"><b>Control Panel</b></a> |
<a href=\"http://www.liquid-core.net/forums/search.php?s=$session[sessionhash]&do=getnew\" target=\"_parent\"><font size=\"1\" face=\"verdana\" target=\"_parent\">View New Posts</font></a> |
<a href=\"http://www.liquid-core.net/forums/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%><a href=\"http://www.liquid-core.net/forums/profile.php?$session[sessionurl]&do=editavatar\"><img src=\"$bbuserinfo[avatarurl]\" border=\"0\"></a></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 #3 //
//Guest Column Edit//
// Dont Forget to //
// Change the Urls //
// IN the FORM //
/////////////////////
echo "
<table width=720><tr><td width=10%>$avatarimage</td><td width=50%>
<font size=1 face=verdana>Welcome Guest!<br><table width=100% border=0 cellpadding=0 cellspacing=0>
<font size=1 face=verdana>
If this is your first visit, be sure to read the <a href=\"http://www.liquid-core.net/forums/faq.php?s=$session[sessionhash]\" target=\"_parent\">
<b>FAQ</b></a>. You have to <a href=\"http://www.liquid-core.net/forums/register.php?s=$session[sessionhash]\"
target=\"_parent\"><b>register</b></a> before you can post on our forums or interact with our growing community.
<form action=\"http://www.liquid-core.net/forums/login.php\" method=\"post\" onsubmit=\"md5hash(vb_login_password,vb_login_md5password)\">
<script type=\"text/javascript\" src=\"http://www.liquid-core.net/forums/clientscript/vbulletin_md5.js\"></script>
<table cellpadding=\"0\" cellspacing=\"3\" border=\"0\">
<tr>
<td><font size=1 face=verdana>User Name</td>
<td><input type=\"text\" class=\"button\" name=\"vb_login_username\" id=\"navbar_username\" size=\"10\" accesskey=\"u\" tabindex=\"1\" value=\"User Name\" onfocus=\"if (this.value == 'User Name') this.value = '';\" /></td>
<td colspan=\"2\" nowrap=\"nowrap\"><label for=\"cb_cookieuser_navbar\"><input type=\"checkbox\" name=\"cookieuser\" value=\"1\" tabindex=\"3\" id=\"cb_cookieuser_navbar\" accesskey=\"c\" checked=\"checked\" /><font size=1 face=verdana>Remember Me?</label></td>
</tr>
<tr>
<td><font size=1 face=verdana>Password</td>
<td><input type=\"password\" class=\"button\" name=\"vb_login_password\" size=\"10\" accesskey=\"p\" tabindex=\"2\" /></td>
<td><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\" /></td>
</tr>
</table>
<input type=\"hidden\" name=\"s\" value=\"\" />
<input type=\"hidden\" name=\"do\" value=\"login\" />
<input type=\"hidden\" name=\"forceredirect\" value=\"1\" />
<input type=\"hidden\" name=\"vb_login_md5password\" />
</form>
";
/////////////////////
//Leave This Alone //
/////////////////////
}
///////////////////////////////
// STEP #4 //
// BEGIN RIGHT COLUMN HTML OUTPUT//
// NO QUOTATION MARKS PLEASE //
// You Can Edit This now //
///////////////////////////////
echo "
</td>
<td width=40% align=right>
<font size=1 face=verdana>Newest member <a
href=\"http://www.liquid-core.net/forums/member.php?s=&action=getinfo&userid=$newuserid\">$newusername</a><br>
<font size=1 face=verdana>The Current Top Poster is: <a href=http://www.liquid-core.net/forums/member.php?&action=getinfo&userid=$topposters[userid]>
<b>$topposters[username]</b></a></font>($topposters[posts])<br>
<font size=1 face=verdana>The Current Top Thread Starter is: <font color=red>
<a href=http://www.liquid-core.net/forums/member.php?&action=getinfo&userid=$toptstarter[postuserid]><b>$toptstarter[postusername]</b></font>
</a>($toptstarter[count])</td></tr></table>
";
?>