View Full Version : Private messages on non-vb page
azerty
09-08-2001, 12:28 PM
I think it's possible, but since my knowledge of PHP is as advanced as the "hello world" script I can't make it myself :D
So you get a simple text line or something (the same as you get on the vbulletin) but simply on another page that sais "you have 0 private messages"
Does it exist ? Or can you make one like really fast ? :)
Thanks
Admin
09-08-2001, 01:57 PM
Open your global.php, and add this code:
$temppermissions=getpermissions();
right after this:
$newpmmsg=1;
eval("\$headnewpm = \"".gettemplate('head_newpm')."\";");
}
In index.php find this code:
//check usergroup of user to see if they can use PMs
//$temppermissions=getpermissions($forumid);
if ($enablepms==1 and $temppermissions['canusepm'] and $bbuserinfo['receivepm']) {
$ignoreusers="";
if (trim($bbuserinfo['ignorelist'])!="") {
$ignoreusers='AND fromuserid<>'.implode(' AND fromuserid<>',explode(' ',$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) {
$lightbulb='off';
} else {
$lightbulb='on';
}
eval("\$pminfo = \"".gettemplate('forumhome_pmloggedin')."\";");
} else {
$pminfo='';
}
CUT it out, and paste it in your global.php right AFTER
$temppermissions=getpermissions();
(what you added before)
Now you can use this
You have $newpm[messages] ($unreadpm[messages] undread) out of $allpm[messages] in total.
in any template you wish (you can change the words of course :)).
Steve Machol
09-08-2001, 02:54 PM
azerty,
Please enter your license info into your user profile. See my sig for details. Thanks! :)
azerty
09-08-2001, 03:24 PM
You say put it in any template, but I don't want it in a template, I want it on another page, so a normal php page.
Steve Machol
09-08-2001, 04:05 PM
Please put your license info into your user profile as I requsted. Thanks.
EJMack
01-11-2002, 04:09 AM
is this possible, im wanting to do somethin like this on my site...
SaintDog
01-11-2002, 04:54 AM
Steve, just on a side note, I do not see anything in your signature at this time that pertains to entering license information (may be one reason he has not entered it). I am not trying to be rude, just pointing that out (may have been deleted by accident).
Just trying to help out :)
Admin
01-11-2002, 12:09 PM
[QUOTE]Originally posted by SaintDog
Steve, just on a side note, I do not see anything in your signature at this time that pertains to entering license information (may be one reason he has not entered it). I am not trying to be rude, just pointing that out (may have been deleted by accident).
Just trying to help out :)
Gutspiller
04-13-2002, 09:32 PM
I don't have
$newpmmsg=1;
eval("\$headnewpm = \"".gettemplate('head_newpm')."\";");
}
I only have:
[php]$newpmmsg=1;
$latest_pm = $DB_site->query("SELECT p.privatemessageid AS pm_popup_id, p.title AS pm_popup_title, u.username AS pm_popup_username FROM privatemessage p, user u WHERE messageread = 0 AND touserid = $bbuserinfo[userid] AND p.fromuserid = u.userid ORDER BY dateline DESC");
$hack_pm_total = $DB_site->num_rows($latest_pm);
if ($hack_pm_total > 1) {
eval("\$pm_popup_text = \"".gettemplate('pm_popup_multiple')."\";");
eval("\$pm_popup_url = \"".gettemplate('pm_popup_url_multiple')."\";");
} else {
extract($DB_site->fetch_array($latest_pm));
eval("\$pm_popup_text = \"".gettemplate('pm_popup')."\";");
eval("\$pm_popup_url = \"".gettemplate('pm_popup_url')."\";");
}
eval("\$headnewpm = \"".gettemplate('head_newpm')."\";");
Can somebody (see also: FireFly) help me?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.