phpAdsNew

phpAdsNew is a banner management and tracking system written in PHP.

[faq] [configuration] [api]       [homepage] [report bugs] [forum]


Configuration

Please read first the INSTALL file for installation instructions.
If you are upgrading from a previous version of phpAdsNew you should read the UPGRADE file for instructions.

In the current release, you have to configure all your information in config.inc.php.

Database configuration

Before you can use phpAdsNew you need to tell phpAdsNew which database to use and which username and password to use.

$phpAds_hostname

Specify the hostname of the MySQL database server.

$phpAds_mysqluser

Specify the username which phpAdsNew must use to gain access to the MySQL database server.

$phpAds_mysqlpassword

Specify the password which phpAdsNew must use to gain access to the MySQL database server.

$phpAds_tbl_adclicks
$phpAds_tbl_adviews
$phpAds_tbl_adstats
$phpAds_tbl_banners
$phpAds_tbl_clients
$phpAds_tbl_session
$phpAds_tbl_acls

If you wish to use different table names, for example to match the existing table names of you project, you can specify the alternative names here. Be aware, the tables you name here must be created; phpAdsNew will not automatically create these tables.

$phpAds_persistent_connections

If you want to use persistent connections to the database server you must specify "1", otherwise specify "0". The use of persistent connection can speed up phpAdsNew considerably, but requires a lot of resources. If phpAdsNew is using too many resources, you should take a look at this setting first. Persistent connections are turned off by default.

$phpAds_insert_delayed

MySQL lock the table when it is inserting a row. If have many visitors to your site, it could be possible phpAdsNew must wait before inserting a new row, because the database is still locked. When you use insert delayed, you don't have to wait and the row will be inserted at a later time when the table is not in use by any other thread. Another major benefit of using insert delayed is that inserts from many clients are bundled together and written in one block. This is much faster than doing many separate inserts, but could cause data corruption when the database server should crash. This option is turned off by default.

phpAdsNew configuration

phpAdsNew needs to know a few things about the system you are using in order to function correctly, for example the location of phpAdsNew.

$phpAds_url_prefix

phpAdsNew needs to know where it is located on the web server in order to work correctly. You must specify the URL to the directory where phpAdsNew is installed, for example: http://www.your-url.com/phpAdsNew

$phpAds_my_header
$phpAds_my_footer

You should put here the path to the header files (e.g.: /home/login/www/header.htm) to have a header and/or footer on each page in the admin interface. You can put either text or html in these files (if you want to use html in one or both of these files do not use tags like <body> or <html>)

$phpAds_language

Specify the default language phpAdsNew should use. This language will be used as a default for the admin and client interface. Please note: you can set a different language for each client from the admin interface and allow clients to change their language themselves.

phpAdsNew currently supports these languages:
czech, dutch, english, flemish, french, german, hungarian, italian, polish, russian-cp1251, russian-koi8r and spanish.

$phpAds_name

Specify the name you want to use for this application. This string will be displayed on all pages in the admin and client interface.

$phpAds_company_name

This name is used in the e-mail sent by phpAdsNew.

Statistics and logging

$phpAds_compact_stats

Traditionally phpAdsNew used rather extensive logging, which was very detailed but was also very demanding on the database server. This could be a big problem on sites with a lot of visitors. Since version 1.9 phpAdsNew uses a new kind of statistics, the compact statistics, which is less demanding on the database server, but also less detailed. The compact statistics only logs daily statistics, if you need hourly statistics you can turn the compact statistics off.

$phpAds_log_adviews

Normally all AdViews are logged, if you don't want to gather statistics about AdViews you can turn this off.

$phpAds_log_adclicks

Normally all AdClicks are logged, if you don't want to gather statistics about AdClicks you can turn this off.

$phpAds_reverse_lookup

phpAdsNew logs the ip address of each visitor by default. If you want phpAdsNew to log domain names you should turn this on. Reverse lookup does take some time; it will slow everything down.

$phpAds_ignore_hosts

If you don't want to count clicks and views from certain computer you can add these to this array. If you have enabled reverse lookup you can add both domain names and ip addresses, otherwise you can only use ip addresses. You can also use wildcards (i.e. '*.altavista.com' or '192.168.*').

$phpAds_begin_of_week

For most people a week starts on a Monday, but if you want to start each week on a Sunday you can.

$phpAds_percentage_decimals

Specifies how many decimal places to display on statistics pages.

$phpAds_warn_admin

phpAdsNew can sent you e-mail if a client has only a limited number of clicks or views left. This is turned on by default.

$phpAds_warn_client

phpAdsNew can sent the client e-mail if he has only a limited number of clicks or views left. This is turned on by default.

