PDA

View Full Version : Problem with user info box


digitalJE5U5
01-21-2003, 07:30 PM
I've added a user info box to the top of my forumhome. The problem Im having is that $newpm[messages] and Users Currently Online: <b>$headeronline</b> arent working. This info box is a combination of a few different hacks, so Im not sure what is wrong.

I've attached a screenshot to try and help explain my problem.

Thanks in advance.

TECK
01-21-2003, 11:46 PM
Is it in "header" template you added the html code? Or "forumhome"?
Post the actual php code so we can have a look at it. :)

digitalJE5U5
01-22-2003, 02:59 PM
The code is in my forumhome_logoutcode template.
I have a seperate "user Info" box for forumhome_logincode template.



<!-- WelcomePanel 2 -->
<table width="739" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="739" height="16"><img src="images/welcomepanel4_01.gif" width="739" height="16"></td>
</tr>

<tr>
<td>
<table width="100%" cellpadding="0" cellspacing="0" border="1" bgcolor="#3B4A59" bordercolor="#455164">
<tr bordercolor="#455164" bgcolor="#646E74">
<td height="85" width="272"><table width="100%" border="1" cellspacing="4" cellpadding="0" height="100%" bordercolor="#646E74" bgcolor="#646E74">
<tr>
<td bgcolor="#3B4A59" bordercolor="455164">
<div align="center"></div>
<div align="center">

<table border="0" cellpadding="4" cellspacing="0" style="border-collapse: collapse" bordercolor="#3B4A59" width="100%" id="AutoNumber3" bgcolor="#3B4A59">
<tr>
<td valign="top" bgcolor="#3B4A59" bordercolor="#3B4A59" rowspan="2">
<table width="0%" border="1" cellspacing="0" cellpadding="0" align="center" bordercolor="#000000" bgcolor="#3B4A59">

<tr>
<td bgcolor="#3B4A59" bordercolor="#3B4A59">$avatarimage</td>
</tr>
</table>
</td>
<td bgcolor="#3B4A59" bordercolor="#3B4A59">
<div align="center"><font face="Verdana"><b><font color="#FFFFFF" size="1">$unregwelcomemessage
$welcometext</font></b>
</font></div>
</td>

</tr>
<tr>
<td bgcolor="#646E74" bordercolor="#646E74">
<p style="margin-top: 1; margin-bottom: 1; word-spacing:1" align="center">
<font color="#FFFFFF" size="1" face="Verdana">Post
Count:<b>$bbuserinfo[posts]</b></font></p>
<p style="margin-top: 1; margin-bottom: 1; word-spacing:1" align="center">
<font color="#FFFFFF" size="1" face="Verdana">Local
Time: <b>$timenow</b></font></p>
<p style="margin-top: 1; margin-bottom: 1; word-spacing:1" align="center">
<font color="#FFFFFF" size="1" face="Verdana">You
have<b> $newpm[messages] </b>new PM's.</font></p>
<p style="margin-top: 1; margin-bottom: 1; word-spacing:1" align="center">
<font color="#FFFFFF"><b><font face="Verdana" size="1">
<font class="sf"><a href='member.php?s=&action=logout'>Log
Out</a> </font> </font></b> </font></p>
</td>
</tr>
</table></div>
</td>
</tr>

