phpPgAds  Home 

 

 

 

  2.2Configuration 

 

Please read first the INSTALL file for installation instructions. If you are upgrading from a previous version of phpPgAds you should read the UPGRADE file for instructions.
In the current release, you have to configure all your information in config.inc.php.

 
  
  2.2.1Database configuration 

 


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

$phpAds_hostname
Specify the hostname of the PostgreSQL database server.


$phpAds_pgsqluser

Specify the username which phpPgAds must use to gain access to the PostgreSQL database server.


$phpAds_pgsqlpassword

Specify the password which phpPgAds must use to gain access to the PostgreSQL database server.


$phpAds_tbl_adclicks, $phpAds_tbl_adviews, $phpAds_tbl_adstats, $phpAds_tbl_banners
$phpAds_tbl_clients, $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; phpPgAds 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 phpPgAds considerably, but requires a lot of resources. If phpPgAds is using too many resources, you should take a look at this setting first. Persistent connections are turned off by default.

 

 
  
  2.2.2phpPgAds configuration 

 


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


$phpAds_url_prefix

phpPgAds 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 phpPgAds is installed, for example: http://www.your-url.com/phpPgAds


$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 phpPgAds 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.

phpPgAds currently supports these languages:
brazilian-portuguese, czech, dutch, english, flemish, french, german, hungarian, italian, polish, romanian, 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 phpPgAds.


$phpAds_override_GD_imageformat
phpPgAds usually detects if the GD library is installed and which image format is supported by the installed version of GD. However it is possible the detection is not accurate or false, some versions of PHP do not allow the detection of the supported image formats. If phpPgAds fails to auto-detect the right image format you can specify the right image format. Possible values are: none, png, jpeg, gif

 

 
  
  2.2.3Statistics and logging 

 


$phpAds_compact_stats
Traditionally phpPgAds 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 phpPgAds 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
phpPgAds logs the IP address of each visitor by default. If you want phpPgAds 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
phpPgAds 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
phpPgAds 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 phpPgAds starts sending warning e-mails. This is 100 by default.

 

 
  
  2.2.4Banner retrieval 

 


$phpAds_random_retrieve
phpPgAds 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 phpPgAds 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
phpPgAds 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 ACLs you can disable ACL checking with this parameter, this will speed up phpPgAds. If you have disabled ACLs with this parameter you can't modify ACL settings from the admin interface.


$phpads_default_banner_url
$phpads_default_banner_target

If phpPgAds 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.

 

 
  
  2.2.5Banner storage and types 

 


$phpAds_type_sql_allow
$phpAds_type_web_allow
$phpAds_type_url_allow
$phpAds_type_html_allow

phpPgAds 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 phpPgAds will store the banner in the SQL database (option 1) or on a web server (option 2). You can also use a banner stored on a different web server (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 banner types are turned on.

If you disable a certain banner type while there are still banners available of the this type, phpPgAds 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 web server, 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 web servers you may want to use the FTP option even on the local web server.

If you want to use FTP to store banners, PHP must support at least one of three extensions, the FTP extension (best), the CURL extension or URL fopen wrappers.


$phpAds_type_web_dir
Specify the directory where phpPgAds needs to copy the uploaded banners to. This directory needs to be writable by 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 web server' document root, the web server 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 phpPgAds needs to copy the uploaded banners to. The directory you specify here needs to be in the web server' document root, the web server must be able to serve the files directly. The URL you specify here can include a username, a password, the server name and the path.

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

phpPgAds 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 phpPgAds will upload the banner to the root directory of the FTP server. If you don't specify a username and password phpPgAds 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 web server, phpPgAds needs to know which public URL corresponds with the directory you specified 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.

 

 
  
  2.2.6 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 phpPgAds sends.

 

 
   
  2.2.7 phpPgAds specific configuration  

 


$phpPgAds_timezone
The time zone Postgres will use, you can leave it blank to use default. For recognized time zones take a look at the PostgreSQL Manual. This is useful if you run a server in a different country, so you can have all stats in local time.