The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Getting PHP to load in side bar?
I have the following PHP code:
Code:
<?php $image[0]['src'] = '/images/your-ad-here.gif'; $image[0]['link'] = 'http://www.domain.com'; $image[0]['title'] = 'Your Ad Here'; $image[0]['alt'] = 'Your Ad Here'; $image[1]['src'] = '/images/advertisement2.gif'; $image[1]['link'] = 'http://www.domain2.com'; $image[1]['title'] = 'Company'; $image[1]['alt'] = 'Company'; shuffle( $image ); $html = ''; foreach( $image as $arr ) { $html .= '<a href="' . $arr['link'] . '" title="' . $arr['title'] . '" rel="nofollow"><img src="' . $arr['src'] . '" alt="' . $arr['alt'] . '"></a>'; } echo $html; ?> How would I go about doing this? |
#2
|
|||
|
|||
you put this code into a plugin with hook global_start for example but without echo $html;
then you can put $html into the the template where it should be shown |
#3
|
|||
|
|||
I would use another variable name instead of $html since vB might use that somewhere. (I know they use $HTML in the UserCP so you could get conflicts. Go with something more descriptive but still short.
|
#4
|
|||
|
|||
ragtek,
Worked just like a dream - thanks so much! --------------- Added [DATE]1193243392[/DATE] at [TIME]1193243392[/TIME] --------------- Opserty, I will change the variable as well then! |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|