Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff
Author Message
phpnewb8
New Member
New Member



Joined: Aug 18, 2005
Posts: 1

PostPosted: Thu Aug 18, 2005 7:21 am Reply with quote

Hey guys I finally got the banners to appear where I wanted them on my website and I have a question. I want to have 5 banners 100w x 54h appear in the same row. Currently when I try to put more than one banner active on my module it rotates which banner it shows.

On a sidenote I searched a site from a guy named scottr from nukecops forum who made a multiple banner module, but his site was not live...


I am using PHP Nuke 6.9 Deep Blue theme. Is there a way I can edit some code to make more than just one banner appear at a time?
 
View user's profile Send private message
hitwalker
Sells PC To Pay For Divorce



Joined:
Posts: 5661

PostPosted: Thu Aug 18, 2005 9:51 am Reply with quote

Maybe this helps...i knew i had it somewhere.... Smile

Code:


<?php

/***************************************************/
/* Multiple Banners Advertising Block v1.0         */
/*                                                 */
/* Allow Multiple Banners In One Advertising block */
/*                                                 */
/* Scott Rubin - March 2004                        */
/*                                                 */
/* ierealtor.com - [ Only registered users can see links on this board! Get registered or login! ] - scottr  */
/*                                                 */
/***************************************************/

#####################################################
# Tested on PHP-Nuke 6.5+                           #
#####################################################
# This replaces the regular Advertising block       #
# (blocks/block-Advertising.php)                    #
# since it does the same thing but                  #
# also allows you to display multiple banners       #
# by setting the $numbanners to any value.          #
# defaults to 1 banner, $numbanners=1               #
#####################################################

if (eregi("block-Advertising.php", $_SERVER[PHP_SELF])) {
   Header("Location: ../index.php");
    die();
}

global $prefix, $db;

# CONFIGURATION
$numbanners=1; # How many banners do you want to appear in the Advertising block?

# The rand() has been known to provide less than favorable results
$sql = "SELECT * FROM ".$prefix."_banner WHERE type='1' AND active='1' order by rand() limit $numbanners";

# Number of rows to process
$numrows = $db->sql_numrows($db->sql_query($sql));

if($numrows>0) {
   $result = $db->sql_query($sql);

   /* Build what to display */
    $content = "<center>";
   while($row = $db->sql_fetchrow($result)) {

      /* Increment number of impressions made */
      if (!is_admin($admin)) {
         $db->sql_query("UPDATE ".$prefix."_banner SET impmade=impmade+1 WHERE bid='$row[bid]'");
      }

      /* Deactivate this banner if this impression is the last one */
      if (($row[impmade]+1 >= $row[imptotal]) AND ($row[imptotal] != 0)) {
         $db->sql_query("UPDATE ".$prefix."_banner SET active='0' WHERE bid='$row[bid]'");
      }

      $content.= "<br><a href=\"banners.php?op=click&amp;bid=$row[bid]\" target=\"_blank\"><img src=\"$row[imageurl]\" border=\"1\" alt=\"$row[alttext]\" title='$row[alttext]'></a><br>";

   }
   $content.= "</center>";
}

?>
 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> General/Other Stuff

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©