Source for file _advanced.php
Documentation is available at _advanced.php
* This file includes advanced settings for Quam Plures.
* Please NOTE: You should not comment variables out to prevent
if( !defined('QP_CONFIG_LOADED') ) die( 'Please, do not access this page directly.' );
* No Translation. Does nothing.
* Nevertheless, the string will be extracted by the gettext tools
* Display debugging informations?
* 2 = yes and potentially die() to display debug info (needed before redirects, e-g message_send.php)
// Most of the time you'll want to see all errors, including notices:
// QP should run notice free! (plugins too!)
{ // Hopefully temporary fix for PHP >= v5.3 (Assigning the return value of new by reference is deprecated)
// Tblue> This doesn't work properly on PHP 5.3... For some reason, you have to set error_reporting to
// the desired value in php.ini -- error_reporting() and even ini_set() fail.
// To help debugging severe errors, you'll probably want PHP to display
// the errors on screen. In this case, uncomment the following line:
// ini_set( 'display_errors', 'on' );
// If you get blank pages, or if image resizing work all the time, PHP may
// be crashing because it doesn't have enough memory. The default is 128 MB
// in PHP > 5.2 but your host might have set a lower limit for some reason.
// Try uncommenting the next line and see if your troubles go away:
// ini_set( 'memory_limit', '128M' );
* Log application errors through {@link error_log() PHP's logging facilities}?
* This means that they will get logged according to PHP's error_log configuration directive.
* Experimental! This may be changed to use regular files instead/optionally.
* @todo Provide logging into normal file instead (more useful for backtraces/multiline error messages)
* @global integer 0: off; 1: log errors; 2: include function backtraces (Default: 1)
* Thumbnail size definitions
* type, width, height, quality
$thumbnail_sizes = array(
'fit-800' => array( 'fit', 800, 1600, 80 ),
'fit-760' => array( 'fit', 760, 1520, 80 ),
'fit-720' => array( 'fit', 720, 1440, 80 ),
'fit-680' => array( 'fit', 680, 1360, 80 ),
'fit-640' => array( 'fit', 640, 1280, 80 ),
'fit-600' => array( 'fit', 600, 1200, 80 ),
'fit-560' => array( 'fit', 560, 1120, 85 ),
'fit-520' => array( 'fit', 520, 1040, 85 ),
'fit-480' => array( 'fit', 480, 960, 85 ),
'fit-440' => array( 'fit', 440, 880, 85 ),
'fit-400' => array( 'fit', 400, 800, 85 ),
'fit-360' => array( 'fit', 360, 720, 85 ),
'fit-320' => array( 'fit', 320, 640, 85 ),
'fit-280' => array( 'fit', 280, 560, 90 ),
'fit-240' => array( 'fit', 240, 480, 90 ),
'fit-200' => array( 'fit', 200, 400, 90 ),
'fit-160' => array( 'fit', 160, 320, 90 ),
'fit-120' => array( 'fit', 120, 240, 90 ),
'fit-80x160' => array( 'fit', 80, 160, 90 ),
'fit-80x80' => array( 'fit', 80, 80, 90 ),
'crop-80x80' => array( 'crop', 80, 80, 85 ),
'crop-64x64' => array( 'crop', 64, 64, 85 ),
'crop-48x48' => array( 'crop', 48, 48, 85 ),
'crop-32x32' => array( 'crop', 32, 32, 85 ),
'crop-15x15' => array( 'crop', 15, 15, 85 ),
* - Do not allow update of files in the file manager
* - Do not allow changes to the 'admin' or 'demouser' or 'demoblogger' or 'demospecial' accounts/groups
* - Blog media directories can only be configured to be inside of {@link $media_path}
* @global boolean Default: false
* URL of the Home link at the top left.
* By default this is the base url. And unless you do a complex installation, there is no need to change this.
$home_url = $app_baseurl;
* Comments: Set this to 1 to require e-mail and name, or 0 to allow comments
* @global boolean $require_name_email
* Minimum interval (in seconds) between consecutive comments from same IP.
* @global int $minimum_comment_interval
$minimum_comment_interval = 30;
* Check antispam blacklist for private messages.
* Do you want to check the antispam blocklist when a message form is submitted?
* @global boolean $antispam_on_message_form
$antispam_on_message_form = 1;
// Get hostname out of baseurl
// YOU SHOULD NOT EDIT THIS unless you know what you're doing
if( preg_match( '#^(https?://(.+?)(:(.+?))?)(/.*)$#', $app_baseurl, $matches ) )
$app_baseurlroot = $matches[1]; // no ending slash!
$basesubpath = $matches[5];
die( 'Your baseurl ('. $app_baseurl. ') set in _main_config.php seems invalid. You probably missed the "http://" prefix or the trailing slash. Please correct that.' );
* Base domain of Quam Plures.
* By default we try to extract it automagically from $basehost (itself extracted from $abaseurl)
* But you may need to adjust this manually.
* @todo does anyone have a clean way of handling stuff like .co.uk ?
$basedomain = preg_replace( '/^( .* \. )? (.+? \. .+? )$/xi', '$2', $basehost );
* Short name of this system (will be used for cookies and notification emails).
* Change this only if you install multiple Quam Plures setups on the same website.
* WARNING: don't play with this or you'll have tons of cookies sent away and your
* readers surely will complain about it!
* You can change the notification email address alone a few lines below.
* @todo generate a random instance name at install and have it saved in the global params in the DB
* @global string Default: 'quamplures'
$instance_name = 'quamplures'; // MUST BE A SINGLE WORD! NO SPACES!!
* Default email address for sending notifications (comments, trackbacks,
* user registrations...).
* Set a custom address like this:
* <code>$notify_from = 'quamplures@your_server.com';</code>
* Alternatively you can use this automated address generation (which removes "www." from
* the beginning of $basehost):
* <code>$notify_from = $instance_name.'@'.preg_replace( '/^www\./i', '', $basehost );</code>
* @global string Default: $instance_name.'@'.$basehost;
$notify_from = $instance_name. '@'. preg_replace( '/^www\./i', '', $basehost );
* Show MySQL errors? (default: true)
* This is recommended on production environments.
$app_db_config['show_errors'] = true;
* Halt on MySQL errors? (default: true)
* Setting this to false is not recommended,
$app_db_config['halt_on_error'] = true;
* DO NOT USE unless you know what you're doing -- For most options, we want to work on a table by table basis.
$app_db_config['table_options'] = ''; // Low ranking MySQL hosting compatibility Default
* Use transactions in DB?
* You need to use InnoDB in order to enable this.
$app_db_config['use_transactions'] = true;
* Display elements that are different on each request (Page processing time, ..)
* Set this to true to prevent displaying minor changing elements (like time) in order not to have artificial content changes
* @global boolean Default: false
$obhandler_debug = false;
* This is the path that will be associated to cookies.
* That means cookies set by this QP install won't be seen outside of this path on the domain below.
* @global string Default: preg_replace( '#https?://[^/]+#', '', $app_baseurl )
$cookie_path = preg_replace( '#https?://[^/]+#', '', $app_baseurl );
* That means cookies set by this QP install won't be seen outside of this domain.
* We'll take {@link $basehost} by default (the leading dot includes subdomains), but
* when there's no dot in it, at least Firefox will not set the cookie. The best
* example for having no dot in the host name is 'localhost', but it's the case for
* host names in an intranet also.
* Note: ".domain.com" cookies will be sent to sub.domain.com too.
* But, see http://www.faqs.org/rfcs/rfc2965:
* "If multiple cookies satisfy the criteria above, they are ordered in
* the Cookie header such that those with more specific Path attributes
* precede those with less specific. Ordering with respect to other
* attributes (e.g., Domain) is unspecified."
* @global string Default: ( strpos($basehost, '.') ) ? '.'. $basehost : '';
if( strpos($basehost, '.') === false )
{ // localhost or windows machine name:
elseif( preg_match( '~^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$~i', $basehost ) )
{ // Use the basehost as it is:
$cookie_domain = $basehost;
$cookie_domain = preg_replace( '/^(www\. )? (.+)$/xi', '.$2', $basehost );
// When hosting multiple domains (not just subdomains) on a single instance of QP,
// you may want to try this:
// $cookie_domain = '.'.$_SERVER['HTTP_HOST'];
// or this: -- Have a cookie domain of 2 levels only, base on current basehost.
// $cookie_domain = preg_replace( '/^( .* \. )? (.+? \. .+? )$/xi', '.$2', $basehost );
// fp> pb with domains like .co.uk !?
// The following remember the comment meta data for non registered users:
$cookie_name = 'cookie'. $instance_name. 'name';
$cookie_email = 'cookie'. $instance_name. 'email';
$cookie_url = 'cookie'. $instance_name. 'url';
// The following handles the session:
$cookie_session = 'cookie'. $instance_name. 'session';
* Expiration for comment meta data cookies.
* Note: user sessions use different settings (config in admin)
* Value in seconds, set this to 0 if you wish to use non permanent cookies (erased when browser is closed).
* Default: time() + 31536000 (one year from now)
* @global int $cookie_expires
$cookie_expires = time() + 31536000;
* Expired-time used to erase comment meta data cookies.
* Note: user sessions use different settings (config in admin)
* Default: time() - 86400 (24 hours ago)
* @global int $cookie_expired
$cookie_expired = time() - 86400;
// ** Location of the Quam Plures subdirectories **
- You should only move these around if you really need to.
- You should keep everything as subdirectories of the base folder
($app_baseurl which is set in _main_config.php, default is the /blogs/ folder)
- Remember you can set the baseurl to your website root (-> _main_config.php).
NOTE: All paths must have a trailing slash!
Example of a possible setting:
$conf_subdir = 'settings/quamplures/'; // Subdirectory relative to base
$conf_subdir = '../../'; // Relative path to go back to base
* Location of the configuration files.
* Note: This folder NEEDS to by accessible by PHP only.
* @global string $conf_subdir
$conf_subdir = 'qp_config/'; // Subdirectory relative to base
* @global string Path of the base.
* fp> made [i]nsensitive to case because of Windows URL oddities)
$basepath = preg_replace( '#/'. $conf_subdir. '$#i', '', $conf_path ). '/';
* Location of the include folder.
* Note: This folder NEEDS to by accessible by PHP only.
* @global string $inc_subdir
$inc_subdir = 'qp_inc/'; // Subdirectory relative to base
$inc_path = $basepath. $inc_subdir; // You should not need to change this
$misc_inc_path = $inc_path. '_misc/'; // You should not need to change this
* Location of the html SeRViCes *and* xml SeRViCes folder.
* Note: This folder NEEDS to by accessible through HTTP.
* @global string $srvc_subdir
$srvc_subdir = 'qp_srvc/'; // Subdirectory relative to base
$srvc_path = $basepath. $srvc_subdir; // You should not need to change this
$srvc_url = $app_baseurl. $srvc_subdir; // You should not need to change this
* Sensitive URL to the srvc folder.
* Set this separately (based on {@link $srvc_url}), if you want to use
* SSL for login, registration and profile updates (where passwords are
* involved), but not for the whole srvc scripts.
$srvc_url_sensitive = $srvc_url;
* Location of the RSC folder.
* Note: This folder NEEDS to by accessible through HTTP.
* @global string $rsc_subdir
$rsc_subdir = 'qp_rsc/'; // Subdirectory relative to base
$rsc_path = $basepath. $rsc_subdir; // You should not need to change this
$rsc_url = $app_baseurl. $rsc_subdir; // You should not need to change this
* Location of the templates folder.
* @global string $templates_subdir
$templates_subdir = 'qp_templates/'; // Subdirectory relative to base
$templates_path = $basepath. $templates_subdir; // You should not need to change this
$templates_url = $app_baseurl. $templates_subdir; // You should not need to change this
* Location of the admin interface dispatcher
$dispatcher = 'admin.php'; // DEPRECATED
$admin_url = $app_baseurl. $dispatcher;
* Location of the admin templates folder.
* Note: This folder NEEDS to by accessible by both PHP AND through HTTP.
* @global string $admintemplates_subdir
$admintemplates_subdir = 'qp_view_admin/'; // Subdirectory relative to ADMIN
$admintemplates_path = $basepath. $admintemplates_subdir; // You should not need to change this
$admintemplates_url = $app_baseurl. $admintemplates_subdir; // You should not need to change this
* Location of the locales folder.
* Note: This folder NEEDS to by accessible by PHP AND MAY NEED to be accessible through HTTP.
* Exact requirements depend on future uses like localized icons.
* @global string $locales_subdir
$locales_subdir = 'qp_locales/'; // Subdirectory relative to base
$locales_path = $basepath. $locales_subdir; // You should not need to change this
* Location of the plugins.
* Note: This folder NEEDS to by accessible by PHP AND MAY NEED to be accessible through HTTP.
* Exact requirements depend on installed plugins.
* @global string $plugins_subdir
$plugins_subdir = 'qp_plugins/'; // Subdirectory relative to base
$plugins_path = $basepath. $plugins_subdir; // You should not need to change this
$plugins_url = $app_baseurl. $plugins_subdir; // You should not need to change this
* Location of the install folder.
* @global string $install_subdir
$install_subdir = 'qp_install/'; // Subdirectory relative to base
* Location of the rendered page cache folder.
* Note: This folder does NOT NEED to be accessible through HTTP.
* This folder MUST be writable by PHP.
* @global string $cache_subdir
$cache_subdir = 'qp_cache/'; // Subdirectory relative to base
$cache_path = $basepath. $cache_subdir; // You should not need to change this
* Location of the root media folder.
* Note: This folder MAY or MAY NOT NEED to be accessible by PHP AND/OR through HTTP.
* Exact requirements depend on $public_access_to_media .
* @global string $media_subdir
$media_subdir = 'media/'; // Subdirectory relative to base
$media_path = $basepath. $media_subdir; // You should not need to change this
$media_url = $app_baseurl. $media_subdir; // You should not need to change this
* Do you want to allow public access to the media dir?
* WARNING: If you set this to false, Quam Plures will use /qp_srvc/getfile.php as a stub
* to access files and getfile.php will check the User permisssion to view files.
* HOWEVER this will not prevent users from hitting directly into the media folder
* with their web browser. You still need to restrict access to the media folder
$public_access_to_media = true;
* File extensions that the admin will not be able to enable in the Settings
$force_upload_forbiddenext = array( 'cgi', 'exe', 'htaccess', 'htpasswd', 'php', 'php3', 'php4', 'php5', 'php6', 'phtml', 'pl', 'vbs' );
* Admin can configure max file upload size, but he won't be able to set it higher than this "max max" value.
$upload_maxmaxkb = 10000;
* The admin can configure the regexp for valid file names in the Settings interface
* However if the following values are set to non empty, the admin will not be able to customize these values.
$force_regexp_filename = '';
$force_regexp_dirname = '';
* XMLRPC logging. Set this to 1 to log XMLRPC calls received by this server (into /qp_srvc/xmlrpc.log).
* @global int $debug_xmlrpc_logging
$debug_xmlrpc_logging = 0;
* Seconds after which a scheduled task is considered to be timed out.
$cron_timeout_delay = 1800; // 30 minutes
* Enable a workaround to allow accessing posts with URL titles ending with
* a dash (workaround for old bug).
* In b2evolution v2.4.5 new tag URLs were introduced: You could choose
* to have tag URLs ending with a dash. This lead to problems with post
* URL titles accidentially ending with a dash (today, URL titles cannot
* end with a dash anymore): Instead of displaying the post, the post
* title was handled as a tag name. When this setting is enabled, all tag
* names which are exactly 40 chars long and end with a dash are handled
* Try to find a post with the given tag name as the URL title. If there
* is a matching post, display it; otherwise, display the normal tag page.
* Note: If you use a 39 chars-long tag name, have an URL title which is
* the same as the tag *but* additionally has a dash at the end and you
* use the dash as a tag URL "marker", you won't be able to access either
* the post or the tag page, depending on the value of this setting.
* @global boolean $tags_dash_fix
* @internal Tblue> We perhaps should notify the user if we detect bogus
* post URLs (check on upgrade?) and recommend enabling
|