vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   How do i add this php code to headers (https://vborg.vbsupport.ru/showthread.php?t=42059)

Powerless 08-08-2002 09:43 AM

How do i add this php code to headers
 
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 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...

PHP Code:

<? 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
PHP 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
PHP Code:

&nbsp;$strLoggedInMsg

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



All times are GMT. The time now is 01:41 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01025 seconds
  • Memory Usage 1,727KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete