The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Help inserting random image in header
Hi
I want to include a random image next to the name on my header and I'm havingtrouble getting it to work. This is the code I have in the header file <li><img src="http://www.domain.com/images/icons/smile"<?php $random = rand(1,9); echo $random; ?>".gif" alt="Smile " height="20" width="22" /></li> But this displays a broken image with the URL http://www.domain.com/images/icons/smile%3C?php%20$random%20=%20rand(1,9);%20echo%20$ random;%20?%3E.gif So it's clearly not parsing the php However, I'm not good at this - can anyone fix my code? Many many thanks K |
#2
|
|||
|
|||
Can noone help me here?
|
#3
|
||||
|
||||
You cannot put php into a template. Templates are for html only. If you want to do some php, you need to do so in a plugin and then spit the result out into the template.
Have you done a search in the vb4 mods for random images? That may help you. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|