Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 09-07-2002, 04:45 AM
Gutspiller's Avatar
Gutspiller Gutspiller is offline
 
Join Date: Dec 2001
Posts: 1,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Getting include statements to work in the forum templates?

I have looked at the following threads:

https://vborg.vbsupport.ru/showthrea...light=includes

https://vborg.vbsupport.ru/showthrea...light=includes

https://vborg.vbsupport.ru/showthrea...light=includes

After reading those, I still don't know how to do it and get it to work. Can somebody give me some help on how to get a php file to be included at the top of each page of the forum?

Any help is appreciated.

Thanks!
Reply With Quote
  #2  
Old 09-07-2002, 07:31 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can add its contents into your "phpinclude" template
Reply With Quote
  #3  
Old 09-07-2002, 05:40 PM
Gutspiller's Avatar
Gutspiller Gutspiller is offline
 
Join Date: Dec 2001
Posts: 1,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Logician
You can add its contents into your "phpinclude" template
What exactly do you mean? You mean just including the include statement in the phpinclude, or do you mean actually including the contents of the file I'm trying to include? It's a big include file. Probably a good 250+ lines of code.
Reply With Quote
  #4  
Old 09-08-2002, 04:23 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I dont know if "include" or "require" would work (I guess so though) so I meant adding the code directly in phpheader template. But it doesnt matter if you include or require either because tecnically they are not different then adding the code directly. If you have some PHP knowledge you can also convert the program to a "function", add it to functions.php and call it inside the template or global.php either..

If you want the program to be parsed you have to use either way even if it's a long program. But being a long program doesnt effect the performance: everytime your "any" vbulletin script is parsed "functions.php" with over 2500 lines of code is included in every run..
Reply With Quote
  #5  
Old 09-09-2002, 06:34 PM
Gutspiller's Avatar
Gutspiller Gutspiller is offline
 
Join Date: Dec 2001
Posts: 1,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've tried to include the file that has the code in it, but it does work. It sounds like your saying that should work. Did I do it wrong? I just used the normal include statement:

PHP Code:
<? include("blah.php"); ?>
What am I doing wrong?
Reply With Quote
  #6  
Old 09-10-2002, 12:01 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I guessed so but if it's not working then it means my guess was wrong. So use the other methods.. You dont need to insist on including because as I said before inclusion is not different than adding the entire code inside your template.. In fact it is what your file does when it runs if you made an inclusion..
Reply With Quote
  #7  
Old 09-12-2002, 11:46 PM
Gutspiller's Avatar
Gutspiller Gutspiller is offline
 
Join Date: Dec 2001
Posts: 1,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Logician
I guessed so but if it's not working then it means my guess was wrong. So use the other methods.. You dont need to insist on including because as I said before inclusion is not different than adding the entire code inside your template.. In fact it is what your file does when it runs if you made an inclusion..
What other "methods" are there? If including is the same as putting code in the files themselves, then that wont work either.

What else can I try? I could do a lot of cool stuff if I can get the include statement to work. I really need something that will make it work, or will work the same way because I have other files that are outputting their data to a file and I need to tell my forums to grab that info and slap it on the pages.

Any ideas?
Reply With Quote
  #8  
Old 09-13-2002, 07:13 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Gutspiller


What other "methods" are there?
I have mentioned them in my previous message. Here are they again:

1- Add the entire code to phpinclude. As I said before you dont need to be scared because technically it's no different than adding a include("file.php") to your phpinclude template.

2- Convert your code to a function and add it at the end of inside function.php. Then you can call it as

PHP Code:
yourfunction(); 
inside phpinclude template or global.php.

3- Add you code to global.php. It also runs everytime any vb scripts runs, just like phpinclude template.Therefore you can try to add either the include statement or the entire code to global.php as well..
Reply With Quote
  #9  
Old 09-13-2002, 07:52 PM
NTLDR's Avatar
NTLDR NTLDR is offline
Coder
 
Join Date: Apr 2002
Location: Bristol, UK
Posts: 3,644
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Gutspiller
I've tried to include the file that has the code in it, but it does work. It sounds like your saying that should work. Did I do it wrong? I just used the normal include statement:

PHP Code:
<? include("blah.php"); ?>
What am I doing wrong?
Just put:

PHP Code:
include('./blah.php'); 
Having the <?php and ?> tags in there is messing it up. This does work as vBstats uses this method.
Reply With Quote
  #10  
Old 09-13-2002, 10:14 PM
Gutspiller's Avatar
Gutspiller Gutspiller is offline
 
Join Date: Dec 2001
Posts: 1,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

NTLDR that seemed to work, but it puts it at the very top of the page. Is there anyway to get it so I can do stuff with it. Like have stuff above it, etc. So that it's just another thing I can call up by doing something like "$stuff"?

I didn't really want it at the very top, but it's a step in the right direction.

Any ideas?
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 01:58 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06418 seconds
  • Memory Usage 2,263KB
  • Queries Executed 13 (?)
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
  • (4)bbcode_php
  • (4)bbcode_quote
  • (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
  • (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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete