![]() |
|
#1
|
|||
|
|||
|
I am trying to create a module that will rotate a random banner/module title. Right now I have this (It is a plugin in the parse_templates hook) :
Code:
$array_titles = array("Hellwig Products", "GAYLORDS Lids");
$array_images = array("http://www.fordtruckclub.net/images/adspace/hellwig.png", "http://www.fordtruckclub.net/sponsors/gaylords/gl_150.png");
$array_url = array("http://www.hellwigproducts.com/", "http://www.gaylordslids.com/");
$random_number = rand(0, 1);
Code:
<div style="padding-bottom:$vba_style[portal_vspace]px">
<table align="center" border="0" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" class="tborder" width="100%">
<thead>
<tr>
<td class="tcat" colspan="$mods[colspan]">
<if condition="$vba_style['portal_collapsemods']">
<a href="#top" onclick="return toggle_collapse('module_$mods[collapse]')" style="float:$stylevar[right]"><img alt="" border="0" id="collapseimg_module_$mods[collapse]" src="$stylevar[imgdir_button]/collapse_tcat$modimgcollapse.gif" /></a>
</if>
<span class="smallfont"><strong>$vba_style[portal_blockbullet] <if condition="$mods['link']"><a href="$mods[link]">$array_titles[$random_number]</a><else />$array_titles[$random_number]</if></strong></span></td>
</tr>
</thead>
<tbody id="collapseobj_module_$mods[collapse]" style="$modcollapse">
<if condition="$show['tablerow']">
<tr>
<td class="$bgclass" style="background-color: #0A1225;">
$array_images[$random_number]
</td>
</tr>
<else />
<a href="$array_url[$random_number]"><img src="$array_images[$random_number]" border="0" /></a>
</if>
</tbody>
</table>
</div>
<if condition="$show['endform']"></form></if>
module.png So I'm not sure what I am doing wrong. Any help? |
|
#2
|
||||
|
||||
|
Try changing the hook location to something like global_start instead. I'm not sure if vB's templates will accept variables like that, so you may need to add something like this at the bottom of your plugin too and then change the variable in your template.
PHP Code:
__________________
Frequently Asked Questions CMPS Users Manual For vBadvanced software assistance, please use the support forums. Unsolicted PMs, IMs, and email will not be responded to. If you have a non-software related question or problem with your account, please submit a support ticket. |
|
#3
|
|||
|
|||
|
Quote:
Thanks though! |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Trying to acess global variables within a module | trbothead | Troubleshooting & Problems | 24 | 04-08-2008 01:36 PM |
| Questions - evaluating whether vBa is for me | convergent | "How Do I..." Questions | 4 | 01-24-2006 03:27 PM |
| My first module - can't display variables. | trana | Troubleshooting / "How do I..." Questions | 3 | 09-07-2005 10:19 AM |
| OK, I give up.... a CGI script from a PHP module using vb & vba variables. | KW802 | Troubleshooting / "How do I..." Questions | 2 | 07-26-2004 01:36 PM |