If you use this file, please write an e-mail to the author
If you have questions, please contact the author.
Thank you for your attention!
********************************************************/
/*
AD Strip Management Program
Public method
GetAdvertisement ($adfile)
*/
Class AdRotator {
var $Target = "_blank";
var $Width = "460";
var $Height = "60";
var $Border = 0;
var $Redirect = "";
var $BannerData =array ();
var $RandTemp = 1;
function AdRotator ()
{
}
/*
Public
Return a link string for an ad
*/
function GetAdvertisement ($adfile)
{
if (count ($this->bannerdata) ==0)
{
$this->bannerdata= $this->readadfile ($adfile);
}
$AdData = $this->bannerdata;
$uplimited =count ($AdData);
Randomly generate an ID
Srand (Double) microtime () *1000000000000000000);
$id = @rand (1, $uplimited);
Case "url":
$BannerData [$i] [url]]= $SetTemp [1];
Break
Case "title":
$BannerData [$i] ["title"]= $SetTemp [1];
Break
Case ' rate ':
$BannerData [$i] [rate]]= $SetTemp [1];
Break
}//end of Switch
}//end of If ($switch)
}//end of If (#)
}//end of While
return $BannerData;
}//end of function
}//end of Class
/*
How to use
Ad setup file writing format Banner.txt
------Start---
Redirect=./adredir.asp
width=468
Height=60
Border=0
*
#注释
#某某公司广告1
Image=. /banner/1.gif
Url=http://www.asps0ite.com1
Title=one
Rate=30
----End-----
Description
Similar to ASP's ad components
* Indicates settings, other settings for the picture #: Indicates comments
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.