Translations of this page:

Adit

I've used Open Ads as an affliate / banner advertising manager and it is a full featured and extensive piece of software. However for smaller websites it can be too complex, taking a considerable amount of time to add new media to the system. I therefore developed adit, a database backed banner advert manager. The aims of the project are:-

  1. Lightweight and fast interface
  2. Quickly add new media by keyword
  3. Support keyword, groupword and fallover advertising
  4. Native support for various CMS, current pmwiki
  5. Geotargetting
  6. Language targetting (Roadmap)

How it works

Adit selects adverts to display on a given page based on the page title or group name and geographic location (country). If there is more than one advert matching the critera it selects adverts on a round robin basis. I say advert, but in fact the object could be anything. An image, a piece of text, whatever.

PMWiki Integration

To use Adit the pmwiki user just needs to include a single tag in a page body, header or footer. The administration tool consists of a number of screens to add, update and delete adverts based on keywords or descriptions plus a screen for viewing statistics. The whole thing uses MySQL as the RDBMS and demonstrates the techniques of display/processing and database transactions.

PMWiki Integration

By including a Pmwiki tag somewhere on a page, for example the GroupFooter, Adit can retrieve advertising related to the Page title or Group name. This can be targetted to one or more countries.

(:adit ${Title}, ${Group} :)

of course you can use any keyword pair you like but this is a typical example.

http://www.pmwiki.org/wiki/Cookbook/Adit

General Setup

Unpack the zip file. The package consists of two parts. A cookbook recipe and an administration system. Under the cookbook directory you will find

  • adit.php
  • adit/geoip.inc

You will need to add the following line to your local/config.php or local/farmconfig.php file

include_once(“$FarmD/cookbook/adit.php”);

Geotargetting

In order to use the geotargetting features of Adit you will also need to download the MaxMind GeoIP Lite country database from the following website:

http://www.maxmind.com/app/php

This file, called GeoIP.dat should be placed in the cookbook/adit directory. It is a database that maps IP addresses to countries. When someone connects to your wiki Adit uses this database to determine where the user is located in the world.

The second part is an administration tool stored under the adit_admin directory. Copy this to your server's document root (or other location) there are two important files from a setup viewpoint

  • authentication.php
  • globals.php

First authentication controls user access to the administration scrips. The PHP array:

$userDB = array(“jo” ⇒ “schmoe”, “user” ⇒ “secret”);

Lets you configure usernames and passwords. You will probably want to change these to your own value(s). There is no real need for more than one user. Multiple users are left open for future use - probably allowing advertisers to view statistics etc.

Globals configures database access. You will need to set the database name or a table extension if you want to share a database with another application. You will also need to set the username and password you use to access MySQL. The hostname will normally be left at localhost.

$database=“adit”; # use this if you share a database with another application $database_ext=“adt_”; $hostname=“localhost”; $user=“username”; $password=“password”;

You may need to create a user for the adit database. Use the mysql admin tool to do this

e.g. mysql -u root -p

grant all privileges on adit.* to username@localhost identified by \'password\' WITH GRANT OPTION;@

As a security measure you may wish to rename adit_admin. Note that the globals file is also used by the adit.php cookbook script. If you change the directory name or place it somewhere other than your document root you will need to modify this variable:

include_once($FarmD . ”/../adit/globals.php”);

Assuming you set up the administration interface under the web server's document root then you will need to run a setup script to create the database tables

http://myserver.com/adit/setup.php

You can manage Adit with the following URL:

http://myserver.com/adit/login.php

You will need to give the username and password that you set up in the authentication.php file.

From the administration interface you can add an advert (any HTML code including Javascript) and associate a keyword and countries, update this to add new keywords and delete an advert. If you associate more than one advert with an instance of a keyword and country adit will rotate the displayed code on a round robin basis. You can access statistics showing how many times each ad has been displayed.

Futher Information

tech/adit.txt · Last modified: 2008/05/17 17:46 by davidof
Recent changes RSS feed