The Banner plugin allows administrators to create banner ads which may be displayed in the header and footer. Banners may be assigned to Campaigns, which are assigned to a site member.
The Banner Plugin uses the glFusion automated plugin installer. Simply upload the distribution using the glFusion plugin installer located in the Plugin Administration page.
The upgrade process is identical to the installation process, simply upload the distribution from the Plugin Administration page.
The Banner plugin consists of three main components: Banners, Campaigns and Categories.
The glFusion permission system is used for each of these items. Permissions for campaigns and categories behave slightly differently than for banners
Categories indicate the placement of the banners. Three categories are provided at installation and may not be deleted:
| Category | Description |
|---|---|
| Header | Replaces {banner_header} in the site template with the banner ad. Requires “The banner is displayed with the template” to be enabled in the plugin configuration. |
| Footer | Replaces {banner_footer} in the site template with the banner ad. Requires “The banner is displayed with the template” to be enabled in the plugin configuration. |
| Block | Places the banner in the Banner and the Random Banner blocks. These blocks are created but not enabled during installation. |
The administrator may disable the default categories or create other categories to have ads appear in blocks or embedded in other content. Other category types may be used for additional blocks or with autotags, for example. The Header and Footer categories are fixed in their purpose.
One or more categories may also be selected to appear in the Centerblock. Refer to the Centerblock Options for help with this configuration.
Each banner must belong to exactly one category.
An ad campaign is a collection of ads. The campaign has its own settings for publication dates and maximum hits & impressions. If the campaign limit is reached for any of these, no banners within the campaign will be displayed.
Each banner must belong to one campaign. Upon installation a single campaign is created which is open to all site members.
Banners under the “Header” and “Footer” categories (or any category of type “header” or “footer”) are automatically placed in the glFusion template, replacing the variables {banner_header} and {banner_footer}, respectively. Most likely you'll want to add {banner_header} in the header.thtml file and {banner_footer} in footer.thtml, but the plugin actually has no knowledge of where the banners are placed.
Also, if you do create Header or Footer banners, but do not implement the template variables, you'll need to turn off “Show Banners in Templates” in the plugin online configuration. Since the plugin has no way of knowing whether the template variables are actually defined, the impression count will quickly become inaccurate as the plugin thinks that it is constantly displaying banners when it isn't.
Banners associated with a category of type “block” are automatically placed in the predefined banner blocks. The administrator may also create additional category types to appear in different blocks.
There are 2 blocks that are created during installation but are not enabled: Banners and Random Banner.
To create additional banner blocks:
phpblock_banner_topic_random(special)
This tells the plugin to search for only banners of type “special” for this block.
Starting with version 0.1.0, any template may contain banners. Simply create a variable named {banner_templatename} in the template and create a matching banner category named templatename. Banners assigned to this category will replace the corresponding template variable when the template is rendered. You may use any string other than “header” or “footer” as long as it contains only characters. You may also have more than one such banner in a template, each with different names (if you use the same name, all that will happen is you replicate the one banner).
The “templatename” that you use needs to match the template name used by glFusion, which isn't always obvious. For example, to have a banner appear in “featuredstorytext.thtml”, you'd specify “featuredarticle” as the template name. Some template names are:
| Template | Variable |
|---|---|
| featuredstorytext.thtml | featuredarticle |
| storytext.thtml | article |
The permissions system for campaigns and categories is a bit different than for normal content.
By giving different permissions to different campaigns and categories, you can show certain types of ads only to certain user groups, such as “Anonymous”.
Banner permissions follow more closely the traditional glFusion security model:
Configuration Options are set by the Banner section in the site Configuration area. There is no config.php required unless you wish to override any other settings.
This controls whether the banner plugin will attempt to put “header” and “footer” banners in the templates. If this is set to “No”, or if there are no header or footer banners defined, nothing will appear in the site template.
The available template variables are:
Determines whether regular site members may submit banners at all. Anonymous users can never submit banners.
Determines whether new submissions from regular site members are diverted to the submission queue for moderator approval.
Determines what to do with banners that are owned by a site user that is deleted.
These settings control the maximum dimensinos of an uploaded image, and are meant only as a sanity check. The site administrator is responsible for making sure that the banner images, whether uploaded, remotely-hosted or provided by an ad service, will fit properly in their display locations.
Each banner also has a width and height value that is used to control the display of locally- and remotely-hosted images via the HTML “img” tags. No size control is exerted over ads provided by ad services.
This value is the default weight applied to new banner ads. The weight is used to give priority to some banners relative to others. For the individual banner a higher or lower weight value may be given which will cause the banner to appear more or less often, respectively.
These settings control who will actually see the ads, and for whom the impressions and click-throughs are counted. Typically, especially with ad-serving services such as Google Adsense, the administrator needs to be careful about causing false impressions or click-throughs. The Banner plugin has no control over measuring click-throughs in these cases, but can control whether an ad is displayed to certain classes of visitor.
This determines whether ads are shown at all on pages that fall under the site admin URL (http://www.example.com/admin).
Enter an array element for each IP address, or part of an address (such as “192.168”), for hosts that should not be shown ads.
These options control whether and how a banner will be displayed in a center block. At least one category must have its Centerblock option selected in order for these options to have any effect.
Selecting “Yes” for this option will cause the banner ad to be displayed by itself as your site's home page.
Note that this option working correctly depends upon whether any other plugin has a similar option set. Depending upon the order in which plugins are loaded, the Banner plugin may never get a chance to become the home page.
This allows the administrator to select the position of the centerblock. Options are:
These are the default permissions applied to new ads. They may be modified during the ad submission.
--- functions.inc.010 2009-12-09 07:46:32.000000000 -0800
+++ functions.inc 2009-12-09 07:46:15.000000000 -0800
@@ -126,7 +126,7 @@
// If centerblock not enabled, or just for homepage and
// we're not on the homepage, just return
- if ($_CONF_BANR['cb_enabled'] == 0 ||
+ if ($_CONF_BANR['cb_enable'] == 0 ||
($CONF_BANR['cb_home'] == 1 && ($page > 1 || $topic != ''))) {
return '';
}
--- banner.class.php.010 2009-12-14 15:23:14.000000000 -0800
+++ banner.class.php 2009-12-14 14:33:26.000000000 -0800
@@ -648,7 +648,7 @@
break;
case 'topic':
// different variable name used in DB
- $sql_cond .= " AND c.tid = '$value'";
+ $sql_cond .= " AND (c.tid = '$value' OR c.tid='all')";
break;
case 'limit':
$limit_clause = " LIMIT $value";
One of the changes is to the glFusion-style date fields in the banner form. A misplaced parentheses causes an error if you use 24-hour time.
Around line 1175 of banner.class.php, replace this:
if ($_CONF['hour_mode'] == 24) { $T->set_var('start_hour_options', COM_getHourFormOptions(date('H', $startdt, 24))); $T->set_var('end_hour_options', COM_getHourFormOptions(date('H', $enddt, 24))); } else {
with this:
if ($_CONF['hour_mode'] == 24) { $T->set_var('start_hour_options', COM_getHourFormOptions(date('H', $startdt), 24)); $T->set_var('end_hour_options', COM_getHourFormOptions(date('H', $enddt), 24)); } else {
See that one of the closing parentheses is moved from the end of the COM_getHourFormOptions lines to right after the date variable name.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This plugin is based on the Banner plugin for Geeklog by Hiroshi Sakuramoto, Copyright (C) 2009 by Hiroshi Sakuramoto and Ivy. See http://www.ivywe.co.jp