![]() |
PHP code in templates?
The following template is used by a navbar replacement I found on the vbadvanced site.
I'd like to insert PHP code to display different options depending on log in status So I tried a simple test that would echo some text. Doesn't work.... What am I doing wrong? The entire template is below. --------------------------------------------------------------------------------- <tr> <td class="thead" align="left">Fab's Boards</td> <?PHP echo "This is a test"; ?> </tr> <tr> <td class="alt1"> <div class="smallfont"><a STYLE="text-decoration:none" href="http://www.fabsboards.com/cmps_index.php" >Fab's Boards Home</a></div> <div class="smallfont"><a STYLE="text-decoration:none" href="http://www.fabsboards.com/vbulletin/index.php" >Read All Forums</a></div> <div class="smallfont"> </td> </tr> <tr> <td class="thead" align="left">Fab's Partner Sites</td> </tr> <tr> <td class="alt1"> <div class="smallfont"><a STYLE="text-decoration:none" href="http://www.fabrocks.com/" >Fab Rocks!</a></div> <div class="smallfont"><a STYLE="text-decoration:none" href="http://www.byjsohana.com/" >BYJ's Ohana</a></div> <div class="smallfont"><a STYLE="text-decoration:none" href="http://www.theblueparrot.info/" >The Blue Parrot</a></div> <div class="smallfont"><a STYLE="text-decoration:none" href="http://www.jimhillmedia.com" >Jim Hill Media</a></div> <div class="smallfont"> </td> </tr> |
Unfortunately, or fortunately depending on your perspective, you cannot insert PHP into a vBulletin template.
|
You need to use plugins to perform any logic operations.
See these: http://www.vbulletin.com/docs/html/plugin_system http://www.vbulletin.com/docs/html/writing_plugin_code For your purposes, however, you might be reinventing the wheel. There are dozens of pre-existing variables available for you to use without any additional logic. Code:
<if condition="$show['member']"> |
Quote:
|
All user info (for the current user) can be access through the variable $bbuserinfo.
|
If you'd like to see a listing of all the data contained within an array, you can use var_dump.
Code:
echo '<pre>'; Profile fields can be accessed like so: $bbuserinfo[fieldx], where x is the field id. |
All times are GMT. The time now is 02:36 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|