Version: , by Luke (Guest)
Developer Last Online: Jan 1970
Version: Unknown
Rating:
Released: 06-06-2001
Last Update: Never
Installs: 0
No support by the author.
I need a vbulletin pm hack .. that will enable me to show users on my main page of the website that they have new private messages or not.. I wrote my own code but for some reason it doesnt work.. can someone take a look at it at least.
I searched all over for it but couldnt find it.
Thanks
Quote:
<?
echo $bbuserid;
//PM HACK
if (isset($bbuserid)==0 or $bbuserid==0 or $bbuserid=="") {
echo("<font size=1 face=verdana,arial><b>Private Messages:</b><br><a href=forum/private.php>Login to read your private messages!</a></font><br><br>");
} else {
require("/www/site/forum/config.php");
$db=mysql_connect($servername,$dbusername,$dbpassw ord) or die("Can't open connection to MySQL");
mysql_select_db($dbname) or die("Can't select database");
$username = $bbuserinfo[username];
$pmcounta = "SELECT COUNT(privatemessageid) AS privatemessageid FROM privatemessage WHERE touserid='$bbuserid'";
$pmcount = $pmcounta[privatemessageid];
$newpmcounta = 'SELECT COUNT(privatemessageid) AS privatemessageid FROM privatemessage WHERE touserid=$bbuserid AND UNIX_TIMESTAMP(dateline)>$bblastvisit';
$newpmcount = $newpmcounta[privatemessageid];
if ($lastsent = 'SELECT privatemessageid,fromuserid,UNIX_TIMESTAMP(datetim e) AS dateline FROM privatemessage WHERE touserid=$bbuserid ORDER BY privatemessageid DESC') {
$lastid = trim($lastsent[fromuserid]);
$lastdate=date($dateformat,$lastsent[dateline]+(($timeoffset+$bbtimezoneoffset)*3600));
$lasttime=date($timeformat,$lastsent[dateline]+(($timeoffset+$bbtimezoneoffset)*3600));
$lastsentuser = 'SELECT username FROM user WHERE userid=$lastid';
$lastuser = htmlspecialchars($lastsentuser[username]);
$lastuserlink = "<a href=\"forum/private.php?action=show&msgid=$lastsent[msgid]&password=$bbpassword\">$lastuser</a>";
} else {
$lastuserlink = "<i>No one</i>";
}
echo mysql_error();
echo("<font size=1 face=verdana,arial><b>Private Messages:</b><br><a href=forum/private.php>Read them!</a><BR>You have $pmcount private message(s) ($newpmcount new) - Latest Message from $lastuserlink</font>");
}
//END PM HACK
?>
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.