![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
JuicyDevils.gr Owner
Industry Role:
Join Date: Jan 2004
Location: Greece
Posts: 25,392
|
Banner rotator...
any fast solution pls?
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
see you later, I'm gone
Industry Role:
Join Date: Oct 2002
Posts: 14,102
|
I have a fairly simple one I use across a bunch of my sites. Uses a 3 table database (banners, links, sites).
Pretty easy to modify out. Database structure -- -- Table structure for table `banners` -- CREATE TABLE IF NOT EXISTS `banners` ( `id` int(10) NOT NULL auto_increment, `site` int(10) NOT NULL default '0', `name` varchar(254) NOT NULL, `type` char(2) NOT NULL, `width` int(10) NOT NULL default '0', `height` int(10) NOT NULL default '0', `last_used` datetime NOT NULL, `active` tinyint(4) NOT NULL default '1', PRIMARY KEY (`id`), KEY `last_used` (`last_used`), KEY `width` (`width`), KEY `height` (`height`), KEY `site` (`site`) ) ENGINE=INNODB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1406 ; -- -------------------------------------------------------- -- -- Table structure for table `links` -- CREATE TABLE IF NOT EXISTS `links` ( `id` int(10) NOT NULL auto_increment, `site` int(10) NOT NULL default '0', `link` varchar(254) NOT NULL, `active` tinyint(4) NOT NULL default '1', PRIMARY KEY (`id`), KEY `site` (`site`) ) ENGINE=INNODB DEFAULT CHARSET=latin1 AUTO_INCREMENT=83 ; -- -------------------------------------------------------- -- -- Table structure for table `sites` -- CREATE TABLE IF NOT EXISTS `sites` ( `id` int(10) NOT NULL auto_increment, `sponsor` int(10) NOT NULL default '0', `name` varchar(35) NOT NULL, `active` tinyint(1) NOT NULL default '1', PRIMARY KEY (`id`), KEY `sponsor` (`sponsor`) ) ENGINE=INNODB DEFAULT CHARSET=latin1 AUTO_INCREMENT=75 ; Actual banner rotation code // pass ins // Type sc=softcore, hc=hardcore // mxw maximum width in pixels // mxh maximum height in pixels // mnw minimum width in pixels // mnh minimum height in pixels function getad($type, $mxw, $mxh, $mnw, $mnh) { $adbhost = "localhost"; $adbuser = "dbusername"; $adbpass = "dbpassword"; $adb = mysql_connect($adbhost, $adbuser, $adbpass); $sql_str="select a.id, a.name, c.name as sitename, a.height, a.width, b.link "; $sql_str .="from banners a "; $sql_str .="inner join links b on a.site=b.site "; $sql_str .="inner join sites c on a.site=c.id "; $sql_str .="where a.type='" . $type . "' "; $sql_str .="and a.width<=" . $mxw . " and a.height<=" . $mxh . " and "; $sql_str .="a.width>=" . $mnw . " and a.height>=" . $mnh . " "; $sql_str .="order by a.last_used limit 1"; $result=mysql_query($sql_str,$adb); if(!$result) { //echo "sql prob sql=" . $sql_str . "<br>\n"; } else { $banner=mysql_fetch_array($result); echo "<a href=" . $banner['link'] . " target=_blank>"; echo "<img src=http://www.yourdomainname.com/images/" . $banner['name'] . " border=0" . ' alt="' . $banner['sitename'] . '">'; echo "</a>"; } $sql_str="update banners set last_used=now() where id=" . $banner['id']; $result=mysql_query($sql_str,$adb); } How to call it in the page. getad('sc',480,80,350,50);
__________________
All cookies cleared! |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Totally Borked
Industry Role:
Join Date: Feb 2005
Posts: 6,284
|
stick a load of banners in a directory and pull 1 at random?
__________________
![]() For coding work - hit me up on andy // borkedcoder // com (consider figuring out the email as test #1) All models are wrong, but some are useful. George E.P. Box. p202 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Industry Role:
Join Date: Jul 2003
Posts: 4,787
|
Cool thread, keep 'hem coming cause i wanna try a new one too.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
JuicyDevils.gr Owner
Industry Role:
Join Date: Jan 2004
Location: Greece
Posts: 25,392
|
thanks!!!!!
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Confirmed User
Industry Role:
Join Date: May 2009
Location: Onboard an airplane around the globe
Posts: 3,735
|
Smart Spots from Smart-Scripts.com?
__________________
---------------------------------------------------------------------------------- The truth is not affected by the beliefs, or doubts, of the majority. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
Confirmed User
Join Date: Apr 2002
Location: Minneapolis
Posts: 2,740
|
__________________
Have Chargebacks? Send me a message. ChargebackHelp.com |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Confirmed User
Industry Role:
Join Date: Mar 2004
Location: Great White North
Posts: 5,794
|
PHP Code:
__________________
LinkSpun - Premier Adult Link Trading Community - ICQ - 464/\281/\250 Be Seen By New Webmasters/Affiliates * Target out webmasters/affiliates based on niches your sites are for less than $20 a month. AmeriNOC - Proudly hosted @ AmeriNOC! |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 |
Biker Gnome
Industry Role:
Join Date: Mar 2004
Location: cell#324
Posts: 23,200
|
__________________
Carbon is not the problem, it makes up 0.041% of our atmosphere , 95% of that is from Volcanos and decomposing plants and stuff. So people in the US are responsible for 13% of the carbon in the atmosphere which 95% is not from Humans, like cars and trucks and stuff and they want to spend trillions to fix it while Solar Panel plants are powered by coal plants think about that |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 |
Promoting Debate on GFY
Industry Role:
Join Date: Apr 2007
Posts: 27,173
|
This is one of the most basic and user friendly HTML rotators ever, it's free as well
http://www.focalmedia.net/htmlrotate.html
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
see you later, I'm gone
Industry Role:
Join Date: Oct 2002
Posts: 14,102
|
Fuck. When I was sanitizing the code I some how killed a couple of things.
Need a select to the database, or in the sql the database could be specified. Also there are a couple of other things that should be in there to protect it a touch. Sorry about that. a better version of the actual script portion: Code:
// pass ins // Type sc=softcore, hc=hardcore // mxw maximum width in pixels // mxh maximum height in pixels // mnw minimum width in pixels // mnh minimum height in pixels function getad($type, $mxw, $mxh, $mnw, $mnh) { // default to softcore if not provided or if invalid if($type<>'sc' && $type<>'hc') { $type='sc'; } // check for numeric values in banner dimensions // protects against sql injection too if(is_numeric($mxw) && is_numeric($mxh) && is_numeric($mnw) && is_numeric($mnh)) { // connection could be a pass in // doing it here is for stand alone // usually would be in an included function $adbhost = "localhost"; $adbuser = "dbusername"; $adbpass = "dbpassword"; $adbname = "dbname"; $adb = mysql_connect($adbhost, $adbuser, $adbpass); if($adb) { // select to the database mysql_select_db($adbname,$adb); // sql to pull the banner $sql_str="select a.id, a.name, c.name as sitename, a.height, a.width, b.link "; $sql_str .="from banners a "; $sql_str .="inner join links b on a.site=b.site "; $sql_str .="inner join sites c on a.site=c.id "; $sql_str .="where a.type='" . $type . "' "; $sql_str .="and a.width<=" . $mxw . " and a.height<=" . $mxh . " and "; $sql_str .="a.width>=" . $mnw . " and a.height>=" . $mnh . " "; $sql_str .="order by a.last_used limit 1"; $result=mysql_query($sql_str,$adb); if(!$result) { //echo "sql prob sql=" . $sql_str . "<br>\n"; } else { //only attempt to present the banner if evrything went ok if(mysql_num_rows($result)>0) { $banner=mysql_fetch_array($result); echo "<a href=" . $banner['link'] . " target=_blank>"; echo "<img src=http://www.yourdomainname.com/images/" . $banner['name'] . " border=0" . ' alt="' . $banner['sitename'] . '">'; echo "</a>"; $sql_str="update banners set last_used=now() where id=" . $banner['id']; $result=mysql_query($sql_str,$adb); } else { // could do a default banner here } } } } }
__________________
All cookies cleared! |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 |
I have a plan B
Industry Role:
Join Date: Aug 2004
Location: Seattle - Miami - St Kitts
Posts: 5,501
|
Someone posted this Simple Banner Rotator on another thread and I've using it. It's pretty easy to set up and works real well.
http://www.spyka.net/scripts/javascr...banner-rotator
__________________
CryptoFeeds |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 |
►SouthOfHeaven
Join Date: Jun 2004
Location: PlanetEarth MyBoardRank: GerbilMaster My-Penis-Size: extralarge MyWeapon: Computer
Posts: 28,609
|
i made/posted this not long ago
https://gfy.com/fucking-around-and-business-discussion/992905-simple-smart-banner-rotation-tutorial-ghetto-openx.html
__________________
hatisblack at yahoo.com |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#14 |
Confirmed User
Join Date: Sep 2006
Posts: 2,746
|
this is cool ;)
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#15 | |
Confirmed User
Industry Role:
Join Date: Dec 2006
Location: Along the shore.
Posts: 1,557
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#16 |
Confirmed User
Join Date: Feb 2007
Location: Sweden
Posts: 5,650
|
PHP Code:
__________________
Free 🅑🅘🅣🅒🅞🅘🅝🅢 Every Hour (Yes, really. Free ₿itCoins.) (Signup with ONLY your Email and Password. You can also refer people and get even more.) |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#17 |
Too lazy to set a custom title
Industry Role:
Join Date: Sep 2005
Location: Springfield
Posts: 13,826
|
small - javascript
big - php (+mysql) custom huge - openx if you need any extra help http://www.awmzone.com/services
__________________
Make a bank with Chaturbate - the best selling webcam program ![]() ![]() ![]() Ads that can't be block with AdBlockers !!! /// Best paying popup program (Bitcoin payouts) !!! PHP, MySql, Smarty, CodeIgniter, Laravel, WordPress, NATS... fixing stuff, server migrations & optimizations... My ICQ: 27429884 | Email: ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#18 | |
Ah My Balls
Industry Role:
Join Date: Feb 2007
Location: Under the gold leaf ICQ 388-454-421
Posts: 14,311
|
Funny I was just looking for one yesterday as well!
Quote:
__________________
![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |