Support Spidean

Do you like our FREE downloads? How about the FREE support for the FREE downloads? Please help us out and donate any amount! It's fast and easy through PayPal.

Spidean Forums

Board Index > AutoTheme 1.0 for PHP-Nuke > Need some help with commands


 < Last Thread   Next Thread >New Topic  Post Reply
Author: Subject: Need some help with commands

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

 
Reply With Quote

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

 
Reply With Quote

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]

 
Reply With Quote
New Topic    Post Reply


Main Menu

Get AutoTheme

Featured Item

Poll

How do you like the new look?

[ Results | Polls ]

Votes: 103
Comments: 0

Powered by the AutoTheme HTML Theme System
Page created in 0.113383 Seconds