From d0a6ffcb0c5a73f5ea5b8cccf81dd5cbd5aabab6 Mon Sep 17 00:00:00 2001
From: Michael Foster
{% if test.result %}
-
+
{% else %}
{% if test.required %}
{% set errors = errors + 1 %}
-
+
{% else %}
{% set warnings = warnings + 1 %}
-
+
{% endif %}
{% endif %}
@@ -34,9 +34,9 @@
{% for test in tests if not test.result%}
tags (PHP 5.3.0+)
+ // $config['markup'][] = array("/^[ |\t]*==([^<]+?)==[ |\t]*$/m", "\$1");
+
+ // Highlight PHP code wrapped in
tags (PHP 5.3+)
// $config['markup'][] = array(
// '/^<code>(.+)<\/code>/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';
-
- // Maximum amount of frames to resize (more frames means more processing power). "1" means no animated thumbnails.
- // Requires $config['thumb_ext'] to be 'gif' and $config['thumb_method'] to be 'imagick', 'convert', or 'convert+gifsicle'.
- // Not respected by 'convert'; will just resize all frames if this is > 1.
+
+ // 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` produces the best still thumbnails and is highly recommended.
- // - '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 thumbnails
- // 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.
+ *
+ * '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
+ * thumbnails have less artifacts than if resized with ImageMagick.
+ */
$config['thumb_method'] = 'gd';
// $config['thumb_method'] = 'convert';
-
- // Strip EXIF metadata from JPEG files
+
+ // Command-line options passed to ImageMagick when using `convert` for thumbnailing.
+ // http://www.imagemagick.org/ImageMagick-7.0.0/script/command-line-options.php
+ $config['convert_args'] = '-background transparent -filter Point -sample %dx%d +antialias -quality 50';
+
+ // Strip EXIF metadata from JPEG files.
$config['strip_exif'] = 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
+
+ // 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
+
+ // 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)
+ // $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'] = $config['dir']['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 links 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
+
+ // 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.
$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;
@@ -510,106 +578,111 @@
// 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;
-
+
/*
* ====================
* 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")
+
+ // 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: {id}" before the post number.
+
+ // 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
+
+ // 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)
+
+ // 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']);
-
- // Make stylesheet selections board-specific
+
+ // 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';
-
- // 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'
- // )
- //);
-
+
+ /*
+ * 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;
@@ -619,25 +692,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';
-
- // Where these script files are located on the web (defaults to $config['root']).
- // $config['additional_javascript_url'] = '/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/';
+
// 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;
/*
@@ -645,12 +724,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',
@@ -677,39 +756,39 @@
''
)
);
-
- // 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.');
- $config['error']['referer'] = _('Your browser sent an invalid or no HTTP referer.');
- $config['error']['toolong'] = _('The %s field was too long.');
+ $config['error']['lurk'] = _('Lurk some more before posting.');
+ $config['error']['bot'] = _('You look like a bot.');
+ $config['error']['referer'] = _('Your browser sent an invalid or no HTTP referer.');
+ $config['error']['toolong'] = _('The %s field was too long.');
$config['error']['toolong_body'] = _('The body was too long.');
$config['error']['tooshort_body'] = _('The body was too short or empty.');
- $config['error']['noimage'] = _('You must upload an image.');
- $config['error']['nomove'] = _('The server failed to handle your upload.');
- $config['error']['fileext'] = _('Unsupported image format.');
- $config['error']['noboard'] = _('Invalid board!');
+ $config['error']['noimage'] = _('You must upload an image.');
+ $config['error']['nomove'] = _('The server failed to handle your upload.');
+ $config['error']['fileext'] = _('Unsupported image format.');
+ $config['error']['noboard'] = _('Invalid board!');
$config['error']['nonexistant'] = _('Thread specified does not exist.');
- $config['error']['locked'] = _('Thread locked. You may not reply at this time.');
+ $config['error']['locked'] = _('Thread locked. You may not reply at this time.');
$config['error']['reply_hard_limit'] = _('Thread has reached its maximum reply limit.');
$config['error']['image_hard_limit'] = _('Thread has reached its maximum image limit.');
- $config['error']['nopost'] = _('You didn\'t make a post.');
- $config['error']['flood'] = _('Flood detected; Post discarded.');
- $config['error']['spam'] = _('Your request looks automated; Post discarded.');
+ $config['error']['nopost'] = _('You didn\'t make a post.');
+ $config['error']['flood'] = _('Flood detected; Post discarded.');
+ $config['error']['spam'] = _('Your request looks automated; Post discarded.');
$config['error']['unoriginal'] = _('Unoriginal content!');
- $config['error']['muted'] = _('Unoriginal content! You have been muted for %d seconds.');
+ $config['error']['muted'] = _('Unoriginal content! You have been muted for %d seconds.');
$config['error']['youaremuted'] = _('You are muted! Expires in %d seconds.');
- $config['error']['dnsbl'] = _('Your IP address is listed in %s.');
+ $config['error']['dnsbl'] = _('Your IP address is listed in %s.');
$config['error']['toomanylinks'] = _('Too many links; flood detected.');
$config['error']['toomanycites'] = _('Too many cites; post discarded.');
$config['error']['toomanycross'] = _('Too many cross-board links; post discarded.');
@@ -720,19 +799,19 @@
$config['error']['invalidimg'] = _('Invalid image.');
$config['error']['unknownext'] = _('Unknown file extension.');
$config['error']['filesize'] = _('Maximum file size: %maxsz% bytes
Your file\'s size: %filesz% bytes');
- $config['error']['maxsize'] = _('The file was too big.');
+ $config['error']['maxsize'] = _('The file was too big.');
$config['error']['invalidzip'] = _('Invalid archive!');
$config['error']['fileexists'] = _('That file already exists!');
$config['error']['fileexistsinthread'] = _('That file already exists in this thread!');
$config['error']['delete_too_soon'] = _('You\'ll have to wait another %s before deleting that.');
$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.');
-
+ $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.');
- $config['error']['notamod'] = _('You are not a mod…');
+ $config['error']['invalid'] = _('Invalid username and/or password.');
+ $config['error']['notamod'] = _('You are not a mod…');
$config['error']['invalidafter'] = _('Invalid username and/or password. Your user may have been deleted or changed.');
$config['error']['malformed'] = _('Invalid/malformed cookies.');
$config['error']['missedafield'] = _('Your browser didn\'t submit an input when it should have.');
@@ -741,98 +820,96 @@
$config['error']['boardexists'] = _('There is already a %s board.');
$config['error']['noaccess'] = _('You don\'t have permission to do that.');
$config['error']['invalidpost'] = _('That post doesn\'t exist…');
- $config['error']['404'] = _('Page not found.');
+ $config['error']['404'] = _('Page not found.');
$config['error']['modexists'] = _('That mod already exists!');
$config['error']['invalidtheme'] = _('That theme doesn\'t exist!');
- $config['error']['csrf'] = _('Invalid security token! Please go back and try again.');
+ $config['error']['csrf'] = _('Invalid security token! Please go back and try again.');
/*
* =========================
* 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 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';
-
+ $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'] = $config['dir']['static'] . 'sticky.gif';
+ // $config['image_locked'] = $config['dir']['static'] . 'locked.gif';
+ // $config['image_bumplocked'] = $config['dir']['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';
-
+
/*
* ====================
* 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&D]';
@@ -847,92 +924,94 @@
$config['mod']['link_bumpunlock'] = '[-Sage]';
$config['mod']['link_editpost'] = '[Edit]';
$config['mod']['link_move'] = '[Move]';
-
- // Moderator capcodes
+
+ // Moderator capcodes.
$config['capcode'] = ' ## %s';
-
- // Custom capcodes, by example:
- // "## Custom" becomes lightgreen, italic and bold
+
+ // "## Custom" becomes lightgreen, italic and bold:
//$config['custom_capcode']['Custom'] =' ## %s';
-
- // "## Mod" makes everything purple, including the name and tripcode
+
+ // "## Mod" makes everything purple, including the name and tripcode:
//$config['custom_capcode']['Mod'] = array(
// ' ## %s',
// '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(
// ' ## %s',
// '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
+
+ // 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 display 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;
-
- // Check public ban message by default
+
+ // 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).
+ // 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'; // Include length in ban message
- // What to append to the post for public bans ("%s" is the message)
+ // $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'] = '(%s)';
-
- // 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
+
+ // 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);
@@ -940,31 +1019,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;
@@ -1004,7 +1076,7 @@
$config['mod']['flood'] = ADMIN;
// Raw HTML posting
$config['mod']['rawhtml'] = ADMIN;
-
+
/* Administration */
// View the report queue
$config['mod']['reports'] = JANITOR;
@@ -1016,8 +1088,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;
@@ -1051,8 +1123,8 @@
$config['mod']['modlog'] = ADMIN;
// 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 exhaustive if your mod logs are huge.
+ // 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;
@@ -1062,7 +1134,8 @@
$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)
+ // 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;
@@ -1080,13 +1153,13 @@
$config['mod']['news_custom'] = ADMIN;
// Delete news entries
$config['mod']['news_delete'] = ADMIN;
-
+
// Edit the current configuration (via web interface)
$config['mod']['edit_config'] = ADMIN;
-
+
// Execute un-filtered SQL queries on the database (?/debug/sql)
$config['mod']['debug_sql'] = DISABLED;
-
+
/*
* ====================
* Events (PHP 5.3.0+)
@@ -1098,7 +1171,7 @@
// event_handler('post', function($post) {
// // do something
// });
-
+
// event_handler('post', function($post) {
// // do something else
//
@@ -1111,51 +1184,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, in seconds.
$config['purge_timeout'] = 3;
-
- // Additional mod.php?/ pages (for developers). 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']);
- // // ...
- //};
-
- // Add links to dashboard (will all be in "Other" category)
- $config['mod']['dashboard_links'] = array();
+
+ // 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']);
+ // // ...
+ // };
+
+ // Add links to dashboard (will all be in a new "Other" category).
// $config['mod']['dashboard_links']['Something'] = '?/something';
-
- // 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'
- //);
-
- // Regex for board URIs
+
+ // 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
+
+ // 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\-~.#\/?=&;:+%!*\[\]@$\'()+,|\^]+)?)?' . '/';
diff --git a/inc/display.php b/inc/display.php
index 5da2f302..7c2665e1 100644
--- a/inc/display.php
+++ b/inc/display.php
@@ -319,31 +319,31 @@ class Post {
// Delete
if (hasPermission($config['mod']['delete'], $board['uri'], $this->mod))
- $built .= ' ' . secure_link_confirm($config['mod']['link_delete'], 'Delete', 'Are you sure you want to delete this?', $board['uri'] . '/delete/' . $this->id);
+ $built .= ' ' . secure_link_confirm($config['mod']['link_delete'], 'Delete', 'Are you sure you want to delete this?', $board['dir'] . 'delete/' . $this->id);
// Delete all posts by IP
if (hasPermission($config['mod']['deletebyip'], $board['uri'], $this->mod))
- $built .= ' ' . secure_link_confirm($config['mod']['link_deletebyip'], 'Delete all posts by IP', 'Are you sure you want to delete all posts by this IP address?', $board['uri'] . '/deletebyip/' . $this->id);
+ $built .= ' ' . secure_link_confirm($config['mod']['link_deletebyip'], 'Delete all posts by IP', 'Are you sure you want to delete all posts by this IP address?', $board['dir'] . 'deletebyip/' . $this->id);
// Delete all posts by IP (global)
if (hasPermission($config['mod']['deletebyip_global'], $board['uri'], $this->mod))
- $built .= ' ' . secure_link_confirm($config['mod']['link_deletebyip_global'], 'Delete all posts by IP across all boards', 'Are you sure you want to delete all posts by this IP address, across all boards?', $board['uri'] . '/deletebyip/' . $this->id . '/global');
+ $built .= ' ' . secure_link_confirm($config['mod']['link_deletebyip_global'], 'Delete all posts by IP across all boards', 'Are you sure you want to delete all posts by this IP address, across all boards?', $board['dir'] . 'deletebyip/' . $this->id . '/global');
// Ban
if (hasPermission($config['mod']['ban'], $board['uri'], $this->mod))
- $built .= ' ' . $config['mod']['link_ban'] . '';
+ $built .= ' ' . $config['mod']['link_ban'] . '';
// Ban & Delete
if (hasPermission($config['mod']['bandelete'], $board['uri'], $this->mod))
- $built .= ' ' . $config['mod']['link_bandelete'] . '';
+ $built .= ' ' . $config['mod']['link_bandelete'] . '';
// Delete file (keep post)
if (!empty($this->file) && hasPermission($config['mod']['deletefile'], $board['uri'], $this->mod))
- $built .= ' ' . secure_link_confirm($config['mod']['link_deletefile'], _('Delete file'), _('Are you sure you want to delete this file?'), $board['uri'] . '/deletefile/' . $this->id);
+ $built .= ' ' . secure_link_confirm($config['mod']['link_deletefile'], _('Delete file'), _('Are you sure you want to delete this file?'), $board['dir'] . 'deletefile/' . $this->id);
// Edit post
if (hasPermission($config['mod']['editpost'], $board['uri'], $this->mod))
- $built .= ' ' . $config['mod']['link_editpost'] . '';
+ $built .= ' ' . $config['mod']['link_editpost'] . '';
if (!empty($built))
$built = '' . $built . '';
@@ -420,54 +420,54 @@ class Thread {
// Mod controls (on posts)
// Delete
if (hasPermission($config['mod']['delete'], $board['uri'], $this->mod))
- $built .= ' ' . secure_link_confirm($config['mod']['link_delete'], _('Delete'), _('Are you sure you want to delete this?'), $board['uri'] . '/delete/' . $this->id);
+ $built .= ' ' . secure_link_confirm($config['mod']['link_delete'], _('Delete'), _('Are you sure you want to delete this?'), $board['dir'] . 'delete/' . $this->id);
// Delete all posts by IP
if (hasPermission($config['mod']['deletebyip'], $board['uri'], $this->mod))
- $built .= ' ' . secure_link_confirm($config['mod']['link_deletebyip'], _('Delete all posts by IP'), _('Are you sure you want to delete all posts by this IP address?'), $board['uri'] . '/deletebyip/' . $this->id);
+ $built .= ' ' . secure_link_confirm($config['mod']['link_deletebyip'], _('Delete all posts by IP'), _('Are you sure you want to delete all posts by this IP address?'), $board['dir'] . 'deletebyip/' . $this->id);
// Delete all posts by IP (global)
if (hasPermission($config['mod']['deletebyip_global'], $board['uri'], $this->mod))
- $built .= ' ' . secure_link_confirm($config['mod']['link_deletebyip_global'], _('Delete all posts by IP across all boards'), _('Are you sure you want to delete all posts by this IP address, across all boards?'), $board['uri'] . '/deletebyip/' . $this->id . '/global');
+ $built .= ' ' . secure_link_confirm($config['mod']['link_deletebyip_global'], _('Delete all posts by IP across all boards'), _('Are you sure you want to delete all posts by this IP address, across all boards?'), $board['dir'] . 'deletebyip/' . $this->id . '/global');
// Ban
if (hasPermission($config['mod']['ban'], $board['uri'], $this->mod))
- $built .= ' ' . $config['mod']['link_ban'] . '';
+ $built .= ' ' . $config['mod']['link_ban'] . '';
// Ban & Delete
if (hasPermission($config['mod']['bandelete'], $board['uri'], $this->mod))
- $built .= ' ' . $config['mod']['link_bandelete'] . '';
+ $built .= ' ' . $config['mod']['link_bandelete'] . '';
// Delete file (keep post)
if (!empty($this->file) && $this->file != 'deleted' && hasPermission($config['mod']['deletefile'], $board['uri'], $this->mod))
- $built .= ' ' . secure_link_confirm($config['mod']['link_deletefile'], _('Delete file'), _('Are you sure you want to delete this file?'), $board['uri'] . '/deletefile/' . $this->id);
+ $built .= ' ' . secure_link_confirm($config['mod']['link_deletefile'], _('Delete file'), _('Are you sure you want to delete this file?'), $board['dir'] . 'deletefile/' . $this->id);
// Sticky
if (hasPermission($config['mod']['sticky'], $board['uri'], $this->mod))
if ($this->sticky)
- $built .= ' ' . $config['mod']['link_desticky'] . '';
+ $built .= ' ' . $config['mod']['link_desticky'] . '';
else
- $built .= ' ' . $config['mod']['link_sticky'] . '';
+ $built .= ' ' . $config['mod']['link_sticky'] . '';
if (hasPermission($config['mod']['bumplock'], $board['uri'], $this->mod))
if ($this->bumplocked)
- $built .= ' ' . $config['mod']['link_bumpunlock'] . '';
+ $built .= ' ' . $config['mod']['link_bumpunlock'] . '';
else
- $built .= ' ' . $config['mod']['link_bumplock'] . '';
+ $built .= ' ' . $config['mod']['link_bumplock'] . '';
// Lock
if (hasPermission($config['mod']['lock'], $board['uri'], $this->mod))
if ($this->locked)
- $built .= ' ' . $config['mod']['link_unlock'] . '';
+ $built .= ' ' . $config['mod']['link_unlock'] . '';
else
- $built .= ' ' . $config['mod']['link_lock'] . '';
+ $built .= ' ' . $config['mod']['link_lock'] . '';
if (hasPermission($config['mod']['move'], $board['uri'], $this->mod))
- $built .= ' ' . $config['mod']['link_move'] . '';
+ $built .= ' ' . $config['mod']['link_move'] . '';
// Edit post
if (hasPermission($config['mod']['editpost'], $board['uri'], $this->mod))
- $built .= ' ' . $config['mod']['link_editpost'] . '';
+ $built .= ' ' . $config['mod']['link_editpost'] . '';
if (!empty($built))
$built = '' . $built . '';
diff --git a/inc/filters.php b/inc/filters.php
index 9f03154d..cd512821 100644
--- a/inc/filters.php
+++ b/inc/filters.php
@@ -132,10 +132,10 @@ class Filter {
function do_filters(array $post) {
global $config;
- if (!isset($config['flood_filters']))
+ if (!isset($config['filters']))
return;
- foreach ($config['flood_filters'] as $arr) {
+ foreach ($config['filters'] as $arr) {
$filter = new Filter($arr);
if ($filter->check($post))
$filter->action();
diff --git a/inc/functions.php b/inc/functions.php
index e871fee0..f000dc3c 100644
--- a/inc/functions.php
+++ b/inc/functions.php
@@ -40,7 +40,7 @@ function loadConfig() {
'dir',
'mod',
'spam',
- 'flood_filters',
+ 'filters',
'wordfilters',
'custom_capcode',
'custom_tripcode',
@@ -54,7 +54,8 @@ function loadConfig() {
'stylesheets',
'additional_javascript',
'markup',
- 'custom_pages'
+ 'custom_pages',
+ 'dashboard_links'
);
$config = array();
@@ -85,8 +86,8 @@ function loadConfig() {
date_default_timezone_set($config['timezone']);
- if (!isset($config['blotter']))
- $config['blotter'] = false;
+ if (!isset($config['global_message']))
+ $config['global_message'] = false;
if (!isset($config['post_url']))
$config['post_url'] = $config['root'] . $config['file_post'];
@@ -128,8 +129,6 @@ function loadConfig() {
$config['image_bumplocked'] = $config['dir']['static'] . 'sage.gif';
if (!isset($config['image_deleted']))
$config['image_deleted'] = $config['dir']['static'] . 'deleted.png';
- if (!isset($config['image_zip']))
- $config['image_zip'] = $config['dir']['static'] . 'zip.png';
if (!isset($config['uri_thumb']))
$config['uri_thumb'] = $config['root'] . $board['dir'] . $config['dir']['thumb'];
@@ -1704,7 +1703,7 @@ function buildThread($id, $return = false, $mod = false) {
'mod' => $mod,
'antibot' => $mod ? false : create_antibot($board['uri'], $id),
'boardlist' => createBoardlist($mod),
- 'return' => ($mod ? '?' . $board['url'] . $config['file_index'] : $config['root'] . $board['uri'] . '/' . $config['file_index'])
+ 'return' => ($mod ? '?' . $board['url'] . $config['file_index'] : $config['root'] . $board['dir'] . $config['file_index'])
));
if ($return)
diff --git a/inc/image.php b/inc/image.php
index 51db2f83..bfb77d30 100644
--- a/inc/image.php
+++ b/inc/image.php
@@ -279,10 +279,8 @@ class ImageConvert extends ImageBase {
}
$this->temp = tempnam($config['tmp'], 'imagick');
-
- $quality = $config['thumb_quality'] * 10;
-
- $config['thumb_keep_animation_frames'] = (int) $config['thumb_keep_animation_frames'];
+
+ $config['thumb_keep_animation_frames'] = (int)$config['thumb_keep_animation_frames'];
if ($this->format == 'gif' && ($config['thumb_ext'] == 'gif' || $config['thumb_ext'] == '') && $config['thumb_keep_animation_frames'] > 1) {
if ($this->gifsicle) {
@@ -291,12 +289,12 @@ class ImageConvert extends ImageBase {
escapeshellarg($this->temp)) || !file_exists($this->temp))
error('Failed to resize image!');
} else {
- if (shell_exec("convert -background transparent -filter Point -sample {$this->width}x{$this->height} +antialias -quality {$quality} " .
+ if (shell_exec('convert ' . sprintf($config['convert_args'], $this->width, $this->height) . ' ' .
escapeshellarg($this->src . '') . " " . escapeshellarg($this->temp)) || !file_exists($this->temp))
error('Failed to resize image!');
}
} else {
- if (shell_exec("convert -background transparent -flatten -filter Point -scale {$this->width}x{$this->height} +antialias -quality {$quality} " .
+ if (shell_exec('convert ' . sprintf($config['convert_args'], $this->width, $this->height) .
escapeshellarg($this->src . '[0]') . " " . escapeshellarg($this->temp)) || !file_exists($this->temp))
error('Failed to resize image!');
}
@@ -309,7 +307,7 @@ class ImagePNG extends ImageBase {
}
public function to($src) {
global $config;
- imagepng($this->image, $src, $config['thumb_quality']);
+ imagepng($this->image, $src);
}
public function resize() {
$this->GD_create();
@@ -322,7 +320,7 @@ class ImagePNG extends ImageBase {
class ImageGIF extends ImageBase {
public function from() {
- $this->image = @imagecreatefromgif ($this->src);
+ $this->image = @imagecreatefromgif($this->src);
}
public function to($src) {
imagegif ($this->image, $src);
diff --git a/mod.php b/mod.php
index cd4d17d4..ee05c349 100644
--- a/mod.php
+++ b/mod.php
@@ -109,7 +109,7 @@ $new_pages = array();
foreach ($pages as $key => $callback) {
if (is_string($callback) && preg_match('/^secure /', $callback))
$key .= '(/(?P
You may proceed with these changes manually by copying and pasting the following code to the end of inc/instance-config.php:
+Tinyboard could not write to ' . $config_file . ' with the ammended configuration, probably due to a permissions error.
+You may proceed with these changes manually by copying and pasting the following code to the end of ' . $config_file . ':
'; echo Element('page.html', $page); @@ -2048,12 +2062,18 @@ function mod_config() { } } - header('Location: ?/', true, $config['redirect_http']); + header('Location: ?/config', true, $config['redirect_http']); exit; } - mod_page(_('Config editor'), 'mod/config-editor.html', array('conf' => $conf)); + mod_page(_('Config editor') . ($board_config ? ': ' . sprintf($config['board_abbreviation'], $board_config) : ''), + 'mod/config-editor.html', array( + 'boards' => listBoards(), + 'board' => $board_config, + 'conf' => $conf, + 'file' => $config_file + )); } function mod_themes_list() { diff --git a/mod.php b/mod.php index ee05c349..742eeefb 100644 --- a/mod.php +++ b/mod.php @@ -21,64 +21,65 @@ if (get_magic_quotes_gpc()) { $query = isset($_SERVER['QUERY_STRING']) ? urldecode($_SERVER['QUERY_STRING']) : ''; $pages = array( - '' => ':?/', // redirect to dashboard - '/' => 'dashboard', // dashboard + '' => ':?/', // redirect to dashboard + '/' => 'dashboard', // dashboard '/confirm/(.+)' => 'confirm', // confirm action (if javascript didn't work) - '/logout' => 'logout', // logout + '/logout' => 'logout', // logout - '/users' => 'users', // manage users - '/users/(\d+)' => 'user', // edit user - '/users/(\d+)/(promote|demote)' => 'user_promote', // prmote/demote user + '/users' => 'users', // manage users + '/users/(\d+)' => 'user', // edit user + '/users/(\d+)/(promote|demote)' => 'user_promote', // prmote/demote user '/users/new' => 'user_new', // create a new user '/new_PM/([^/]+)' => 'new_pm', // create a new pm - '/PM/(\d+)(/reply)?' => 'pm', // read a pm - '/inbox' => 'inbox', // pm inbox + '/PM/(\d+)(/reply)?' => 'pm', // read a pm + '/inbox' => 'inbox', // pm inbox '/noticeboard' => 'noticeboard', // view noticeboard - '/noticeboard/(\d+)' => 'noticeboard', // view noticeboard - '/noticeboard/delete/(\d+)' => 'noticeboard_delete',// delete from noticeboard - '/log' => 'log', // modlog - '/log/(\d+)' => 'log', // modlog + '/noticeboard/(\d+)' => 'noticeboard', // view noticeboard + '/noticeboard/delete/(\d+)' => 'noticeboard_delete', // delete from noticeboard + '/log' => 'log', // modlog + '/log/(\d+)' => 'log', // modlog '/log:([^/]+)' => 'user_log', // modlog - '/log:([^/]+)/(\d+)' => 'user_log', // modlog - '/news' => 'news', // view news - '/news/(\d+)' => 'news', // view news - '/news/delete/(\d+)' => 'news_delete', // delete from news + '/log:([^/]+)/(\d+)' => 'user_log', // modlog + '/news' => 'news', // view news + '/news/(\d+)' => 'news', // view news + '/news/delete/(\d+)' => 'news_delete', // delete from news '/edit/(\%b)' => 'edit_board', // edit board details '/new-board' => 'new_board', // create a new board - '/rebuild' => 'rebuild', // rebuild static files - '/reports' => 'reports', // report queue - '/reports/(\d+)/dismiss(all)?' => 'report_dismiss', // dismiss a report + '/rebuild' => 'rebuild', // rebuild static files + '/reports' => 'reports', // report queue + '/reports/(\d+)/dismiss(all)?' => 'report_dismiss', // dismiss a report - '/IP/([\w.:]+)' => 'ip', // view ip address + '/IP/([\w.:]+)' => 'ip', // view ip address '/IP/([\w.:]+)/remove_note/(\d+)' => 'ip_remove_note', // remove note from ip address - '/bans' => 'bans', // ban list - '/bans/(\d+)' => 'bans', // ban list + '/bans' => 'bans', // ban list + '/bans/(\d+)' => 'bans', // ban list - '/search' => 'search_redirect', // search + '/search' => 'search_redirect', // search '/search/(posts|IP_notes|bans|log)/(.+)/(\d+)' => 'search', // search - '/search/(posts|IP_notes|bans|log)/(.+)' => 'search', // search + '/search/(posts|IP_notes|bans|log)/(.+)' => 'search', // search // CSRF-protected moderator actions - '/ban' => 'secure_POST ban', // new ban - '/(\%b)/ban(&delete)?/(\d+)' => 'secure_POST ban_post', // ban poster - '/(\%b)/move/(\d+)' => 'secure_POST move', // move thread + '/ban' => 'secure_POST ban', // new ban + '/(\%b)/ban(&delete)?/(\d+)' => 'secure_POST ban_post', // ban poster + '/(\%b)/move/(\d+)' => 'secure_POST move', // move thread '/(\%b)/edit(_raw)?/(\d+)' => 'secure_POST edit_post', // edit post - '/(\%b)/delete/(\d+)' => 'secure delete', // delete post - '/(\%b)/deletefile/(\d+)' => 'secure deletefile', // delete file from post + '/(\%b)/delete/(\d+)' => 'secure delete', // delete post + '/(\%b)/deletefile/(\d+)' => 'secure deletefile', // delete file from post '/(\%b)/deletebyip/(\d+)(/global)?' => 'secure deletebyip', // delete all posts by IP address - '/(\%b)/(un)?lock/(\d+)' => 'secure lock', // lock thread - '/(\%b)/(un)?sticky/(\d+)' => 'secure sticky', // sticky thread - '/(\%b)/bump(un)?lock/(\d+)' => 'secure bumplock', // "bumplock" thread + '/(\%b)/(un)?lock/(\d+)' => 'secure lock', // lock thread + '/(\%b)/(un)?sticky/(\d+)' => 'secure sticky', // sticky thread + '/(\%b)/bump(un)?lock/(\d+)' => 'secure bumplock', // "bumplock" thread - '/themes' => 'themes_list', // manage themes + '/themes' => 'themes_list', // manage themes '/themes/(\w+)' => 'theme_configure', // configure/reconfigure theme - '/themes/(\w+)/rebuild' => 'theme_rebuild', // rebuild theme - '/themes/(\w+)/uninstall' => 'theme_uninstall', // uninstall theme + '/themes/(\w+)/rebuild' => 'theme_rebuild', // rebuild theme + '/themes/(\w+)/uninstall' => 'theme_uninstall', // uninstall theme - '/config' => 'config', // config editor + '/config' => 'config', // config editor + '/config/(\%b)' => 'config', // config editor // these pages aren't listed in the dashboard without $config['debug'] '/debug/antispam' => 'debug_antispam', diff --git a/templates/mod/config-editor-php.html b/templates/mod/config-editor-php.html index 54c398e4..4f76b5dd 100644 --- a/templates/mod/config-editor-php.html +++ b/templates/mod/config-editor-php.html @@ -1,17 +1,35 @@ -{% if readonly %} -Tinyboard does not have the required permissions to edit inc/instance-config.php. To make changes, you will need to change the file's permissions first or manually edit the code.
-{% endif %} - - -{% if not readonly %}
+ Any changes you make here will simply be appended to {{ file }}
. If you wish to make the most of Tinyboard's customizability, you can instead edit the file directly. This page is intended for making quick changes and for those who don't have a basic understanding of PHP code.
+
Tinyboard does not have the required permissions to edit {{ file }}
. To make changes, you will need to change the file's permissions first or manually edit the code.