If you use this document, please write an e-mail to the author
Please contact the author if you have any questions
Thank you for your attention!
********************************************************/
/*
Advertising Bar 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
Returns the link string for the advertisement
*/
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
Advertising settings 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 advertising component
* Indicates the setting, others are the picture's setting #: Indicates a comment
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.