PDA

View Full Version : ty banner adds



Hanuman
10-20-2007, 12:18 AM
Um all three of the website adds that randomly refresh on refresh are in the same order, at least on my end they do this, kind of odd if you ask me, to have three of the same add in such a small space.

edit: all 5 of them do this now that I look hah.

saeon-tsion
10-20-2007, 03:49 AM
Obviously Marco et al. are working out the bugs. Let's try to give them some room to do so without pulling out all their hair....as a fellow webmaster myself, having almost 20 years experience in publishing and running servers/site software like vBulletin.....I know how incredibly frustrating it can be to work out those things. So let's do our best to help them take the time to live well and worry about fine-tuning the ad code when it gets done :)

Marco Renda
10-20-2007, 06:34 AM
All ads will be different! If you look on our website pages they are all different and are on rotation. Once we have worked out all the bugs the forum will be the same

Our web guy does have a FULL TIME job and a family so he does what he can in his spare time. Our web guy is a VOLENTEER

Take Care and Peace
Marco

Marco Renda
10-20-2007, 09:38 AM
Looks like he used the old code... there is a new version of the code that allows different banner ads in each block.

Do you know what the new code is? If so can you email it to me please.

Take Care and Peace
Marco

lriv
10-20-2007, 10:13 AM
this may help....


How To Implement A Simple Random Banner

--------------------------------------------------------------------------------

There are many ways to do this. Here is a simple method that uses PHP's rand() function to randomize the banners.

Enable Your Plugin System

You need to use a plugin for this, so first make sure your plugin system is enabled:

Admin CP -> vBulletin Options -> Plugin/Hook System -> Enable Plugin/Hook System
Create New Plugin

Now create a new plugin for the parse_templates hook location:

Admin CP -> Plugin System -> Add New Plugin

Use this PHP code in the plugin:




$random_number = rand(1, 5);

$random_banner[1] = '<a href="http://www.link1.com/"><img src="path/to/banner1.gif" alt="" border="0" /></a>';
$random_banner[2] = '<a href="http://www.link2.com/"><img src="path/to/banner2.gif" alt="" border="0" /></a>';
$random_banner[3] = '<a href="http://www.link3.com/"><img src="path/to/banner3.gif" alt="" border="0" /></a>';
$random_banner[4] = '<a href="http://www.link4.com/"><img src="path/to/banner4.gif" alt="" border="0" /></a>';
$random_banner[5] = '<a href="http://www.link5.com/"><img src="path/to/banner5.gif" alt="" border="0" /></a>';

The blue numbers represent the range of random numbers to be generated, or the number of banners you have in your rotation. You need to edit the top two numbers appropriately, and then create a $random_banner[X] line for each number in the range. In the above code, the random number is between 1 and 5, inclusive, and there are five banners defined.

Change the red code appropriately for each banner.

Display The Banner

Use this code in any template to display the random banner:



$random_banner[$random_number]

The header template is a common place to insert banners:

Admin CP -> Styles & Templates -> Style Manager -> Common Templates (in the menu) -> header

Replace the red code:



<!-- logo -->
<a name="top"></a>
<table border="0" width="$stylevar[outertablewidth]" cellpadding="0" cellspacing="0" align="center">
<tr>
<td align="$stylevar[left]"><a href="$vboptions[forumhome].php$session[sessionurl_q]"><img src="$stylevar[titleimage]" border="0" alt="$vboptions[bbtitle]" /></a></td>
<td align="$stylevar[right]">
&nbsp;
</td>
</tr>
</table>
<!-- /logo -->

<!-- content table -->
$spacer_open

$_phpinclude_output...

with the blue code:



<!-- logo -->
<a name="top"></a>
<table border="0" width="$stylevar[outertablewidth]" cellpadding="0" cellspacing="0" align="center">
<tr>
<td align="$stylevar[left]"><a href="$vboptions[forumhome].php$session[sessionurl_q]"><img src="$stylevar[titleimage]" border="0" alt="$vboptions[bbtitle]" /></a></td>
<td align="$stylevar[right]">
$random_banner[$random_number]
</td>
</tr>
</table>
<!-- /logo -->

<!-- content table -->
$spacer_open

$_phpinclude_output

Calling Specific Banners

You can call a specific banner in the templates by using that banner's number. For example:



$random_banner[3]

Marco Renda
10-20-2007, 10:26 AM
Thanks but I needed it to be emailed to me so that I can forward it to my web guy. Who knows he may already know what the fix is but just hasn't had the time to impliment it. I will be intouch with him next week

Take Care and Peace
Marco