pagetitle: phpBannerExchange install and upgrade instructions - tagline: Run your own banner exchange - menu:
- content:If you are upgrading your script from phpBannerExchange 1.x, see the section regarding Upgrading towards the end of this document.
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/Directory | Permission Required |
/config.php | 755 or 777 |
/manifest.php | 755 or 777 |
/css.php | 755 or 777 |
/templates/* | 777 |
/admin/db/ | 777 |
/upload_dir/ | 777 |
[top]
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.
Name | config.php Value | Description |
Database Host: | $dbhost | The host name of your database. This is most likely localhost. |
Database Login: | $dblogin | The username you use to connect to your database. |
Database Password: | $dbpass | The password you use to connect to your database. |
Database Name: | $dbname | The name of the database you wish to use to store your user data. |
Base Exchange URL: | $baseurl | The 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: | $basepath | The 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: | $exchangename | The 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: | $sitename | The name of your site. This is used for the legalese in the "Conditions of Use". |
Admin Name: | $adminname | Your name or alias. It is primarily used in the footer of each page. |
Admin Email: | $ownermail | The e-mail address you would like to use to receive exchange related questions, new account notifications, etc. |
Banner Width: | $bannerwidth | The width, in pixels, of the banners you would like to support with your exchange. Standard banners are 468 pixels wide. |
Banner Height: | $bannerheight | The height, in pixels, of the banners you would like to support with your exhange. Standard banners are 60 pixels wide. |
Default Ratio: | $steexp, $banexp | This 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 |
Show Exchange Image: | $showimage | This 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: | $imagepos | The 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: | $imageurl | If 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, $exchangetext | If 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: | $reqbanapproval | This 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_upload | This 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_filesize | The 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_path | The *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_url | This 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: | $maxbanners | This 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: | $anticheat | Select 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: | $expiretime | This 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_program | This 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_bounty | This option is the amount of credits you wish to reward your users with for referring users for the exchange. |
Starting Credits: | $startcredits | If 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: | $sellcredits | Enables 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: | $topnum | This 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: | $sendemail | If you would like to be notified when a new user signs up to the exchange, click the "Yes" radio button. |
Use MD5 Encrypted Passwords: | $usemd5 | For 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_gzhandler | If 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_clicks | Stores 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_dbrand | Enables 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_format | Select the date style to use. (mm/dd/yyyy or dd/mm/yyyy). |
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 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.
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.
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]