PHP Classes

Advertisement Banner Module: Manage and display advertisement banners in MySQL

Recommend this page to a friend!
  Info   View files Example   View files View files (7)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 434 All time: 6,279 This week: 107Up
Version License PHP version Categories
advertisement-banner 1.1Freeware5.0HTML, PHP 5, Graphics, Content manage...
Description 

Author

This class can manage and display advertisement banners in MySQL.

It can add several types of advertisements and stores its details in a MySQL database table like the title, description, image data and size.

The class can also pick one or more banner randomly from the database to display filtering by banner size.

It also generates the necessary HTML to display the banner on a Web page and update the number of impressions when the banner is displayed.

The class can also return the number of impressions and clicks on a given banner.

Picture of Bharat Parmar
  Performance   Level  
Name: Bharat Parmar <contact>
Classes: 11 packages by
Country: India India
Age: 33
All time rank: 52131 in India India
Week rank: 51 Up6 in India India Up
Innovation award
Innovation award
Nominee: 3x

Example

<?php
@include("config.php");
@include(
"class/Advertisement.Class.php");
$Advertisement = new Advertisement();
?>
<html>
    <meta charset="UTF-8">
    <head>
        <title>Example Script : Manage Advertisement</title>
    </head>
    <body>
        <h3>Add New Addvertisement</h3>
        <?php $Advertisement->DisplayMessage();?>
<form method="post" enctype="multipart/form-data">
            <div class="row">
                <div>Title : </div>
                <input type="text" name="title" value="<?php echo @$_POST['title'];?>" placeholder="Enter Advertisement Title" maxlength="50" size="50">
            </div>

            <div class="row">
                <div>Description : </div>
                <textarea name="description" maxlength="150" placehoder="Enter Advertisement Description Here" cols="39"><?php echo @$_POST['description'];?></textarea>
            </div>

            <div class="row">
                <div>Banner Size : </div>
                <select name="banner_size">
                    <option value="120x60">120x60</option>
                    <option value="120x90">120x90</option>
                    <option value="125x125">125x125</option>
                    <option value="180x150">180x150</option>
                    <option value="120x400">120x400</option>
                    <option value="250x250">250x250</option>
                    <option value="468x60">468x60</option>
                    <option value="728x90">728x90</option>
                </select>
            </div>
            <div class="row">
                <div>Banner Image : </div>
                <input type="file" name="banner_image" accepty="image/*">
            </div>
            <div class="row">
                <div>Destination URL : </div>
                <input type="text" name="destination_url" value="<?php echo @$_POST['destination_url'];?>" placeholder="Enter Destination URL. Example :http://www.google.com" size="50">
            </div>
            <div class="row">
                <div>Advertisement Impression : </div>
                <input type="text" name="impression" value="<?php echo @$_POST['impression'];?>" placeholder="Enter Advertisement Impression in Numeric Value. Example : 100" size="50">
            </div>
            <div class="row">
                <input type="submit" name="submit_add" value="Add Advertisement">
            </div>
        </form>
        <hr>
        <?php $Advertisement->DisplayBanner("120x60","1");?>
<?php $Advertisement->DisplayBanner("125x125","2");?>
<?php $Advertisement->DisplayBanner("468x60","1");?>
<h3>Manage Advertisement</h3>
        <table width="100%" border="1" cellpadding="3" cellspacing="3">
            <tr>
                <th>#ID</th>
                <th>Title</th>
                <th>Description</th>
                <th>Image</th>
                <th>Impression</th>
                <th>Display Counter</th>
                <th>Click Counter</th>
                <th>Status</th>
            </tr>
            <?php if(!empty($Advertisement->data)) { $total_clicks = $Advertisement->DisplayClickHistory();?>
<?php foreach ($Advertisement->data as $record) { ?>
<tr align="center">
                        <td><?php echo $record['id'];?></td>
                        <td><?php echo stripslashes($record['title']);?></td>
                        <td><?php echo stripslashes($record['description']);?></td>
                        <td><img src="banner/<?php echo stripslashes($record['banner_image']);?>" height="50%" width="50%"></td>
                        <td><?php echo $record['impression'];?></td>
                        <td><?php echo $record['display_counter'];?></td>
                        <td><?php echo $total_clicks[$record['id']];?></td>
                        <td>
                            <?php if($record['active_status']==1) { ?>
<a href="advertisement.php?status=0&id=<?php echo $record['id'];?>">Active</a>
                            <?php } else { ?>
<a href="advertisement.php?status=1&id=<?php echo $record['id'];?>">Inactive</a>
                            <?php } ?>
</td>
                    </tr>
                <?php } ?>
<?php } else { ?>
<tr><td colspan="7" align="center">Records not available.</a></tr>
            <?php } ?>
</table>
    </body>
</html>



Details

# Advertisement Banner Module Advertisement Banner Module will help you to add various size of advertisement banners to your site. You can place the advertisement display code to anywhere in your site. # Version `1.0.0` # Features - Multiple Advertisement Banner Sizes Supported. - Standard Banner Sizes are already added. - Possible to display the Advertisement Banner anywhere in the site. - Click History with IP Address and Click Time - Impression based Limitation to display the Advertisement - Display Counter - Very Simple and Short Code to use - Permission will be set automatically. # How To Use - advertisement.php : Manage Advertisement Banner - clickhistory.php : Click History for the Advertisement - Display Banner : `<?php $Advertisement->DisplayBanner("125x125","2");?>` Parameter 1 : Banner Size Parameter 2 : Number of advertisements to display # About : Bharat Parmar Email : bharatparmar383@gmail.com

  Files folder image Files  
File Role Description
Files folder imageclass (1 file)
Accessible without login Plain text file advcounter.php Example Click Counter on Advertisement Click
Accessible without login Plain text file advertisement.php Example Manage Advertisement
Accessible without login Plain text file clickhistory.php Example Click Counter History Page
Accessible without login Plain text file config.php Conf. Configuration File
Plain text file database.sql Class Database File
Accessible without login Plain text file readme.txt Doc. Read Me : Documentation for the script

  Files folder image Files  /  class  
File Role Description
  Plain text file Advertisement.Class.php Class Class file of all methods

 Version Control Unique User Downloads Download Rankings  
 0%
Total:434
This week:0
All time:6,279
This week:107Up