Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by voogru voogru is offline
Developer Last Online: Apr 2014 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 02-08-2002 Last Update: Never Installs: 0
 
No support by the author.

im having a problem trying to include global.php in my main page (non-vB)

heres what the top of header.php looks like for my main site:

PHP Code:
<?
/*
Includes
*/
chdir("/home/voogru/public_html/forums");
require('global.php');
chdir("/home/voogru/public_html/");
?>
<title>voogru.com You IT Resource</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<LINK REL="StyleSheet" HREF="/style/style.css" TYPE="text/css">
<style>
.last10{  border: 1px #616889 solid; background-color: #ffffff; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #000000; text-decoration: none}
.pluhnews{  border: 1px #000000 solid; background-color: #F1F5F8; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; color: #000000; text-decoration: none}

the two errors i get are:

Warning: Cannot add header information - headers already sent by (output started at /home/voogru/public_html/index.php:3) in /home/voogru/public_html/forums/admin/functions.php on line 1610

Warning: Cannot add header information - headers already sent by (output started at /home/voogru/public_html/index.php:3) in /home/voogru/public_html/forums/admin/functions.php on line 1610


i tried everything i can think of, im very new to php so i need help!

thanks

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 02-08-2002, 05:49 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

In the
PHP Code:
/*
Includes
*/ 
part, do you have anything that echo/print/outputs stuff to the browser?
Reply With Quote
  #3  
Old 02-08-2002, 06:00 PM
voogru's Avatar
voogru voogru is offline
 
Join Date: Dec 2001
Location: Miami, FL
Posts: 104
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

not that i know of, no

i belive /* and */ are for commenting out text, right?

thats just so when i put more code i cant find different areas easier.
Reply With Quote
  #4  
Old 02-09-2002, 03:16 PM
TECK's Avatar
TECK TECK is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 4,182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hmmm.. you probably want to have 2 diff headers. this is not the best way to do it (in my oppinion). try this:

01. open root/global.php.

02. find the code:
PHP Code:
$templatesused.='gobutton,timezone,[...]' 
and add at the end:
PHP Code:
,home_headinclude,home_header,home_footer 
03. find the code:
PHP Code:
$header='';
$footer='';

// parse PHP include ##################
eval(gettemplate('phpinclude',0,0));

// parse css, header & footer ##################
eval("\$headinclude = \"".gettemplate('headinclude')."\";");
eval(
"\$header .= \"".gettemplate('header')."\";");
eval(
"\$footer .= \"".gettemplate('footer')."\";"); 
replace it with:
PHP Code:
$header='';
$headerhome='';
$footer='';
$footerhome='';

// parse PHP include ##################
eval(gettemplate('phpinclude',0,0));

// parse css, header & footer ##################
eval("\$headinclude = \"".gettemplate('headinclude')."\";");
eval(
"\$headincludehome = \"".gettemplate('home_headinclude')."\";");
eval(
"\$header .= \"".gettemplate('header')."\";");
eval(
"\$headerhome .= \"".gettemplate('home_header')."\";");
eval(
"\$footer .= \"".gettemplate('footer')."\";");
eval(
"\$footerhome .= \"".gettemplate('home_footer')."\";"); 
03. create the 3 templates with the content you want.

that should solve your prob .
Reply With Quote
  #5  
Old 02-10-2002, 12:01 PM
voogru's Avatar
voogru voogru is offline
 
Join Date: Dec 2001
Location: Miami, FL
Posts: 104
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i did that but i still get "Warning: Cannot add header information - headers already sent by (output started at /home/voogru/public_html/index.php:3) in /home/voogru/public_html/forums/admin/functions.php on line 1612" my problem is i cant figure out how to get global.php to work on a non-vb page. if someone can tell me how to include it it would be great, right now im trying to use:
PHP Code:
<?
/*
Includes
*/
chdir("/home/voogru/public_html/forums");
require('global.php');
chdir("/home/voogru/public_html/");
?>
and i dont know if this is the right way. if someone could point me in the right direction to include global.php it would be great.

thanks
Reply With Quote
  #6  
Old 02-10-2002, 01:25 PM
TECK's Avatar
TECK TECK is offline
 
Join Date: Nov 2001
Location: Canada
Posts: 4,182
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

what i would me is this:

01. create a insertcode.php file with all the code i need to add in specific files and place it in root/forum.

02. call insertcode.php in each file i want to add the specific code. in this way you will never have any problems.
Reply With Quote
  #7  
Old 02-10-2002, 01:32 PM
Martz's Avatar
Martz Martz is offline
 
Join Date: Oct 2001
Location: UK
Posts: 156
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

From my very limited experience, I have got these "Cannot add header information" when I have used cpheader() and another <head></head> tag in the same file. Requiring the global.php will (I am guessing) format your page with the standard headers, if your including a another file or complete .html file this might conflict?

Might be worth a try :frus:
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:43 PM.


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.04417 seconds
  • Memory Usage 2,276KB
  • Queries Executed 20 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (7)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (6)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete