Print
Category: PHP and Web Design
Hits: 39447

User Rating: 4 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Inactive
 

So called banner plug boards or banner rotations have been around for a while now for successful website promotion. Here you'll find a free script you can put on your own website to run your own plug board. All you need is some webspace that supports PHP, the possibility to make text files on the webspace writable, and of course some basic HTML knowledge to integrate the plug board properly into your own website.

PHP Banner Plug Board 2.00

Before you start installation, have a look at this live Banner Plug Board Demo, so you'll get an idea what this script actually does.

As for installation, the first thing to do is to download the file bannerrota.zip and unpack it to your webspace. The file .htaccess should be placed in the same folder in which you want to run the plug board. If such a file already exists, you can merge these two.

The plug board consists of a couple of PHP and text files. The text files named bannerrota.txt, bannerrota_neu.txt and badwords.txt must be configuered to be writable. To accomplish this, you set the read/write pemissions to 666. You don't need to set up any database. The script will store all data in these text files.

The script can be placed inside any html page. To make sure that the PHP script will be parsed, the file of the page must necessarily have the extension .php. The script produces a banner table including a header and a footer line, and the form to submit a new record only. Everything else that should appear on your page, such as submission rules, navigation, advertising, CSS etc. must be placed separately onto the html page. Here's an example how to include the plug board script into html:

<?php
  $group=1;
  $title="Banner Plug";
  $maxnbr=20;
  $minhits=40;
  $ownname="Jan Krohn";
  $ownmail="...";
  $ownsite="https://www.heidoc.net/php/demo.php";
  $ownbanner="https://www.heidoc.net/joomla/images/heidoc/heidoc468.jpg";
  $xres=468;
  $yres=60;
  $size=50;
  $nofollow=true;
  $pass="abcdefg";
  include("bannerrota.php");
?>

The banner script leverages Twitter Bootstrap 3 for layout, so you will also need to include the following lines into the header of your html document:

  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

Explanation of the parameters

group: If you want to run several plug boards simultaneously (either on the same page, or on different pages), you assign a number to each board. For example, choose group 1 for a 486x60 plug board, group 2 for a 88x31 plug board, and group 3 for a text link plug board.

title: Put the title of your plug board here.

maxnbr Maximum number of banners on your board.

minhits: Minimum number of hits required on the plug board on all banners overall before new submissions will be accepted. Choose minhits=0 if you don't want to use this requirement.

ownname: The name put here will be used as sender name of the notification mail sent out when a record drops off the board.

ownmail: The email address put here will be used as sender name of the notification mail sent out when a record drops off the board.

ownsite: The URL put here will be placed in the notification mail to prompt the visitor back to your site to make a new submission.

ownbanner: The URL of your own banner (468x60) to be placed into the notification mail.

xres: Enter the horizontal size of the banners here.

yres: Enter the vertical size of the banners here.

size: Enter the maximum size in KByte of the banner submissions here. Default file size is 1024 KByte = 1 MByte. If you set xres, yres and size all to 0, a text link plug board instead of a banner plug board will be created.

nofollow: Adds rel="nofollow" to all outbound links.

pass: Set the password for accessing the admin panel.

After setting these parameters, you include one of the two files bannerrota.php (for English language interface) or d_bannerrota.php (for German language inteface).

The Admin Panel

To access the admin panel, enter your password and click the admin button in the footer line. Here you'll see an extended version of the banner table that doesn't count any hits, shows the submitter's e-mail address, and the status visible or invisible if a record is affected by the spam filter.

Spam Filter

In the admin panel, you'll also have access to the spam word list. Enter one word per line here. Any existing records containing a word from the list will be hidden, and new submissions will be blocked.

Once a word is added to the list, it will be applied in quite a restrictive way. For example, adding "sex" would also ban any submissions about "Sussex". Entering a single space, or the letter "e" for example would consequently cause havoc.

Repair or Initialise the Plug Board

The script should automatically backup the plug board data. Should the data be corrupted for whatever reason anyway, or you want to initialise the plug board for another reason, just copy a backup or the original files bannerrota.txt and bannerrota_neu.txt on your server replacing the currupted files.

Update Newsletter and Feed

All updates and bugfixes to this script will be announced on this feed. You can also have the feed updates sent to you by email using Google Feedburner.

License and Copyright Issues

The script can be used on free of charge on any website. However, the copyright message and the link to heidoc.net may not be deleted. Other portions of the script may be adapted to the user's needs. The actual source code of the script may not be distributed in any form.