|
|
| Author |
Message |
| Marmalade |
This post is not being displayed .
|
 Marmalade World Chat Champion

Joined: 28 Apr 2009 Karma :    
|
 Posted: 20:38 - 09 Feb 2011 Post subject: php ad code |
 |
|
Righty
On a little forum i run i have a banner at the top of the page that auto displays some affiliate ads, these are a waste of time and brought in a total of about £18 in the last 17 months and would like it to at least cover the hosting costs so want to be able to display google ads as well into the randomness, but, how do i do this.
The google ad code is this
| Code: | <script type="text/javascript"><!--
google_ad_client = "ca-pub-5945362558941022";
/* cwindextop */
google_ad_slot = "0002837345";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script> |
and the code for the adbox ads is below, how would i go about putting the google code into one of the slots?
The #### is simply to not be spamming bcf
| Code: | <?php
$filePath = '..';
$paidAds[0] = // ######map
"<a href='http://www.#####.co.uk/forums/viewtopic.php?f=6&t=3904' title='Find out about getting on the ###### map, click here' target='_blank'><img src='" . $filePath . "/images/banners/#####.gif' alt='Find out about getting on the ###### map, click here' style='border:none;' /></a>";
$paidAds[1] = // vistaprint
"<a href='http://scripts.affiliatefuture.com/AFClick.asp?affiliateID=218739&merchantID=1064&programmeID=3161&mediaID=82863&tracking=&url='><img border=0 src='http://banners.affiliatefuture.com/1064/82863.gif'></a>";
$paidAds[2] = // ### ad pd to 31-04-10
"<a href='http://www.#####.co.uk/' title='####light Transport' target='_blank'><img src='" . $filePath . "/images/banners/rlt1.gif' alt='##### light Transport' style='border:none;' /></a>";
$paidAds[3] = // travelcash
"<a href='http://scripts.affiliatefuture.com/AFClick.asp?affiliateID=218739&merchantID=4646&programmeID=11982&mediaID=92907&tracking=&url='><img border=0 src='http://banners.affiliatefuture.com/4646/92907.gif'></a>";
$paidAds[4] = // Catalink
"<a href='http://scripts.affiliatefuture.com/AFClick.asp?affiliateID=218739&merchantID=323&programmeID=1128&mediaID=4499&tracking=&url='><img border=0 src='http://banners.affiliatefuture.com/323/4499.gif'></a>";
$paidAds[5] = // get geared
"<a href='http://scripts.affiliatefuture.com/AFClick.asp?affiliateID=218739&merchantID=578&programmeID=1995&mediaID=94755&tracking=&url='><img border=0 src='http://banners.affiliatefuture.com/578/94755.gif'></a>";
$paidAds[6] = // my pix
"<a href='http://scripts.affiliatefuture.com/AFClick.asp?affiliateID=218739&merchantID=367&programmeID=1444&mediaID=6197&tracking=&url='><img border=0 src='http://banners.affiliatefuture.com/367/6197.gif'></a>";
$paidAds[7] = // ######
"<a href='http://www.####.co.uk' title='##### web site' target='_blank'><img src='" . $filePath . "/images/banners/#####.gif' alt='#####' style='border:none;' /></a>";
$paidAds[8] = // POD####
"<a href='http://www.thepodfather.com/sector.php?sectorID=16' title='The POD####' target='_blank'><img src='" . $filePath . "/images/banners/POD#####.gif' alt='POD#####' style='border:none;' /></a>";
$paidAds[9] = // ####
"<a href='http://www.#####.org.uk/#######-driver-shop-stick2.php' title='####' target='_blank'><img src='" . $filePath . "/images/banners/stickersbanner2.gif' alt='####' style='border:none;' /></a>";
$paidAds[10] = // she####
"<a href='http://www.sh####.co.uk' title='she####' target='_blank'><img src='" . $filePath . "/images/banners/headscrewedon4cw.gif' alt='sh###' style='border:none;' /></a>";
$x = rand(0,10);
if (isset($_GET['displayad'])) $x = (int)$_GET['displayad'];
$paidAdToDisplay = $paidAds[$x];
echo $paidAdToDisplay;
?> |
I don't know why bikechatforums has appeared in the code, see, i'm useless ____________________ Nobby the Bastard: How yo tell the difference between the actual japanese and her just screaming because she's had live fish stuck up her arse? [url=https://www.nicks-shop.co.uk/bcf-goodies-15-c.aspGet BCF stickers and things here[/url] Reflective helmet stickers - Legal requirement in france - Clicky |
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| Frost |
This post is not being displayed .
|
 Frost World Chat Champion

Joined: 26 May 2004 Karma :  
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| Wabby |
This post is not being displayed .
|
 Wabby Trackday Trickster
