ixian, the phpinclude template is always parsed, even for the front page of the site, if you include("$forumpath/global.php").
here's the chatstuff in my phpinclude template:
PHP Code:
if ($bbuserinfo[userid] != "0") {
$chatname = str_replace(" ", "%20", $bbuserinfo[username]);
$chatpass = $bbuserinfo[password];
$db=mysql_connect($servername,$dbusername,$dbpassword) or die("Can't open connection to MySQL");
mysql_select_db($dbname) or die("Can't select database");
mysql_query("DELETE from chat_users where u_time < ".(time() - 240)." and u_time > 0");
$num_chatters_query = mysql_query("SELECT DISTINCT username FROM chat_users WHERE room != \"PRIVATE_ROOM\"");
$num_chatters = mysql_num_rows($num_chatters_query);
if ($num_chatters == "0") {
$chatextra = "";
} elseif ($num_chatters == "1") {
$chatextra = "(1 user)";
$istext = "is";
$membertext = "member";
} else {
$chatextra = "($num_chatters users)";
$istext = "are";
$membertext = "members";
}
$who_chatters_query = mysql_query("SELECT DISTINCT username FROM chat_users");
while ($chatters = mysql_fetch_array($who_chatters_query)) {
$who_chatters .= " $chatters[username] ";
}
eval("\$chatinfo = \"".gettemplate("forumhome_chatinfo")."\";");
}
also in my phpinclude, specifically the bit that builds the dynamic menu:
PHP Code:
ob_start();
$pan = new Panel();
$pan->addPanel( "1", "General", "$forumpath/menu_general.php" );
$pan->addPanel( "2", "Help", "$forumpath/menu_help.php" );
if ($bbuserinfo[userid] != "0") {
$pan->addPanel( "3", "User", "$forumpath/menu_user.php" );
$pan->addPanel( "4", "Chat $chatextra", "$baseurl/forums/menu_chat.php?username=$chatname&password=$chatpass" );
$pan->addPanel( "5", "Misc.", "$baseurl/forums/menu_misc.php?username=$chatname&password=$chatpass&userid=$bbuserinfo[userid]" );
if ($bbuserinfo[usergroupid] == "6") {
$pan->addPanel( "6", "Moderator", "$baseurl/forums/menu_mod.php?username=$chatname&password=$chatpass" );
$pan->addPanel( "7", "Administrator", "$baseurl/forums/menu_admin.php?username=$chatname&password=$chatpass" );
$pan->addPanel( "8", "Test", "$baseurl/forums/menu_test.php?username=$chatname&password=$chatpass&userid=$bbuserinfo[userid]" );
}
if ($bbuserinfo[usergroupid] == "7" || $bbuserinfo[usergroupid] == "5") {
$pan->addPanel( "6", "Moderator", "$baseurl/forums/menu_mod.php?username=$chatname&password=$chatpass" );
$pan->addPanel( "7", "Test", "$baseurl/forums/menu_test.php?username=$chatname&password=$chatpass&userid=$bbuserinfo[userid]" );
}
}
$pan->Display();
$menucontents = ob_get_contents();
ob_end_clean();
as you can see, i pass variables to my subscripts variables in the URLs, i.e. $chatname as $username, $bbuserinfo[userid] as $userid.
here is the contents of the "menu_chat.php" script mentioned above:
PHP Code:
print "<a href=\"/chat/index.php3?U=$username&PWD_Hash=$password&Ver=H&L=english&R0=General&T=1&D=10&N=200&EN=1\">General Chat</a><br>
<a href=\"/chat/index.php3?U=$username&PWD_Hash=$password&Ver=H&L=english&R0=Poetry+Slam&T=1&D=10&N=200&EN=1\">Poetry Slam</a><br>";
i am also attaching the template for the forumhome_chatinfo. let me know if there is more questions, and if someone wants to add more (or better) instructions to my package, send me the changes and i will give you credit. (busy life right now, got twins on the way

)