PDA

View Full Version : How do i add this php code to headers


Powerless
08-08-2002, 09:43 AM
How do add this Php code to headers in other to read from a file, thanx in advance

<?php
$fp = fopen ("/home/theplacement/public_html/forum/storepl.cpl", "r");
$bytes = 900000;
$buffer = fread($fp, $bytes);
fclose ($fp);
print $buffer;

?>

Admin
08-08-2002, 10:32 AM
Powerless, please go to this (http://www.vbulletin.com/members/vbulletin.org.php) page and enter your username, to show you are licensed. (you will need to use your customer number and password to access that page)
Thank you.

cybrcyfr
08-08-2002, 04:08 PM
I recently purchased vB and have the same issue!

I need to have a conditional statement in the header...


<? if ($bbuserinfo[userid]!=0)
{
?><a href="<? echo $siteRoot; ?>/forums/member.php?action=logout"><B>Logout</B></a><? }
else
{
?><a href="<? echo $siteRoot; ?>/login.php"><B>Login</B></a><? }



Help! :)

cybrcyfr
08-08-2002, 04:47 PM
Ok, got it working after a few hours.

Had to do everything in the "PHP Parsed Code", and create a bunch of string variables and write them out to the headers. It doesn't really follow the development style of the site, but I guess it works...

Parsed Code

// **** Lets find out what usergroup this user belongs to... ****
//6 = Admin
//8 = NewsAdmin
//9 = ScriptsAdmin
if ($bbuserinfo[usergroupid] == 6){
$strMenuFile = "adminmenu";
}elseif ($bbuserinfo[usergroupid] == 8){
$strMenuFile = "newsmenu";
}elseif ($bbuserinfo[usergroupid] == 9){
$strMenuFile = "scriptsmenu";
}else{
$strMenuFile = "menu";
}

if ($bbuserinfo[userid]!=0)
{
$strLoggedInMsg = " You are logged in as $bbuserinfo[username]";
$strLogInOutLink = "/forums/member.php?action=logout";
$strLogInOutText = "<B>Logout</B>";
}else{
$strLoggedInMsg = "";
$strLogInOutLink = "/login.php";
$strLogInOutText = "<B>Login</B>";
}


Header Code

&nbsp;$strLoggedInMsg

<a href="{siteRoot}$LogInOutLink">$strLogInOutText</a>