</table>
</td>
<td width="467"><table width="100%" border="1" cellspacing="4" cellpadding="4" height="100%" bordercolor="#646E74" bgcolor="#646E74">
<tr>
<td bgcolor="#3B4A59" bordercolor="455164">
<div align="center"><font color="#FFFFFF" size="1" face="Verdana, Arial, Helvetica, sans-serif">Registered
Members: <b>$numbermembers</b></font><font color="#FFFFFF"><br>
<font size="1" face="Verdana">Total Threads: <b>$totalthreads</b>
</font></font> <font color="#FFFFFF"><br>
<font size="1" face="Verdana">Total Posts: <b>$totalposts</b>
</font></font> <font color="#FFFFFF"><br>
<font size="1" face="Verdana"> <b><a href="member.php?s=$session[sessionhash]&action=markread">Mark
All Forums Read</a> </b></font></font> <font color="#FFFFFF"><br>
<font size="1" face="Verdana">Users Currently Online: <b>$headeronline</b></font></font></div>
</td>
<td bgcolor="#3B4A59" bordercolor="#455164">
<div align="center">
<p style="margin-top: 2; margin-bottom: 2" align="center"><font color="#FFFFFF" size="1" face="Verdana">Last
visited: $bbuserinfo[lastvisitdate].</font></p>
<p style="margin-top: 2; margin-bottom: 2" align="center">
<font color="#FFFFFF" size="1" face="Verdana">Newest member:
<a href="member.php?s=$session[sessionhash]&action=getinfo&userid=$newuserid"><b>$newusername</b></a><br>
<a href="store.php?s=$session[sessionhash]&action=main"><b><u>$storename</u></b></a></font></p>
<p style="margin-top: 2; margin-bottom: 2" align="center">
<font color="#FFFFFF" size="1" face="Verdana"><b><a href="search.php?s=$session[sessionhash]&action=getnew">View
New Posts</a> | <a href="search.php?s=$session[sessionhash]&action=getdaily">Todays
Active Topics</a><br>
<br>
</b></font></p>
<p style="margin-top: 2; margin-bottom: 2" align="center">
</p>
</div>

</td>
</tr>
</table>
</td>
</tr>
<tr bordercolor="#455164" bgcolor="#3B4A59">
<td colspan="2" height="7"></td>
</tr>
</table>

</td>
</tr>
</table>
<!-- End WelcomePanel 2 -->


I allude to this template in forumhome template. Here is an excerpt:

</head>
<body>
$header
<br>
$logincode <br>

<!-- text -->

TECK
01-22-2003, 07:11 PM
I'm not interested in the template, but the php code you added.

digitalJE5U5
01-23-2003, 02:59 AM
Firstly the avatar hack. Thanks to Firefly for writing and sharing this code. For reference, Fireflys original avatar hack can be found here: https://vborg.vbsupport.ru/showthread.php?s=&threadid=32560. On with the hack...

Open index.php (NOTE: *not* admin/index.php) and find:

#############################
$permissions=getpermissions();
if (!$permissions['canview']) {
show_nopermission();
}
############################

and directly after it add this...

############################
if ($bbuserinfo[userid]!=0) {
$avatarurl=getavatarurl($bbuserinfo[userid]);
if ($avatarurl=='') {
$avatarurl='images/avatars/noavatar.gif';
}
$avatarimage='<a href="member.php?s='.$session[sessionhash].'&action=editavatar"><img src="'.$avatarurl.'" border="0">';
} else {
$avatarimage='<a href="register.php?s='.$session[sessionhash].'&action=signup"><img src="images/avatars/guestavatar.gif" border="0"></a>';
}
############################

and

Again in index.php, find:

############################
// if user is know, then welcome
############################

and directly under it add this...

############################
$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]'");
############################

TECK
01-24-2003, 11:26 AM
FIND:// if user is know, then welcomeBELOW, ADD:$countnewthreads = $DB_site->query_first("
SELECT COUNT(*) AS total
FROM thread
WHERE dateline>$bbuserinfo[lastvisit]
");
$countnewposts = $DB_site->query_first("
SELECT COUNT(*) AS total
FROM post
WHERE dateline>$bbuserinfo[lastvisit]
");
$getnewthread = number_format( $countnewthreads['total'] );
$getnewpost = number_format( $countnewposts['total'] );Then use the 2 $getnewthread and $getnewpost variables in your template.

digitalJE5U5
01-25-2003, 01:16 AM
OK, but doesnt that just give me new posts and new threads since last visit? What I want, is new PMs, and total users online.

Im confused.
=/

TECK
01-25-2003, 03:59 AM
So post the code you have problems with then. What you posted above made me think that is your problem.