phpDocumentor pond
[ class tree: pond ] [ index: pond ] [ all elements ]

Source for file _advanced.php

Documentation is available at _advanced.php

  1. <?php
  2. /**
  3.  * This file includes advanced settings for Quam Plures.
  4.  *
  5.  * Please NOTE: You should not comment variables out to prevent
  6.  * URL overrides.
  7.  *
  8.  * @package pond
  9.  */
  10. if!defined('QP_CONFIG_LOADED') ) die'Please, do not access this page directly.' );
  11.  
  12. /**
  13.  * No Translation. Does nothing.
  14.  *
  15.  * Nevertheless, the string will be extracted by the gettext tools
  16.  */
  17. function NT_$string )
  18. {
  19.     return $string;
  20. }
  21.  
  22. /**
  23.  * Display debugging informations?
  24.  *
  25.  * 0 = no
  26.  * 1 = yes
  27.  * 2 = yes and potentially die() to display debug info (needed before redirects, e-g message_send.php)
  28.  *
  29.  * @global integer 
  30.  */
  31. $debug 0;
  32.  
  33. // Most of the time you'll want to see all errors, including notices:
  34. // QP should run notice free! (plugins too!)
  35. ifdefined'E_DEPRECATED' ) )
  36. {
  37.     error_reportingE_ALL );
  38. }
  39. else
  40. {    // Hopefully temporary fix for PHP >= v5.3 (Assigning the return value of new by reference is deprecated)
  41.     // Tblue> This doesn't work properly on PHP 5.3... For some reason, you have to set error_reporting to
  42.     // the desired value in php.ini -- error_reporting() and even ini_set() fail.
  43.     error_reportingE_ALL ~E_DEPRECATED );
  44. }
  45.  
  46. // To help debugging severe errors, you'll probably want PHP to display
  47. // the errors on screen. In this case, uncomment the following line:
  48. // ini_set( 'display_errors', 'on' );
  49.  
  50. // If you get blank pages, or if image resizing work all the time, PHP may
  51. // be crashing because it doesn't have enough memory. The default is 128 MB
  52. // in PHP > 5.2 but your host might have set a lower limit for some reason.
  53. // Try uncommenting the next line and see if your troubles go away:
  54. // ini_set( 'memory_limit', '128M' );
  55.  
  56.  
  57. /**
  58.  * Log application errors through {@link error_log() PHP's logging facilities}?
  59.  *
  60.  * This means that they will get logged according to PHP's error_log configuration directive.
  61.  *
  62.  * Experimental! This may be changed to use regular files instead/optionally.
  63.  *
  64.  * @todo Provide logging into normal file instead (more useful for backtraces/multiline error messages)
  65.  *
  66.  * @global integer 0: off; 1: log errors; 2: include function backtraces (Default: 1)
  67.  */
  68. $log_app_errors 1;
  69.  
  70.  
  71. /**
  72.  * Thumbnail size definitions
  73.  *
  74.  * type, width, height, quality
  75.  */
  76. $thumbnail_sizes array(
  77.             'fit-800' => array'fit'800160080 ),
  78.             'fit-760' => array'fit'760152080 ),
  79.             'fit-720' => array'fit'720144080 ),
  80.             'fit-680' => array'fit'680136080 ),
  81.             'fit-640' => array'fit'640128080 ),
  82.             'fit-600' => array'fit'600120080 ),
  83.             'fit-560' => array'fit'560112085 ),
  84.             'fit-520' => array'fit'520104085 ),
  85.             'fit-480' => array'fit'48096085 ),
  86.             'fit-440' => array'fit'44088085 ),
  87.             'fit-400' => array'fit'40080085 ),
  88.             'fit-360' => array'fit'36072085 ),
  89.             'fit-320' => array'fit'32064085 ),
  90.             'fit-280' => array'fit'28056090 ),
  91.             'fit-240' => array'fit'24048090 ),
  92.             'fit-200' => array'fit'20040090 ),
  93.             'fit-160' => array'fit'16032090 ),
  94.             'fit-120' => array'fit'12024090 ),
  95.             'fit-80x160' => array'fit'8016090 ),
  96.             'fit-80x80' => array'fit'808090 ),
  97.             'crop-80x80' => array'crop'808085 ),
  98.             'crop-64x64' => array'crop'646485 ),
  99.             'crop-48x48' => array'crop'484885 ),
  100.             'crop-32x32' => array'crop'323285 ),
  101.             'crop-15x15' => array'crop'151585 ),
  102.     );
  103.  
  104.  
  105. /**
  106.  * Demo mode
  107.  *  - Do not allow update of files in the file manager
  108.  *  - Do not allow changes to the 'admin' or 'demouser' or 'demoblogger' or 'demospecial' accounts/groups
  109.  *  - Blog media directories can only be configured to be inside of {@link $media_path}
  110.  * @global boolean Default: false
  111.  */
  112. $demo_mode false;
  113.  
  114.  
  115. /**
  116.  * URL of the Home link at the top left.
  117.  *
  118.  * By default this is the base url. And unless you do a complex installation, there is no need to change this.
  119.  */
  120. $home_url $app_baseurl;
  121.  
  122.  
  123. /**
  124.  * Comments: Set this to 1 to require e-mail and name, or 0 to allow comments
  125.  * without e-mail/name.
  126.  * @global boolean $require_name_email 
  127.  */
  128. $require_name_email 1;
  129.  
  130. /**
  131.  * Minimum interval (in seconds) between consecutive comments from same IP.
  132.  * @global int $minimum_comment_interval 
  133.  */
  134. $minimum_comment_interval 30;
  135.  
  136.  
  137. /**
  138.  * Check antispam blacklist for private messages.
  139.  *
  140.  * Do you want to check the antispam blocklist when a message form is submitted?
  141.  *
  142.  * @global boolean $antispam_on_message_form 
  143.  */
  144. $antispam_on_message_form 1;
  145.  
  146.  
  147. // Get hostname out of baseurl
  148. // YOU SHOULD NOT EDIT THIS unless you know what you're doing
  149. ifpreg_match'#^(https?://(.+?)(:(.+?))?)(/.*)$#'$app_baseurl$matches ) )
  150. {
  151.     $app_baseurlroot $matches[1]// no ending slash!
  152.     $basehost $matches[2];
  153.     $baseport =  $matches[4];
  154.     $basesubpath =  $matches[5];
  155. }
  156. else
  157. {
  158.     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.' );
  159. }
  160.  
  161.  
  162. /**
  163.  * Base domain of Quam Plures.
  164.  *
  165.  * By default we try to extract it automagically from $basehost (itself extracted from $abaseurl)
  166.  * But you may need to adjust this manually.
  167.  *
  168.  * @todo does anyone have a clean way of handling stuff like .co.uk ?
  169.  *
  170.  * @global string 
  171.  */
  172. $basedomain preg_replace'/^( .* \. )? (.+? \. .+? )$/xi''$2'$basehost );
  173.  
  174.  
  175. /**
  176.  * Short name of this system (will be used for cookies and notification emails).
  177.  *
  178.  * Change this only if you install multiple Quam Plures setups on the same website.
  179.  *
  180.  * WARNING: don't play with this or you'll have tons of cookies sent away and your
  181.  * readers surely will complain about it!
  182.  *
  183.  * You can change the notification email address alone a few lines below.
  184.  *
  185.  * @todo generate a random instance name at install and have it saved in the global params in the DB
  186.  *
  187.  * @global string Default: 'quamplures'
  188.  */
  189. $instance_name 'quamplures'// MUST BE A SINGLE WORD! NO SPACES!!
  190.  
  191.  
  192. /**
  193.  * Default email address for sending notifications (comments, trackbacks,
  194.  * user registrations...).
  195.  *
  196.  * Set a custom address like this:
  197.  * <code>$notify_from = 'quamplures@your_server.com';</code>
  198.  *
  199.  * Alternatively you can use this automated address generation (which removes "www." from
  200.  * the beginning of $basehost):
  201.  * <code>$notify_from = $instance_name.'@'.preg_replace( '/^www\./i', '', $basehost );</code>
  202.  *
  203.  * @global string Default: $instance_name.'@'.$basehost;
  204.  */
  205. $notify_from $instance_name.'@'.preg_replace'/^www\./i'''$basehost );
  206.  
  207.  
  208. // ** DB options **
  209.  
  210. /**
  211.  * Show MySQL errors? (default: true)
  212.  *
  213.  * This is recommended on production environments.
  214.  */
  215. $app_db_config['show_errors'true;
  216.  
  217.  
  218. /**
  219.  * Halt on MySQL errors? (default: true)
  220.  *
  221.  * Setting this to false is not recommended,
  222.  */
  223. $app_db_config['halt_on_error'true;
  224.  
  225.  
  226. /**
  227.  * CREATE TABLE options.
  228.  *
  229.  * DO NOT USE unless you know what you're doing -- For most options, we want to work on a table by table basis.
  230.  */
  231. $app_db_config['table_options''';     // Low ranking MySQL hosting compatibility Default
  232.  
  233.  
  234. /**
  235.  * Use transactions in DB?
  236.  *
  237.  * You need to use InnoDB in order to enable this.
  238.  */
  239. $app_db_config['use_transactions'true;
  240.  
  241.  
  242. /**
  243.  * Display elements that are different on each request (Page processing time, ..)
  244.  *
  245.  * Set this to true to prevent displaying minor changing elements (like time) in order not to have artificial content changes
  246.  *
  247.  * @global boolean Default: false
  248.  */
  249. $obhandler_debug false;
  250.  
  251.  
  252. // ** Cookies **
  253.  
  254. /**
  255.  * This is the path that will be associated to cookies.
  256.  *
  257.  * That means cookies set by this QP install won't be seen outside of this path on the domain below.
  258.  *
  259.  * @global string Default: preg_replace( '#https?://[^/]+#', '', $app_baseurl )
  260.  */
  261. $cookie_path preg_replace'#https?://[^/]+#'''$app_baseurl );
  262.  
  263. /**
  264.  * Cookie domain.
  265.  *
  266.  * That means cookies set by this QP install won't be seen outside of this domain.
  267.  *
  268.  * We'll take {@link $basehost} by default (the leading dot includes subdomains), but
  269.  * when there's no dot in it, at least Firefox will not set the cookie. The best
  270.  * example for having no dot in the host name is 'localhost', but it's the case for
  271.  * host names in an intranet also.
  272.  *
  273.  * Note: ".domain.com" cookies will be sent to sub.domain.com too.
  274.  * But, see http://www.faqs.org/rfcs/rfc2965:
  275.  *    "If multiple cookies satisfy the criteria above, they are ordered in
  276.  *    the Cookie header such that those with more specific Path attributes
  277.  *    precede those with less specific.  Ordering with respect to other
  278.  *    attributes (e.g., Domain) is unspecified."
  279.  *
  280.  * @global string Default: ( strpos($basehost, '.') ) ? '.'. $basehost : '';
  281.  */
  282. ifstrpos($basehost'.'=== false )
  283. {    // localhost or windows machine name:
  284.     $cookie_domain '';
  285. }
  286. elseifpreg_match'~^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$~i'$basehost ) )
  287. {    // Use the basehost as it is:
  288.     $cookie_domain $basehost;
  289. }
  290. else
  291. {
  292.     $cookie_domain preg_replace'/^(www\. )? (.+)$/xi''.$2'$basehost );
  293.  
  294.     // When hosting multiple domains (not just subdomains) on a single instance of QP,
  295.     // you may want to try this:
  296.     // $cookie_domain = '.'.$_SERVER['HTTP_HOST'];
  297.     // or this: -- Have a cookie domain of 2 levels only, base on current basehost.
  298.     // $cookie_domain = preg_replace( '/^( .* \. )? (.+? \. .+? )$/xi', '.$2', $basehost );
  299.     // fp> pb with domains like .co.uk !?
  300. }
  301.  
  302. /**#@+
  303.  * Names for cookies.
  304.  */
  305. // The following remember the comment meta data for non registered users:
  306. $cookie_name    'cookie'.$instance_name.'name';
  307. $cookie_email   'cookie'.$instance_name.'email';
  308. $cookie_url     'cookie'.$instance_name.'url';
  309. // The following handles the session:
  310. $cookie_session 'cookie'.$instance_name.'session';
  311. /**#@-*/
  312.  
  313. /**
  314.  * Expiration for comment meta data cookies.
  315.  *
  316.  * Note: user sessions use different settings (config in admin)
  317.  *
  318.  * Value in seconds, set this to 0 if you wish to use non permanent cookies (erased when browser is closed).
  319.  * Default: time() + 31536000 (one year from now)
  320.  *
  321.  * @global int $cookie_expires 
  322.  */
  323. $cookie_expires time(31536000;
  324.  
  325. /**
  326.  * Expired-time used to erase comment meta data cookies.
  327.  *
  328.  * Note: user sessions use different settings (config in admin)
  329.  *
  330.  * Default: time() - 86400 (24 hours ago)
  331.  *
  332.  * @global int $cookie_expired 
  333.  */
  334. $cookie_expired time(86400;
  335.  
  336.  
  337. // ** Location of the Quam Plures subdirectories **
  338.  
  339. /*
  340.     - You should only move these around if you really need to.
  341.     - You should keep everything as subdirectories of the base folder
  342.         ($app_baseurl which is set in _main_config.php, default is the /blogs/ folder)
  343.     - Remember you can set the baseurl to your website root (-> _main_config.php).
  344.  
  345.     NOTE: All paths must have a trailing slash!
  346.  
  347.     Example of a possible setting:
  348.         $conf_subdir = 'settings/quamplures/'; // Subdirectory relative to base
  349.         $conf_subdir = '../../';               // Relative path to go back to base
  350. */
  351. /**
  352.  * Location of the configuration files.
  353.  *
  354.  * Note: This folder NEEDS to by accessible by PHP only.
  355.  *
  356.  * @global string $conf_subdir 
  357.  */
  358. $conf_subdir 'qp_config/';                  // Subdirectory relative to base
  359. $conf_path str_replace'\\''/'dirname(__FILE__) ).'/';
  360.  
  361. /**
  362.  * @global string Path of the base.
  363.  *  fp> made [i]nsensitive to case because of Windows URL oddities)
  364.  */
  365. $basepath preg_replace'#/'.$conf_subdir.'$#i'''$conf_path ).'/';
  366.  
  367. /**
  368.  * Location of the include folder.
  369.  *
  370.  * Note: This folder NEEDS to by accessible by PHP only.
  371.  *
  372.  * @global string $inc_subdir 
  373.  */
  374. $inc_subdir 'qp_inc/';                            // Subdirectory relative to base
  375. $inc_path $basepath.$inc_subdir;                // You should not need to change this
  376. $misc_inc_path $inc_path.'_misc/';           // You should not need to change this
  377.  
  378. /**
  379.  * Location of the html SeRViCes *and* xml SeRViCes folder.
  380.  *
  381.  * Note: This folder NEEDS to by accessible through HTTP.
  382.  *
  383.  * @global string $srvc_subdir 
  384.  */
  385. $srvc_subdir 'qp_srvc/';                // Subdirectory relative to base
  386. $srvc_path $basepath.$srvc_subdir;   // You should not need to change this
  387. $srvc_url $app_baseurl.$srvc_subdir;     // You should not need to change this
  388.  
  389. /**
  390.  * Sensitive URL to the srvc folder.
  391.  *
  392.  * Set this separately (based on {@link $srvc_url}), if you want to use
  393.  * SSL for login, registration and profile updates (where passwords are
  394.  * involved), but not for the whole srvc scripts.
  395.  *
  396.  * @global string 
  397.  */
  398. $srvc_url_sensitive $srvc_url;
  399.  
  400. /**
  401.  * Location of the RSC folder.
  402.  *
  403.  * Note: This folder NEEDS to by accessible through HTTP.
  404.  *
  405.  * @global string $rsc_subdir 
  406.  */
  407. $rsc_subdir 'qp_rsc/';                    // Subdirectory relative to base
  408. $rsc_path $basepath.$rsc_subdir;       // You should not need to change this
  409. $rsc_url $app_baseurl.$rsc_subdir;         // You should not need to change this
  410.  
  411. /**
  412.  * Location of the templates folder.
  413.  * @global string $templates_subdir 
  414.  */
  415. $templates_subdir 'qp_templates/';                // Subdirectory relative to base
  416. $templates_path $basepath.$templates_subdir;   // You should not need to change this
  417. $templates_url $app_baseurl.$templates_subdir;     // You should not need to change this
  418.  
  419.  
  420. /**
  421.  * Location of the admin interface dispatcher
  422.  */
  423. $dispatcher 'admin.php'// DEPRECATED
  424. $admin_url $app_baseurl.$dispatcher;
  425.  
  426.  
  427. /**
  428.  * Location of the admin templates folder.
  429.  *
  430.  * Note: This folder NEEDS to by accessible by both PHP AND through HTTP.
  431.  *
  432.  * @global string $admintemplates_subdir 
  433.  */
  434. $admintemplates_subdir 'qp_view_admin/';         // Subdirectory relative to ADMIN
  435. $admintemplates_path $basepath.$admintemplates_subdir// You should not need to change this
  436. $admintemplates_url $app_baseurl.$admintemplates_subdir;   // You should not need to change this
  437.  
  438. /**
  439.  * Location of the locales folder.
  440.  *
  441.  * Note: This folder NEEDS to by accessible by PHP AND MAY NEED to be accessible through HTTP.
  442.  * Exact requirements depend on future uses like localized icons.
  443.  *
  444.  * @global string $locales_subdir 
  445.  */
  446. $locales_subdir 'qp_locales/';            // Subdirectory relative to base
  447. $locales_path $basepath.$locales_subdir;  // You should not need to change this
  448.  
  449. /**
  450.  * Location of the plugins.
  451.  *
  452.  * Note: This folder NEEDS to by accessible by PHP AND MAY NEED to be accessible through HTTP.
  453.  * Exact requirements depend on installed plugins.
  454.  *
  455.  * @global string $plugins_subdir 
  456.  */
  457. $plugins_subdir 'qp_plugins/';            // Subdirectory relative to base
  458. $plugins_path $basepath.$plugins_subdir;  // You should not need to change this
  459. $plugins_url $app_baseurl.$plugins_subdir;    // You should not need to change this
  460.  
  461. /**
  462.  * Location of the install folder.
  463.  * @global string $install_subdir 
  464.  */
  465. $install_subdir 'qp_install/';            // Subdirectory relative to base
  466.  
  467. /**
  468.  * Location of the rendered page cache folder.
  469.  *
  470.  * Note: This folder does NOT NEED to be accessible through HTTP.
  471.  * This folder MUST be writable by PHP.
  472.  *
  473.  * @global string $cache_subdir 
  474.  */
  475. $cache_subdir 'qp_cache/';                // Subdirectory relative to base
  476. $cache_path $basepath.$cache_subdir;   // You should not need to change this
  477.  
  478.  
  479. /**
  480.  * Location of the root media folder.
  481.  *
  482.  * Note: This folder MAY or MAY NOT NEED to be accessible by PHP AND/OR through HTTP.
  483.  * Exact requirements depend on $public_access_to_media .
  484.  *
  485.  * @global string $media_subdir 
  486.  */
  487. $media_subdir 'media/';                // Subdirectory relative to base
  488. $media_path $basepath.$media_subdir;   // You should not need to change this
  489. $media_url $app_baseurl.$media_subdir;     // You should not need to change this
  490.  
  491.  
  492. /**
  493.  * Do you want to allow public access to the media dir?
  494.  *
  495.  * WARNING: If you set this to false, Quam Plures will use /qp_srvc/getfile.php as a stub
  496.  * to access files and getfile.php will check the User permisssion to view files.
  497.  * HOWEVER this will not prevent users from hitting directly into the media folder
  498.  * with their web browser. You still need to restrict access to the media folder
  499.  * from your webserver.
  500.  *
  501.  * @global boolean 
  502.  */
  503. $public_access_to_media true;
  504.  
  505. /**
  506.  * File extensions that the admin will not be able to enable in the Settings
  507.  */
  508. $force_upload_forbiddenext array'cgi''exe''htaccess''htpasswd''php''php3''php4''php5''php6''phtml''pl''vbs' );
  509.  
  510. /**
  511.  * Admin can configure max file upload size, but he won't be able to set it higher than this "max max" value.
  512.  */
  513. $upload_maxmaxkb 10000;
  514.  
  515. /**
  516.  * The admin can configure the regexp for valid file names in the Settings interface
  517.  * However if the following values are set to non empty, the admin will not be able to customize these values.
  518.  */
  519. $force_regexp_filename '';
  520. $force_regexp_dirname '';
  521.  
  522.  
  523. /**
  524.  * XMLRPC logging. Set this to 1 to log XMLRPC calls received by this server (into /qp_srvc/xmlrpc.log).
  525.  *
  526.  * Default: 0
  527.  *
  528.  * @global int $debug_xmlrpc_logging 
  529.  */
  530. $debug_xmlrpc_logging 0;
  531.  
  532.  
  533. /**
  534.  * Seconds after which a scheduled task is considered to be timed out.
  535.  */
  536. $cron_timeout_delay 1800// 30 minutes
  537.  
  538. /**
  539.  * Enable a workaround to allow accessing posts with URL titles ending with
  540.  * a dash (workaround for old bug).
  541.  *
  542.  * In b2evolution v2.4.5 new tag URLs were introduced: You could choose
  543.  * to have tag URLs ending with a dash. This lead to problems with post
  544.  * URL titles accidentially ending with a dash (today, URL titles cannot
  545.  * end with a dash anymore): Instead of displaying the post, the post
  546.  * title was handled as a tag name. When this setting is enabled, all tag
  547.  * names which are exactly 40 chars long and end with a dash are handled
  548.  * in the following way:
  549.  * Try to find a post with the given tag name as the URL title. If there
  550.  * is a matching post, display it; otherwise, display the normal tag page.
  551.  *
  552.  * Note: If you use a 39 chars-long tag name, have an URL title which is
  553.  * the same as the tag *but* additionally has a dash at the end and you
  554.  * use the dash as a tag URL "marker", you won't be able to access either
  555.  * the post or the tag page, depending on the value of this setting.
  556.  *
  557.  * @global boolean $tags_dash_fix 
  558.  *
  559.  * @internal Tblue> We perhaps should notify the user if we detect bogus
  560.  *                   post URLs (check on upgrade?) and recommend enabling
  561.  *                   this setting.
  562.  */
  563. $tags_dash_fix 0;
  564. ?>