pagetitle: phpBannerExchange install and upgrade instructions - tagline: Run your own banner exchange - menu: - content:
What's New
[top]

Quick Start Guide (new install)
If you are upgrading your script from phpBannerExchange 1.x, see the section regarding Upgrading towards the end of this document.
  1. Unzip the distribution binary.
  2. Upload the files to your Banner Exchange directory on your web server. There are no binary files, so insure the files are uploaded as ASCII.
  3. chmod config.php to allow read/write access to it (755 or 777).
  4. chmod manifest.php to allow read/write access to it (755 or 777).
  5. chmod css.php to allow read/write access to it (755 or 777).
  6. chmod your upload directory for global read/write access (777).
  7. chmod your template directory for global read/write access (777).
  8. chmod admin/db for global read/write access and set up an .htaccess file to password protect it.
  9. Navigate to http://yourdomain.com/exchange_directory/install/install.php.
  10. Follow the directions provided in the install script.
  11. DELETE THE ENTIRE INSTALL DIRECTORY AFTER SUCCESSFULLY INSTALLING THE SCRIPT.
[top]

Install.php
phpBannerExchange 2.0 comes with an automatic installer script that allows you to set the appropriate variables, create the tables and insert your primary administrator account automatically. Before running the install script, insure all files included in the distribution archive have been uploaded to your server with the directory structure intact.

To access the installation script, you will need to go to http://www.yourdomain.com/root_bannerexchange_directory/install/install.php in your web browser. Replace "yourdomain.com" with your domain name and "root_bannerexchange_directory" with the directory path you have uploaded the software to (eg. http://www.eschew.net/exchange/install/install.php).

