The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
Hey,
How can I include a PHP script in the navbar style template? Alternatively, where can I find the navbar template in a PHP file rather than through the admin cpanel... Cheers, -Ross |
#2
|
||||
|
||||
![]()
1) You can't use PHP in Templates
2) Templates are stored in the Database (table template) and not in files. |
#3
|
||||
|
||||
![]() Quote:
Check this topic, you will learn much on how vb works: https://vborg.vbsupport.ru/showpost....13&postcount=1 Quote:
|
#4
|
|||
|
|||
![]()
urgh, I can't get my head round this :ermm:
Ok, I have my php script which now just returns a load of HTML in a single variable. What I don't understand is how to get that variable into the template. Do I some how use an 'xml hook' so I could include it something like; <myphpscript> parameters here if I want... </myphpscript> If that is the case, is there some kind of template I can alter that will show me the basic idea of how to do this? Thanks, -Ross |
#5
|
||||
|
||||
![]()
This is a FAQ
![]() global_start PHP Code:
|
#6
|
||||
|
||||
![]()
In short... normally you can use PHP in HTML like you're thinking but you can't do it in vB templates... if you dig around either vB.org or vB.com you'll come across a thread where it's discussed that the ability of doing PHP in templates is prevented for security concerns.
To do what you want... are you trying to show a new page using vB's header & footer (and style) or are you trying to just include one or two new fields on an existing vB page somewhere? |
#7
|
|||
|
|||
![]()
Alright, but where does that go and how does it make it's way into the template?
![]() Cheers, -Ross Quote:
-Ross |
#8
|
||||
|
||||
![]()
As said - global_start.
Then just use the variable created by your script (and/or $script_output if it directly generates output) in the Template you want it. |
#9
|
|||
|
|||
![]()
Ah ok I think I understand now - but I think im going crazy, what on earth is 'global_start'? a file, template, something in the admincp :ermm:
-Ross |
#10
|
||||
|
||||
![]()
'global_start' is a hook location where you can place PHP code that will be ran on every page - You can add a hook to it in the AdminCP under 'Plugin System > Add New Plugin'
|
![]() |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|