From RNWiki
Jump to: navigation, search

"Sometimes a cigar is just a cigar"

This quote, attributed to Sigmund Freud and echoed by Groucho Marx could also be applied to the advertising module in RavenNuke™. However, it would have to be changed to say "sometimes an advertising module is not just an advertising module". More to the point, the advertising module has certain features and capabilities which might make it of interest to site administrators even if they are not seeking to produce revenue through advertising on their site. Most relevant, it allows placement of small blocks of text and images (with links) in the banner area of your web pages (or anywhere else you wish to place them in your theme) on a random basis... so, if you have several messages that you want to emphasize you can set them up through advertising. But read on ...


The Advertising Module within RavenNuke™ has been substantially revised in version 2.40.00 from previous versions, especially on the administrative side. Many of the functions in the previous versions either did not work completely or generated warning and notice type errors or were non-compliant with XHTML standards or all of the above. Screens for setting up ads did not work logically - a different set of entries were required for different types of ads and the errors that were generated if you did not guess correctly about the full set of required entries were extremely frustrating to deal with. Revisions for 2.40.00 did not concentrate on functional enhancements but rather focused on making the core Advertising module "work" - functional enhancements will be entertained for future releases (expiration dates anyone?).

A Site Admin's View of Advertising

The first question a site administrator might have is "what is the advertising module and what can it do for me?" And then he/she might ask: "and what are the best practices for implementing it?"

So, let us start at the beginning; the advertising module allows you to define:

  • Advertising terms and conditions,
  • Pricing plans,
  • Clients,
  • Positions on your web page
  • and the ads themselves.

Ads can be of type javascript/html, image or a flash file. Ads can be linked to external sites where the advertiser can provide more detail and/or attempt to sell items. Pricing for ads can be based on actual clicks, impressions (one impression for each time it is presented on a page) or the time-frame that an ad will run. Ads display randomly on your pages either in a block or in the header (banner) area of your theme, or anywhere else that you can add the needed PHP code.

The site administrator defines all ads. There is a capacity for advertising clients to look at a "client-side" of their ad and to click on a "buy-link" (defined by the administrator) to actually make the payment for the ad, The client can also (if desired by the site administrator) sign-in to view statistics about his ads,

As noted in the introduction, ads do not necessarily have to be "ads" in the traditional sense. If, as a site administrator, you want to have certain small blocks of "messages" or images that appear more or less randomly at a prominent spot on your web page and that optionally link to other content on your page, you can use the advertising module for that.

The display of ads is controlled by settings within the ads and by the theme you are using and/or an advertising block. Your theme calls a function within mainfile.php that randomly selects an ad, validates whether it is still active and centers the ad within an area before sending it back to the theme for display. If you want to get familiar with the details of how ads are displayed you should look at the ads() function in mainfile.php as well as the themeheader() function of your theme and perhaps the block-Advertising.php that is in your /blocks directory.

Getting Started

To help getting oriented with advertising capabilities we would recommend you do an experiment:

  • Start by setting up a simple time-based pricing plan. Use the add advertising plan from the advertising administration menu. Give it some kind of description and, for quantity, put in a number of months (or whatever period you choose). Optionally you can associate a "buy link" with it. This will let your clients pay for the ad through the link you associate with the buying plan. This can be, for instance, a Paypal link or it could be an email address. The link needs to be constructed properly. For a web type link you need the full http:// address. If you want your client to send an email you can construct a mailto: type of link. The system will put the proper anchor tag around the link when displaying it. However, if the link does not work correctly your clients will see an error page so you will want to test your links thoroughly.
  • Next set up a position. You can name the position anything you want. Right now it doesn't control anything but is really just a means of selecting subsets of your ads that belong to that "position". Make sure you have a position 0 because that's the position used by the standard code.
  • Now, create a client . To get started, make yourself or your site the client. Fill out the information about the client and save it.
  • Finally it is time to create an ad. Let's say you have an image that you want to use and then have that point to a news article or a content item on your web page. The add a new banner (aka, ad) screen has two parts. On the first part you select whether you want the ad to be an image or a flash file or Javascript/HTML code. Pick image, give the banner a name and leave impressions set on unlimited. Assign that ad to position 0 so you will be able to see it without editing any code. Then click continue and fill out the rest of the information about your ad. Because you have set up positions and clients first, you will be able to pick these from a drop down box. For the image and click url you will want to make sure that your link works properly by testing it in a separate window or tab. Just fill out the http:// information -- the advertising code will construct the proper href for you. Note: if you construct the link incorrectly your users will see a not found page -- there is no verification of link correctness built into this version of advertising.

Activating and Using

Once the ad is activated, which you will do upon saving it, it should start showing up in the banner area of your web page. The standard themes that come with RavenNuke™ all take care of this. When you have one ad working, you might want to define another so you can see them rotating in and out of the banner area on your theme, more or less randomly. If you want ads in other places, you will have to use the block advertising. When that block is activated you can use the blocks administration features of the ACP to place the block anywhere you want. As of RavenNuke™ 2.40.00 the themes show ads that are in position 0 whereas the block file shows ads that are in position 1. This of course can be modified and/or you can clone the advertising block using a different block name to show ads from different positions.