PDA

View Full Version : $pminfo in the Header?


jamesdasher
10-24-2001, 07:30 PM
Okay, can you all give me a hand possibly?

I am using vb 2.0.3 what I am trying to do is this, I want the $pminfo variable to be in the Header template...and therefore display on all the pages in the site...I have found the code that is used in index.php and I tried to copy it over to global.php, but it doesn't work that way, what am I missing, please help!

James

rez
10-25-2001, 04:04 PM
You just have to insert $pminfo into the header template. Nothing else is needed.

Admin
10-25-2001, 04:07 PM
You just have to insert $pminfo into the header template. Nothing else is needed.
Actually that won't work, rez.

jamesdasher, I don't understand why you can't put the code from index.php in global.php. Maybe you're doing something wrong?

Admin
10-25-2001, 04:13 PM
I added this to global.php:
$permissions=getpermissions();
if ($enablepms==1 and $permissions['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='';
}
right before this:
if (!$header) {
and it worked. Keep in mind you're adding this to -all- your pages!

jamesdasher
10-26-2001, 02:24 AM
Thanks! It worked... :D

cooldude
10-27-2001, 04:11 AM
nothings happend m8

shurie
08-11-2002, 05:45 AM
I added the code posted above to Global.php on my (under development) board but could not get it to work. I would like the PM info to display on all pages on the board in the "My Toolbox" area. You can see the board here:

http://64.78.63.86/forums/index.php

Any help would be appreciated.

Best,
Lee

PeterNRG
08-19-2002, 09:35 PM
I'm also wondering how this could work in 2.2.6.

Anyone?

Bro_Joey_Gowdy
08-19-2002, 09:52 PM
I think its already implimented