kristin
Junior Member   Posts: 27 Registered: 1/13/2003 Status: Offline
|
posted on 5/6/2003 at 11:59 PM |
Im trying to add a command that will display how many new messages a user
has
how would I do this?
I tried to add a command with the following code:
list($dbconn) = pnDBGetConn();
$pntable = pnDBGetTables();
$column1 = &$pntable['users_column'];
$column2 = &$pntable['priv_msgs_column'];
$query = "SELECT $column2[to_userid]
FROM $pntable[priv_msgs], $pntable[users]
WHERE ($column1[uname]='".pnUsergetVar('uname')."'
AND $column2[to_userid]=$column1[uid])
AND $column2[read_msg]='0' and pn_msg_type='1'";
$result = $dbconn->Execute($query);
$newmsgs = $result->PO_RecordCount();
if ($newmsgs > 0) {
$messages = "You have
<a class=\"pn-normal3\"
href=%22modules.php?op=modload&name=Messages&file=index/"><b&
gt;$newmsgs</b></a> unread messages.";
} else {
$messages = "You have no unread messages
!";
}
echo "<font color=\"#e5e5e5\">";
$uname = pnUserGetVar('uname');
echo "Welcome <a
href=%22user.php?op=userinfo&uname=$uname/"><b>$username</b
></a>!</font> <font
color=\"#b1b1b1\">[</font><a href=%22user.php/%22><font
color=\"#a3a3a3\">Account</font></a><font
color=\"#b1b1b1\">]</font><br><font
color=\"#a3a3a3\">$messages</font><br>";
}
which would work but it conflicts with autotheme.php somehow. Am i calling
things from the database wrong?
or am i completely offtrack here.. |
| |
| |
shawn
Administrator   Posts: 4575 Registered: 10/7/2002 Status: Offline
|
posted on 5/7/2003 at 07:08 PM |
So you added this as a custom command???
What do you mean by "it conflicts"? What does it DO or NOT do?
-Shawn |
| |
kristin
Junior Member   Posts: 27 Registered: 1/13/2003 Status: Offline
|
posted on 5/8/2003 at 12:45 AM |
I tired adding it as a command and tried just putting it in php tags
straight into the theme.html and I got this error both times:
Fatal error: Call to a member function on a non-object in
/home/gbb/public_html/modules/AutoTheme/autotheme.php(20) : eval()'d code
on line 53
[Edited on 8/5/2003 by kristin] |
| |