The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
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> |
#2
|
|||
|
|||
![]()
Unfortunately, or fortunately depending on your perspective, you cannot insert PHP into a vBulletin template.
|
#3
|
||||
|
||||
![]()
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']"> You're logged in. <else /> You need to log in or register! </if> |
#4
|
|||
|
|||
![]() Quote:
|
#5
|
||||
|
||||
![]()
All user info (for the current user) can be access through the variable $bbuserinfo.
|
#6
|
||||
|
||||
![]()
If you'd like to see a listing of all the data contained within an array, you can use var_dump.
Code:
echo '<pre>'; var_dump($bbuserinfo); echo '</pre>'; Profile fields can be accessed like so: $bbuserinfo[fieldx], where x is the field id. |
![]() |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|