PDA

View Full Version : $welcometext outisde of forumhome?


okrogius
01-01-2002, 10:22 PM
I was wondering f it's possible to make the $welcometext variable work on all forum pages. Not just forumhome.

Any ideas?

JJR512
01-02-2002, 05:28 AM
It is possible. Now I haven't tried this myself yet, so you'll have to try it and see that it works...but I'm pretty sure that, at least in theory, this should work. ;)

You would need to edit whatever file is responsible for what shows up on the screen...for example, because when you see the forumhome the URL you are visiting is index.php, what generates the welcome message is in the file index.php. When you are looking at a thread, you are looking at showthread.php, etc. You would need to edit any such file, and put this in it:

// if user is know, then welcome
$getnewthread=$DB_site->query_first("SELECT COUNT(*) AS threads FROM thread WHERE dateline > '$bbuserinfo[lastvisit]'");
$getnewpost=$DB_site->query_first("SELECT count(*) AS posts FROM post WHERE dateline > '$bbuserinfo[lastvisit]'");
if ($bbuserinfo['userid']!=0) {
$username=$bbuserinfo['username'];
eval("\$welcometext = \"".gettemplate('forumhome_welcometext')."\";");
eval("\$logincode = \"".gettemplate('forumhome_logoutcode')."\";");
eval("\$newposts = \"".gettemplate('forumhome_newposts')."\";");

} else {
$welcometext = "";
eval("\$newposts = \"".gettemplate('forumhome_todayposts')."\";");
eval("\$logincode = \"".gettemplate('forumhome_logincode')."\";");
}

I'm not exactly sure how important it is where you stick this... I think it should be near the top, below the require of global.php but before any action= parts.

Then, you just stick $welcometext in the appropriate spot in the appropriate template.