Uutiset:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu
Advertisement:

banner random rotation

Aloittaja hellboy78, toukokuu 17, 2008, 03:28:39 AP

« edellinen - seuraava »

hellboy78

hi everyone

I have SMF 1.1.4. with black to the future themes, and Ad managment installed.

I would like to have some random rotation banners, (fixed banners don't generate much clicks and signups)

wich file I should change and how I should change it???

and how I can manage the random rotation?

thank you in advance

metallica48423

you might be able to use the ad management mod to accomplish this (see the customize link at the top of this forum).  You might need to customize the location of the code to accomplish this but its the easiest solution i can think of... but i'm not sure if/how it supports multiple banners/ads though to be honest (i've never used it)

edit: http://custom.simplemachines.org/mods/index.php?mod=255
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

LainaaMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

N3RVE

This Rotating Ad script can be used*

First, create a file with a name like adverts.php and have this at the top:

      <?
      $bannerCounter= 1;

For each of your advertisements, you'll first write out the ad's code, and then increase the banner counter, like this:

      $bannerCode[$bannerCounter] = "put your ad code here";
      $bannerCounter++;

See a short example; This is a 3-banner rotation. Note that every (") in your ad code needs to be "escaped" with a slash mark in front of the quote mark, like this: \"
This is required for php to properly parse the script

$bannerCode[$bannerCounter] = "<A HREF=\"http://www.amazon.com/exec/obidos/redirect-home/teijn21-20\">
<IMG SRC=\"home-banner-468x60.gif\" BORDER=\"0\" HEIGHT=\"60\" WIDTH=\"468\" alt=\"In Association with Amazon.com\"></A>";
$bannerCounter++;

Next, we get the total number of ads, and if there are more than one, we'll randomly pick one of them. (If less than one, we automatically pick the first advertisement. This may seem like a stupid feature for a random advert generator, but it could happen if you drop non-performing affiliates or if paid-inclusion ads expire :P

$bannerAdTotals = $bannerCounter - 1;
if($bannerAdTotals>1)
{
   mt_srand((double)microtime() * 1234567);
   $bannerPicked = mt_rand(1, $bannerAdTotals);
}
else
{
   $bannerPicked = 1;
}
$bannerAd = $bannerCode[$bannerPicked];

Add a (>
$bannerCode[$bannerCounter] = "<a href=\"http://www.vmcsatellite.com/?aid=55537\" target=\"_top\"> <img src=\"http://www.vmcsatellite.com/banners/468x60(2).gif\" width=\"468\" height=\"60\" alt=\"Free Satellite TV!\" border=\"0\"></a>";
$bannerCounter++;

$bannerCode[$bannerCounter] = "<a href=\"http://www.vmcsatellite.com/channels/affiliates.cfm?aid=55537\" target=\"_top\"> <img src=\"http://www.vmcsatellite.com/banners/recruit395x141.gif\" width=\"395\" height=\"141\" alt=\"Free Satellite TV!\" border=\"0\"></a>";
$bannerCounter++;
?>

Now, for the forum - Insert this script using the ad management mod linked in metallica's post.

<?
include_once("adverts.php");
echo "<div align='center'>$bannerAd</div>";
?>


Let us know how it goes :)
Ralph "[n3rve]" Otowo
Former Marketing Co-ordinator, Simple Machines.
ralph [at] simplemachines [dot] org                       
Lainaa"Somewhere, something incredible is waiting to be known." - Carl Sagan

hellboy78

this is very interesting,

but,

I have many banners, into differents positions,

may I manage all positions togheter?

what about if I want to random few positions in my forum?

and what about set a "timer" for banners changing,
example: $bannerChangeAfter:60minutes

thank u so much

N3RVE

You can repeat the code at different sections of the forum!!
Ralph "[n3rve]" Otowo
Former Marketing Co-ordinator, Simple Machines.
ralph [at] simplemachines [dot] org                       
Lainaa"Somewhere, something incredible is waiting to be known." - Carl Sagan

hellboy78

what you mean?

where should I upload PHP with banner rotation???

N3RVE

There should be uploaded into the board dir.

-[n3rve]
Ralph "[n3rve]" Otowo
Former Marketing Co-ordinator, Simple Machines.
ralph [at] simplemachines [dot] org                       
Lainaa"Somewhere, something incredible is waiting to be known." - Carl Sagan

hellboy78

I cannot understand!!!

thanks anyway

greyknight17

Which part don't you understand? Upload that script to your SMF directory?

hellboy78

I'm checking now.

I see that ad managment can accept html and php.

maybe I can put php code for every single area I need to cover with rotation banners...

right?

N3RVE

Ralph "[n3rve]" Otowo
Former Marketing Co-ordinator, Simple Machines.
ralph [at] simplemachines [dot] org                       
Lainaa"Somewhere, something incredible is waiting to be known." - Carl Sagan

Rumbaar

Were you able to install your rotating banners hellboy78?  If they were just static 'image' banners I would have though a simple service that offers image rotation would have done.  Now if it's a rotation advertisement banner, this too I'm sure would have been handed by your 'supplier'.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

hellboy78


Rumbaar

Lainaus käyttäjältä: hellboy78 - heinäkuu 06, 2008, 06:10:44 AP
no rotating banners
What does that mean?  There are a number of way to take that, and I wont attempt to guess what you mean.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

tatore

Since Ad Management Mod doesn't create scripts by itself, but it's the best mod to display *any* kind of code (html, js, php and so on..) what I would do is search a good and secure script or advertising system, create your campaign, put the code into your Ad Management mod.
One of those powerful system could be OpenX.
I don't know if it is a free source (OpenAds was free).
It requires a database and patience  :P (and bandwidth), but once configured it becomes very very useful, to have a constant monitored position of your adverts, banners(any extension), clicks and so on...
The system generates what you require, from js to iframes, and once generated you paste the code in your Ad Management mod, to display it where you want-
Other easier solutions can be  found @ http://www.hotscripts.com/
*Salvo*




Lainaus käyttäjältä: RumbaarI wont jump to conclusion, but you might be hacked?

hellboy78

my smf is on servage hosting.

I had few problems to install mods, and now, doing rotation banner, an error is showed.

so I think I cannot put rotation banners.

Rumbaar

Even something as basic as this might work, just whipped it up
<?php
$img 
= array("image1.jpg","image2.jpg","image3.jpg");
$i rand(0,2);
$image $img[$i];
echo 
'<img src="static URL/$image">';
?>
Just add more images to the array and increase the rand range.  Then have the Static URL correct for the location of the image you'll be using.
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

DirtRider

Well I am using this code with TinyPortal to place it where I want it, see here http://www.s247631067.onlinehome.us/index.php



<script language="JavaScript">
<!-- Begin
var ad_cnt1 = 4;
var now1 = new Date()
var sec1 = now1.getSeconds()
var ad1 = sec1 % ad_cnt1;
ad1 +=1;
if (ad1==1) {
url1="YOUR-DOMAIN-HERE";
banner1="URL_OF_BANNER";
width1="468";
height1="60";
alt1="ALT TEXT HERE";
}
if (ad1==2) {
url1="YOUR-DOMAIN-HERE";
banner1="URL_OF_BANNER";
width1="468";
height1="60";
alt1="ALT TEXT HERE";
}
if (ad1==3) {
url1="YOUR-DOMAIN-HERE";
banner1="URL_OF_BANNER";
width1="468";
height1="60";
alt1="ALT TEXT HERE";
}
if (ad1==4) {
url1="YOUR-DOMAIN-HERE";
banner1="URL_OF_BANNER";
width1="468";
height1="60";
alt1="ALT TEXT HERE";
}
document.write('<center><a href="' + url1 + '" target="_blank">');
document.write('<img src="' + banner1 + '" width=' + width1 + ' height=' + height1 + ' border=0 alt="' + alt1 + '"></a>');
document.write('</center>');
// End -->
</SCRIPT>



http://www.triumphtalk.com

"The real question is not whether machines think but whether men do. "

Rumbaar

Well how did you exactly add your rotating banners hellboy78?  What is the specific error?
"An important reward for a job well done is a personal sense of worthwhile achievement."

[ Themes ]

Advertisement: