The version of vichan running on lainchan.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1529 lines
64KB

  1. <?php
  2. /*
  3. * Copyright (c) 2010-2013 Tinyboard Development Group
  4. *
  5. * WARNING: This is a project-wide configuration file and is overwritten when upgrading to a newer
  6. * version of Tinyboard. Please leave this file unchanged, or it will be a lot harder for you to upgrade.
  7. * If you would like to make instance-specific changes to your own setup, please use instance-config.php.
  8. *
  9. * This is the default configuration. You can copy values from here and use them in
  10. * your instance-config.php
  11. *
  12. * You can also create per-board configuration files. Once a board is created, locate its directory and
  13. * create a new file named config.php (eg. b/config.php). Like instance-config.php, you can copy values
  14. * from here and use them in your per-board configuration files.
  15. *
  16. * Some directives are commented out. This is either because they are optional and examples, or because
  17. * they are "optionally configurable", and given their default values by Tinyboard's code later if unset.
  18. *
  19. * More information: http://tinyboard.org/docs/?p=Config
  20. *
  21. * Tinyboard documentation: http://tinyboard.org/docs/
  22. *
  23. */
  24. /*
  25. * =======================
  26. * General/misc settings
  27. * =======================
  28. */
  29. // Global announcement -- the very simple version.
  30. // This used to be wrongly named $config['blotter'] (still exists as an alias).
  31. // $config['global_message'] = 'This is an important announcement!';
  32. $config['blotter'] = &$config['global_message'];
  33. // Automatically check if a newer version of Tinyboard is available when an administrator logs in.
  34. $config['check_updates'] = true;
  35. // How often to check for updates
  36. $config['check_updates_time'] = 43200; // 12 hours
  37. // Shows some extra information at the bottom of pages. Good for development/debugging.
  38. $config['debug'] = false;
  39. // For development purposes. Displays (and "dies" on) all errors and warnings. Turn on with the above.
  40. $config['verbose_errors'] = true;
  41. // EXPLAIN all SQL queries (when in debug mode).
  42. $config['debug_explain'] = false;
  43. // Directory where temporary files will be created.
  44. $config['tmp'] = sys_get_temp_dir();
  45. // The HTTP status code to use when redirecting. http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
  46. // Can be either 303 "See Other" or 302 "Found". (303 is more correct but both should work.)
  47. // There is really no reason for you to ever need to change this.
  48. $config['redirect_http'] = 303;
  49. // A tiny text file in the main directory indicating that the script has been ran and the board(s) have
  50. // been generated. This keeps the script from querying the database and causing strain when not needed.
  51. $config['has_installed'] = '.installed';
  52. // Use syslog() for logging all error messages and unauthorized login attempts.
  53. $config['syslog'] = false;
  54. // Use `host` via shell_exec() to lookup hostnames, avoiding query timeouts. May not work on your system.
  55. // Requires safe_mode to be disabled.
  56. $config['dns_system'] = false;
  57. // When executing most command-line tools (such as `convert` for ImageMagick image processing), add this
  58. // to the environment path (seperated by :).
  59. $config['shell_path'] = '/usr/local/bin';
  60. /*
  61. * ====================
  62. * Database settings
  63. * ====================
  64. */
  65. // Database driver (http://www.php.net/manual/en/pdo.drivers.php)
  66. // Only MySQL is supported by Tinyboard at the moment, sorry.
  67. $config['db']['type'] = 'mysql';
  68. // Hostname, IP address or Unix socket (prefixed with ":")
  69. $config['db']['server'] = 'localhost';
  70. // Example: Unix socket
  71. // $config['db']['server'] = ':/tmp/mysql.sock';
  72. // Login
  73. $config['db']['user'] = '';
  74. $config['db']['password'] = '';
  75. // Tinyboard database
  76. $config['db']['database'] = '';
  77. // Table prefix (optional)
  78. $config['db']['prefix'] = '';
  79. // Use a persistent database connection when possible
  80. $config['db']['persistent'] = false;
  81. // Anything more to add to the DSN string (eg. port=xxx;foo=bar)
  82. $config['db']['dsn'] = '';
  83. // Connection timeout duration in seconds
  84. $config['db']['timeout'] = 30;
  85. /*
  86. * ====================
  87. * Cache settings
  88. * ====================
  89. */
  90. /*
  91. * On top of the static file caching system, you can enable the additional caching system which is
  92. * designed to minimize SQL queries and can significantly increase speed when posting or using the
  93. * moderator interface. APC is the recommended method of caching.
  94. *
  95. * http://tinyboard.org/docs/index.php?p=Config/Cache
  96. */
  97. $config['cache']['enabled'] = false;
  98. // $config['cache']['enabled'] = 'xcache';
  99. // $config['cache']['enabled'] = 'apc';
  100. // $config['cache']['enabled'] = 'memcached';
  101. // $config['cache']['enabled'] = 'redis';
  102. // Timeout for cached objects such as posts and HTML.
  103. $config['cache']['timeout'] = 60 * 60 * 48; // 48 hours
  104. // Optional prefix if you're running multiple Tinyboard instances on the same machine.
  105. $config['cache']['prefix'] = '';
  106. // Memcached servers to use. Read more: http://www.php.net/manual/en/memcached.addservers.php
  107. $config['cache']['memcached'] = array(
  108. array('localhost', 11211)
  109. );
  110. // Redis server to use. Location, port, password, database id.
  111. // Note that Tinyboard may clear the database at times, so you may want to pick a database id just for
  112. // Tinyboard to use.
  113. $config['cache']['redis'] = array('localhost', 6379, '', 1);
  114. /*
  115. * ====================
  116. * Cookie settings
  117. * ====================
  118. */
  119. // Used for moderation login.
  120. $config['cookies']['mod'] = 'mod';
  121. // Used for communicating with Javascript; telling it when posts were successful.
  122. $config['cookies']['js'] = 'serv';
  123. // Cookies path. Defaults to $config['root']. If $config['root'] is a URL, you need to set this. Should
  124. // be '/' or '/board/', depending on your installation.
  125. // $config['cookies']['path'] = '/';
  126. // Where to set the 'path' parameter to $config['cookies']['path'] when creating cookies. Recommended.
  127. $config['cookies']['jail'] = true;
  128. // How long should the cookies last (in seconds). Defines how long should moderators should remain logged
  129. // in (0 = browser session).
  130. $config['cookies']['expire'] = 60 * 60 * 24 * 30 * 6; // ~6 months
  131. // Make this something long and random for security.
  132. $config['cookies']['salt'] = 'abcdefghijklmnopqrstuvwxyz09123456789!@#$%^&*()';
  133. // Whether or not you can access the mod cookie in JavaScript. Most users should not need to change this.
  134. $config['cookies']['httponly'] = true;
  135. // Used to salt secure tripcodes ("##trip") and poster IDs (if enabled).
  136. $config['secure_trip_salt'] = ')(*&^%$#@!98765432190zyxwvutsrqponmlkjihgfedcba';
  137. /*
  138. * ====================
  139. * Flood/spam settings
  140. * ====================
  141. */
  142. /*
  143. * To further prevent spam and abuse, you can use DNS blacklists (DNSBL). A DNSBL is a list of IP
  144. * addresses published through the Internet Domain Name Service (DNS) either as a zone file that can be
  145. * used by DNS server software, or as a live DNS zone that can be queried in real-time.
  146. *
  147. * Read more: http://tinyboard.org/docs/?p=Config/DNSBL
  148. */
  149. // Prevents most Tor exit nodes from making posts. Recommended, as a lot of abuse comes from Tor because
  150. // of the strong anonymity associated with it.
  151. $config['dnsbl'][] = array('tor.dnsbl.sectoor.de', 1);
  152. // http://www.sorbs.net/using.shtml
  153. // $config['dnsbl'][] = array('dnsbl.sorbs.net', array(2, 3, 4, 5, 6, 7, 8, 9));
  154. // http://www.projecthoneypot.org/httpbl.php
  155. // $config['dnsbl'][] = array('<your access key>.%.dnsbl.httpbl.org', function($ip) {
  156. // $octets = explode('.', $ip);
  157. //
  158. // // days since last activity
  159. // if ($octets[1] > 14)
  160. // return false;
  161. //
  162. // // "threat score" (http://www.projecthoneypot.org/threat_info.php)
  163. // if ($octets[2] < 5)
  164. // return false;
  165. //
  166. // return true;
  167. // }, 'dnsbl.httpbl.org'); // hide our access key
  168. // Skip checking certain IP addresses against blacklists (for troubleshooting or whatever)
  169. $config['dnsbl_exceptions'][] = '127.0.0.1';
  170. /*
  171. * Introduction to Tinyboard's spam filter:
  172. *
  173. * In simple terms, whenever a posting form on a page is generated (which happens whenever a
  174. * post is made), Tinyboard will add a random amount of hidden, obscure fields to it to
  175. * confuse bots and upset hackers. These fields and their respective obscure values are
  176. * validated upon posting with a 160-bit "hash". That hash can only be used as many times
  177. * as you specify; otherwise, flooding bots could just keep reusing the same hash.
  178. * Once a new set of inputs (and the hash) are generated, old hashes for the same thread
  179. * and board are set to expire. Because you have to reload the page to get the new set
  180. * of inputs and hash, if they expire too quickly and more than one person is viewing the
  181. * page at a given time, Tinyboard would return false positives (depending on how long the
  182. * user sits on the page before posting). If your imageboard is quite fast/popular, set
  183. * $config['spam']['hidden_inputs_max_pass'] and $config['spam']['hidden_inputs_expire'] to
  184. * something higher to avoid false positives.
  185. *
  186. * See also: http://tinyboard.org/docs/?p=Your_request_looks_automated
  187. *
  188. */
  189. // Number of hidden fields to generate.
  190. $config['spam']['hidden_inputs_min'] = 4;
  191. $config['spam']['hidden_inputs_max'] = 12;
  192. // How many times can a "hash" be used to post?
  193. $config['spam']['hidden_inputs_max_pass'] = 12;
  194. // How soon after regeneration do hashes expire (in seconds)?
  195. $config['spam']['hidden_inputs_expire'] = 60 * 60 * 3; // three hours
  196. // Whether to use Unicode characters in hidden input names and values.
  197. $config['spam']['unicode'] = true;
  198. // These are fields used to confuse the bots. Make sure they aren't actually used by Tinyboard, or it won't work.
  199. $config['spam']['hidden_input_names'] = array(
  200. 'user',
  201. 'username',
  202. 'login',
  203. 'search',
  204. 'q',
  205. 'url',
  206. 'firstname',
  207. 'lastname',
  208. 'text',
  209. 'message'
  210. );
  211. // Always update this when adding new valid fields to the post form, or EVERYTHING WILL BE DETECTED AS SPAM!
  212. $config['spam']['valid_inputs'] = array(
  213. 'hash',
  214. 'board',
  215. 'thread',
  216. 'mod',
  217. 'name',
  218. 'email',
  219. 'subject',
  220. 'post',
  221. 'body',
  222. 'password',
  223. 'sticky',
  224. 'lock',
  225. 'raw',
  226. 'embed',
  227. 'recaptcha_challenge_field',
  228. 'recaptcha_response_field',
  229. 'spoiler',
  230. 'quick-reply',
  231. 'page',
  232. 'file_url',
  233. 'json_response',
  234. );
  235. // Enable reCaptcha to make spam even harder. Rarely necessary.
  236. $config['recaptcha'] = false;
  237. // Public and private key pair from https://www.google.com/recaptcha/admin/create
  238. $config['recaptcha_public'] = '6LcXTcUSAAAAAKBxyFWIt2SO8jwx4W7wcSMRoN3f';
  239. $config['recaptcha_private'] = '6LcXTcUSAAAAAOGVbVdhmEM1_SyRF4xTKe8jbzf_';
  240. /*
  241. * Custom filters detect certain posts and reject/ban accordingly. They are made up of a condition and an
  242. * action (for when ALL conditions are met). As every single post has to be put through each filter,
  243. * having hundreds probably isn't ideal as it could slow things down.
  244. *
  245. * By default, the custom filters array is populated with basic flood prevention conditions. This
  246. * includes forcing users to wait at least 5 seconds between posts. To disable (or amend) these flood
  247. * prevention settings, you will need to empty the $config['filters'] array first. You can do so by
  248. * adding "$config['filters'] = array();" to inc/instance-config.php. Basic flood prevention used to be
  249. * controlled solely by config variables such as $config['flood_time'] and $config['flood_time_ip'], and
  250. * it still is, as long as you leave the relevant $config['filters'] intact. These old config variables
  251. * still exist for backwards-compatability and general convenience.
  252. *
  253. * Read more: http://tinyboard.org/docs/index.php?p=Config/Filters
  254. */
  255. // Minimum time between between each post by the same IP address.
  256. $config['flood_time'] = 10;
  257. // Minimum time between between each post with the exact same content AND same IP address.
  258. $config['flood_time_ip'] = 120;
  259. // Same as above but by a different IP address. (Same content, not necessarily same IP address.)
  260. $config['flood_time_same'] = 30;
  261. // Minimum time between posts by the same IP address (all boards).
  262. $config['filters'][] = array(
  263. 'condition' => array(
  264. 'flood-match' => array('ip'), // Only match IP address
  265. 'flood-time' => &$config['flood_time']
  266. ),
  267. 'action' => 'reject',
  268. 'message' => &$config['error']['flood']
  269. );
  270. // Minimum time between posts by the same IP address with the same text.
  271. $config['filters'][] = array(
  272. 'condition' => array(
  273. 'flood-match' => array('ip', 'body'), // Match IP address and post body
  274. 'flood-time' => &$config['flood_time_ip'],
  275. '!body' => '/^$/', // Post body is NOT empty
  276. ),
  277. 'action' => 'reject',
  278. 'message' => &$config['error']['flood']
  279. );
  280. // Minimum time between posts with the same text. (Same content, but not always the same IP address.)
  281. $config['filters'][] = array(
  282. 'condition' => array(
  283. 'flood-match' => array('body'), // Match only post body
  284. 'flood-time' => &$config['flood_time_same']
  285. ),
  286. 'action' => 'reject',
  287. 'message' => &$config['error']['flood']
  288. );
  289. // Example: Minimum time between posts with the same file hash.
  290. // $config['filters'][] = array(
  291. // 'condition' => array(
  292. // 'flood-match' => array('file'), // Match file hash
  293. // 'flood-time' => 60 * 2 // 2 minutes minimum
  294. // ),
  295. // 'action' => 'reject',
  296. // 'message' => &$config['error']['flood']
  297. // );
  298. // Example: Use the "flood-count" condition to only match if the user has made at least two posts with
  299. // the same content and IP address in the past 2 minutes.
  300. // $config['filters'][] = array(
  301. // 'condition' => array(
  302. // 'flood-match' => array('ip', 'body'), // Match IP address and post body
  303. // 'flood-time' => 60 * 2, // 2 minutes
  304. // 'flood-count' => 2 // At least two recent posts
  305. // ),
  306. // '!body' => '/^$/',
  307. // 'action' => 'reject',
  308. // 'message' => &$config['error']['flood']
  309. // );
  310. // Example: Blocking an imaginary known spammer, who keeps posting a reply with the name "surgeon",
  311. // ending his posts with "regards, the surgeon" or similar.
  312. // $config['filters'][] = array(
  313. // 'condition' => array(
  314. // 'name' => '/^surgeon$/',
  315. // 'body' => '/regards,\s+(the )?surgeon$/i',
  316. // 'OP' => false
  317. // ),
  318. // 'action' => 'reject',
  319. // 'message' => 'Go away, spammer.'
  320. // );
  321. // Example: Same as above, but issuing a 3-hour ban instead of just reject the post.
  322. // $config['filters'][] = array(
  323. // 'condition' => array(
  324. // 'name' => '/^surgeon$/',
  325. // 'body' => '/regards,\s+(the )?surgeon$/i',
  326. // 'OP' => false
  327. // ),
  328. // 'action' => 'ban',
  329. // 'expires' => 60 * 60 * 3, // 3 hours
  330. // 'reason' => 'Go away, spammer.'
  331. // );
  332. // Example: PHP 5.3+ (anonymous functions)
  333. // There is also a "custom" condition, making the possibilities of this feature pretty much endless.
  334. // This is a bad example, because there is already a "name" condition built-in.
  335. // $config['filters'][] = array(
  336. // 'condition' => array(
  337. // 'body' => '/h$/i',
  338. // 'OP' => false,
  339. // 'custom' => function($post) {
  340. // if($post['name'] == 'Anonymous')
  341. // return true;
  342. // else
  343. // return false;
  344. // }
  345. // ),
  346. // 'action' => 'reject'
  347. // );
  348. // Filter flood prevention conditions ("flood-match") depend on a table which contains a cache of recent
  349. // posts across all boards. This table is automatically purged of older posts, determining the maximum
  350. // "age" by looking at each filter. However, when determining the maximum age, Tinyboard does not look
  351. // outside the current board. This means that if you have a special flood condition for a specific board
  352. // (contained in a board configuration file) which has a flood-time greater than any of those in the
  353. // global configuration, you need to set the following variable to the maximum flood-time condition value.
  354. // $config['flood_cache'] = 60 * 60 * 24; // 24 hours
  355. /*
  356. * ====================
  357. * Post settings
  358. * ====================
  359. */
  360. // Do you need a body for your reply posts?
  361. $config['force_body'] = false;
  362. // Do you need a body for new threads?
  363. $config['force_body_op'] = true;
  364. // Require an image for threads?
  365. $config['force_image_op'] = true;
  366. // Strip superfluous new lines at the end of a post.
  367. $config['strip_superfluous_returns'] = true;
  368. // Strip combining characters from Unicode strings (eg. "Zalgo").
  369. $config['strip_combining_chars'] = true;
  370. // Maximum post body length.
  371. $config['max_body'] = 1800;
  372. // Maximum number of post body lines to show on the index page.
  373. $config['body_truncate'] = 15;
  374. // Maximum number of characters to show on the index page.
  375. $config['body_truncate_char'] = 2500;
  376. // Typically spambots try to post many links. Refuse a post with X links?
  377. $config['max_links'] = 20;
  378. // Maximum number of cites per post (prevents abuse, as more citations mean more database queries).
  379. $config['max_cites'] = 45;
  380. // Maximum number of cross-board links/citations per post.
  381. $config['max_cross'] = $config['max_cites'];
  382. // Track post citations (>>XX). Rebuilds posts after a cited post is deleted, removing broken links.
  383. // Puts a little more load on the database.
  384. $config['track_cites'] = true;
  385. // Maximum filename length (will be truncated).
  386. $config['max_filename_len'] = 255;
  387. // Maximum filename length to display (the rest can be viewed upon mouseover).
  388. $config['max_filename_display'] = 30;
  389. // How long after posting should you have to wait before being able to delete that post? (In seconds.)
  390. $config['delete_time'] = 10;
  391. // Reply limit (stops bumping thread when this is reached).
  392. $config['reply_limit'] = 250;
  393. // Image hard limit (stops allowing new image replies when this is reached if not zero).
  394. $config['image_hard_limit'] = 0;
  395. // Reply hard limit (stops allowing new replies when this is reached if not zero).
  396. $config['reply_hard_limit'] = 0;
  397. $config['robot_enable'] = false;
  398. // Strip repeating characters when making hashes.
  399. $config['robot_strip_repeating'] = true;
  400. // Enabled mutes? Tinyboard uses ROBOT9000's original 2^x implementation where x is the number of times
  401. // you have been muted in the past.
  402. $config['robot_mute'] = true;
  403. // How long before Tinyboard forgets about a mute?
  404. $config['robot_mute_hour'] = 336; // 2 weeks
  405. // If you want to alter the algorithm a bit. Default value is 2.
  406. $config['robot_mute_multiplier'] = 2; // (n^x where x is the number of previous mutes)
  407. $config['robot_mute_descritpion'] = _('You have been muted for unoriginal content.');
  408. // Automatically convert things like "..." to Unicode characters ("…").
  409. $config['auto_unicode'] = true;
  410. // Whether to turn URLs into functional links.
  411. $config['markup_urls'] = true;
  412. // Optional URL prefix for links (eg. "http://anonym.to/?").
  413. $config['link_prefix'] = '';
  414. $config['url_ads'] = &$config['link_prefix']; // leave alias
  415. // Allow "uploading" images via URL as well. Users can enter the URL of the image and then Tinyboard will
  416. // download it. Not usually recommended.
  417. $config['allow_upload_by_url'] = false;
  418. // The timeout for the above, in seconds.
  419. $config['upload_by_url_timeout'] = 15;
  420. // A wordfilter (sometimes referred to as just a "filter" or "censor") automatically scans users’ posts
  421. // as they are submitted and changes or censors particular words or phrases.
  422. // For a normal string replacement:
  423. // $config['wordfilters'][] = array('cat', 'dog');
  424. // Advanced raplcement (regular expressions):
  425. // $config['wordfilters'][] = array('/ca[rt]/', 'dog', true); // 'true' means it's a regular expression
  426. // Always act as if the user had typed "noko" into the email field.
  427. $config['always_noko'] = false;
  428. // Example: Custom tripcodes. The below example makes a tripcode of "#test123" evaluate to "!HelloWorld".
  429. // $config['custom_tripcode']['#test123'] = '!HelloWorld';
  430. // Example: Custom secure tripcode.
  431. // $config['custom_tripcode']['##securetrip'] = '!!somethingelse';
  432. // Allow users to mark their image as a "spoiler" when posting. The thumbnail will be replaced with a
  433. // static spoiler image instead (see $config['spoiler_image']).
  434. $config['spoiler_images'] = false;
  435. // With the following, you can disable certain superfluous fields or enable "forced anonymous".
  436. // When true, all names will be set to $config['anonymous'].
  437. $config['field_disable_name'] = false;
  438. // When true, there will be no email field.
  439. $config['field_disable_email'] = false;
  440. // When true, there will be no subject field.
  441. $config['field_disable_subject'] = false;
  442. // When true, there will be no subject field for replies.
  443. $config['field_disable_reply_subject'] = false;
  444. // When true, a blank password will be used for files (not usable for deletion).
  445. $config['field_disable_password'] = false;
  446. // When true, users are instead presented a selectbox for email. Contains, blank, noko and sage.
  447. $config['field_email_selectbox'] = false;
  448. // Attach country flags to posts.
  449. $config['country_flags'] = false;
  450. // Load all country flags from one file
  451. $config['country_flags_condensed'] = true;
  452. $config['country_flags_condensed_css'] = 'static/flags/flags.css';
  453. /*
  454. * ====================
  455. * Ban settings
  456. * ====================
  457. */
  458. // Require users to see the ban page at least once for a ban even if it has since expired.
  459. $config['require_ban_view'] = true;
  460. // Show the post the user was banned for on the "You are banned" page.
  461. $config['ban_show_post'] = false;
  462. // Optional HTML to append to "You are banned" pages. For example, you could include instructions and/or
  463. // a link to an email address or IRC chat room to appeal the ban.
  464. $config['ban_page_extra'] = '';
  465. // Allow users to appeal bans through Tinyboard.
  466. $config['ban_appeals'] = false;
  467. // Do not allow users to appeal bans that are shorter than this length (in seconds).
  468. $config['ban_appeals_min_length'] = 60 * 60 * 6; // 6 hours
  469. // How many ban appeals can be made for a single ban?
  470. $config['ban_appeals_max'] = 1;
  471. /*
  472. * ====================
  473. * Markup settings
  474. * ====================
  475. */
  476. // "Wiki" markup syntax ($config['wiki_markup'] in pervious versions):
  477. $config['markup'][] = array("/'''(.+?)'''/", "<strong>\$1</strong>");
  478. $config['markup'][] = array("/''(.+?)''/", "<em>\$1</em>");
  479. $config['markup'][] = array("/\*\*(.+?)\*\*/", "<span class=\"spoiler\">\$1</span>");
  480. $config['markup'][] = array("/^[ |\t]*==(.+?)==[ |\t]*$/m", "<span class=\"heading\">\$1</span>");
  481. // Highlight PHP code wrapped in <code> tags (PHP 5.3+)
  482. // $config['markup'][] = array(
  483. // '/^&lt;code&gt;(.+)&lt;\/code&gt;/ms',
  484. // function($matches) {
  485. // return highlight_string(html_entity_decode($matches[1]), true);
  486. // }
  487. // );
  488. // Repair markup with HTML Tidy. This may be slower, but it solves nesting mistakes. Tinyboad, at the
  489. // time of writing this, can not prevent out-of-order markup tags (eg. "**''test**'') without help from
  490. // HTML Tidy.
  491. $config['markup_repair_tidy'] = false;
  492. // Always regenerate markup. This isn't recommended and should only be used for debugging; by default,
  493. // Tinyboard only parses post markup when it needs to, and keeps post-markup HTML in the database. This
  494. // will significantly impact performance when enabled.
  495. $config['always_regenerate_markup'] = false;
  496. /*
  497. * ====================
  498. * Image settings
  499. * ====================
  500. */
  501. // For resizing, maximum thumbnail dimensions.
  502. $config['thumb_width'] = 255;
  503. $config['thumb_height'] = 255;
  504. // Maximum thumbnail dimensions for thread (OP) images.
  505. $config['thumb_op_width'] = 255;
  506. $config['thumb_op_height'] = 255;
  507. // Thumbnail extension ("png" recommended). Leave this empty if you want the extension to be inherited
  508. // from the uploaded file.
  509. $config['thumb_ext'] = 'png';
  510. // Maximum amount of animated GIF frames to resize (more frames can mean more processing power). A value
  511. // of "1" means thumbnails will not be animated. Requires $config['thumb_ext'] to be 'gif' (or blank) and
  512. // $config['thumb_method'] to be 'imagick', 'convert', or 'convert+gifsicle'. This value is not
  513. // respected by 'convert'; will just resize all frames if this is > 1.
  514. $config['thumb_keep_animation_frames'] = 1;
  515. /*
  516. * Thumbnailing method:
  517. *
  518. * 'gd' PHP GD (default). Only handles the most basic image formats (GIF, JPEG, PNG).
  519. * GD is a prerequisite for Tinyboard no matter what method you choose.
  520. *
  521. * 'imagick' PHP's ImageMagick bindings. Fast and efficient, supporting many image formats.
  522. * A few minor bugs. http://pecl.php.net/package/imagick
  523. *
  524. * 'convert' The command line version of ImageMagick (`convert`). Fixes most of the bugs in
  525. * PHP Imagick. `convert` produces the best still thumbnails and is highly recommended.
  526. *
  527. * 'gm' GraphicsMagick (`gm`) is a fork of ImageMagick with many improvements. It is more
  528. * efficient and gets thumbnailing done using fewer resources.
  529. *
  530. * 'convert+gifscale'
  531. * OR 'gm+gifsicle' Same as above, with the exception of using `gifsicle` (command line application)
  532. * instead of `convert` for resizing GIFs. It's faster and resulting animated
  533. * thumbnails have less artifacts than if resized with ImageMagick.
  534. */
  535. $config['thumb_method'] = 'gd';
  536. // $config['thumb_method'] = 'convert';
  537. // Command-line options passed to ImageMagick when using `convert` for thumbnailing. Don't touch the
  538. // placement of "%s" and "%d".
  539. $config['convert_args'] = '-size %dx%d %s -thumbnail %dx%d -auto-orient +profile "*" %s';
  540. // Strip EXIF metadata from JPEG files.
  541. $config['strip_exif'] = false;
  542. // Use the command-line `exiftool` tool to strip EXIF metadata without decompressing/recompressing JPEGs.
  543. // Ignored when $config['redraw_image'] is true. This is also used to adjust the Orientation tag when
  544. // $config['strip_exif'] is false and $config['convert_manual_orient'] is true.
  545. $config['use_exiftool'] = false;
  546. // Redraw the image to strip any excess data (commonly ZIP archives) WARNING: This might strip the
  547. // animation of GIFs, depending on the chosen thumbnailing method. It also requires recompressing
  548. // the image, so more processing power is required.
  549. $config['redraw_image'] = false;
  550. // Automatically correct the orientation of JPEG files using -auto-orient in `convert`. This only works
  551. // when `convert` or `gm` is selected for thumbnailing. Again, requires more processing power because
  552. // this basically does the same thing as $config['redraw_image']. (If $config['redraw_image'] is enabled,
  553. // this value doesn't matter as $config['redraw_image'] attempts to correct orientation too.)
  554. $config['convert_auto_orient'] = false;
  555. // Is your version of ImageMagick or GraphicsMagick old? Older versions may not include the -auto-orient
  556. // switch. This is a manual replacement for that switch. This is independent from the above switch;
  557. // -auto-orrient is applied when thumbnailing too.
  558. $config['convert_manual_orient'] = false;
  559. // Regular expression to check for an XSS exploit with IE 6 and 7. To disable, set to false.
  560. // Details: https://github.com/savetheinternet/Tinyboard/issues/20
  561. $config['ie_mime_type_detection'] = '/<(?:body|head|html|img|plaintext|pre|script|table|title|a href|channel|scriptlet)/i';
  562. // Allowed image file extensions.
  563. $config['allowed_ext'][] = 'jpg';
  564. $config['allowed_ext'][] = 'jpeg';
  565. $config['allowed_ext'][] = 'bmp';
  566. $config['allowed_ext'][] = 'gif';
  567. $config['allowed_ext'][] = 'png';
  568. // $config['allowed_ext'][] = 'svg';
  569. // Allowed additional file extensions (not images; downloadable files).
  570. // $config['allowed_ext_files'][] = 'txt';
  571. // $config['allowed_ext_files'][] = 'zip';
  572. // An alternative function for generating image filenames, instead of the default UNIX timestamp.
  573. // $config['filename_func'] = function($post) {
  574. // return sprintf("%s", time() . substr(microtime(), 2, 3));
  575. // };
  576. // Thumbnail to use for the non-image file uploads.
  577. $config['file_icons']['default'] = 'file.png';
  578. $config['file_icons']['zip'] = 'zip.png';
  579. // Example: Custom thumbnail for certain file extension.
  580. // $config['file_icons']['extension'] = 'some_file.png';
  581. // Location of above images.
  582. $config['file_thumb'] = 'static/%s';
  583. // Location of thumbnail to use for spoiler images.
  584. $config['spoiler_image'] = 'static/spoiler.png';
  585. // Location of thumbnail to use for deleted images.
  586. // $config['image_deleted'] = 'static/deleted.png';
  587. // When a thumbnailed image is going to be the same (in dimension), just copy the entire file and use
  588. // that as a thumbnail instead of resizing/redrawing.
  589. $config['minimum_copy_resize'] = false;
  590. // Maximum image upload size in bytes.
  591. $config['max_filesize'] = 10 * 1024 * 1024; // 10MB
  592. // Maximum image dimensions.
  593. $config['max_width'] = 10000;
  594. $config['max_height'] = $config['max_width'];
  595. // Reject duplicate image uploads.
  596. $config['image_reject_repost'] = true;
  597. // Reject duplicate image uploads within the same thread. Doesn't change anything if
  598. // $config['image_reject_repost'] is true.
  599. $config['image_reject_repost_in_thread'] = false;
  600. // Display the aspect ratio of uploaded files.
  601. $config['show_ratio'] = false;
  602. // Display the file's original filename.
  603. $config['show_filename'] = true;
  604. // Display image identification links using regex.info/exif, TinEye and Google Images.
  605. $config['image_identification'] = false;
  606. // Number of posts in a "View Last X Posts" page
  607. $config['noko50_count'] = 50;
  608. // Number of posts a thread needs before it gets a "View Last X Posts" page.
  609. // Set to an arbitrarily large value to disable.
  610. $config['noko50_min'] = 100;
  611. /*
  612. * ====================
  613. * Board settings
  614. * ====================
  615. */
  616. // Maximum amount of threads to display per page.
  617. $config['threads_per_page'] = 10;
  618. // Maximum number of pages. Content past the last page is automatically purged.
  619. $config['max_pages'] = 10;
  620. // Replies to show per thread on the board index page.
  621. $config['threads_preview'] = 5;
  622. // Same as above, but for stickied threads.
  623. $config['threads_preview_sticky'] = 1;
  624. // How to display the URI of boards. Usually '/%s/' (/b/, /mu/, etc). This doesn't change the URL. Find
  625. // $config['board_path'] if you wish to change the URL.
  626. $config['board_abbreviation'] = '/%s/';
  627. // The default name (ie. Anonymous).
  628. $config['anonymous'] = 'Anonymous';
  629. // Number of reports you can create at once.
  630. $config['report_limit'] = 3;
  631. // Attention Whoring Bar
  632. // REMEMBER TO CHMOD attentionbar.txt PROPERLY
  633. // Oh, and add jQuery in additional_javascript.
  634. $config['attention_bar'] = false;
  635. // Allow unfiltered HTML in board subtitle. This is useful for placing icons and links.
  636. $config['allow_subtitle_html'] = false;
  637. /*
  638. * ====================
  639. * Display settings
  640. * ====================
  641. */
  642. // Tinyboard has been translated into a few langauges. See inc/locale for available translations.
  643. $config['locale'] = 'en'; // (en, ru_RU.UTF-8, fi_FI.UTF-8, pl_PL.UTF-8)
  644. // Timezone to use for displaying dates/tiems.
  645. $config['timezone'] = 'America/Los_Angeles';
  646. // The format string passed to strftime() for displaying dates.
  647. // http://www.php.net/manual/en/function.strftime.php
  648. $config['post_date'] = '%m/%d/%y (%a) %H:%M:%S';
  649. // Same as above, but used for "you are banned' pages.
  650. $config['ban_date'] = '%A %e %B, %Y';
  651. // The names on the post buttons. (On most imageboards, these are both just "Post").
  652. $config['button_newtopic'] = _('New Topic');
  653. $config['button_reply'] = _('New Reply');
  654. // Assign each poster in a thread a unique ID, shown by "ID: xxxxx" before the post number.
  655. $config['poster_ids'] = false;
  656. // Number of characters in the poster ID (maximum is 40).
  657. $config['poster_id_length'] = 5;
  658. // Show thread subject in page title.
  659. $config['thread_subject_in_title'] = false;
  660. // Additional lines added to the footer of all pages.
  661. $config['footer'][] = _('All trademarks, copyrights, comments, and images on this page are owned by and are the responsibility of their respective parties.');
  662. // Characters used to generate a random password (with Javascript).
  663. $config['genpassword_chars'] = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_+';
  664. // Optional banner image at the top of every page.
  665. // $config['url_banner'] = '/banner.php';
  666. // Banner dimensions are also optional. As the banner loads after the rest of the page, everything may be
  667. // shifted down a few pixels when it does. Making the banner a fixed size will prevent this.
  668. // $config['banner_width'] = 300;
  669. // $config['banner_height'] = 100;
  670. // Custom stylesheets available for the user to choose. See the "stylesheets/" folder for a list of
  671. // available stylesheets (or create your own).
  672. $config['stylesheets']['Yotsuba B'] = ''; // Default; there is no additional/custom stylesheet for this.
  673. $config['stylesheets']['Yotsuba'] = 'yotsuba.css';
  674. // $config['stylesheets']['Futaba'] = 'futaba.css';
  675. // $config['stylesheets']['Dark'] = 'dark.css';
  676. // The prefix for each stylesheet URI. Defaults to $config['root']/stylesheets/
  677. // $config['uri_stylesheets'] = 'http://static.example.org/stylesheets/';
  678. // The default stylesheet to use.
  679. $config['default_stylesheet'] = array('Yotsuba B', $config['stylesheets']['Yotsuba B']);
  680. // Make stylesheet selections board-specific.
  681. $config['stylesheets_board'] = false;
  682. // Use Font-Awesome for displaying lock and pin icons, instead of the images in static/.
  683. // http://fortawesome.github.io/Font-Awesome/icon/pushpin/
  684. // http://fortawesome.github.io/Font-Awesome/icon/lock/
  685. $config['font_awesome'] = true;
  686. $config['font_awesome_css'] = 'stylesheets/font-awesome/css/font-awesome.min.css';
  687. /*
  688. * For lack of a better name, “boardlinks” are those sets of navigational links that appear at the top
  689. * and bottom of board pages. They can be a list of links to boards and/or other pages such as status
  690. * blogs and social network profiles/pages.
  691. *
  692. * "Groups" in the boardlinks are marked with square brackets. Tinyboard allows for infinite recursion
  693. * with groups. Each array() in $config['boards'] represents a new square bracket group.
  694. */
  695. // $config['boards'] = array(
  696. // array('a', 'b'),
  697. // array('c', 'd', 'e', 'f', 'g'),
  698. // array('h', 'i', 'j'),
  699. // array('k', array('l', 'm')),
  700. // array('status' => 'http://status.example.org/')
  701. // );
  702. // Whether or not to put brackets around the whole board list
  703. $config['boardlist_wrap_bracket'] = false;
  704. // Show page navigation links at the top as well.
  705. $config['page_nav_top'] = false;
  706. // Show "Catalog" link in page navigation. Use with the Catalog theme.
  707. // $config['catalog_link'] = 'catalog.html';
  708. // Board categories. Only used in the "Categories" theme.
  709. // $config['categories'] = array(
  710. // 'Group Name' => array('a', 'b', 'c'),
  711. // 'Another Group' => array('d')
  712. // );
  713. // Optional for the Categories theme. This is an array of name => (title, url) groups for categories
  714. // with non-board links.
  715. // $config['custom_categories'] = array(
  716. // 'Links' => array(
  717. // 'Tinyboard' => 'http://tinyboard.org',
  718. // 'Donate' => 'donate.html'
  719. // )
  720. // );
  721. // Automatically remove unnecessary whitespace when compiling HTML files from templates.
  722. $config['minify_html'] = true;
  723. /*
  724. * Advertisement HTML to appear at the top and bottom of board pages.
  725. */
  726. // $config['ad'] = array(
  727. // 'top' => '',
  728. // 'bottom' => '',
  729. // );
  730. // Display flags (when available). This config option has no effect unless poster flags are enabled (see
  731. // $config['country_flags']). Disable this if you want all previously-assigned flags to be hidden.
  732. $config['display_flags'] = true;
  733. // Location of post flags/icons (where "%s" is the flag name). Defaults to static/flags/%s.png.
  734. // $config['uri_flags'] = 'http://static.example.org/flags/%s.png';
  735. // Width and height (and more?) of post flags. Can be overridden with the Tinyboard post modifier:
  736. // <tinyboard flag style>.
  737. $config['flag_style'] = 'width:16px;height:11px;';
  738. /*
  739. * ====================
  740. * Javascript
  741. * ====================
  742. */
  743. // Additional Javascript files to include on board index and thread pages. See js/ for available scripts.
  744. $config['additional_javascript'][] = 'js/inline-expanding.js';
  745. // $config['additional_javascript'][] = 'js/local-time.js';
  746. // Some scripts require jQuery. Check the comments in script files to see what's needed. When enabling
  747. // jQuery, you should first empty the array so that "js/query.min.js" can be the first, and then re-add
  748. // "js/inline-expanding.js" or else the inline-expanding script might not interact properly with other
  749. // scripts.
  750. // $config['additional_javascript'] = array();
  751. // $config['additional_javascript'][] = 'js/jquery.min.js';
  752. // $config['additional_javascript'][] = 'js/inline-expanding.js';
  753. // $config['additional_javascript'][] = 'js/auto-reload.js';
  754. // $config['additional_javascript'][] = 'js/post-hover.js';
  755. // $config['additional_javascript'][] = 'js/style-select.js';
  756. // Where these script files are located on the web. Defaults to $config['root'].
  757. // $config['additional_javascript_url'] = 'http://static.example.org/tinyboard-javascript-stuff/';
  758. // Compile all additional scripts into one file ($config['file_script']) instead of including them seperately.
  759. $config['additional_javascript_compile'] = false;
  760. // Minify Javascript using http://code.google.com/p/minify/.
  761. $config['minify_js'] = false;
  762. // Allows js/quick-reply-old.js to work. This could make your imageboard more vulnerable to flood attacks.
  763. $config['quick_reply'] = false;
  764. /*
  765. * ====================
  766. * Video embedding
  767. * ====================
  768. */
  769. // Enable embedding (see below).
  770. $config['enable_embedding'] = false;
  771. // Custom embedding (YouTube, vimeo, etc.)
  772. // It's very important that you match the entire input (with ^ and $) or things will not work correctly.
  773. $config['embedding'] = array(
  774. array(
  775. '/^https?:\/\/(\w+\.)?youtube\.com\/watch\?v=([a-zA-Z0-9\-_]{10,11})(&.+)?$/i',
  776. '<iframe style="float: left;margin: 10px 20px;" width="%%tb_width%%" height="%%tb_height%%" frameborder="0" id="ytplayer" type="text/html" src="http://www.youtube.com/embed/$2"></iframe>'
  777. ),
  778. array(
  779. '/^https?:\/\/(\w+\.)?vimeo\.com\/(\d{2,10})(\?.+)?$/i',
  780. '<object style="float: left;margin: 10px 20px;" width="%%tb_width%%" height="%%tb_height%%"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=$2&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=$2&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="%%tb_width%%" height="%%tb_height%%"></embed></object>'
  781. ),
  782. array(
  783. '/^https?:\/\/(\w+\.)?dailymotion\.com\/video\/([a-zA-Z0-9]{2,10})(_.+)?$/i',
  784. '<object style="float: left;margin: 10px 20px;" width="%%tb_width%%" height="%%tb_height%%"><param name="movie" value="http://www.dailymotion.com/swf/video/$2"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><param name="wmode" value="transparent"></param><embed type="application/x-shockwave-flash" src="http://www.dailymotion.com/swf/video/$2" width="%%tb_width%%" height="%%tb_height%%" wmode="transparent" allowfullscreen="true" allowscriptaccess="always"></embed></object>'
  785. ),
  786. array(
  787. '/^https?:\/\/(\w+\.)?metacafe\.com\/watch\/(\d+)\/([a-zA-Z0-9_\-.]+)\/(\?.+)?$/i',
  788. '<div style="float:left;margin:10px 20px;width:%%tb_width%%px;height:%%tb_height%%px"><embed flashVars="playerVars=showStats=no|autoPlay=no" src="http://www.metacafe.com/fplayer/$2/$3.swf" width="%%tb_width%%" height="%%tb_height%%" wmode="transparent" allowFullScreen="true" allowScriptAccess="always" name="Metacafe_$2" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash"></embed></div>'
  789. ),
  790. array(
  791. '/^https?:\/\/video\.google\.com\/videoplay\?docid=(\d+)([&#](.+)?)?$/i',
  792. '<embed src="http://video.google.com/googleplayer.swf?docid=$1&hl=en&fs=true" style="width:%%tb_width%%px;height:%%tb_height%%px;float:left;margin:10px 20px" allowFullScreen="true" allowScriptAccess="always" type="application/x-shockwave-flash"></embed>'
  793. ),
  794. array(
  795. '/^https?:\/\/(\w+\.)?vocaroo\.com\/i\/([a-zA-Z0-9]{2,15})$/i',
  796. '<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>'
  797. )
  798. );
  799. // Embedding width and height.
  800. $config['embed_width'] = 300;
  801. $config['embed_height'] = 246;
  802. /*
  803. * ====================
  804. * Error messages
  805. * ====================
  806. */
  807. // Error messages
  808. $config['error']['bot'] = _('You look like a bot.');
  809. $config['error']['referer'] = _('Your browser sent an invalid or no HTTP referer.');
  810. $config['error']['toolong'] = _('The %s field was too long.');
  811. $config['error']['toolong_body'] = _('The body was too long.');
  812. $config['error']['tooshort_body'] = _('The body was too short or empty.');
  813. $config['error']['noimage'] = _('You must upload an image.');
  814. $config['error']['nomove'] = _('The server failed to handle your upload.');
  815. $config['error']['fileext'] = _('Unsupported image format.');
  816. $config['error']['noboard'] = _('Invalid board!');
  817. $config['error']['nonexistant'] = _('Thread specified does not exist.');
  818. $config['error']['locked'] = _('Thread locked. You may not reply at this time.');
  819. $config['error']['reply_hard_limit'] = _('Thread has reached its maximum reply limit.');
  820. $config['error']['image_hard_limit'] = _('Thread has reached its maximum image limit.');
  821. $config['error']['nopost'] = _('You didn\'t make a post.');
  822. $config['error']['flood'] = _('Flood detected; Post discarded.');
  823. $config['error']['spam'] = _('Your request looks automated; Post discarded.');
  824. $config['error']['unoriginal'] = _('Unoriginal content!');
  825. $config['error']['muted'] = _('Unoriginal content! You have been muted for %d seconds.');
  826. $config['error']['youaremuted'] = _('You are muted! Expires in %d seconds.');
  827. $config['error']['dnsbl'] = _('Your IP address is listed in %s.');
  828. $config['error']['toomanylinks'] = _('Too many links; flood detected.');
  829. $config['error']['toomanycites'] = _('Too many cites; post discarded.');
  830. $config['error']['toomanycross'] = _('Too many cross-board links; post discarded.');
  831. $config['error']['nodelete'] = _('You didn\'t select anything to delete.');
  832. $config['error']['noreport'] = _('You didn\'t select anything to report.');
  833. $config['error']['toomanyreports'] = _('You can\'t report that many posts at once.');
  834. $config['error']['invalidpassword'] = _('Wrong password…');
  835. $config['error']['invalidimg'] = _('Invalid image.');
  836. $config['error']['unknownext'] = _('Unknown file extension.');
  837. $config['error']['filesize'] = _('Maximum file size: %maxsz% bytes<br>Your file\'s size: %filesz% bytes');
  838. $config['error']['maxsize'] = _('The file was too big.');
  839. $config['error']['fileexists'] = _('That file <a href="%s">already exists</a>!');
  840. $config['error']['fileexistsinthread'] = _('That file <a href="%s">already exists</a> in this thread!');
  841. $config['error']['delete_too_soon'] = _('You\'ll have to wait another %s before deleting that.');
  842. $config['error']['mime_exploit'] = _('MIME type detection XSS exploit (IE) detected; post discarded.');
  843. $config['error']['invalid_embed'] = _('Couldn\'t make sense of the URL of the video you tried to embed.');
  844. $config['error']['captcha'] = _('You seem to have mistyped the verification.');
  845. // Moderator errors
  846. $config['error']['toomanyunban'] = _('You are only allowed to unban %s users at a time. You tried to unban %u users.');
  847. $config['error']['invalid'] = _('Invalid username and/or password.');
  848. $config['error']['notamod'] = _('You are not a mod…');
  849. $config['error']['invalidafter'] = _('Invalid username and/or password. Your user may have been deleted or changed.');
  850. $config['error']['malformed'] = _('Invalid/malformed cookies.');
  851. $config['error']['missedafield'] = _('Your browser didn\'t submit an input when it should have.');
  852. $config['error']['required'] = _('The %s field is required.');
  853. $config['error']['invalidfield'] = _('The %s field was invalid.');
  854. $config['error']['boardexists'] = _('There is already a %s board.');
  855. $config['error']['noaccess'] = _('You don\'t have permission to do that.');
  856. $config['error']['invalidpost'] = _('That post doesn\'t exist…');
  857. $config['error']['404'] = _('Page not found.');
  858. $config['error']['modexists'] = _('That mod <a href="?/users/%d">already exists</a>!');
  859. $config['error']['invalidtheme'] = _('That theme doesn\'t exist!');
  860. $config['error']['csrf'] = _('Invalid security token! Please go back and try again.');
  861. $config['error']['badsyntax'] = _('Your code contained PHP syntax errors. Please go back and correct them. PHP says: ');
  862. /*
  863. * =========================
  864. * Directory/file settings
  865. * =========================
  866. */
  867. // The root directory, including the trailing slash, for Tinyboard.
  868. // Examples: '/', 'http://boards.chan.org/', '/chan/'.
  869. if (isset($_SERVER['REQUEST_URI'])) {
  870. $request_uri = $_SERVER['REQUEST_URI'];
  871. if (isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] !== '')
  872. $request_uri = substr($request_uri, 0, - 1 - strlen($_SERVER['QUERY_STRING']));
  873. $config['root'] = str_replace('\\', '/', dirname($request_uri)) == '/'
  874. ? '/' : str_replace('\\', '/', dirname($request_uri)) . '/';
  875. unset($request_uri);
  876. } else
  877. $config['root'] = '/'; // CLI mode
  878. // The scheme and domain. This is used to get the site's absolute URL (eg. for image identification links).
  879. // If you use the CLI tools, it would be wise to override this setting.
  880. $config['domain'] = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') ? 'https://' : 'http://';
  881. $config['domain'] .= isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'localhost';
  882. // If for some reason the folders and static HTML index files aren't in the current working direcotry,
  883. // enter the directory path here. Otherwise, keep it false.
  884. $config['root_file'] = false;
  885. // Location of files.
  886. $config['file_index'] = 'index.html';
  887. $config['file_page'] = '%d.html';
  888. $config['file_page50'] = '%d+50.html';
  889. $config['file_mod'] = 'mod.php';
  890. $config['file_post'] = 'post.php';
  891. $config['file_script'] = 'main.js';
  892. // Board directory, followed by a forward-slash (/).
  893. $config['board_path'] = '%s/';
  894. // Misc directories.
  895. $config['dir']['img'] = 'src/';
  896. $config['dir']['thumb'] = 'thumb/';
  897. $config['dir']['res'] = 'res/';
  898. // For load balancing, having a seperate server (and domain/subdomain) for serving static content is
  899. // possible. This can either be a directory or a URL. Defaults to $config['root'] . 'static/'.
  900. // $config['dir']['static'] = 'http://static.example.org/';
  901. // Where to store the .html templates. This folder and the template files must exist.
  902. $config['dir']['template'] = getcwd() . '/templates';
  903. // Location of Tinyboard "themes".
  904. $config['dir']['themes'] = getcwd() . '/templates/themes';
  905. // Same as above, but a URI (accessable by web interface).
  906. $config['dir']['themes_uri'] = 'templates/themes';
  907. // Home directory. Used by themes.
  908. $config['dir']['home'] = '';
  909. // Location of a blank 1x1 gif file. Only used when country_flags_condensed is enabled
  910. $config['uri_blank'] = $config['root'] . 'static/blank.gif';
  911. // Static images. These can be URLs OR base64 (data URI scheme). These are only used if
  912. // $config['font_awesome'] is false (default).
  913. // $config['image_sticky'] = 'static/sticky.gif';
  914. // $config['image_locked'] = 'static/locked.gif';
  915. // $config['image_bumplocked'] = 'static/sage.gif'.
  916. // If you want to put images and other dynamic-static stuff on another (preferably cookieless) domain.
  917. // This will override $config['root'] and $config['dir']['...'] directives. "%s" will get replaced with
  918. // $board['dir'], which includes a trailing slash.
  919. // $config['uri_thumb'] = 'http://images.example.org/%sthumb/';
  920. // $config['uri_img'] = 'http://images.example.org/%ssrc/';
  921. // Set custom locations for stylesheets and the main script file. This can be used for load balancing
  922. // across multiple servers or hostnames.
  923. // $config['url_stylesheet'] = 'http://static.example.org/style.css'; // main/base stylesheet
  924. // $config['url_javascript'] = 'http://static.example.org/main.js';
  925. // Website favicon.
  926. // $config['url_favicon'] = '/favicon.gif';
  927. // EXPERIMENTAL: Try not to build pages when we shouldn't have to.
  928. $config['try_smarter'] = true;
  929. /*
  930. * ====================
  931. * Mod settings
  932. * ====================
  933. */
  934. // Limit how many bans can be removed via the ban list. Set to false (or zero) for no limit.
  935. $config['mod']['unban_limit'] = false;
  936. // Whether or not to lock moderator sessions to IP addresses. This makes cookie theft ineffective.
  937. $config['mod']['lock_ip'] = true;
  938. // The page that is first shown when a moderator logs in. Defaults to the dashboard (?/).
  939. $config['mod']['default'] = '/';
  940. // Mod links (full HTML).
  941. $config['mod']['link_delete'] = '[D]';
  942. $config['mod']['link_ban'] = '[B]';
  943. $config['mod']['link_bandelete'] = '[B&amp;D]';
  944. $config['mod']['link_deletefile'] = '[F]';
  945. $config['mod']['link_spoilerimage'] = '[S]';
  946. $config['mod']['link_deletebyip'] = '[D+]';
  947. $config['mod']['link_deletebyip_global'] = '[D++]';
  948. $config['mod']['link_sticky'] = '[Sticky]';
  949. $config['mod']['link_desticky'] = '[-Sticky]';
  950. $config['mod']['link_lock'] = '[Lock]';
  951. $config['mod']['link_unlock'] = '[-Lock]';
  952. $config['mod']['link_bumplock'] = '[Sage]';
  953. $config['mod']['link_bumpunlock'] = '[-Sage]';
  954. $config['mod']['link_editpost'] = '[Edit]';
  955. $config['mod']['link_move'] = '[Move]';
  956. // Moderator capcodes.
  957. $config['capcode'] = ' <span class="capcode">## %s</span>';
  958. // "## Custom" becomes lightgreen, italic and bold:
  959. //$config['custom_capcode']['Custom'] ='<span class="capcode" style="color:lightgreen;font-style:italic;font-weight:bold"> ## %s</span>';
  960. // "## Mod" makes everything purple, including the name and tripcode:
  961. //$config['custom_capcode']['Mod'] = array(
  962. // '<span class="capcode" style="color:purple"> ## %s</span>',
  963. // 'color:purple', // Change name style; optional
  964. // 'color:purple' // Change tripcode style; optional
  965. //);
  966. // "## Admin" makes everything red and bold, including the name and tripcode:
  967. //$config['custom_capcode']['Admin'] = array(
  968. // '<span class="capcode" style="color:red;font-weight:bold"> ## %s</span>',
  969. // 'color:red;font-weight:bold', // Change name style; optional
  970. // 'color:red;font-weight:bold' // Change tripcode style; optional
  971. //);
  972. // Enable the moving of single replies
  973. $config['move_replies'] = false;
  974. // How often (minimum) to purge the ban list of expired bans (which have been seen). Only works when
  975. // $config['cache'] is enabled and working.
  976. $config['purge_bans'] = 60 * 60 * 12; // 12 hours
  977. // Do DNS lookups on IP addresses to get their hostname for the moderator IP pages (?/IP/x.x.x.x).
  978. $config['mod']['dns_lookup'] = true;
  979. // How many recent posts, per board, to show in ?/IP/x.x.x.x.
  980. $config['mod']['ip_recentposts'] = 5;
  981. // Number of posts to display on the reports page.
  982. $config['mod']['recent_reports'] = 10;
  983. // Number of actions to show per page in the moderation log.
  984. $config['mod']['modlog_page'] = 350;
  985. // Number of bans to show per page in the ban list.
  986. $config['mod']['banlist_page'] = 350;
  987. // Number of news entries to display per page.
  988. $config['mod']['news_page'] = 40;
  989. // Number of results to display per page.
  990. $config['mod']['search_page'] = 200;
  991. // Number of entries to show per page in the moderator noticeboard.
  992. $config['mod']['noticeboard_page'] = 50;
  993. // Number of entries to summarize and display on the dashboard.
  994. $config['mod']['noticeboard_dashboard'] = 5;
  995. // Check public ban message by default.
  996. $config['mod']['check_ban_message'] = false;
  997. // Default public ban message. In public ban messages, %length% is replaced with "for x days" or
  998. // "permanently" (with %LENGTH% being the uppercase equivalent).
  999. $config['mod']['default_ban_message'] = _('USER WAS BANNED FOR THIS POST');
  1000. // $config['mod']['default_ban_message'] = 'USER WAS BANNED %LENGTH% FOR THIS POST';
  1001. // HTML to append to post bodies for public bans messages (where "%s" is the message).
  1002. $config['mod']['ban_message'] = '<span class="public_ban">(%s)</span>';
  1003. // When moving a thread to another board and choosing to keep a "shadow thread", an automated post (with
  1004. // a capcode) will be made, linking to the new location for the thread. "%s" will be replaced with a
  1005. // standard cross-board post citation (>>>/board/xxx)
  1006. $config['mod']['shadow_mesage'] = 'Moved to %s.';
  1007. // Capcode to use when posting the above message.
  1008. $config['mod']['shadow_capcode'] = 'Mod';
  1009. // Name to use when posting the above message. If false, $config['anonymous'] will be used.
  1010. $config['mod']['shadow_name'] = false;
  1011. // PHP time limit for ?/rebuild. A value of 0 should cause PHP to wait indefinitely.
  1012. $config['mod']['rebuild_timelimit'] = 0;
  1013. // PM snippet (for ?/inbox) length in characters.
  1014. $config['mod']['snippet_length'] = 75;
  1015. // Edit raw HTML in posts by default.
  1016. $config['mod']['raw_html_default'] = false;
  1017. // Automatically dismiss all reports regarding a thread when it is locked.
  1018. $config['mod']['dismiss_reports_on_lock'] = true;
  1019. // Replace ?/config with a simple text editor for editing inc/instance-config.php.
  1020. $config['mod']['config_editor_php'] = false;
  1021. /*
  1022. * ====================
  1023. * Mod permissions
  1024. * ====================
  1025. */
  1026. // Probably best not to change this unless you are smart enough to figure out what you're doing. If you
  1027. // decide to change it, remember that it is impossible to redefinite/overwrite groups; you may only add
  1028. // new ones.
  1029. $config['mod']['groups'] = array(
  1030. 10 => 'Janitor',
  1031. 20 => 'Mod',
  1032. 30 => 'Admin',
  1033. // 98 => 'God',
  1034. 99 => 'Disabled'
  1035. );
  1036. // If you add stuff to the above, you'll need to call this function immediately after.
  1037. define_groups();
  1038. // Example: Adding a new permissions group.
  1039. // $config['mod']['groups'][0] = 'NearlyPowerless';
  1040. // define_groups();
  1041. // Capcode permissions.
  1042. $config['mod']['capcode'] = array(
  1043. // JANITOR => array('Janitor'),
  1044. MOD => array('Mod'),
  1045. ADMIN => true
  1046. );
  1047. // Example: Allow mods to post with "## Moderator" as well
  1048. // $config['mod']['capcode'][MOD][] = 'Moderator';
  1049. // Example: Allow janitors to post with any capcode
  1050. // $config['mod']['capcode'][JANITOR] = true;
  1051. // Set any of the below to "DISABLED" to make them unavailable for everyone.
  1052. // Don't worry about per-board moderators. Let all mods moderate any board.
  1053. $config['mod']['skip_per_board'] = false;
  1054. /* Post Controls */
  1055. // View IP addresses
  1056. $config['mod']['show_ip'] = MOD;
  1057. // Delete a post
  1058. $config['mod']['delete'] = JANITOR;
  1059. // Ban a user for a post
  1060. $config['mod']['ban'] = MOD;
  1061. // Ban and delete (one click; instant)
  1062. $config['mod']['bandelete'] = MOD;
  1063. // Remove bans
  1064. $config['mod']['unban'] = MOD;
  1065. // Spoiler image
  1066. $config['mod']['spoilerimage'] = JANITOR;
  1067. // Delete file (and keep post)
  1068. $config['mod']['deletefile'] = JANITOR;
  1069. // Delete all posts by IP
  1070. $config['mod']['deletebyip'] = MOD;
  1071. // Delete all posts by IP across all boards
  1072. $config['mod']['deletebyip_global'] = ADMIN;
  1073. // Sticky a thread
  1074. $config['mod']['sticky'] = MOD;
  1075. // Lock a thread
  1076. $config['mod']['lock'] = MOD;
  1077. // Post in a locked thread
  1078. $config['mod']['postinlocked'] = MOD;
  1079. // Prevent a thread from being bumped
  1080. $config['mod']['bumplock'] = MOD;
  1081. // View whether a thread has been bumplocked ("-1" to allow non-mods to see too)
  1082. $config['mod']['view_bumplock'] = MOD;
  1083. // Edit posts
  1084. $config['mod']['editpost'] = ADMIN;
  1085. // "Move" a thread to another board (EXPERIMENTAL; has some known bugs)
  1086. $config['mod']['move'] = DISABLED;
  1087. // Bypass "field_disable_*" (forced anonymity, etc.)
  1088. $config['mod']['bypass_field_disable'] = MOD;
  1089. // Post bypass unoriginal content check on robot-enabled boards
  1090. $config['mod']['postunoriginal'] = ADMIN;
  1091. // Bypass flood check
  1092. $config['mod']['bypass_filters'] = ADMIN;
  1093. $config['mod']['flood'] = &$config['mod']['bypass_filters'];
  1094. // Raw HTML posting
  1095. $config['mod']['rawhtml'] = ADMIN;
  1096. /* Administration */
  1097. // View the report queue
  1098. $config['mod']['reports'] = JANITOR;
  1099. // Dismiss an abuse report
  1100. $config['mod']['report_dismiss'] = JANITOR;
  1101. // Dismiss all abuse reports by an IP
  1102. $config['mod']['report_dismiss_ip'] = JANITOR;
  1103. // View list of bans
  1104. $config['mod']['view_banlist'] = MOD;
  1105. // View the username of the mod who made a ban
  1106. $config['mod']['view_banstaff'] = MOD;
  1107. // If the moderator doesn't fit the $config['mod']['view_banstaff''] (previous) permission, show him just
  1108. // a "?" instead. Otherwise, it will be "Mod" or "Admin".
  1109. $config['mod']['view_banquestionmark'] = false;
  1110. // Show expired bans in the ban list (they are kept in cache until the culprit returns)
  1111. $config['mod']['view_banexpired'] = true;
  1112. // View ban for IP address
  1113. $config['mod']['view_ban'] = $config['mod']['view_banlist'];
  1114. // View IP address notes
  1115. $config['mod']['view_notes'] = JANITOR;
  1116. // Create notes
  1117. $config['mod']['create_notes'] = $config['mod']['view_notes'];
  1118. // Remote notes
  1119. $config['mod']['remove_notes'] = ADMIN;
  1120. // Create a new board
  1121. $config['mod']['newboard'] = ADMIN;
  1122. // Manage existing boards (change title, etc)
  1123. $config['mod']['manageboards'] = ADMIN;
  1124. // Delete a board
  1125. $config['mod']['deleteboard'] = ADMIN;
  1126. // List/manage users
  1127. $config['mod']['manageusers'] = MOD;
  1128. // Promote/demote users
  1129. $config['mod']['promoteusers'] = ADMIN;
  1130. // Edit any users' login information
  1131. $config['mod']['editusers'] = ADMIN;
  1132. // Change user's own password
  1133. $config['mod']['change_password'] = JANITOR;
  1134. // Delete a user
  1135. $config['mod']['deleteusers'] = ADMIN;
  1136. // Create a user
  1137. $config['mod']['createusers'] = ADMIN;
  1138. // View the moderation log
  1139. $config['mod']['modlog'] = ADMIN;
  1140. // View IP addresses of other mods in ?/log
  1141. $config['mod']['show_ip_modlog'] = ADMIN;
  1142. // View relevant moderation log entries on IP address pages (ie. ban history, etc.) Warning: Can be
  1143. // pretty resource intensive if your mod logs are huge.
  1144. $config['mod']['modlog_ip'] = MOD;
  1145. // Create a PM (viewing mod usernames)
  1146. $config['mod']['create_pm'] = JANITOR;
  1147. // Read any PM, sent to or from anybody
  1148. $config['mod']['master_pm'] = ADMIN;
  1149. // Rebuild everything
  1150. $config['mod']['rebuild'] = ADMIN;
  1151. // Search through posts, IP address notes and bans
  1152. $config['mod']['search'] = JANITOR;
  1153. // Allow searching posts (can be used with board configuration file to disallow searching through a
  1154. // certain board)
  1155. $config['mod']['search_posts'] = JANITOR;
  1156. // Read the moderator noticeboard
  1157. $config['mod']['noticeboard'] = JANITOR;
  1158. // Post to the moderator noticeboard
  1159. $config['mod']['noticeboard_post'] = MOD;
  1160. // Delete entries from the noticeboard
  1161. $config['mod']['noticeboard_delete'] = ADMIN;
  1162. // Public ban messages; attached to posts
  1163. $config['mod']['public_ban'] = MOD;
  1164. // Manage and install themes for homepage
  1165. $config['mod']['themes'] = ADMIN;
  1166. // Post news entries
  1167. $config['mod']['news'] = ADMIN;
  1168. // Custom name when posting news
  1169. $config['mod']['news_custom'] = ADMIN;
  1170. // Delete news entries
  1171. $config['mod']['news_delete'] = ADMIN;
  1172. // Execute un-filtered SQL queries on the database (?/debug/sql)
  1173. $config['mod']['debug_sql'] = DISABLED;
  1174. // Look through all cache values for debugging when APC is enabled (?/debug/apc)
  1175. $config['mod']['debug_apc'] = ADMIN;
  1176. // Edit the current configuration (via web interface)
  1177. $config['mod']['edit_config'] = ADMIN;
  1178. // View ban appeals
  1179. $config['mod']['view_ban_appeals'] = MOD;
  1180. // Accept and deny ban appeals
  1181. $config['mod']['ban_appeals'] = MOD;
  1182. // Config editor permissions
  1183. $config['mod']['config'] = array();
  1184. // Disable the following configuration variables from being changed via ?/config. The following default
  1185. // banned variables are considered somewhat dangerous.
  1186. $config['mod']['config'][DISABLED] = array(
  1187. 'mod>config',
  1188. 'mod>config_editor_php',
  1189. 'mod>groups',
  1190. 'convert_args',
  1191. 'db>password',
  1192. );
  1193. $config['mod']['config'][JANITOR] = array(
  1194. '!', // Allow editing ONLY the variables listed (in this case, nothing).
  1195. );
  1196. $config['mod']['config'][MOD] = array(
  1197. '!', // Allow editing ONLY the variables listed (plus that in $config['mod']['config'][JANITOR]).
  1198. 'global_message',
  1199. );
  1200. // Example: Disallow ADMIN from editing (and viewing) $config['db']['password'].
  1201. // $config['mod']['config'][ADMIN] = array(
  1202. // 'db>password',
  1203. // );
  1204. // Example: Allow ADMIN to edit anything other than $config['db']
  1205. // (and $config['mod']['config'][DISABLED]).
  1206. // $config['mod']['config'][ADMIN] = array(
  1207. // 'db',
  1208. // );
  1209. /*
  1210. * ====================
  1211. * Public post search
  1212. * ====================
  1213. */
  1214. $config['search'] = array();
  1215. // Enable the search form
  1216. $config['search']['enable'] = false;
  1217. // Maximal number of queries per IP address per minutes
  1218. $config['search']['queries_per_minutes'] = Array(15, 2);
  1219. // Global maximal number of queries per minutes
  1220. $config['search']['queries_per_minutes_all'] = Array(50, 2);
  1221. // Limit of search results
  1222. $config['search']['search_limit'] = 100;
  1223. // Boards for searching
  1224. //$config['search']['boards'] = array('a', 'b', 'c', 'd', 'e');
  1225. /*
  1226. * ====================
  1227. * Events (PHP 5.3.0+)
  1228. * ====================
  1229. */
  1230. // http://tinyboard.org/docs/?p=Events
  1231. // event_handler('post', function($post) {
  1232. // // do something
  1233. // });
  1234. // event_handler('post', function($post) {
  1235. // // do something else
  1236. //
  1237. // // return an error (reject post)
  1238. // return 'Sorry, you cannot post that!';
  1239. // });
  1240. /*
  1241. * =============
  1242. * API settings
  1243. * =============
  1244. */
  1245. // Whether or not to enable the 4chan-compatible API, disabled by default. See
  1246. // https://github.com/4chan/4chan-API for API specification.
  1247. $config['api']['enabled'] = false;
  1248. // Extra fields in to be shown in the array that are not in the 4chan-API. You can get these by taking a
  1249. // look at the schema for posts_ tables. The array should be formatted as $db_column => $translated_name.
  1250. // Example: Adding the pre-markup post body to the API as "com_nomarkup".
  1251. // $config['api']['extra_fields'] = array('body_nomarkup' => 'com_nomarkup');
  1252. /*
  1253. * ====================
  1254. * Other/uncategorized
  1255. * ====================
  1256. */
  1257. // Meta keywords. It's probably best to include these in per-board configurations.
  1258. // $config['meta_keywords'] = 'chan,anonymous discussion,imageboard,tinyboard';
  1259. // Link imageboard to your Google Analytics account to track users and provide traffic insights.
  1260. // $config['google_analytics'] = 'UA-xxxxxxx-yy';
  1261. // Keep the Google Analytics cookies to one domain -- ga._setDomainName()
  1262. // $config['google_analytics_domain'] = 'www.example.org';
  1263. // If you use Varnish, Squid, or any similar caching reverse-proxy in front of Tinyboard, you can
  1264. // configure Tinyboard to PURGE files when they're written to.
  1265. // $config['purge'] = array(
  1266. // array('127.0.0.1', 80)
  1267. // array('127.0.0.1', 80, 'example.org')
  1268. // );
  1269. // Connection timeout for $config['purge'], in seconds.
  1270. $config['purge_timeout'] = 3;
  1271. // Additional mod.php?/ pages. Look in inc/mod/pages.php for help.
  1272. // $config['mod']['custom_pages']['/something/(\d+)'] = function($id) {
  1273. // global $config;
  1274. // if (!hasPermission($config['mod']['something']))
  1275. // error($config['error']['noaccess']);
  1276. // // ...
  1277. // };
  1278. // Example: Add links to dashboard (will all be in a new "Other" category).
  1279. // $config['mod']['dashboard_links']['Something'] = '?/something';
  1280. // Remote servers. I'm not even sure if this code works anymore. It might. Haven't tried it in a while.
  1281. // $config['remote']['static'] = array(
  1282. // 'host' => 'static.example.org',
  1283. // 'auth' => array(
  1284. // 'method' => 'plain',
  1285. // 'username' => 'username',
  1286. // 'password' => 'password!123'
  1287. // ),
  1288. // 'type' => 'scp'
  1289. // );
  1290. // Regex for board URIs. Don't add "`" character or any Unicode that MySQL can't handle. 58 characters
  1291. // is the absolute maximum, because MySQL cannot handle table names greater than 64 characters.
  1292. $config['board_regex'] = '[0-9a-zA-Z$_\x{0080}-\x{FFFF}]{1,58}';
  1293. // Youtube.js embed HTML code
  1294. $config['youtube_js_html'] = '<div class="video-container" data-video="$2">'.
  1295. '<a href="$0" target="_blank" class="file">'.
  1296. '<img style="width:360px;height:270px;" src="//img.youtube.com/vi/$2/0.jpg" class="post-image"/>'.
  1297. '</a></div>';