NameSilo

Ad Script V2

SpaceshipSpaceship
Watch
Hi,

I noticed my script was quite popular so i decided to add a size option to it.
Here is the new one:
PHP:
<?php 
srand( microtime() * 1000000); 
$advertise = rand(1,3); 
//After the rand decided how many youve got and the first and last number e.g got 3, 1,3
switch($advertise) 
//you can add more just use the same format
{ 
case 1 : $banner="site 1 image url"; $url="site one address"; $height="height"; $width="width"; break; 
case 2 : $banner="site 2 image url"; $url="site two address"; $height="height"; $width="width"; break; 
case 3 : $banner="site 3 image url"; $url="site 3 address"; $height="height"; $width="width"; break; 
} 
$display = "<a href=\"$url\" target=\"_blank\"> "; 
$display.= "<img src=\"$banner\"  "; 
$display.= "width=\"$width\" height=\"$height\" border=\"0\" >"; 
$display.="</a>"; 
echo($display); 
?>

If you use it please donate NP$ or Add rep.

Thanks
 
1
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Rep added! Thanks
 
0
•••
Glad you like it!
 
0
•••
Thanks all, does anyone know anything else they would like me to add?
 
0
•••
this is a nice code indeed!

I got one problem and need guide and help. Instead of inserting ads one by one into each sites, I come across this iPanel application. I look thru iPanel (http://www.ihostdev.com/ipanel.html) which is able to get ads display on several site at one (the feature - Forced ads into free sites ). My problem is :-
1. How to rotate the ads/banner..etc in these sites? I could get my host to install Mod-Layout (as per the iPanel requirement), but further than that, I'm lost!
2. Or I could just utilize Mod_Layout + PhpAdsNew ?
http://phpadsnew.com/two/


Really lost here... :'( Apology if I didn't give a clear picture of the problem...too lost in my mind in this!

Thz for your kind guide.
James
 
0
•••
I dont understand what you mean, if you use my script and are using php pages it will work, if you still need help feel free to pm me, What does everyone think?
 
0
•••
This script is only for image banners. How can we edit to display javascript ad codes like the ones by google or clicksor. I am not much into PHP so please help me.
 
0
•••
If you want random google or clicksor ads use this: (not tested)

PHP:
$ad[0] = 'whole javascript code here';
$ad[1] = 'whole javascript code here';
$ad[2] = 'whole javascript code here';

$ad = $ad[rand(0,count($ad))];
echo $ad;

I think you can figure out how to add or remove ads. :)
 
Last edited:
0
•••
Thanks..I will test and tell you.
 
0
•••
Blah, you need to look at my edit. :X

Subtract one from all the numbers so that the first one is 0.
 
0
•••
Appraise.net

We're social

Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back