View Single Post
  #74  
Old 08-21-2004, 01:59 AM
Jargon Jargon is offline
 
Join Date: Apr 2004
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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


"
;
?>
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01167 seconds
  • Memory Usage 1,900KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete