Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 06-19-2003, 04:37 PM
mateo1221 mateo1221 is offline
 
Join Date: Jun 2003
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Need help w/ PHP include statement in VB

I'm kind of a newbie b/c I just installed VB on my site, but I need to create a new environment/global variable that I can reference throughout VB much like {picturesfolder} and such... which file do I modify to create a new variable like this? Thanks!
Reply With Quote
  #2  
Old 06-19-2003, 04:50 PM
filburt1 filburt1 is offline
 
Join Date: Feb 2002
Location: Maryland, US
Posts: 6,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Those are replacements; you can create them in the Replacements (surprise ) section of the admin CP.
Reply With Quote
  #3  
Old 06-19-2003, 04:59 PM
mateo1221 mateo1221 is offline
 
Join Date: Jun 2003
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ohhh... so maybe that's NOT what I want... the replacements basically just insert a set of code for the {REPLACEMENT} word? nice feature! VB get's better as I work through it...

OK, well then here's the REAL problem... attached is a PHP file that I want to include (using a PHP include statement ). It generates a random banner and displays it. I want to put it just above the section where it puts the "Name Of Your Forum" on the left and "Welcome back, Username" on the right.

What file do I need to modify to do this?? I was told it was "header" in the templates, so I modified that, inserted a table w/ a <?php include ('myfile.php'); ?> statement in it and it put the banner there, but it put it @ the VERY top of the page... ??? then when I removed the code, it did not remove the banner... I'm getting scared now... Plus, about half the time that you refresh any post or the forum index page, you get this PHP error:

Warning: Cannot modify header information - headers already sent by (output started at /home/clubvwof/public_html/forum/banner/banner.php:54) in /home/clubvwof/public_html/forum/admin/functions.php on line 1652

Line 1652 is a setcookie line... I'm lost

If anyone could be sooooo helpful as to take a look, I'd appreciate it... Our forum is HERE. Thanks again!
Attached Files
File Type: php banner.php (2.8 KB, 8 views)
Reply With Quote
  #4  
Old 06-19-2003, 05:32 PM
mateo1221 mateo1221 is offline
 
Join Date: Jun 2003
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

anyone? aranoid:
Reply With Quote
  #5  
Old 06-19-2003, 06:12 PM
filburt1 filburt1 is offline
 
Join Date: Feb 2002
Location: Maryland, US
Posts: 6,144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It's only been half an hour, please wait much longer before bumping...
Reply With Quote
  #6  
Old 06-19-2003, 06:20 PM
SmEdD's Avatar
SmEdD SmEdD is offline
 
Join Date: Mar 2003
Location: Ontario, Canada
Posts: 381
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well I can't really explain how it's done but I will do my best.

First this is not in the header otherwise it will go on every page there is.

Second this file need to be added into index.php with a $callname.

Third you need to edit forumhome template and put the $callname in it where you want to locate it.

Or unless you want it in your header you have to do the file stuff in global.php and template header.

I don't really get where you exactly want to put it.
Reply With Quote
  #7  
Old 06-19-2003, 07:32 PM
mateo1221 mateo1221 is offline
 
Join Date: Jun 2003
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I DO want it to go on every page in the forum... so should I do it in the header??? My problem is that when I edit anything in the header (even if I edit it @ the end of the header) whatever I insert ends up @ the TOP of the page... ???

If I create a variable called $banner in index.php, can I reference $banner in any of the forum php files? For instance, should I create a string variable like this?:

$banner = "include ('myfile.php');"

or something along those lines and then just add $banner wherever I need the banner script included?

I'd just like to insert it pretty much @ the top of the forum but below the title image and the UserCP, Register, etc buttons... somewhere in there... placement isn't ALL that important.

I'll play w/ all of the things you mentioned, but I am still kind of new to VB... what exactly do you mean by a $callname? Just creating my own variable?

THX!
Reply With Quote
  #8  
Old 06-19-2003, 09:24 PM
mateo1221 mateo1221 is offline
 
Join Date: Jun 2003
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK... got it fixed for the most part now... one last problem...

I have the SPOT I want and all and all of the repeats and errors are gone, but now I can't get the banner to come up @ all... :surprised:

Is this an illegal statement in the "header" template?:

<?php include ('banner/banner.php'); ?>

I know it's the right path b/c it worked before, but now it won't. The "header" template IS a part of a PHP file, correct???

Confused...
Reply With Quote
  #9  
Old 06-20-2003, 12:35 AM
SmEdD's Avatar
SmEdD SmEdD is offline
 
Join Date: Mar 2003
Location: Ontario, Canada
Posts: 381
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok first off the templates are html and cannot use php.

Open global.php

Find:

PHP Code:
eval("\$headinclude = \"".gettemplate('headinclude')."\";");
eval(
"\$header .= \"".gettemplate('header')."\";");
eval(
"\$footer .= \"".gettemplate('footer')."\";"); 
Replace with:

PHP Code:
eval("\$headinclude = \"".gettemplate('headinclude')."\";");
$banner = include ('banner/banner.php'); 
eval(
"\$header .= \"".gettemplate('header')."\";");
eval(
"\$footer .= \"".gettemplate('footer')."\";"); 
Save and upload.

Then in header template put $banner where you want it to come up.
Reply With Quote
  #10  
Old 06-20-2003, 06:38 PM
mateo1221 mateo1221 is offline
 
Join Date: Jun 2003
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Getting somewhere now, but I have yet another question...

This just creates the VARIABLE between the headinclude and the header, correct? It doesn't actually put the information there or parse any text. I realized this when I did what you suggested above and the banner.php script appeared @ the top of the page. How, now, do I fix THIS issue? Any suggestions?

Thanks for your help... we're getting SOMEWHERE... :classic:
Reply With Quote
Reply

Thread Tools
Display Modes

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:45 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.04232 seconds
  • Memory Usage 2,268KB
  • Queries Executed 14 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)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_postinfo_query
  • fetch_postinfo
  • 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
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete