Table of Contents

glBanner - Banner Ad Plugin

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.

Requirements

Installation

The Banner Plugin uses the glFusion automated plugin installer. Simply upload the distribution using the glFusion plugin installer located in the Plugin Administration page.

Upgrading

The upgrade process is identical to the installation process, simply upload the distribution from the Plugin Administration page.

Features

Limitations

Usage

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

The glFusion “AdBlock” feature is used to place banners in your site. The Banner plugin uses Categories to indicate which banners may be placed in the different possible ad blocks.

The administrator may disable the default categories or create other categories to have ads appear in blocks or embedded in other content.

Plugins that return template names that can display an ad block are shown on the Category edit screen. Some, like a Header, will logically only display one ad while others may display multiple ads interspersed with the content.

Category ID

A unique identifier for the category, may be anything

Category Name

The display name for the category

Category Type

Deprecated, unused beginning with plugin version 0.3.0

Category Description

This is just for you notes and is not displayed anywhere.

Topic

Select a topic, or “All”, where ads in this category should appear

Max Image Width and Height

Enter the maximum image size that can be uploaded for this category. This is to ensure that uploaded images conform to the spaces where banners will be placed.

Enabled

Enable or disable this category.

Centerblock

Indicate if this category is used as a Centerblock on the home page

Template Support

Enabled

Each template name must be enabled. If this box is unchecked, the template variable will not be set.

Position

For locations that allow multiple placements, select the position of the ad. For example, select “1” to have the banner appear after the first item, “2” to have it appear after the second, etc.

Show Once?

If this box is checked, then a banner on a list-type page will appear only once according to the Position. If left unchecked, then the Position is used to determine multiple placements, e.g. placing a banner after every 2nd item.

Show In Content?

Check this box to have the banner also shown in the main content area, such as the story body, if supported by the content type.

Examples

To have a banner show only in the story index after every third story:

To have the banner also be displayed in the story content, check “Show In Content”

To display a banner only in the story content page and not in the index:

To display a banner once in the article index, between the first and second listing:

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.

Campaigns

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

The banner ID may be a descriptive text string, but each banner must have a unique ID.

Title

The banner title describes the banner's purpose, customer, etc.

Category Name

Select the category to determine the placement for this banner.

Campaign

Select the campaign in which this banner is included.

Topic

Select the glFusion topic in which this banner will be displayed. Categories are also associated with topics but banners may be further restricted to a single topic.

Publish Start/End

Enter the dates between which the banner will be published. This can further restrict banners to only appear during a small window within the Campaign publication period.

Enabled

Check this box to enable the banner's display. This allows the administrator to temporarily suspend a banner without having to delete it and possibly recreate it later.

Hits and Impressions

Enter the number of hits and imressions already incurred for this banner, if any.

Max Hits and Max Impressions

Enter the hit and impression limit for the banner. Enter zero if unlimited.

Target URL

Enter the URL, including "https://", where visitors will be sent when they click on the banner. Leave this empty for a display-only banner, and for HTML or Javascript banners which will have the URL embedded in their code.

Target

Select which window will be used to display the URL for the banner. “New Window” is recommended.

Type of Ad

Select one of “Uploaded Image”, “Remotely-Hosted Image”, “HTML or Javascript”, or “Autotag”. The remaining options will depend upon this selection.

Upload a Banner

For uploaded image banners, select the file to upload here.

URL to Remote Image

For remotely-hosted banners, enter the URL to the image file.

Dimensions

Enter the image dimensions. For uploaded banners the dimensions will be derived from the image file if not entered here. For remotely-hosted banners these values should be entered.

Complete Ad Code

For HTML/Javascript banners enter the complete ad code, e.g. the code provided by Google Adsense.

Weighting

Select a weight to give the banner. A higher value increases the chance of it being shown for a given page load.

Block Banners

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:

  1. Create a new banner category with a new type. For example, “special”.
  2. Create a new PHP block. The function name is either “phpblock_banner_topic” or “phpblock_banner_topic_random, depending upon which type of block you'd like. The category type (“special” in this example) is supplied to the PHP function as a parameter:
    phpblock_banner_topic_random(special)

    This tells the plugin to search for only banners of type “special” for this block.

If you remove or disable the Banner plugin, only the two standard blocks will be removed or disabled. Any custom blocks that you create will have to be disabled or removed manually.

Other Templates

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:

TemplateVariable
featuredstorytext.thtmlfeaturedarticle
storytext.thtmlarticle

Permissions

Campaigns

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”.

Categories

The category only has a “visibility” setting to indicate which users will see the banners.

Configuration Options

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.

Main Settings

The banner is displayed with the template

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.

If this is “Yes”, and there are header or footer banners defined, you must define the appropriate variable in your site templates to have them displayed. If you don't, the ad impression counts will increment even though nothing is shown to the visitor.

The available template variables are:

Allow submissions from site members?

Determines whether regular site members may submit banners at all. Anonymous users can never submit banners.

Enable Submission Queue?

Determines whether new submissions from regular site members are diverted to the submission queue for moderator approval.

If “Allow submissions from site members” is set to “Yes”, and “Enable Submission Queue” is set to “No”, then any site member may submit a banner ad for immediate display. This is not recommended.

Notification Email?

Delete Banner with Owner?

Determines what to do with banners that are owned by a site user that is deleted.

Maximum image width/height (px)

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.

Default Weight

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.

Ad Display Control Settings

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.

Show banners on admin pages?

This determines whether ads are shown at all on pages that fall under the site admin URL (http://www.example.com/admin).

IP Addresses that will not be shown ads

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.

Show ads to the ad owner?

Show ads to ad administrators?

Count ad clicks made by the ad owner?

Count ad clicks mad by ad administrators?

Count ad impressions for the ad owner?

Count ad impressions for ad administrators?

Centerblock Options

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.

Centerblock Enabled?
Centerblock Replaces Home Page?

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.

Centerblock Position

This allows the administrator to select the position of the centerblock. Options are:

Default Permissions

These are the default permissions applied to new ads. They may be modified during the ad submission.

Known Issues

Version 0.0.1

Version 0.1.0

Version 0.1.1

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.

License

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