PDA

View Full Version : variable in template header not parse?? why??


aneip
07-04-2001, 07:46 AM
I put $welcometext inside template header but it not work, i want to move $welcometext from forumhome to header coz of my board design... does anything inside header will not parse?

G0D
07-04-2001, 07:50 AM
it's cuzz the header template is loaded in global.php. And when index.php calls up global.php (it does that right at the beginning) the $welcometext variable is still empty. So it will not show up.

G0D
07-04-2001, 07:58 AM
edit global.php

FIND:
if (!$header) {

ABOVE it add:

if (!$welcometext) {
if ($bbuserinfo['userid']!=0) {
$username=$bbuserinfo['username'];
eval("\$welcometext = \"".gettemplate('forumhome_welcometext')."\";");
} else { // username to dislpay when he's not registered.
$username='Stranger';
eval("\$welcometext = \"".gettemplate('forumhome_welcometext')."\";");
}
} else {
if ($bbuserinfo['userid']!=0) {
$username=$bbuserinfo['username'];
eval("\$welcometext .= \"".gettemplate('forumhome_welcometext')."\";");
} else { // username to dislpay when he's not registered.
$username='Stranger';
eval("\$welcometext .= \"".gettemplate('forumhome_welcometext')."\";");
}
}

pcmania
07-04-2001, 02:18 PM
Hi,

I am trying to do the samething for currently active users but I don't know the code for that, could you help me with that please?

Regards,
PCMANIA :confused: