General parameters
Configuration files
To configure White Pages, you need to create a local configuration file named config.inc.local.php
in white-pages/conf
. For example :
<?php
// Override config.inc.php parameters below
?>
White Pages default configuration file is white-pages/conf/config.inc.php
. It includes config.inc.local.php
. Consequently, you can override all parameters in config.inc.local.php
. This prevents you to be disturbed by an upgrade.
Warning
Do not copy config.inc.php
into config.inc.local.php
, as the first one includes the second.
You would then create an infinite loop and crash your application.
Multi tenancy
You can load a specific configuration file by passing a HTTP header. This feature is disabled by default. To enable it:
$header_name_extra_config = "WP-Extra-Config";
Then if you send the header WP-Extra-Config: domain1
, the file
conf/config.inc.domain1.php
will be loaded.
Using Apache, we may set such header using the following:
<VirtualHost *:80>
ServerName wp.domain1.com
RequestHeader setIfEmpty WP-Extra-Config domain1
[...]
</VirtualHost>
Using Nginx, we could use instead:
server {
[...]
location ~ \.php {
fastcgi_param WP-Extra-Config domain1;
[...]
}
Language
Tip
Lang is selected from browser configuration. If no matching language is found, the default language is used.
Set default language in $lang
:
$lang = "en";
Available languages are:
English (en)
French (fr)
Italian (it)
Tip
You can override messages by creating lang files in conf/
, for example conf/en.inc.php
.
Dates
You can adapt how dates are displayed with specifiers (see strftime reference):
$date_specifiers = "%Y-%m-%d %H:%M:%S (%Z)";
Graphics
Logo
You change the default logo with your own. Set the path to your logo in $logo
:
$logo = "images/ltb-logo.png";
Background
You change the background image with your own. Set the path to image in $background_image
:
$background_image = "images/unsplash-space.jpeg";
Hover effect
You can define which Hover effect is applied to search result and gallery boxes:
$hover_effect = "grow";
Custom CSS
To easily customize CSS, you can use a separate CSS file:
$custom_css = "css/custom.css";
Default page
By default, the welcome page is displayed. To change this:
$default_page = "gallery";
Debug
You can turn on debug mode with $debug
:
$debug = true;
Tip
Debug messages will be printed in server logs.
This is also possible to enable Smarty debug, for web interface issues:
$smarty_debug = true;
Tip
Debug messages will appear on web interface.
Smarty
You need to define where Smarty is installed:
define("SMARTY", "/usr/share/php/smarty3/Smarty.class.php");
You can also configure cache directories:
$smarty_compile_dir = "/var/cache/white-pages/templates_c";
$smarty_cache_dir = "/var/cache/white-pages/cache";
Tip
These directories must be writable by system user running the php code.