![]() |
how to execute php code in the vb template
I've seen the link to the functions you can run, using the < if condition> tags, etc.
i saw somethign about a plugin (i was confused on that) I don't see / understand how you do this? I run this little code on all my pages, as i want to track how they got to my pages [[ yes, i use other log analyzers, other track analytic software, but i have a specific reason why i need this too]] so I do get how i could use the if condidtion tags to do this? i can't call the script / include it -- as i loose the refer data. i'm pretty sure i need to run it ASAP as the visitor lands on the page. Code:
session_start(); THANKS |
As you've found out, raw PHP cannot be run inside templates. PHP must be run in plugins.
The Plugin Manager |
You can use PHP, but the template manager restricts what PHP you can use to these functions:
http://www.vbulletin.com/docs/html/f...n_conditionals If you need something other than that, you'll have to do what Dismounted said and use a plugin. |
That PHP is only allowed in conditionals, and no where else.
|
so i can't do this:
Code:
<if condition="session_start()"> |
No, you can't do that. You must add a plugin to do what you want - I have already posted a link to the manual. Read it.
|
You can do this...
Code:
<if condition="empty($_SESSION['vREFERER'])"> |
That wouldn't work - the quotes would fail. Also, I don't know if you can access superglobals in templates directly (they may be cleared, or it might be at some other point, I don't remember).
|
You should take a look at the plugin section of the vBulletin manual to check out plugins and how they work. The architecture is a little strange at first but once you figure out the order, you can do a lot with it, including what you are trying to do I think.
http://www.vbulletin.com/docs/html/main/plugin_system |
All times are GMT. The time now is 12:05 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|