$phpAds_warn_limit

The limit on which phpAdsNew starts sending warning e-mails. This is 100 by default.

Banner retrieval

$phpAds_random_retrieve

phpAdsNew can use four different types of banner retrieval: Random banner retrieval (0, default), Normal sequential banner retrieval (1), Weight based sequential banner retrieval (2) and Full sequential banner retrieval (3).

For example, you have set 4 banners in phpAdsNew and the second banner is weight 2 (rest of the banners is weight 1):

Random banner retrieval: 1312312331231231231232312314121312
Normal sequential banner retrieval: 1234 3214 4213 2314 3241
Weight based sequential banner retrieval: 12324 43122 31221 21342 42321
Full sequential banner retrieval: 1234 1234 1234 1234 1234

$phpAds_con_key

phpAdsNew includes a powerful banner retrieval system. For more information, please read the API section. With this option, you can activate conditional keywords. This is turned on by default.

$phpAds_mult_key

For each banner, you can specify one or more keywords. This option is needed if you want to specify more than one keyword. This is turned on by default.

$phpAds_acl

If you are not using ACL's you can disable ACL checking with this parameter, this will speed up phpAdsNew. If you have disabled ACL's with this parameter you can't modify ACL settings from the admin interface.

$phpads_default_banner_url
$phpads_default_banner_target

If phpAdsNew can't connect to the database server, or can't find any matching banners at all, for example when the database crashed or was deleted, it won't display anything. Some users may want to specify a default banner, which will be displayed in these situations. The default banner specified here will not be logged and won't be used if there are still active banners left in the database. Be aware this default banner should only be used as a failsafe, not as a regular banner. This is turned off by default.

Banner storage and types

$phpAds_type_sql_allow
$phpAds_type_web_allow
$phpAds_type_url_allow
$phpAds_type_html_allow

phpAdsNew can use different types of banners and store them in different ways. The first two options are used for local storage of banners. You can use the admin interface to upload a banner and phpAdsNew will store the banner in the SQL database (option 1) or on a webserver (option 2). You can also use a banner stored on a different webserver (option 3) or use html to generate a banner (option 4). You can disable any one of these types by altering these settings. By default all bannertypes are turned on.

If you disable a certain banner type while there are still banners available of the this type, phpAdsNew will allow the use of these banners, but will not allow the creation of new banners of this type.

$phpAds_type_web_mode

If you want to use banners stored on the webserver, you need to configure this setting. If you want to store the banners in a local directory set this option to 0. If you want to store the banner on an external FTP server set this option to 1. On certain webservers you may want to use the FTP option even on the local webserver.

$phpAds_type_web_dir

Specify the directory where phpAdsNew needs to copy the uploaded banners to. This directory needs to be writable for PHP, this could mean you need to modify the UNIX permissions for this directory (chmod). The directory you specify here needs to be in the webserver' document root, the webserver must be able to serve the files directly. Do not specify a trailing slash (/). You only need to configure this option if you have set $phpAds_type_web_mode to 0.

$phpAds_type_web_ftp

Specify the FTP server where phpAdsNew needs to copy the uploaded banners to. The directory you specify here needs to be in the webserver' document root, the webserver must be able to serve the files directly. The URL you specify here can include an username, a password, the server name and the path.

ftp://phpads:1234@ftp.phpads.com/www/ads

phpAdsNew will try to log in using username "phpads", password "1234" on the ftp server called "ftp.phpads.com" and will try to upload the banners in the directory "www/ads". If you don't specify a directory phpAdsNew will upload the banner to the root directory of the FTP server. If you don't specify a username and password phpAdsNew will try to login as an anonymous user with the administrators e-mail address. It is not recommended to store you banners on an FTP server which can be accessed by anonymous users!!! Do not specify a trailing slash (/). You only need to configure this option if you have set $phpAds_type_web_mode to 1.

$phpAds_type_web_url

If you store banners on a webserver, phpAdsNew needs to know which public URL corresponds with the directory you specifed above. Do not specify a trailing slash(/). You need to configure this option if you have set $phpAds_type_web_mode to 0 or 1.

Administrator configuration

$phpAds_admin

The administrator username, you can specify the username that you can use to log into the administrator interface.

$phpAds_admin_pw

The administrator password, you can specify the password that you can use to log into the administrator interface.

$phpAds_admin_fullname

Specify the administrator's full name. This used when sending statistics via email.

$phpAds_admin_email

The administrator's e-mail address. This is used as from-address when sending statistics via email.

$phpAds_admin_email_headers

You can alter the e-mail headers used by the e-mails which phpAdsNew sends.