Once the files have been uploaded, you will need to configure several files and directories for write permissions. Because the installer writes directly to "config.php", "css.php", and "manifest.php" as well as the templates folder, you will need to insure that you have appropriate permissions to write to these files/directories. This is done by using "chmod" to change the permissions. Most FTP clients allow you to chmod a file by right clicking on it. Set the permissions to "755". In DOS/*nix FTP, use the following command:

quote site chmod 755 config.php

If you are planning to allow your users to upload files, you will also need to create an upload directory (such as "banners") and chmod this directory to "777". The admin/db folder will also need to be chmod to 777. This folder contains database backups created by the database backup feature.

File/DirectoryPermission Required
/config.php755 or 777
/manifest.php755 or 777
/css.php755 or 777
/templates/*777
/admin/db/777
/upload_dir/777

[top]

Variables
The following is a list of variables phpBannerExchange asks for during the installation process and a detailed description of what each variable does in the script.

Nameconfig.php ValueDescription
Database Host:$dbhostThe host name of your database. This is most likely localhost.
Database Login:$dbloginThe username you use to connect to your database.
Database Password:$dbpassThe password you use to connect to your database.
Database Name:$dbnameThe name of the database you wish to use to store your user data.
Base Exchange URL:$baseurlThe path on the Internet to which you have phpBannerExchange installed. For example, if you have installed the software to the directory "exchange" just off your root directory, the Base Exchange URL would be http://www.yourdomain.com/exchange. Do not include a trailing slash after the directory name.
Base Path:$basepathThe path (NOT the URL) of where the exchange script is installed. This should be entered automatically by the installation/upgrade script. If it is not, enter the base path (eg: /home/www/exchange). Do not include a trailing slash after the directory name.
Exchange Name:$exchangenameThe name of your exchange, as you would like it to appear in the exchange script. This value is displayed under the banner that is served as well as in e-mail and control panel pages. Examples: "The 1:1 Banner Exchange", "Commander Skippy's Banner Exchange"
Site Name:$sitenameThe name of your site. This is used for the legalese in the "Conditions of Use".
Admin Name:$adminnameYour name or alias. It is primarily used in the footer of each page.
Admin Email:$ownermailThe e-mail address you would like to use to receive exchange related questions, new account notifications, etc.
Banner Width:$bannerwidthThe width, in pixels, of the banners you would like to support with your exchange. Standard banners are 468 pixels wide.
Banner Height:$bannerheightThe height, in pixels, of the banners you would like to support with your exhange. Standard banners are 60 pixels wide.
Default Ratio:$steexp, $banexpThis is your default exchange ratio..sort of. The way this works is the first number is how many exposures are required to have one display. For example, setting this value to "3" will require 3 exposures before the account becomes eligible to display a banner. The second number is how many credits the script should take away when the banner is being displayed. So setting this option to "3" will take away 3 credits when the banner is displayed. Some common ratios are listed below:

1 banner display allows 1 banner to be displayed: 1:1
2 banner displays allows 1 banner to be displayed: 1:2
3 banner displays allows 2 banners to be displayed: 1:1.5

Show Exchange Image:$showimageThis will allow you to specify if you wish to display a small image to the left of the banner. Typically, this is a 60x60 image in a 468x60 banner exchange. It will link back to your Banner Exchange main page.
Exchange Image Position:$imageposThe postion of the exchange image (as described above) relative to the banner itself. Options are Top, Bottom, Left or Right. Selecting Bottom for example, will display the Exchange Image (see below) under the banner.
Exchange Image URL:$imageurlIf you have decided to show an exchange image above, enter the full URL to the image here (eg: http://www.yourdomain.com/image.gif). Otherwise, you may leave this value blank.
Show Exchange Link:$showtext, $exchangetextIf you wish to show a brief exchange text link under the image, set this option to yes, and enter the text you wish to display here. You should keep this brief, something like "Join the (your exchange's name)!" or some such verbage.
Require Banner Approval:$reqbanapprovalThis option controls how the banners are validated. You can set this option to No and the account and URL only need be approved, not the banners. setting this option to Yes will force the account into unvalidated mode when a banner is added or deleted.
Allow Uploads:$allow_uploadThis option allows you to create an upload folder for your user's banners. Setting this option to No will require the user to his his or her own webspace and bandwidth to serve the banner for the exchange.
Maximum Filesize: $max_filesizeThe maximum filesize you wish to allow your users to upload. A 30K banner would be expressed as "30000", for example. You may leave this value blank if you do not wish to use the upload feature.
Upload Path:$upload_pathThe *nix/Windows path to the upload directory. Typically, this will be something like /home/username/public_html/exchange/upload or similar. Do not include a trailing slash after the path. This path must be globally readable and writable (chmod 777 upload_directory). Contact your hosting provider if you are unsure of the path to your html directory. Do not include a trailing slash in the path. You may leave this value blank if you do not wish to use the upload feature.
Upload directory URL:$banner_dir_urlThis is the URL to your upload directory specified in the Upload Path variable above. An example of this would be http://www.yourdomain.com/exchange/upload. Do not include a trailing slash in your URL. You may leave this value blank if you do not wish to use the upload feature.
Maximum Banners:$maxbannersThis is the maximum amount of banners you wish to allow your users to add to their account. If you would like your users to have the ability to add an unlimited number of banners to their account, set this value to 0 (zero). This feature works for both uploaded AND remotely hosted banners.
Anti-Cheat method:$anticheatSelect the type of anti-cheat method you would like to use. Valid options are DB, Cookie, and None.

The Cookies anti-cheat measure that uses cookies to store timeout data for a specific computer. Only after the timeout has expired will credits continue to add up for the account displaying the banner (the timeout value is expressed in a later variable).

The DB method is the same as the Use Cookies variable except it does not use cookies: all data is stored in a database and automatically purged when the timeout expires.

Duration:$expiretimeThis is the timeout value for the two anti-cheat methods, expressed in seconds. This feature controls how long a client on the banner exchange member's page is not counted as an additional visit and subsequently an additional credit for the exchange member. It is recommended you set this value to a low number, perhaps 20 or 30 seconds.
Referral Program:$referral_programThis option allows you to grant your users extra credits for signing up new users. By linking to your Banner Exchange main directory, (eg: http://www.somesite.com/exchange/index.php) with a special code, your end users can earn extra credits. For anti-cheat reasons, the credit is only granted after the created account is validated.
Referral Bounty:$referral_bountyThis option is the amount of credits you wish to reward your users with for referring users for the exchange.
Starting Credits:$startcreditsIf you wish to provide new users with a set amount of free credits, enter this value here. When validating the account, you may change this amount for any individual account.
Sell Credits:$sellcreditsEnables the online store. The credit store will not be visible to end users unless this option is activated, even if there are items available for purchase. See the Online Store section for more details about the online store and configuration instructions.
Top x will display X accounts:$topnumThis value is used for the "top accounts" feature on the main client login page. Specify the maximum number of accounts you would like to display on this page.
Send Admin Email:$sendemailIf you would like to be notified when a new user signs up to the exchange, click the "Yes" radio button.
Use MD5 Encrypted Passwords:$usemd5For security purposes, you may encrypt your passwords with the MD5 encryption routine, which is a 32 character hash of the password. Note that passwords will become unreadable (but will still work) when you use this feature.
Use gZip/Zend code:$use_gzhandlerIf you wish to compress the pages and send the output as a gZip file, enable this option. This saves some bandwidth, but slows down the server.
Log Clicks:$log_clicksStores each click's date & time and IP address to the database for your end users. Note that on large exchanges, this could cause the database to get very large.
Use mySQL4 rand():$use_dbrandEnables the mySQL rand() function in the view.php queries. This method is better than the exchange's built-in random algorythm, but requres mySQL 4.x or greater.
Date Format:$date_formatSelect the date style to use. (mm/dd/yyyy or dd/mm/yyyy).
[top]

Database Structure
Below is a dump of the database structure.

--  -- Table structure for table `banneradmin --   CREATE TABLE banneradmin (   id int(11) NOT NULL auto_increment,   adminuser varchar(15) NOT NULL default '',   adminpass varchar(255) NOT NULL default '',   PRIMARY KEY  (id),   UNIQUE KEY id (id,adminuser) ) TYPE=MyISAM;  -- --------------------------------------------------------  --  -- Table structure for table `bannercats` --   CREATE TABLE bannercats (   id int(7) NOT NULL auto_increment,   catname varchar(50) NOT NULL default '',   PRIMARY KEY  (id) ) TYPE=MyISAM;  -- --------------------------------------------------------  --  -- Table structure for table `bannerclicklog` --   CREATE TABLE bannerclicklog (   id int(11) NOT NULL auto_increment,   siteid int(11) NOT NULL default '0',   clickedtosite int(11) NOT NULL default '0',   bannerid int(11) NOT NULL default '0',   ip varchar(255) NOT NULL default '',   page int(11) NOT NULL default '0',   time int(11) NOT NULL default '0',   PRIMARY KEY  (id) ) TYPE=MyISAM;  -- --------------------------------------------------------  --  -- Table structure for table `bannercommerce` --   CREATE TABLE bannercommerce (   productid int(11) NOT NULL auto_increment,   productname text NOT NULL,   credits decimal(14,0) NOT NULL default '0',   price decimal(12,2) NOT NULL default '0.00',   purchased int(11) NOT NULL default '0',   UNIQUE KEY productid (productid) ) TYPE=MyISAM;  -- --------------------------------------------------------  --  -- Table structure for table `bannerconfig` --   CREATE TABLE bannerconfig (   name varchar(255) NOT NULL default '',   data longtext NOT NULL,   PRIMARY KEY  (name) ) TYPE=MyISAM;  -- --------------------------------------------------------  --  -- Table structure for table `bannerfaq` --   CREATE TABLE bannerfaq (   id int(11) NOT NULL auto_increment,   question longtext NOT NULL,   answer longtext NOT NULL,   UNIQUE KEY id (id) ) TYPE=MyISAM;  -- --------------------------------------------------------  --  -- Table structure for table `bannerlogs` --   CREATE TABLE bannerlogs (   uid int(11) NOT NULL default '0',   ipaddr text NOT NULL,   page int(11) NOT NULL default '0',   timestamp text NOT NULL ) TYPE=MyISAM;  -- --------------------------------------------------------  --  -- Table structure for table `bannerpromologs` --   CREATE TABLE bannerpromologs (   id int(11) NOT NULL auto_increment,   uid int(11) NOT NULL default '0',   promoid int(11) NOT NULL default '0',   usedate int(11) NOT NULL default '0',   PRIMARY KEY  (id) ) TYPE=MyISAM;  -- --------------------------------------------------------  --  -- Table structure for table `bannerpromos` --   CREATE TABLE bannerpromos (   promoid int(11) NOT NULL auto_increment,   promoname varchar(255) NOT NULL default '',   promocode varchar(255) NOT NULL default '',   promotype int(11) NOT NULL default '0',   promonotes text,   promovals decimal(11,2) NOT NULL default '0.00',   promocredits int(11) NOT NULL default '0',   promoreuse tinyint(4) NOT NULL default '0',   promoreuseint int(11) NOT NULL default '0',   promousertype tinyint(4) NOT NULL default '0',   ptimestamp int(11) NOT NULL default '0',   promostatus tinyint(4) NOT NULL default '0',   PRIMARY KEY  (promoid) ) TYPE=MyISAM;  -- --------------------------------------------------------  --  -- Table structure for table `bannerrefs` --   CREATE TABLE bannerrefs (   id int(11) NOT NULL auto_increment,   uid int(11) NOT NULL default '0',   refid tinyint(4) NOT NULL default '0',   given tinyint(4) NOT NULL default '0',   PRIMARY KEY  (id) ) TYPE=MyISAM;  -- --------------------------------------------------------  --  -- Table structure for table `bannersales` --   CREATE TABLE bannersales (   invoice int(11) NOT NULL default '0',   uid int(11) NOT NULL default '0',   item_number int(11) NOT NULL default '0',   payment_status text NOT NULL,   payment_gross text NOT NULL,   payer_email varchar(200) NOT NULL default '',   timestamp int(14) NOT NULL default '0' ) TYPE=MyISAM;  -- --------------------------------------------------------  --  -- Table structure for table `bannerstats` --   CREATE TABLE bannerstats (   uid int(11) NOT NULL default '0',   category int(11) NOT NULL default '0',   exposures int(11) NOT NULL default '0',   credits int(11) NOT NULL default '0',   clicks int(11) NOT NULL default '0',   siteclicks int(11) NOT NULL default '0',   approved tinyint(4) NOT NULL default '0',   defaultacct tinyint(4) NOT NULL default '0',   histexposures int(11) NOT NULL default '0',   raw tinyint(4) NOT NULL default '0',   startdate int(11) NOT NULL default '0',   PRIMARY KEY  (uid) ) TYPE=MyISAM;  -- --------------------------------------------------------  --  -- Table structure for table `bannerurls` --   CREATE TABLE bannerurls (   id int(11) NOT NULL auto_increment,   bannerurl varchar(200) NOT NULL default '',   targeturl varchar(255) NOT NULL default '',   clicks tinyint(4) NOT NULL default '0',   views int(11) NOT NULL default '0',   uid int(11) NOT NULL default '0',   pos int(11) NOT NULL default '0',   PRIMARY KEY  (id) ) TYPE=MyISAM;  -- --------------------------------------------------------  --  -- Table structure for table `banneruser` --   CREATE TABLE banneruser (   id int(11) NOT NULL auto_increment,   login varchar(20) NOT NULL default '',   pass varchar(255) NOT NULL default '',   name varchar(200) NOT NULL default '',   email varchar(100) NOT NULL default '',   newsletter tinyint(4) NOT NULL default '0',   PRIMARY KEY  (id),   UNIQUE KEY id (id,login) ) TYPE=MyISAM;  
[top]

Upgrading
Upgrading your script is almost as easy as installing it. There is an upgrade script located in the /install directory that will make the necessary table and config.php changes.

Upgrading from 1.x to 2.0 Instructions
  1. BACKUP YOUR ORIGINAL EXCHANGE DIRECTORY AND DATABASE ENTRIES FOR THE SCRIPT. This is extremely important unless you want to gamble and play the numbers for losing data.
  2. Upload all the files to your Banner Exchange directory on your web server. There are no binary files, so insure the files are uploaded as ASCII.
  3. chmod config.php to allow read/write access to it (755 or 777).
  4. chmod manifest.php to allow read/write access to it (755 or 777).
  5. chmod css.php to allow read/write access to it (755 or 777).
  6. chmod your upload directory for global read/write access (777).
  7. chmod your template directory for global read/write access (777).
  8. Navigate to http://yourdomain.com/exchange_directory/install/install.php.
  9. Choose the "1.x to 2.0 upgrade" option and follow the directions provided in the install script. If you need help with what the variables do, look here.
  10. DELETE THE ENTIRE INSTALL DIRECTORY AFTER SUCCESSFULLY INSTALLING THE SCRIPT.
Upgrading from 2.0 RCx to 2.0 Gold Instructions
  1. BACKUP YOUR ORIGINAL EXCHANGE DIRECTORY AND DATABASE ENTRIES FOR THE SCRIPT. This is extremely important unless you want to gamble and play the numbers for losing data.
  2. Upload all the files to your Banner Exchange directory on your web server. There are no binary files, so insure the files are uploaded as ASCII.
  3. chmod config.php to allow read/write access to it (755 or 777).
  4. chmod manifest.php to allow read/write access to it (755 or 777).
  5. chmod css.php to allow read/write access to it (755 or 777).
  6. chmod your upload directory for global read/write access (777).
  7. chmod your template directory for global read/write access (777).
  8. Navigate to http://yourdomain.com/exchange_directory/install/install.php.
  9. Follow the directions provided in the install script. If you need help with what the variables do, look here.
  10. DELETE THE ENTIRE INSTALL DIRECTORY AFTER SUCCESSFULLY INSTALLING THE SCRIPT.
[top]

Getting Help
There is no formal support for this script. I neither have the time nor the inclination to provide technical support for this script. You should be OK provided you read the documentation and carefully follow the instructions provided therein.

If you run in to a problem with the script and do need help, you can go to the Support Forums and ask a question.

Bugs and Bug Reporting
Please let me know if you find a bug in the software. I spent a considerable amount of time debugging the script however I can not check everything on my own. If you happen to run across a bug, please report it in the Support Forums. Be sure to include a detailed description of the bug you encountered, the error message, or the result condition so I can address the problem.

Security Issues
If you run across a security issue/vulnerability, please report it directly to me at darkrose@eschew.net so I can make an announcement on the forums once the script has been fixed. These types of problems usually require some sort of exploit and could compromise the security of thousands of machines. If you happen to run across a bug of this magnitude, it is essential that I be notified first so I can protect the security of these machines. Please be aware that support issues sent to this address will be ignored. You will NOT receive a reply support issues if e-mailed to me.

Mods, Localization and Templates
If you change something in the script or add a new feature, I encourage you to share it with the other users. My vision of what makes a good Banner Exchange script as far as features are concerned might be vastly different than yours, so if you make a modification to the script, I encourage you to share it with me. I plan to make all working mods to the script available for download as an add-on to the base script. If the modification is good enough, I will even include it in a future version of the script and you will receive credit for the code you have submitted or changed. You may e-mail your mods to me at darkrose@eschew.net.

I am seeking assistance with translating the software into different languages. All language files for the script are located in the lang/ directory under your root banner exchange directory. If you translate the files, please provide me with a copy and I will make it available for all users. You may e-mail the translated language files to me at darkrose@eschew.net.

The templates are located in the template/ directory. If you alter the templates or style.css file, please send me your new files and I will make them available to all users. You may email them to me at darkrose@eschew.net.
[top]

- rightside: ________ - footer: Script made by eschew.net -