NamePros.Com (http://www.namepros.com/)
-   CODE (http://www.namepros.com/code/)
-   -   Ad Script V2 (http://www.namepros.com/code/192504-ad-script-v2.html)

Xyzer 04-30-2006 06:02 AM

Ad Script V2
 
Hi,

I noticed my script was quite popular so i decided to add a size option to it.
Here is the new one:
PHP Code:
<?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

wvccboy 05-01-2006 02:52 PM

Rep added! Thanks

Xyzer 05-01-2006 03:06 PM

Glad you like it!

Xyzer 05-05-2006 08:29 AM

Thanks all, does anyone know anything else they would like me to add?

jamesl 05-15-2006 05:29 AM

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... :cry: 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

Xyzer 05-15-2006 08:43 AM

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?

navjotjsingh 05-28-2006 01:28 PM

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.

Dan 05-28-2006 01:31 PM

If you want random google or clicksor ads use this: (not tested)

PHP Code:
$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. :)

navjotjsingh 05-28-2006 01:32 PM

Thanks..I will test and tell you.

Dan 05-28-2006 01:35 PM

Blah, you need to look at my edit. :X

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


All times are GMT -7. The time now is 12:09 AM.
Site Sponsors
Advertise your business at NamePros

Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0