Joined: 25 Sep 2007 Karma :    
|
 Posted: 21:06 - 09 Feb 2011 Post subject: |
 |
|
Add
| Code: | $paidAds[11] = // adwords
"<script type=\"text/javascript\"><!--
google_ad_client = \"ca-pub-5945362558941022\";
/* cwindextop */
google_ad_slot = \"0002837345\";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type=\"text/javascript\"
src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\">
</script>"; |
after advert 10
and change
to
Total code (commented out as per your demo script)
| Code: | <?php
$filePath = '..';
$paidAds[0] = // ######map
"<a href='http://www.#####.co.uk/forums/viewtopic.php?f=6&t=3904' title='Find out about getting on the ###### map, click here' target='_blank'><img src='" . $filePath . "/images/banners/#####.gif' alt='Find out about getting on the ###### map, click here' style='border:none;' /></a>";
$paidAds[1] = // vistaprint
"<a href='http://scripts.affiliatefuture.com/AFClick.asp?affiliateID=218739&merchantID=1064&programmeID=3161&mediaID=82863&tracking=&url='><img border=0 src='http://cdn.bikechatforums.com/http://banners.affiliatefuture.com/1064/82863.gif'></a>";
$paidAds[2] = // ### ad pd to 31-04-10
"<a href='http://www.#####.co.uk/' title='####light Transport' target='_blank'><img src='" . $filePath . "/images/banners/rlt1.gif' alt='##### light Transport' style='border:none;' /></a>";
$paidAds[3] = // travelcash
"<a href='http://scripts.affiliatefuture.com/AFClick.asp?affiliateID=218739&merchantID=4646&programmeID=11982&mediaID=92907&tracking=&url='><img border=0 src='http://cdn.bikechatforums.com/http://banners.affiliatefuture.com/4646/92907.gif'></a>";
$paidAds[4] = // Catalink
"<a href='http://scripts.affiliatefuture.com/AFClick.asp?affiliateID=218739&merchantID=323&programmeID=1128&mediaID=4499&tracking=&url='><img border=0 src='http://cdn.bikechatforums.com/http://banners.affiliatefuture.com/323/4499.gif'></a>";
$paidAds[5] = // get geared
"<a href='http://scripts.affiliatefuture.com/AFClick.asp?affiliateID=218739&merchantID=578&programmeID=1995&mediaID=94755&tracking=&url='><img border=0 src='http://cdn.bikechatforums.com/http://banners.affiliatefuture.com/578/94755.gif'></a>";
$paidAds[6] = // my pix
"<a href='http://scripts.affiliatefuture.com/AFClick.asp?affiliateID=218739&merchantID=367&programmeID=1444&mediaID=6197&tracking=&url='><img border=0 src='http://cdn.bikechatforums.com/http://banners.affiliatefuture.com/367/6197.gif'></a>";
$paidAds[7] = // ######
"<a href='http://www.####.co.uk' title='##### web site' target='_blank'><img src='" . $filePath . "/images/banners/#####.gif' alt='#####' style='border:none;' /></a>";
$paidAds[8] = // POD####
"<a href='http://www.thepodfather.com/sector.php?sectorID=16' title='The POD####' target='_blank'><img src='" . $filePath . "/images/banners/POD#####.gif' alt='POD#####' style='border:none;' /></a>";
$paidAds[9] = // ####
"<a href='http://www.#####.org.uk/#######-driver-shop-stick2.php' title='####' target='_blank'><img src='" . $filePath . "/images/banners/stickersbanner2.gif' alt='####' style='border:none;' /></a>";
$paidAds[10] = // she####
"<a href='http://www.sh####.co.uk' title='she####' target='_blank'><img src='" . $filePath . "/images/banners/headscrewedon4cw.gif' alt='sh###' style='border:none;' /></a>";
$paidAds[11] = // adwords
"<script type=\"text/javascript\"><!--
google_ad_client = \"ca-pub-5945362558941022\";
/* cwindextop */
google_ad_slot = \"0002837345\";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type=\"text/javascript\"
src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\">
</script>";
$x = rand(0,11);
if (isset($_GET['displayad'])) $x = (int)$_GET['displayad'];
$paidAdToDisplay = $paidAds[$x];
echo $paidAdToDisplay;
?> |
____________________ What restriction? |
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| Wabby |
This post is not being displayed .
|
 Wabby Trackday Trickster
Joined: 25 Sep 2007 Karma :    
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| Marmalade |
This post is not being displayed .
|
 Marmalade World Chat Champion

Joined: 28 Apr 2009 Karma :    
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
Old Thread Alert!
The last post was made 15 years, 241 days ago. Instead of replying here, would creating a new thread be more useful? |
 |
|
|