summaryrefslogtreecommitdiff
path: root/inc/config.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/config.php')
-rw-r--r--inc/config.php1121
1 files changed, 654 insertions, 467 deletions
diff --git a/inc/config.php b/inc/config.php
index 6860ba42..54b60bf3 100644
--- a/inc/config.php
+++ b/inc/config.php
@@ -29,45 +29,53 @@
* General/misc settings
* =======================
*/
- // Blotter -- the simple version.
- //$config['blotter'] = 'This is an important announcement!';
-
- // Automatically check if a newer version of Tinyboard is available when an administrator logs in
+
+ // Global announcement -- the very simple version.
+ // This used to be wrongly named $config['blotter'] (still exists as an alias).
+ // $config['global_message'] = 'This is an important announcement!';
+ $config['blotter'] = &$config['global_message'];
+
+ // Automatically check if a newer version of Tinyboard is available when an administrator logs in.
$config['check_updates'] = true;
// How often to check for updates
$config['check_updates_time'] = 43200; // 12 hours
-
- // Shows some extra information at the bottom of pages. Good for debugging development.
+
+ // Shows some extra information at the bottom of pages. Good for development/debugging.
$config['debug'] = false;
- // For development purposes. Turns 'display_errors' on. Not recommended for production.
+ // For development purposes. Displays (and "dies" on) all errors and warnings. Turn on with the above.
$config['verbose_errors'] = true;
-
- // Directory where temporary files will be created. Not really used much yet except for some experimental stuff.
+
+ // Directory where temporary files will be created.
$config['tmp'] = sys_get_temp_dir();
-
+
// The HTTP status code to use when redirecting. http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
// Can be either 303 "See Other" or 302 "Found". (303 is more correct but both should work.)
+ // There is really no reason for you to ever need to change this.
$config['redirect_http'] = 303;
-
- // A small file in the main directory indicating that the script has been ran and the board(s) have been generated.
- // This keeps the script from querying the database and causing strain when not needed.
+
+ // A tiny text file in the main directory indicating that the script has been ran and the board(s) have
+ // been generated. This keeps the script from querying the database and causing strain when not needed.
$config['has_installed'] = '.installed';
-
+
// Use syslog() for logging all error messages and unauthorized login attempts.
$config['syslog'] = false;
-
+
// Use `host` via shell_exec() to lookup hostnames, avoiding query timeouts. May not work on your system.
// Requires safe_mode to be disabled.
$config['dns_system'] = false;
+ // When executing most command-line tools (such as `convert` for ImageMagick image processing), add this
+ // to the environment path (seperated by :).
+ $config['shell_path'] = '/usr/local/bin';
+
/*
* ====================
* Database settings
* ====================
*/
-
- // SQL driver ("mysql", "pgsql", "sqlite", "dblib", etc)
- // http://www.php.net/manual/en/pdo.drivers.php
+
+ // Database driver (http://www.php.net/manual/en/pdo.drivers.php)
+ // Only MySQL is supported by Tinyboard at the moment, sorry.
$config['db']['type'] = 'mysql';
// Hostname or IP address
$config['db']['server'] = 'localhost';
@@ -76,63 +84,77 @@
$config['db']['password'] = '';
// Tinyboard database
$config['db']['database'] = '';
+ // Table prefix
+ $config['db']['prefix'] = '';
// Use a persistent connection (experimental)
$config['db']['persistent'] = false;
// Anything more to add to the DSN string (eg. port=xxx;foo=bar)
- $config['db']['dsn'] = 'charset=UTF8';
+ $config['db']['dsn'] = '';
// Timeout duration in seconds (not all drivers support this)
$config['db']['timeout'] = 5;
-
+
/*
* ====================
* Cache settings
* ====================
*/
-
- $config['cache']['enabled'] = false;
- // $config['cache']['enabled'] = 'memcached';
- // $config['cache']['enabled'] = 'redis';
- // $config['cache']['enabled'] = 'apc';
- // $config['cache']['enabled'] = 'xcache';
-
- // Timeout for cached objects such as posts and HTML
- $config['cache']['timeout'] = 43200; // 12 hours
-
- // Optional prefix if you're running multiple Tinyboard instances on the same machine
+
+ /*
+ * On top of the static file caching system, you can enable the additional caching system which is
+ * designed to minimize SQL queries and can significantly increase speed when posting or using the
+ * moderator interface. APC is the recommended method of caching.
+ *
+ * http://tinyboard.org/docs/index.php?p=Config/Cache
+ */
+
+ $config['cache']['enabled'] = false;
+ // $config['cache']['enabled'] = 'xcache';
+ // $config['cache']['enabled'] = 'apc';
+ // $config['cache']['enabled'] = 'memcached';
+ // $config['cache']['enabled'] = 'redis';
+
+ // Timeout for cached objects such as posts and HTML.
+ $config['cache']['timeout'] = 60 * 60 * 48; // 48 hours
+
+ // Optional prefix if you're running multiple Tinyboard instances on the same machine.
$config['cache']['prefix'] = '';
-
- // Memcached servers to use - http://www.php.net/manual/en/memcached.addservers.php
+
+ // Memcached servers to use. Read more: http://www.php.net/manual/en/memcached.addservers.php
$config['cache']['memcached'] = array(
array('localhost', 11211)
);
// Redis server to use. Location, port, password, database id.
- // Note that Tinyboard may clear the database at times, so you may want to pick a
- // database id just for Tinyboard to use.
+ // Note that Tinyboard may clear the database at times, so you may want to pick a database id just for
+ // Tinyboard to use.
$config['cache']['redis'] = array('localhost', 6379, '', 1);
-
+
/*
* ====================
* Cookie settings
* ====================
*/
-
- // Used for moderation login
+
+ // Used for moderation login.
$config['cookies']['mod'] = 'mod';
+
// Used for communicating with Javascript; telling it when posts were successful.
- // Rebuild Javascript file after changing this value or it won't work.
$config['cookies']['js'] = 'serv';
- // Cookies "path". Defaults to $config['root']. If $config['root'] is a URL, you need to set this. Should be '/' or '/board/', depending on your installation.
+
+ // Cookies path. Defaults to $config['root']. If $config['root'] is a URL, you need to set this. Should
+ // be '/' or '/board/', depending on your installation.
// $config['cookies']['path'] = '/';
// Where to set the 'path' parameter to $config['cookies']['path'] when creating cookies. Recommended.
$config['cookies']['jail'] = true;
- // How long should the cookies last (in seconds)
- $config['cookies']['expire'] = 15778463; //6 months
- // Make this something long and random for security
+
+ // How long should the cookies last (in seconds). Defines how long should moderators should remain logged
+ // in (0 = browser session).
+ $config['cookies']['expire'] = 60 * 60 * 24 * 30 * 6; // ~6 months
+
+ // Make this something long and random for security.
$config['cookies']['salt'] = 'abcdefghijklmnopqrstuvwxyz09123456789!@#$%^&*()';
- // How long should moderators should remain logged in (0=browser session) (in seconds)
- $config['mod']['expire'] = 15778463; //6 months
- // Used to salt secure tripcodes (##trip) and poster IDs (if enabled)
+
+ // Used to salt secure tripcodes ("##trip") and poster IDs (if enabled).
$config['secure_trip_salt'] = ')(*&^%$#@!98765432190zyxwvutsrqponmlkjihgfedcba';
/*
@@ -140,22 +162,29 @@
* Flood/spam settings
* ====================
*/
-
- // How many seconds between each post
+
+ // Minimum time between between each post by the same IP address.
$config['flood_time'] = 10;
- // How many seconds between each post with exactly the same content and same IP
+ // Minimum time between between each post with the exact same content AND same IP address.
$config['flood_time_ip'] = 120;
- // Same as above but different IP address
+ // Same as above but by a different IP address. (Same content, not necessarily same IP address.)
$config['flood_time_same'] = 30;
-
- // DNS blacklists (DNSBL) http://tinyboard.org/docs/?p=Config/DNSBL
-
- // http://www.sectoor.de/tor.php
- $config['dnsbl'][] = array('tor.dnsbl.sectoor.de', 1); // Tor exit servers
-
+
+ /*
+ * To further prevent spam and abuse, you can use DNS blacklists (DNSBL). A DNSBL is a list of IP
+ * addresses published through the Internet Domain Name Service (DNS) either as a zone file that can be
+ * used by DNS server software, or as a live DNS zone that can be queried in real-time.
+ *
+ * Read more: http://tinyboard.org/docs/?p=Config/DNSBL
+ */
+
+ // Prevents most Tor exit nodes from making posts. Recommended, as a lot of abuse comes from Tor because
+ // of the strong anonymity associated with it.
+ $config['dnsbl'][] = array('tor.dnsbl.sectoor.de', 1);
+
// http://www.sorbs.net/using.shtml
// $config['dnsbl'][] = array('dnsbl.sorbs.net', array(2, 3, 4, 5, 6, 7, 8, 9));
-
+
// http://www.projecthoneypot.org/httpbl.php
// $config['dnsbl'][] = array('<your access key>.%.dnsbl.httpbl.org', function($ip) {
// $octets = explode('.', $ip);
@@ -170,11 +199,10 @@
//
// return true;
// }, 'dnsbl.httpbl.org'); // hide our access key
-
-
+
// Skip checking certain IP addresses against blacklists (for troubleshooting or whatever)
$config['dnsbl_exceptions'][] = '127.0.0.1';
-
+
/*
* Introduction to Tinyboard's spam filter:
*
@@ -194,14 +222,17 @@
* See also: http://tinyboard.org/docs/?p=Your_request_looks_automated
*
*/
-
- // Number of hidden fields to generate
+
+ // Number of hidden fields to generate.
$config['spam']['hidden_inputs_min'] = 4;
$config['spam']['hidden_inputs_max'] = 12;
+
// How many times can a "hash" be used to post?
$config['spam']['hidden_inputs_max_pass'] = 12;
+
// How soon after regeneration do hashes expire (in seconds)?
$config['spam']['hidden_inputs_expire'] = 60 * 60 * 3; // three hours
+
// These are fields used to confuse the bots. Make sure they aren't actually used by Tinyboard, or it won't work.
$config['spam']['hidden_input_names'] = array(
'user',
@@ -215,6 +246,7 @@
'text',
'message'
);
+
// Always update this when adding new valid fields to the post form, or EVERYTHING WILL BE DETECTED AS SPAM!
$config['spam']['valid_inputs'] = array(
'hash',
@@ -233,56 +265,18 @@
'embed',
'recaptcha_challenge_field',
'recaptcha_response_field',
- 'imgcaptcha_hash',
- 'imgcaptcha_verify',
'spoiler',
- 'quick-reply'
+ 'quick-reply',
+ 'page'
);
-
- // Custom flood filters. Detect flood attacks and reject new posts if there's a positive match.
- // See http://tinyboard.org/wiki/index.php?title=Flood_filters for more information.
- //$config['flood_filters'][] = array(
- // 'condition' => array(
- // // 100 posts in the past 5 minutes (~20 p/m)
- // 'posts_in_past_x_minutes' => array(100, 5)
- // ),
- // // Don't allow the user to post
- // 'action' => 'reject',
- // // Display this message
- // 'message' => 'Your post has been rejected on the suspicion of a flood attack on this board.'
- //);
-
- // Another filter
- //$config['flood_filters'][] = array(
- // 'condition' => array(
- // // 10 new empty threads in the past 2 minutes
- // 'threads_with_no_replies_in_past_x_minutes' => array(10, 2),
- // // Allow replies, but not new threads (ie. reject topics only).
- // 'OP' => true
- // ),
- // 'action' => 'reject',
- // 'message' => 'Your post has been rejected on the suspicion of a flood attack on this board (too many new threads); post a reply instead.'
- //);
-
- // Enable reCaptcha to make spam even harder
+
+ // Enable reCaptcha to make spam even harder. Rarely necessary.
$config['recaptcha'] = false;
+
// Public and private key pair from https://www.google.com/recaptcha/admin/create
$config['recaptcha_public'] = '6LcXTcUSAAAAAKBxyFWIt2SO8jwx4W7wcSMRoN3f';
$config['recaptcha_private'] = '6LcXTcUSAAAAAOGVbVdhmEM1_SyRF4xTKe8jbzf_';
-
- $config['imgcaptcha'] = false;
- $config['imgcaptcha_key'] = "cos losowego"; // max 32 znaki
- $config['imgcaptcha_list'] = "/sciezka/do/pliku.txt";
- $config['imgcaptcha_images'] = "/sciezka/do/obrazkow"; // without a slash at the end
- $config['imgcaptcha_question'] = "Was ist das?";
- $config['imgcaptcha_time_limit'] = 90; // Kapcza wazna przez 90 sekund po wejsciu
- $config['imgcaptcha_filler'] = "/plik/kliknijmie.png";
- $config['imgcaptcha_width'] = 128;
- $config['imgcaptcha_height'] = 96;
- // JESLI DODAJESZ IMGKAPCZE, NIE ZAPOMNIJ O TYM
- // Wymagane tez jQuery - o tam, nizej.
- //$config['additional_javascript'][] = 'js/imgcaptcha.js';
/*
* ====================
* Post settings
@@ -293,100 +287,156 @@
$config['force_body'] = false;
// Do you need a body for new threads?
$config['force_body_op'] = true;
- // Strip superfluous new lines at the end of a post
- $config['strip_superfluous_returns'] = true;
// Require an image for threads?
$config['force_image_op'] = true;
-
- // Max body length
+
+ // Strip superfluous new lines at the end of a post.
+ $config['strip_superfluous_returns'] = true;
+ // Strip combining characters from Unicode strings (eg. "Zalgo").
+ $config['strip_combining_chars'] = true;
+
+ // Maximum post body length.
$config['max_body'] = 1800;
- // Amount of post lines to show on the index page
+ // Maximum number of post body lines to show on the index page.
$config['body_truncate'] = 15;
- // Amount of characters to show on the index page
+ // Maximum number of characters to show on the index page.
$config['body_truncate_char'] = 2500;
-
- // Typically spambots try to post a lot of links. Refuse a post with X standalone links?
+
+ // Typically spambots try to post many links. Refuse a post with X links?
$config['max_links'] = 20;
- // Maximum number of cites per post (protects against abuse)
+ // Maximum number of cites per post (prevents abuse, as more citations mean more database queries).
$config['max_cites'] = 45;
- // Maximum number of cross-board links/cites per post
+ // Maximum number of cross-board links/citations per post.
$config['max_cross'] = $config['max_cites'];
-
+
// Track post citations (>>XX). Rebuilds posts after a cited post is deleted, removing broken links.
- // A little more database load.
+ // Puts a little more load on the database.
$config['track_cites'] = true;
-
- // Maximum filename length (will be truncated)
+
+ // Maximum filename length (will be truncated).
$config['max_filename_len'] = 255;
- // Maximum filename length to display (the rest can be viewed upon mouseover)
+ // Maximum filename length to display (the rest can be viewed upon mouseover).
$config['max_filename_display'] = 30;
-
- // How long before you can delete a post after posting, in seconds.
+
+ // How long after posting should you have to wait before being able to delete that post? (In seconds.)
$config['delete_time'] = 10;
- // Reply limit (stops bumping thread when this is reached)
+ // Reply limit (stops bumping thread when this is reached).
$config['reply_limit'] = 250;
-
- // Image hard limit (stops allowing new image replies when this is reached if not zero)
+
+ // Image hard limit (stops allowing new image replies when this is reached if not zero).
$config['image_hard_limit'] = 0;
- // Reply hard limit (stops allowing new replies when this is reached if not zero)
+ // Reply hard limit (stops allowing new replies when this is reached if not zero).
$config['reply_hard_limit'] = 0;
-
- // Strip repeating characters when making hashes
+
+
$config['robot_enable'] = false;
+ // Strip repeating characters when making hashes.
$config['robot_strip_repeating'] = true;
-
- // Enable mutes
- // Tinyboard uses ROBOT9000's original 2^x implementation
+ // Enabled mutes? Tinyboard uses ROBOT9000's original 2^x implementation where x is the number of times
+ // you have been muted in the past.
$config['robot_mute'] = true;
- // How many mutes x hours ago to include in the algorithm
+ // How long before Tinyboard forgets about a mute?
$config['robot_mute_hour'] = 336; // 2 weeks
- // If you want to alter the algorithm a bit. Default value is 2. n^x
- $config['robot_mute_multiplier'] = 2;
- $config['robot_mute_descritpion'] = 'You have been muted for unoriginal content.';
-
- // Automatically convert things like "..." to Unicode characters ("…")
+ // If you want to alter the algorithm a bit. Default value is 2.
+ $config['robot_mute_multiplier'] = 2; // (n^x where x is the number of previous mutes)
+ $config['robot_mute_descritpion'] = _('You have been muted for unoriginal content.');
+
+ // Automatically convert things like "..." to Unicode characters ("…").
$config['auto_unicode'] = true;
- // Whether to turn URLs into functional links
+ // Whether to turn URLs into functional links.
$config['markup_urls'] = true;
- // Prefix those functional links with some other url, for example some service for hiding referers
- // (eg. 'http://www.nullrefer.com/?', or 'http://anonym.to/?'), a pay-per-view exit page, etc.
- $config['url_ads'] = '';
-
- // Wordfilters are used to automatically replace certain words/phrases with something else.
+
+ // Optional URL prefix for links (eg. "http://anonym.to/?").
+ $config['link_prefix'] = '';
+ $config['url_ads'] = &$config['link_prefix']; // leave alias
+
+ // A wordfilter (sometimes referred to as just a "filter" or "censor") automatically scans users’ posts
+ // as they are submitted and changes or censors particular words or phrases.
+
// For a normal string replacement:
- // $config['wordfilters'][] = array('cat', 'dog');
-
+ // $config['wordfilters'][] = array('cat', 'dog');
// Advanced raplcement (regular expressions):
- // $config['wordfilters'][] = array('/cat/', 'dog', true); // 'true' means it's a regular expression
-
- // Always act as if they had typed "noko" in the email field no mattter what
+ // $config['wordfilters'][] = array('/ca[rt]/', 'dog', true); // 'true' means it's a regular expression
+
+ // Always act as if the user had typed "noko" into the email field.
$config['always_noko'] = false;
-
- // Custom tripcodes. The below example makes a tripcode
- // of "#test123" evaluate to "!HelloWorld"
+
+ // Example: Custom tripcodes. The below example makes a tripcode of "#test123" evaluate to "!HelloWorld".
// $config['custom_tripcode']['#test123'] = '!HelloWorld';
+ // Example: Custom secure tripcode.
// $config['custom_tripcode']['##securetrip'] = '!!somethingelse';
-
- // Optional spoiler images
+
+ // Allow users to mark their image as a "spoiler" when posting. The thumbnail will be replaced with a
+ // static spoiler image instead (see $config['spoiler_image']).
$config['spoiler_images'] = false;
-
-
+
// With the following, you can disable certain superfluous fields or enable "forced anonymous".
-
+
// When true, all names will be set to $config['anonymous'].
$config['field_disable_name'] = false;
- // When true, no email will be able to be set.
+ // When true, there will be no email field.
$config['field_disable_email'] = false;
- // When true, no subject will be able to be set.
+ // When true, there will be no subject field.
$config['field_disable_subject'] = false;
- // When true, no subject will be able to be set in replies.
+ // When true, there will be no subject field for replies.
$config['field_disable_reply_subject'] = false;
// When true, a blank password will be used for files (not usable for deletion).
$config['field_disable_password'] = false;
-
- // Require users to see the ban page at least once for a ban even if it has since expired?
- $config['require_ban_view'] = false;
-
+
+ // Require users to see the ban page at least once for a ban even if it has since expired.
+ $config['require_ban_view'] = true;
+
+ /*
+ * Custom filters detect certain posts and reject/ban accordingly. They are made up of a
+ * condition and an action (for when ALL conditions are met). As every single post has to
+ * be put through each filter, having hundreds probably isn’t ideal as it could slow things down.
+ *
+ * Read more: http://tinyboard.org/docs/index.php?p=Config/Filters
+ *
+ * This used to be named $config['flood_filters'] (still exists as an alias).
+ */
+
+ // An example of blocking an imaginary known spammer, who keeps posting a reply with the name "surgeon",
+ // ending his posts with "regards, the surgeon" or similar.
+ // $config['filters'][] = array(
+ // 'condition' => array(
+ // 'name' => '/^surgeon$/',
+ // 'body' => '/regards,\s+(the )?surgeon$/i',
+ // 'OP' => false
+ // ),
+ // 'action' => 'reject',
+ // 'message' => 'Go away, spammer.'
+ // );
+
+ // Same as above, but issuing a 3-hour ban instead of just reject the post.
+ // $config['filters'][] = array(
+ // 'condition' => array(
+ // 'name' => '/^surgeon$/',
+ // 'body' => '/regards,\s+(the )?surgeon$/i',
+ // 'OP' => false
+ // ),
+ // 'action' => 'ban',
+ // 'expires' => 60 * 60 * 3, // 3 hours
+ // 'reason' => 'Go away, spammer.'
+ // );
+
+ // PHP 5.3+ (anonymous functions)
+ // There is also a "custom" condition, making the possibilities of this feature pretty much endless.
+ // This is a bad example, because there is already a "name" condition built-in.
+ // $config['filters'][] = array(
+ // 'condition' => array(
+ // 'body' => '/h$/i',
+ // 'OP' => false,
+ // 'custom' => function($post) {
+ // if($post['name'] == 'Anonymous')
+ // return true;
+ // else
+ // return false;
+ // }
+ // ),
+ // 'action' => 'reject'
+ // );
+
/*
* ====================
* Markup settings
@@ -394,122 +444,160 @@
*/
// "Wiki" markup syntax ($config['wiki_markup'] in pervious versions):
- $config['markup'][] = array("/'''(.+?)'''/", "<strong>\$1</strong>");
- $config['markup'][] = array("/''(.+?)''/", "<em>\$1</em>");
- $config['markup'][] = array("/\*\*(.+?)\*\*/", "<span class=\"spoiler\">\$1</span>");
- $config['markup'][] = array("/^[ |\t]*==(.+?)==[ |\t]*$/m", "<span class=\"heading\">\$1</span>");
-
- // Highlight PHP code wrapped in <code> tags (PHP 5.3.0+)
+ $config['markup'][] = array("/'''([^<]+?)'''/", "<strong>\$1</strong>");
+ $config['markup'][] = array("/''([^<]+?)''/", "<em>\$1</em>");
+ $config['markup'][] = array("/\*\*([^<]+?)\*\*/", "<span class=\"spoiler\">\$1</span>");
+ $config['markup'][] = array("/^[ |\t]*==([^<]+?)==[ |\t]*$/m", "<span class=\"heading\">\$1</span>");
+
+ // Highlight PHP code wrapped in <code> tags (PHP 5.3+)
// $config['markup'][] = array(
// '/^&lt;code&gt;(.+)&lt;\/code&gt;/ms',
// function($matches) {
// return highlight_string(html_entity_decode($matches[1]), true);
// }
// );
-
+
/*
* ====================
* Image settings
* ====================
*/
-
- // For resizing, max thumbnail size
+
+ // For resizing, maximum thumbnail dimensions.
$config['thumb_width'] = 255;
$config['thumb_height'] = 255;
- // Max thumbnail size for thread images
+ // Maximum thumbnail dimensions for thread (OP) images.
$config['thumb_op_width'] = 255;
$config['thumb_op_height'] = 255;
-
- // Thumbnail extension, empty for inherited (png recommended)
+
+ // Thumbnail extension ("png" recommended). Leave this empty if you want the extension to be inherited
+ // from the uploaded file.
$config['thumb_ext'] = 'png';
-
- // EXPERIMENTAL:
- // Maximum amount of frames to resize (more frames means more processing power). "1" means no animated thumbnails.
- // Requires $config['thumb_ext'] to be 'gif' $config['imagick'] to be enabled.
+
+ // Maximum amount of animated GIF frames to resize (more frames can mean more processing power). A value
+ // of "1" means thumbnails will not be animated. Requires $config['thumb_ext'] to be 'gif' (or blank) and
+ // $config['thumb_method'] to be 'imagick', 'convert', or 'convert+gifsicle'. This value is not
+ // respected by 'convert'; will just resize all frames if this is > 1.
$config['thumb_keep_animation_frames'] = 1;
-
- // Thumbnailing method:
- // - 'gd' PHP GD (default). Only handles the most basic image formats (GIF, JPEG, PNG).
- // This is a prerequisite for Tinyboard no matter what method you choose.
- // - 'imagick' PHP's ImageMagick bindings. Fast and efficient, supporting many image formats.
- // A few minor bugs. http://pecl.php.net/package/imagick
- // - 'convert' The command line version of ImageMagick (`convert`). Fixes most of the bugs in
- // PHP Imagick.
- // - 'convert+gifsicle' Same as above, with the exception of using `gifsicle` (command line application)
- // instead of `convert` for resizing gifs. It's faster and resulting animated gifs
- // have less artifacts than if resized with ImageMagick.
-
+
+ /*
+ * Thumbnailing method:
+ *
+ * 'gd' PHP GD (default). Only handles the most basic image formats (GIF, JPEG, PNG).
+ * GD is a prerequisite for Tinyboard no matter what method you choose.
+ *
+ * 'imagick' PHP's ImageMagick bindings. Fast and efficient, supporting many image formats.
+ * A few minor bugs. http://pecl.php.net/package/imagick
+ *
+ * 'convert' The command line version of ImageMagick (`convert`). Fixes most of the bugs in
+ * PHP Imagick. `convert` produces the best still thumbnails and is highly recommended.
+ *
+ * 'gm' GraphicsMagick (`gm`) is a fork of ImageMagick with many improvements. It is more
+ * efficient and gets thumbnailing done using fewer resources.
+ *
+ * 'convert+gifscale'
+ * OR 'gm+gifsicle' Same as above, with the exception of using `gifsicle` (command line application)
+ * instead of `convert` for resizing GIFs. It's faster and resulting animated
+ * thumbnails have less artifacts than if resized with ImageMagick.
+ */
$config['thumb_method'] = 'gd';
+ // $config['thumb_method'] = 'convert';
+
+ // Command-line options passed to ImageMagick when using `convert` for thumbnailing. Don't touch the
+ // placement of "%s" and "%d".
+ $config['convert_args'] = '-size %dx%d %s -thumbnail %dx%d -auto-orient +profile "*" %s';
+
+ // Strip EXIF metadata from JPEG files.
+ $config['strip_exif'] = false;
+ // Use the command-line `exiftool` tool to strip EXIF metadata without decompressing/recompressing JPEGs.
+ // Ignored when $config['redraw_image'] is true. This is also used to adjust the Orientation tag when
+ // $config['strip_exif'] is false and $config['convert_manual_orient'] is true.
+ $config['use_exiftool'] = false;
- // Regular expression to check for IE MIME type detection XSS exploit. To disable, comment the line out
- // https://github.com/savetheinternet/Tinyboard/issues/20
- $config['ie_mime_type_detection'] = '/<(?:body|head|html|img|plaintext|pre|script|table|title|a href|channel|scriptlet)/i';
+ // Redraw the image to strip any excess data (commonly ZIP archives) WARNING: This might strip the
+ // animation of GIFs, depending on the chosen thumbnailing method. It also requires recompressing
+ // the image, so more processing power is required.
+ $config['redraw_image'] = false;
- // Allowed image file extensions
+ // Automatically correct the orientation of JPEG files using -auto-orient in `convert`. This only works
+ // when `convert` or `gm` is selected for thumbnailing. Again, requires more processing power because
+ // this basically does the same thing as $config['redraw_image']. (If $config['redraw_image'] is enabled,
+ // this value doesn't matter as $config['redraw_image'] attempts to correct orientation too.)
+ $config['convert_auto_orient'] = false;
+
+ // Is your version of ImageMagick or GraphicsMagick old? Older versions may not include the -auto-orient
+ // switch. This is a manual replacement for that switch. This is independent from the above switch;
+ // -auto-orrient is applied when thumbnailing too.
+ $config['convert_manual_orient'] = false;
+
+ // Regular expression to check for an XSS exploit with IE 6 and 7. To disable, set to false.
+ // Details: https://github.com/savetheinternet/Tinyboard/issues/20
+ $config['ie_mime_type_detection'] = '/<(?:body|head|html|img|plaintext|pre|script|table|title|a href|channel|scriptlet)/i';
+
+ // Allowed image file extensions.
$config['allowed_ext'][] = 'jpg';
$config['allowed_ext'][] = 'jpeg';
$config['allowed_ext'][] = 'bmp';
$config['allowed_ext'][] = 'gif';
$config['allowed_ext'][] = 'png';
// $config['allowed_ext'][] = 'svg';
-
- // Allowed additional file extensions (not images; downloadable files)
+
+ // Allowed additional file extensions (not images; downloadable files).
// $config['allowed_ext_files'][] = 'txt';
// $config['allowed_ext_files'][] = 'zip';
-
- // An alternative function for generating a filename, instead of the default UNIX timestamp.
- // http://tinyboard.org/wiki/index.php?title=Filenames
- // $config['filename_func'] = 'some_function_you_have_created';
-
- // Non-image file icons
+
+ // An alternative function for generating image filenames, instead of the default UNIX timestamp.
+ // $config['filename_func'] = function($post) {
+ // return sprintf("%s", time() . substr(microtime(), 2, 3));
+ // };
+
+ // Thumbnail to use for the non-image file uploads.
$config['file_icons']['default'] = 'file.png';
$config['file_icons']['zip'] = 'zip.png';
-
- // Thumbnail to use for the downloadable files (not images)
+ // Example: Custom thumbnail for certain file extension.
+ // $config['file_icons']['extension'] = 'some_file.png';
+
+ // Location of above images.
$config['file_thumb'] = 'static/%s';
- // Thumbnail to use for spoiler images
+ // Location of thumbnail to use for spoiler images.
$config['spoiler_image'] = 'static/spoiler.png';
-
- // Thumbnail quality (compression level), from 0 to 9
- $config['thumb_quality'] = 8;
-
- // When a thumbnailed image is going to be the same (in dimension), just copy the entire file and use that as a thumbnail instead of resizing/redrawing
+ // Location of thumbnail to use for deleted images.
+ // $config['image_deleted'] = 'static/deleted.png';
+
+ // When a thumbnailed image is going to be the same (in dimension), just copy the entire file and use
+ // that as a thumbnail instead of resizing/redrawing.
$config['minimum_copy_resize'] = false;
-
- // Store image hash in the database for r9k-like boards implementation soon
- // Function name for hashing
+
+ // Image hashing function. There's really no reason to change this.
// sha1_file, md5_file, etc. You can also define your own similar function.
$config['file_hash'] = 'sha1_file';
-
- // Maximum image upload size in bytes
- $config['max_filesize'] = 10*1024*1024; // 10MB
- // Maximum image dimensions
+
+ // Maximum image upload size in bytes.
+ $config['max_filesize'] = 10 * 1024 * 1024; // 10MB
+ // Maximum image dimensions.
$config['max_width'] = 10000;
- $config['max_height'] = $config['max_width']; // 1:1
- // Reject duplicate image uploads
+ $config['max_height'] = $config['max_width'];
+ // Reject duplicate image uploads.
$config['image_reject_repost'] = true;
- // Reject duplicate image uploads within the same thread. Doesn't change anything if image_reject_repost is true.
+ // Reject duplicate image uploads within the same thread. Doesn't change anything if
+ // $config['image_reject_repost'] is true.
$config['image_reject_repost_in_thread'] = false;
-
- // Display the aspect ratio in a post's file info
+
+ // Display the aspect ratio of uploaded files.
$config['show_ratio'] = false;
- // Display the file's original filename
+ // Display the file's original filename.
$config['show_filename']= true;
- // Image identification buttons using regex.info/exif, tineye and google images
+ // Display image identification links using regex.info/exif, TinEye and Google Images.
$config['image_identification'] = false;
-
- // Redraw the image using GD functions to strip any excess data (commonly ZIP archives)
- // WARNING: Currently strips animated GIFs too
- $config['redraw_image'] = false;
-
+
/*
* ====================
* Board settings
* ====================
*/
- // Maximum amount of threads to display on a given page.
+ // Maximum amount of threads to display per page.
$config['threads_per_page'] = 10;
// Maximum number of pages. Content past the last page is automatically purged.
$config['max_pages'] = 10;
@@ -518,14 +606,14 @@
// Same as above, but for stickied threads.
$config['threads_preview_sticky'] = 1;
- // Name of the boards. Usually '/%s/' (/b/, /mu/, etc)
- // $config['board_abbreviation'] - BOARD_TITLE
+ // How to display the URI of boards. Usually '/%s/' (/b/, /mu/, etc). This doesn't change the URL. Find
+ // $config['board_path'] if you wish to change the URL.
$config['board_abbreviation'] = '/%s/';
-
- // The default name (ie. Anonymous)
+
+ // The default name (ie. Anonymous).
$config['anonymous'] = 'Anonymous';
-
- // How many reports you can create in the same request.
+
+ // Number of reports you can create at once.
$config['report_limit'] = 3;
// Attention Whoring Bar
@@ -537,82 +625,96 @@
* Display settings
* ====================
*/
-
- // Locale (en, ru_RU.UTF-8, fi_FI.UTF-8, pl_PL.UTF-8)
- $config['locale'] = 'en';
-
- // Timezone
+
+ // Tinyboard has been translated into a few langauges. See inc/locale for available translations.
+ $config['locale'] = 'en'; // (en, ru_RU.UTF-8, fi_FI.UTF-8, pl_PL.UTF-8)
+
+ // Timezone to use for displaying dates/tiems.
$config['timezone'] = 'America/Los_Angeles';
-
- // The format string passed to strftime() for post times
+ // The format string passed to strftime() for displaying dates.
// http://www.php.net/manual/en/function.strftime.php
$config['post_date'] = '%m/%d/%y (%a) %H:%M:%S';
-
// Same as above, but used for "you are banned' pages.
$config['ban_date'] = '%A %e %B, %Y';
-
- // The names on the post buttons. (On most imageboards, these are both "Post")
- $config['button_newtopic'] = 'New Topic';
- $config['button_reply'] = 'New Reply';
-
- // Assign each poster in a thread a unique ID, shown by "ID: {id}" before the post number.
+
+ // The names on the post buttons. (On most imageboards, these are both just "Post").
+ $config['button_newtopic'] = _('New Topic');
+ $config['button_reply'] = _('New Reply');
+
+ // Assign each poster in a thread a unique ID, shown by "ID: xxxxx" before the post number.
$config['poster_ids'] = false;
- // Number of characters in the poster ID (maximum is 40)
+ // Number of characters in the poster ID (maximum is 40).
$config['poster_id_length'] = 5;
-
- // Show thread subject in page title?
+
+ // Show thread subject in page title.
$config['thread_subject_in_title'] = false;
-
- // Page footer
- $config['footer'][] = 'All trademarks, copyrights, comments, and images on this page are owned by and are the responsibility of their respective parties.';
-
- // Characters used to generate a random password (with Javascript)
+
+ // Additional lines added to the footer of all pages.
+ $config['footer'][] = _('All trademarks, copyrights, comments, and images on this page are owned by and are the responsibility of their respective parties.');
+
+ // Characters used to generate a random password (with Javascript).
$config['genpassword_chars'] = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_+';
-
- // Optional banner at the top of every page.
+
+ // Optional banner image at the top of every page.
// $config['url_banner'] = '/banner.php';
- // Banner dimensions are also optional. As the banner loads after the rest of the page, everything
- // may be shifted down a few pixels when it does. Making the banner a fixed size will prevent this.
+ // Banner dimensions are also optional. As the banner loads after the rest of the page, everything may be
+ // shifted down a few pixels when it does. Making the banner a fixed size will prevent this.
// $config['banner_width'] = 300;
// $config['banner_height'] = 100;
-
- // Custom stylesheets available. The prefix for each stylesheet URI is defined below.
- $config['stylesheets']['Yotsuba B'] = ''; // default
+
+ // Custom stylesheets available for the user to choose. See the "stylesheets/" folder for a list of
+ // available stylesheets (or create your own).
+ $config['stylesheets']['Yotsuba B'] = ''; // Default; there is no additional/custom stylesheet for this.
$config['stylesheets']['Yotsuba'] = 'yotsuba.css';
// $config['stylesheets']['Futaba'] = 'futaba.css';
-
+ // $config['stylesheets']['Dark'] = 'dark.css';
+
// The prefix for each stylesheet URI. Defaults to $config['root']/stylesheets/
// $config['uri_stylesheets'] = 'http://static.example.org/stylesheets/';
-
- // The default stylesheet to use
+
+ // The default stylesheet to use.
$config['default_stylesheet'] = array('Yotsuba B', $config['stylesheets']['Yotsuba B']);
-
- // Boardlinks
- // You can group, order and place the boardlist at the top of every page, using the following template.
- //$config['boards'] = array(
- // array('a', 'b'),
- // array('c', 'd', 'e', 'f', 'g'),
- // array('h', 'i', 'j'),
- // array('k', array('l', 'm')),
- // array('status' => 'http://status.example.org/')
- //);
-
- // Categories
- // Required for the Categories theme.
- //$config['categories'] = array(
- // 'Group Name' => array('a', 'b', 'c'),
- // 'Another Group' => array('d')
- //);
-
- // Custom_categories
- // Optional for the Categories theme. array of name => (title, url) groups for categories with non-board links.
- //$config['custom_categories'] = array(
- // 'Links' => array(
- // 'Tinyboard' => 'http://tinyboard.org',
- // 'Donate' => 'donate.html'
- // )
- //);
-
+
+ // Make stylesheet selections board-specific.
+ $config['stylesheets_board'] = false;
+
+ // Use Font-Awesome for displaying lock and pin icons, instead of the images in static/.
+ // http://fortawesome.github.io/Font-Awesome/icon/pushpin/
+ // http://fortawesome.github.io/Font-Awesome/icon/lock/
+ $config['font_awesome'] = true;
+ $config['font_awesome_css'] = 'stylesheets/font-awesome/css/font-awesome.min.css';
+
+ /*
+ * For lack of a better name, “boardlinks” are those sets of navigational links that appear at the top
+ * and bottom of board pages. They can be a list of links to boards and/or other pages such as status
+ * blogs and social network profiles/pages.
+ *
+ * "Groups" in the boardlinks are marked with square brackets. Tinyboard allows for infinite recursion
+ * with groups. Each array() in $config['boards'] represents a new square bracket group.
+ */
+
+ // $config['boards'] = array(
+ // array('a', 'b'),
+ // array('c', 'd', 'e', 'f', 'g'),
+ // array('h', 'i', 'j'),
+ // array('k', array('l', 'm')),
+ // array('status' => 'http://status.example.org/')
+ // );
+
+ // Board categories. Only used in the "Categories" theme.
+ // $config['categories'] = array(
+ // 'Group Name' => array('a', 'b', 'c'),
+ // 'Another Group' => array('d')
+ // );
+ // Optional for the Categories theme. This is an array of name => (title, url) groups for categories
+ // with non-board links.
+ // $config['custom_categories'] = array(
+ // 'Links' => array(
+ // 'Tinyboard' => 'http://tinyboard.org',
+ // 'Donate' => 'donate.html'
+ // )
+ // );
+
// Automatically remove unnecessary whitespace when compiling HTML files from templates.
$config['minify_html'] = true;
@@ -622,28 +724,31 @@
* ====================
*/
- // Additional Javascript files to include on board index and thread pages.
+ // Additional Javascript files to include on board index and thread pages. See js/ for available scripts.
$config['additional_javascript'][] = 'js/inline-expanding.js';
// $config['additional_javascript'][] = 'js/local-time.js';
-
- // Some scripts require jQuery. Check the comments in script files to see what's needed.
+
+ // Some scripts require jQuery. Check the comments in script files to see what's needed. When enabling
+ // jQuery, you should first empty the array so that "js/query.min.js" can be the first, and then re-add
+ // "js/inline-expanding.js" or else the inline-expanding script might not interact properly with other
+ // scripts.
+ // $config['additional_javascript'] = array();
// $config['additional_javascript'][] = 'js/jquery.min.js';
+ // $config['additional_javascript'][] = 'js/inline-expanding.js';
// $config['additional_javascript'][] = 'js/auto-reload.js';
+ // $config['additional_javascript'][] = 'js/post-hover.js';
+ // $config['additional_javascript'][] = 'js/style-select.js';
+
+ // Where these script files are located on the web. Defaults to $config['root'].
+ // $config['additional_javascript_url'] = 'http://static.example.org/tinyboard-javascript-stuff/';
- // Enable hiding posts. Remember to put this AFTER jQuery.
- // $config['additional_javascript'][] = 'js/post-hider.js';
-
- // Where these script files are located on the web (defaults to $config['root']).
- // $config['additional_javascript_url'] = '/js/';
-
// Compile all additional scripts into one file ($config['file_script']) instead of including them seperately.
$config['additional_javascript_compile'] = false;
-
- // Minify Javascript using http://code.google.com/p/minify/
+
+ // Minify Javascript using http://code.google.com/p/minify/.
$config['minify_js'] = false;
- // Allows js/quick-reply.js to work
- // This will make your imageboard more vulnerable to flood attacks.
+ // Allows js/quick-reply.js to work. This could make your imageboard more vulnerable to flood attacks.
$config['quick_reply'] = false;
/*
@@ -651,12 +756,12 @@
* Video embedding
* ====================
*/
-
- // Enable embedding (see below)
+
+ // Enable embedding (see below).
$config['enable_embedding'] = false;
-
+
// Custom embedding (YouTube, vimeo, etc.)
- // It's very important that you match the full string (with ^ and $) or things will not work correctly.
+ // It's very important that you match the entire input (with ^ and $) or things will not work correctly.
$config['embedding'] = array(
array(
'/^https?:\/\/(\w+\.)?youtube\.com\/watch\?v=([a-zA-Z0-9\-_]{10,11})(&.+)?$/i',
@@ -683,17 +788,17 @@
'<object style="float: left;margin: 10px 20px;" width="148" height="44"><param name="movie" value="http://vocaroo.com/player.swf?playMediaID=$2&autoplay=0"></param><param name="wmode" value="transparent"></param><embed src="http://vocaroo.com/player.swf?playMediaID=$2&autoplay=0" width="148" height="44" wmode="transparent" type="application/x-shockwave-flash"></embed></object>'
)
);
-
- // Embedding width and height
+
+ // Embedding width and height.
$config['embed_width'] = 300;
$config['embed_height'] = 246;
-
+
/*
* ====================
* Error messages
* ====================
*/
-
+
// Error messages
$config['error']['lurk'] = _('Lurk some more before posting.');
$config['error']['bot'] = _('You look like a bot.');
@@ -734,7 +839,7 @@
$config['error']['mime_exploit'] = _('MIME type detection XSS exploit (IE) detected; post discarded.');
$config['error']['invalid_embed'] = _('Couldn\'t make sense of the URL of the video you tried to embed.');
$config['error']['captcha'] = _('You seem to have mistyped the verification.');
-
+
// Moderator errors
$config['error']['toomanyunban'] = _('You are only allowed to unban %s users at a time. You tried to unban %u users.');
$config['error']['invalid'] = _('Invalid username and/or password.');
@@ -757,88 +862,89 @@
* Directory/file settings
* =========================
*/
-
+
// The root directory, including the trailing slash, for Tinyboard.
- // examples: '/', 'http://boards.chan.org/', '/chan/'
+ // Examples: '/', 'http://boards.chan.org/', '/chan/'.
if (isset($_SERVER['REQUEST_URI']))
- $config['root'] = (str_replace('\\', '/', dirname($_SERVER['REQUEST_URI'])) == '/' ? '/' : str_replace('\\', '/', dirname($_SERVER['REQUEST_URI'])) . '/');
+ $config['root'] = str_replace('\\', '/', dirname($_SERVER['REQUEST_URI'])) == '/' ? '/' : str_replace('\\', '/', dirname($_SERVER['REQUEST_URI'])) . '/';
else
$config['root'] = '/'; // CLI mode
- // The scheme and domain. This is needed to get absolute URL of some page (for instance image
- // identification buttons). If you use the CLI tools, it would be wise to override this setting.
- $config['domain'] = (isset ($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') ? "https://" : "http://";
- $config['domain'] .= isset ($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'localhost';
-
+ // The scheme and domain. This is used to get the site's absolute URL (eg. for image identification links).
+ // If you use the CLI tools, it would be wise to override this setting.
+ $config['domain'] = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') ? 'https://' : 'http://';
+ $config['domain'] .= isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'localhost';
+
// If for some reason the folders and static HTML index files aren't in the current working direcotry,
// enter the directory path here. Otherwise, keep it false.
$config['root_file'] = false;
-
+
+ // Location of files.
$config['file_index'] = 'index.html';
$config['file_page'] = '%d.html';
$config['file_mod'] = 'mod.php';
$config['file_post'] = 'post.php';
$config['file_script'] = 'main.js';
-
- // Board directory, followed by a forward-slash (/). (%s is board abbreviation)
+
+ // Board directory, followed by a forward-slash (/).
$config['board_path'] = '%s/';
-
+ // Misc directories.
$config['dir']['img'] = 'src/';
$config['dir']['thumb'] = 'thumb/';
$config['dir']['res'] = 'res/';
- // For load balancing, having a seperate server (and domain/subdomain) for serving static content is possible.
- // This can either be a directory or a URL (eg. http://static.example.org/)
- //$config['dir']['static'] = $config['root'] . 'static/';
- // Where to store the .html templates. This folder and templates must exist or fatal errors will be thrown.
+
+ // For load balancing, having a seperate server (and domain/subdomain) for serving static content is
+ // possible. This can either be a directory or a URL. Defaults to $config['root'] . 'static/'.
+ // $config['dir']['static'] = 'http://static.example.org/';
+
+ // Where to store the .html templates. This folder and the template files must exist.
$config['dir']['template'] = getcwd() . '/templates';
- // For the themes (homepages, etc.)
+ // Location of Tinyboard "themes".
$config['dir']['themes'] = getcwd() . '/templates/themes';
- // Same as above, but a URI (accessable by web interface, not locally)
+ // Same as above, but a URI (accessable by web interface).
$config['dir']['themes_uri'] = 'templates/themes';
- // Homepage directory
+ // Home directory. Used by themes.
$config['dir']['home'] = '';
-
- // Static images
- // These can be URLs OR base64 (data URI scheme)
- //$config['image_sticky'] = $config['dir']['static'] . 'sticky.gif';
- //$config['image_locked'] = $config['dir']['static'] . 'locked.gif';
- //$config['image_bumplocked'] = $config['dir']['static'] . 'sage.gif';
- //$config['image_deleted'] = $config['dir']['static'] . 'deleted.';
- //$config['image_zip'] = $config['dir']['static'] . 'zip.';
-
- // If you want to put images and other dynamic-static stuff on another (preferably cookieless) domain, you can use this:
- // This will override $config['root'] and $config['dir']['...'] directives.
- // "%s" will get replaced with $board['dir'], which usually includes a trailing slash. To avoid double slashes, you don't need
- // to put a slash after %s
+
+ // Static images. These can be URLs OR base64 (data URI scheme). These are only used if
+ // $config['font_awesome'] is false (default).
+ // $config['image_sticky'] = 'static/sticky.gif';
+ // $config['image_locked'] = 'static/locked.gif';
+ // $config['image_bumplocked'] = 'static/sage.gif'.
+
+ // If you want to put images and other dynamic-static stuff on another (preferably cookieless) domain.
+ // This will override $config['root'] and $config['dir']['...'] directives. "%s" will get replaced with
+ // $board['dir'], which includes a trailing slash.
// $config['uri_thumb'] = 'http://images.example.org/%sthumb/';
// $config['uri_img'] = 'http://images.example.org/%ssrc/';
-
- // Set custom locations for stylesheets, scripts and maybe a banner.
- // This can be good for load balancing across multiple servers or hostnames.
+
+ // Set custom locations for stylesheets and the main script file. This can be used for load balancing
+ // across multiple servers or hostnames.
// $config['url_stylesheet'] = 'http://static.example.org/style.css'; // main/base stylesheet
// $config['url_javascript'] = 'http://static.example.org/main.js';
+
+ // Website favicon.
// $config['url_favicon'] = '/favicon.gif';
+ // EXPERIMENTAL: Try not to build pages when we shouldn't have to.
+ $config['try_smarter'] = false;
+
/*
* ====================
* Mod settings
* ====================
*/
-
- // Limit how many bans can be removed via the ban list. (Set too -1 to remove limit.)
- $config['mod']['unban_limit'] = 5;
-
- // Whether or not to lock moderator sessions to the IP address that was logged in with.
+
+ // Limit how many bans can be removed via the ban list. Set to -1 for no limit.
+ $config['mod']['unban_limit'] = -1;
+
+ // Whether or not to lock moderator sessions to IP addresses. This makes cookie theft ineffective.
$config['mod']['lock_ip'] = true;
-
- // The page that is first shown when a moderator logs in. Defaults to the dashboard.
+
+ // The page that is first shown when a moderator logs in. Defaults to the dashboard (?/).
$config['mod']['default'] = '/';
-
- // Don't even display MySQL password to administrators (in the configuration page).
- $config['mod']['never_reveal_password'] = true;
-
- // Mod links (full HTML)
- // Correspond to above permission directives
+
+ // Mod links (full HTML).
$config['mod']['link_delete'] = '[D]';
$config['mod']['link_ban'] = '[B]';
$config['mod']['link_bandelete'] = '[B&amp;D]';
@@ -853,85 +959,98 @@
$config['mod']['link_bumpunlock'] = '[-Sage]';
$config['mod']['link_editpost'] = '[Edit]';
$config['mod']['link_move'] = '[Move]';
-
- // Moderator capcodes
+
+ // Moderator capcodes.
$config['capcode'] = ' <span class="capcode">## %s</span>';
-
- // Custom capcodes, by example:
- // "## Custom" becomes lightgreen, italic and bold
+
+ // "## Custom" becomes lightgreen, italic and bold:
//$config['custom_capcode']['Custom'] ='<span class="capcode" style="color:lightgreen;font-style:italic;font-weight:bold"> ## %s</span>';
-
- // "## Mod" makes everything purple, including the name and tripcode
+
+ // "## Mod" makes everything purple, including the name and tripcode:
//$config['custom_capcode']['Mod'] = array(
// '<span class="capcode" style="color:purple"> ## %s</span>',
// 'color:purple', // Change name style; optional
// 'color:purple' // Change tripcode style; optional
//);
-
- // "## Admin" makes everything red and bold, including the name and tripcode
+
+ // "## Admin" makes everything red and bold, including the name and tripcode:
//$config['custom_capcode']['Admin'] = array(
// '<span class="capcode" style="color:red;font-weight:bold"> ## %s</span>',
// 'color:red;font-weight:bold', // Change name style; optional
// 'color:red;font-weight:bold' // Change tripcode style; optional
//);
-
- // Enable IP range bans (eg. "127.*.0.1", "127.0.0.*", and "12*.0.0.1" all match "127.0.0.1").
- // A little more load on the database
+
+ // Enable IP range bans (eg. "127.*.0.1", "127.0.0.*", and "12*.0.0.1" all match "127.0.0.1"). Puts a
+ // little more load on the database
$config['ban_range'] = true;
-
- // Enable CDIR netmask bans (eg. "10.0.0.0/8" for 10.0.0.0.0 - 10.255.255.255). Useful for stopping persistent spammers.
- // Again, a little more database load.
+
+ // Enable CDIR netmask bans (eg. "10.0.0.0/8" for 10.0.0.0.0 - 10.255.255.255). Useful for stopping
+ // persistent spammers and ban evaders. Again, a little more database load.
$config['ban_cidr'] = true;
-
- // Do a DNS lookup on IP addresses to get their hostname on the IP summary page
+
+ // How often (minimum) to purge the ban list of expired bans (which have been seen). Only works when
+ // $config['cache'] is enabled and working.
+ $config['purge_bans'] = 60 * 60 * 12; // 12 hours
+
+ // Do DNS lookups on IP addresses to get their hostname for the moderator IP pages (?/IP/x.x.x.x).
$config['mod']['dns_lookup'] = true;
- // How many recent posts, per board, to show in the IP summary page
+ // How many recent posts, per board, to show in ?/IP/x.x.x.x.
$config['mod']['ip_recentposts'] = 5;
-
- // How many posts to display on the reports page
+
+ // Number of posts to display on the reports page.
$config['mod']['recent_reports'] = 10;
-
- // How many actions to show per page in the moderation log
+ // Number of actions to show per page in the moderation log.
$config['mod']['modlog_page'] = 350;
- // How many bans to show per page in the ban list
+ // Number of bans to show per page in the ban list.
$config['mod']['banlist_page'] = 350;
-
- // Number of news entries to display per page
+ // Number of news entries to display per page.
$config['mod']['news_page'] = 40;
-
- // Number of results to dispaly per page
+ // Number of results to display per page.
$config['mod']['search_page'] = 200;
-
- // How many entries to show per page in the moderator noticeboard
+ // Number of entries to show per page in the moderator noticeboard.
$config['mod']['noticeboard_page'] = 50;
- // Number of entries to summarize and display on the dashboard
+ // Number of entries to summarize and display on the dashboard.
$config['mod']['noticeboard_dashboard'] = 5;
-
- // Default public ban message
- $config['mod']['default_ban_message'] = 'USER WAS BANNED FOR THIS POST';
- // What to append to the post for public bans ("%s" is the message)
+
+ // Check public ban message by default.
+ $config['mod']['check_ban_message'] = false;
+ // Default public ban message. In public ban messages, %length% is replaced with "for x days" or
+ // "permanently" (with %LENGTH% being the uppercase equivalent).
+ $config['mod']['default_ban_message'] = _('USER WAS BANNED FOR THIS POST');
+ // $config['mod']['default_ban_message'] = 'USER WAS BANNED %LENGTH% FOR THIS POST';
+ // HTML to append to post bodies for public bans messages (where "%s" is the message).
$config['mod']['ban_message'] = '<span class="public_ban">(%s)</span>';
-
- // When moving a thread to another board and choosing to keep a "shadow thread", an automated post (with a capcode) will
- // be made, linking to the new location for the thread. "%s" will be replaced with a standard cross-board post citation (>>>/board/xxx)
+
+ // When moving a thread to another board and choosing to keep a "shadow thread", an automated post (with
+ // a capcode) will be made, linking to the new location for the thread. "%s" will be replaced with a
+ // standard cross-board post citation (>>>/board/xxx)
$config['mod']['shadow_mesage'] = 'Moved to %s.';
// Capcode to use when posting the above message.
$config['mod']['shadow_capcode'] = 'Mod';
- // Name to use when posting the above message. If false, the default board name will be used. If something else, that will be used.
+ // Name to use when posting the above message. If false, $config['anonymous'] will be used.
$config['mod']['shadow_name'] = false;
-
- // Wait indefinitely when rebuilding everything
+
+ // PHP time limit for ?/rebuild. A value of 0 should cause PHP to wait indefinitely.
$config['mod']['rebuild_timelimit'] = 0;
-
- // PM snippet (for ?/inbox) length in characters
+
+ // PM snippet (for ?/inbox) length in characters.
$config['mod']['snippet_length'] = 75;
-
- // Edit raw HTML in posts by default
+
+ // Edit raw HTML in posts by default.
$config['mod']['raw_html_default'] = false;
-
- // Automatically dismiss all reports regarding a thread when it is locked
+
+ // Automatically dismiss all reports regarding a thread when it is locked.
$config['mod']['dismiss_reports_on_lock'] = true;
-
+
+ // Replace ?/config with a simple text editor for editing inc/instance-config.php.
+ $config['mod']['config_editor_php'] = false;
+
+/*
+ * ====================
+ * Mod permissions
+ * ====================
+ */
+
// Probably best not to change these:
if (!defined('JANITOR')) {
define('JANITOR', 0, true);
@@ -939,31 +1058,24 @@
define('ADMIN', 2, true);
define('DISABLED', 3, true);
}
-
-/*
- * ====================
- * Mod permissions
- * ====================
- */
-
- // Capcode permissions
+
+ // Capcode permissions.
$config['mod']['capcode'] = array(
// JANITOR => array('Janitor'),
- MOD => array('Mod'),
+ MOD => array('Mod'),
ADMIN => true
);
-
+
// Example: Allow mods to post with "## Moderator" as well
// $config['mod']['capcode'][MOD][] = 'Moderator';
-
// Example: Allow janitors to post with any capcode
// $config['mod']['capcode'][JANITOR] = true;
-
- // Set any of the below to "DISABLED" to make them unavailable for everyone.
-
+
+ // Set any of the below to "DISABLED" to make them unavailable for everyone.
+
// Don't worry about per-board moderators. Let all mods moderate any board.
$config['mod']['skip_per_board'] = false;
-
+
/* Post Controls */
// View IP addresses
$config['mod']['show_ip'] = MOD;
@@ -1002,8 +1114,8 @@
// Bypass flood check
$config['mod']['flood'] = ADMIN;
// Raw HTML posting
- $config['mod']['rawhtml'] = MOD;
-
+ $config['mod']['rawhtml'] = ADMIN;
+
/* Administration */
// View the report queue
$config['mod']['reports'] = JANITOR;
@@ -1015,8 +1127,8 @@
$config['mod']['view_banlist'] = MOD;
// View the username of the mod who made a ban
$config['mod']['view_banstaff'] = MOD;
- // If the moderator doesn't fit the $config['mod']['view_banstaff''] (previous) permission,
- // show him just a "?" instead. Otherwise, it will be "Mod" or "Admin"
+ // If the moderator doesn't fit the $config['mod']['view_banstaff''] (previous) permission, show him just
+ // a "?" instead. Otherwise, it will be "Mod" or "Admin".
$config['mod']['view_banquestionmark'] = false;
// Show expired bans in the ban list (they are kept in cache until the culprit returns)
$config['mod']['view_banexpired'] = true;
@@ -1048,8 +1160,10 @@
$config['mod']['createusers'] = ADMIN;
// View the moderation log
$config['mod']['modlog'] = ADMIN;
- // View relevant moderation log entries on IP address pages (ie. ban history, etc.)
- // Warning: Can be pretty resource exhaustive if your mod logs are huge.
+ // View IP addresses of other mods in ?/log
+ $config['mod']['show_ip_modlog'] = ADMIN;
+ // View relevant moderation log entries on IP address pages (ie. ban history, etc.) Warning: Can be
+ // pretty resource intensive if your mod logs are huge.
$config['mod']['modlog_ip'] = MOD;
// Create a PM (viewing mod usernames)
$config['mod']['create_pm'] = JANITOR;
@@ -1059,6 +1173,9 @@
$config['mod']['rebuild'] = ADMIN;
// Search through posts, IP address notes and bans
$config['mod']['search'] = JANITOR;
+ // Allow searching posts (can be used with board configuration file to disallow searching through a
+ // certain board)
+ $config['mod']['search_posts'] = JANITOR;
// Read the moderator noticeboard
$config['mod']['noticeboard'] = JANITOR;
// Post to the moderator noticeboard
@@ -1075,15 +1192,70 @@
$config['mod']['news_custom'] = ADMIN;
// Delete news entries
$config['mod']['news_delete'] = ADMIN;
-
- // View the current configuration
- $config['mod']['show_config'] = ADMIN;
+ // Execute un-filtered SQL queries on the database (?/debug/sql)
+ $config['mod']['debug_sql'] = DISABLED;
// Edit the current configuration (via web interface)
$config['mod']['edit_config'] = ADMIN;
+
+ // Config editor permissions
+ $config['mod']['config'] = array(
+ JANITOR => false,
+ MOD => false,
+ ADMIN => false,
+ DISABLED => false,
+ );
+
+ // Disable the following configuration variables from being changed via ?/config. The following default
+ // banned variables are considered somewhat dangerous.
+ $config['mod']['config'][DISABLED] = array(
+ 'mod>config',
+ 'mod>config_editor_php',
+ 'convert_args',
+ 'db>password',
+ );
- // Execute un-filtered SQL queries on the database (?/debug/sql)
- $config['mod']['debug_sql'] = DISABLED;
+ $config['mod']['config'][JANITOR] = array(
+ '!', // Allow editing ONLY the variables listed (in this case, nothing).
+ );
+
+ $config['mod']['config'][MOD] = array(
+ '!', // Allow editing ONLY the variables listed (plus that in $config['mod']['config'][JANITOR]).
+ 'global_message',
+ );
+
+ // Example: Disallow ADMIN from editing (and viewing) $config['db']['password'].
+ // $config['mod']['config'][ADMIN] = array(
+ // 'db>password',
+ // );
+ // Example: Allow ADMIN to edit anything other than $config['db']
+ // (and $config['mod']['config'][DISABLED]).
+ // $config['mod']['config'][ADMIN] = array(
+ // 'db',
+ // );
+
+/*
+ * ====================
+ * Public post search
+ * ====================
+ */
+ $config['search'] = array();
+
+ // Enable the search form
+ $config['search']['enable'] = false;
+
+ // Maximal number of queries per IP address per minutes
+ $config['search']['queries_per_minutes'] = Array(15, 2);
+
+ // Global maximal number of queries per minutes
+ $config['search']['queries_per_minutes_all'] = Array(50, 2);
+
+ // Limit of search results
+ $config['search']['search_limit'] = 100;
+
+ // Boards for searching
+ //$config['search']['boards'] = array('a', 'b', 'c', 'd', 'e');
+
/*
* ====================
* Events (PHP 5.3.0+)
@@ -1095,7 +1267,7 @@
// event_handler('post', function($post) {
// // do something
// });
-
+
// event_handler('post', function($post) {
// // do something else
//
@@ -1108,35 +1280,50 @@
* Other/uncategorized
* ====================
*/
-
- // Meta keywords. It's probably best to include these in per-board configurations.
- //$config['meta_keywords'] = 'chan,anonymous discussion,imageboard,tinyboard';
-
- // Link imageboard to your Google Analytics account to track users and provide marketing insights.
+
+ // Meta keywords. It's probably best to include these in per-board configurations.
+ // $config['meta_keywords'] = 'chan,anonymous discussion,imageboard,tinyboard';
+
+ // Link imageboard to your Google Analytics account to track users and provide traffic insights.
// $config['google_analytics'] = 'UA-xxxxxxx-yy';
// Keep the Google Analytics cookies to one domain -- ga._setDomainName()
// $config['google_analytics_domain'] = 'www.example.org';
-
- // If you use Varnish, Squid, or any similar caching reverse-proxy in front of Tinyboard,
- // you can configure Tinyboard to PURGE files when they're written to
- //$config['purge'] = array(
- // array('127.0.0.1', 80)
- // array('127.0.0.1', 80, 'example.org')
- //);
- // Connection timeout, in seconds
+
+ // If you use Varnish, Squid, or any similar caching reverse-proxy in front of Tinyboard, you can
+ // configure Tinyboard to PURGE files when they're written to.
+ // $config['purge'] = array(
+ // array('127.0.0.1', 80)
+ // array('127.0.0.1', 80, 'example.org')
+ // );
+
+ // Connection timeout for $config['purge'], in seconds.
$config['purge_timeout'] = 3;
-
- // Remote servers
- // http://tinyboard.org/wiki/index.php?title=Multiple_Servers
- //$config['remote']['static'] = array(
- // 'host' => 'static.example.org',
- // 'auth' => array(
- // 'method' => 'plain',
- // 'username' => 'username',
- // 'password' => 'password!123'
- // ),
- // 'type' => 'scp'
- //);
-
- // Complex regular expression to catch URLs
+
+ // Additional mod.php?/ pages. Look in inc/mod/pages.php for help.
+ // $config['mod']['custom_pages']['/something/(\d+)'] = function($id) {
+ // global $config;
+ // if (!hasPermission($config['mod']['something']))
+ // error($config['error']['noaccess']);
+ // // ...
+ // };
+
+ // Example: Add links to dashboard (will all be in a new "Other" category).
+ // $config['mod']['dashboard_links']['Something'] = '?/something';
+
+ // Remote servers. I'm not even sure if this code works anymore. It might. Haven't tried it in a while.
+ // $config['remote']['static'] = array(
+ // 'host' => 'static.example.org',
+ // 'auth' => array(
+ // 'method' => 'plain',
+ // 'username' => 'username',
+ // 'password' => 'password!123'
+ // ),
+ // 'type' => 'scp'
+ // );
+
+ // Regex for board URIs. Don't add "`" character or any Unicode that MySQL can't handle. 58 characters
+ // is the absolute maximum, because MySQL cannot handle table names greater than 64 characters.
+ $config['board_regex'] = '[0-9a-zA-Z$_\x{0080}-\x{FFFF}]{1,58}';
+
+ // Complex regular expression to catch URLs.
$config['url_regex'] = '/' . '(https?|ftp):\/\/' . '(([\w\-]+\.)+[a-zA-Z]{2,6}|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})' . '(:\d+)?' . '(\/([\w\-~.#\/?=&;:+%!*\[\]@$\'()+,|\^]+)?)?' . '/';