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.

config.php 78KB

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