The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
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! |
#2
|
||||
|
||||
You can add its contents into your "phpinclude" template
|
#3
|
||||
|
||||
Quote:
|
#4
|
||||
|
||||
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.. |
#5
|
||||
|
||||
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:
|
#6
|
||||
|
||||
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..
|
#7
|
||||
|
||||
Quote:
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? |
#8
|
||||
|
||||
Quote:
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:
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.. |
#9
|
||||
|
||||
Quote:
PHP Code:
|
#10
|
||||
|
||||
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? |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|