2013-10-31 23:14:19 +01:00
< ? php
/*
* Instance Configuration
* ----------------------
* Edit this file and not config . php for imageboard configuration .
*
* You can copy values from config . php ( defaults ) and paste them here .
*/
2015-02-21 08:13:52 +01:00
require_once " lib/htmlpurifier-4.6.0/library/HTMLPurifier.auto.php " ;
2014-09-24 22:19:58 +02:00
require_once " 8chan-functions.php " ;
2013-10-31 23:14:19 +01:00
2014-10-04 22:44:42 +02:00
// Note - you may want to change some of these in secrets.php instead of here
// See the secrets.example.php file
2013-10-31 23:14:19 +01:00
$config [ 'db' ][ 'server' ] = 'localhost' ;
$config [ 'db' ][ 'database' ] = '8chan' ;
$config [ 'db' ][ 'prefix' ] = '' ;
$config [ 'db' ][ 'user' ] = 'root' ;
2014-09-24 22:14:02 +02:00
$config [ 'db' ][ 'password' ] = '' ;
2014-05-17 22:01:14 +02:00
$config [ 'timezone' ] = 'UTC' ;
2014-10-23 04:21:21 +02:00
$config [ 'cache' ][ 'enabled' ] = 'apc' ;
2014-10-19 03:07:04 +02:00
2013-10-31 23:14:19 +01:00
$config [ 'cookies' ][ 'mod' ] = 'mod' ;
2014-09-24 22:14:02 +02:00
$config [ 'cookies' ][ 'salt' ] = '' ;
2014-10-19 03:07:04 +02:00
2014-09-27 01:54:53 +02:00
$config [ 'spam' ][ 'hidden_inputs_max_pass' ] = 128 ;
$config [ 'spam' ][ 'hidden_inputs_expire' ] = 60 * 60 * 4 ; // three hours
2014-10-19 03:07:04 +02:00
2014-09-24 22:14:02 +02:00
$config [ 'flood_time' ] = 5 ;
2014-10-05 19:07:59 +02:00
$config [ 'flood_time_ip' ] = 30 ;
2014-09-23 03:29:06 +02:00
$config [ 'flood_time_same' ] = 2 ;
2014-05-17 22:01:14 +02:00
$config [ 'max_body' ] = 5000 ;
2014-10-08 02:33:32 +02:00
$config [ 'reply_limit' ] = 300 ;
2013-10-31 23:14:19 +01:00
$config [ 'thumb_width' ] = 255 ;
$config [ 'thumb_height' ] = 255 ;
$config [ 'max_width' ] = 10000 ;
$config [ 'max_height' ] = 10000 ;
2014-09-20 17:21:09 +02:00
$config [ 'threads_per_page' ] = 15 ;
2014-10-08 02:33:32 +02:00
$config [ 'max_pages' ] = 15 ;
2013-10-31 23:14:19 +01:00
$config [ 'threads_preview' ] = 5 ;
$config [ 'root' ] = '/' ;
2014-09-24 22:14:02 +02:00
$config [ 'secure_trip_salt' ] = '' ;
2014-09-20 17:21:09 +02:00
$config [ 'always_noko' ] = true ;
$config [ 'allow_no_country' ] = true ;
2014-09-21 19:51:42 +02:00
$config [ 'thread_subject_in_title' ] = true ;
$config [ 'spam' ][ 'hidden_inputs_max_pass' ] = 128 ;
2014-09-26 00:53:56 +02:00
$config [ 'ayah_enabled' ] = true ;
2014-10-19 03:07:04 +02:00
2014-10-29 07:23:17 +01:00
2013-10-31 23:14:19 +01:00
// Image shit
2015-02-17 01:35:01 +01:00
$config [ 'thumb_method' ] = 'convert' ;
2015-01-29 02:57:31 +01:00
$config [ 'thumb_ext' ] = 'jpg' ;
$config [ 'thumb_keep_animation_frames' ] = 1 ;
2013-10-31 23:14:19 +01:00
$config [ 'show_ratio' ] = true ;
2014-09-21 19:51:42 +02:00
//$config['allow_upload_by_url'] = true;
2014-10-08 02:33:32 +02:00
$config [ 'max_filesize' ] = 1024 * 1024 * 8 ; // 8MB
2013-10-31 23:14:19 +01:00
$config [ 'spoiler_images' ] = true ;
2014-09-24 06:25:55 +02:00
$config [ 'image_reject_repost' ] = true ;
2014-05-17 22:01:14 +02:00
$config [ 'allowed_ext_files' ][] = 'webm' ;
2014-11-19 09:53:35 +01:00
$config [ 'allowed_ext_files' ][] = 'mp4' ;
2014-09-21 19:51:42 +02:00
$config [ 'webm' ][ 'use_ffmpeg' ] = true ;
$config [ 'webm' ][ 'allow_audio' ] = true ;
2015-02-17 01:35:01 +01:00
$config [ 'webm' ][ 'max_length' ] = 60 * 30 ;
2013-10-31 23:14:19 +01:00
// Mod shit
2014-10-29 07:23:17 +01:00
$config [ 'mod' ][ 'groups' ][ 25 ] = 'GlobalVolunteer' ;
$config [ 'mod' ][ 'groups' ][ 19 ] = 'BoardVolunteer' ;
2013-10-31 23:14:19 +01:00
define_groups ();
2014-10-29 07:23:17 +01:00
$config [ 'mod' ][ 'capcode' ][ BOARDVOLUNTEER ] = array ( 'Board Volunteer' );
$config [ 'mod' ][ 'capcode' ][ MOD ] = array ( 'Board Owner' );
$config [ 'mod' ][ 'capcode' ][ GLOBALVOLUNTEER ] = array ( 'Global Volunteer' );
2015-01-05 13:38:16 +01:00
$config [ 'mod' ][ 'capcode' ][ ADMIN ] = array ( 'Admin' , 'Global Volunteer' );
2014-05-17 22:01:14 +02:00
$config [ 'custom_capcode' ][ 'Admin' ] = array (
2015-01-22 08:49:15 +01:00
'<span class="capcode" title="This post was written by the global 8chan administrator."> <i class="fa fa-wheelchair" style="color:blue;"></i> <span style="color:red">8chan Administrator</span></span>' ,
2014-05-17 22:01:14 +02:00
);
2014-10-29 07:23:17 +01:00
//$config['mod']['view_banlist'] = GLOBALVOLUNTEER;
2014-09-23 17:31:52 +02:00
$config [ 'mod' ][ 'recent_reports' ] = 65535 ;
2014-10-17 03:53:52 +02:00
$config [ 'mod' ][ 'ip_less_recentposts' ] = 75 ;
2014-10-08 02:33:32 +02:00
$config [ 'ban_show_post' ] = true ;
2013-10-31 23:14:19 +01:00
// Board shit
2014-10-01 01:06:48 +02:00
$config [ 'max_links' ] = 40 ;
2014-09-27 23:23:51 +02:00
$config [ 'poster_id_length' ] = 6 ;
2014-10-23 04:18:23 +02:00
$config [ 'ayah_enabled' ] = false ;
$config [ 'cbRecaptcha' ] = true ;
2014-05-17 22:01:14 +02:00
$config [ 'url_banner' ] = '/banners.php' ;
2014-10-23 04:18:23 +02:00
$config [ 'additional_javascript_compile' ] = true ;
2013-10-31 23:14:19 +01:00
//$config['default_stylesheet'] = array('Notsuba', 'notsuba.css');
$config [ 'additional_javascript' ][] = 'js/jquery.min.js' ;
2014-10-23 04:18:23 +02:00
$config [ 'additional_javascript' ][] = 'js/jquery.mixitup.min.js' ;
2014-12-14 12:25:43 +01:00
$config [ 'additional_javascript' ][] = 'js/jquery-ui.custom.min.js' ;
2014-10-23 04:18:23 +02:00
$config [ 'additional_javascript' ][] = 'js/catalog.js' ;
2014-11-14 15:09:52 +01:00
$config [ 'additional_javascript' ][] = 'js/captcha.js' ;
2013-10-31 23:14:19 +01:00
$config [ 'additional_javascript' ][] = 'js/jquery.tablesorter.min.js' ;
2014-09-23 03:29:06 +02:00
$config [ 'additional_javascript' ][] = 'js/options.js' ;
$config [ 'additional_javascript' ][] = 'js/style-select.js' ;
$config [ 'additional_javascript' ][] = 'js/options/general.js' ;
2014-05-17 22:01:14 +02:00
$config [ 'additional_javascript' ][] = 'js/post-hover.js' ;
2014-10-07 03:01:01 +02:00
$config [ 'additional_javascript' ][] = 'js/update_boards.js' ;
2014-09-20 17:21:09 +02:00
$config [ 'additional_javascript' ][] = 'js/favorites.js' ;
2014-05-17 22:01:14 +02:00
$config [ 'additional_javascript' ][] = 'js/show-op.js' ;
2014-09-25 23:35:17 +02:00
$config [ 'additional_javascript' ][] = 'js/smartphone-spoiler.js' ;
2014-05-17 22:01:14 +02:00
$config [ 'additional_javascript' ][] = 'js/inline-expanding.js' ;
$config [ 'additional_javascript' ][] = 'js/show-backlinks.js' ;
$config [ 'additional_javascript' ][] = 'js/webm-settings.js' ;
$config [ 'additional_javascript' ][] = 'js/expand-video.js' ;
$config [ 'additional_javascript' ][] = 'js/treeview.js' ;
$config [ 'additional_javascript' ][] = 'js/expand-too-long.js' ;
$config [ 'additional_javascript' ][] = 'js/settings.js' ;
$config [ 'additional_javascript' ][] = 'js/hide-images.js' ;
$config [ 'additional_javascript' ][] = 'js/expand-all-images.js' ;
$config [ 'additional_javascript' ][] = 'js/local-time.js' ;
2014-06-10 19:57:37 +02:00
$config [ 'additional_javascript' ][] = 'js/no-animated-gif.js' ;
2014-09-13 18:36:40 +02:00
$config [ 'additional_javascript' ][] = 'js/expand.js' ;
2014-09-20 17:21:09 +02:00
$config [ 'additional_javascript' ][] = 'js/auto-reload.js' ;
2014-09-23 03:29:06 +02:00
$config [ 'additional_javascript' ][] = 'js/options/user-css.js' ;
$config [ 'additional_javascript' ][] = 'js/options/user-js.js' ;
2015-03-15 12:56:28 +01:00
$config [ 'additional_javascript' ][] = 'js/options/fav.js' ;
2014-09-23 03:29:06 +02:00
$config [ 'additional_javascript' ][] = 'js/forced-anon.js' ;
$config [ 'additional_javascript' ][] = 'js/toggle-locked-threads.js' ;
$config [ 'additional_javascript' ][] = 'js/toggle-images.js' ;
2014-09-25 23:35:17 +02:00
$config [ 'additional_javascript' ][] = 'js/mobile-style.js' ;
2014-09-27 22:08:18 +02:00
$config [ 'additional_javascript' ][] = 'js/id_highlighter.js' ;
$config [ 'additional_javascript' ][] = 'js/id_colors.js' ;
2014-10-07 03:36:19 +02:00
$config [ 'additional_javascript' ][] = 'js/inline.js' ;
2014-10-09 03:20:47 +02:00
$config [ 'additional_javascript' ][] = 'js/infinite-scroll.js' ;
2014-10-10 01:58:00 +02:00
$config [ 'additional_javascript' ][] = 'js/download-original.js' ;
2014-10-11 19:21:00 +02:00
$config [ 'additional_javascript' ][] = 'js/thread-watcher.js' ;
2014-10-23 04:18:23 +02:00
$config [ 'additional_javascript' ][] = 'js/ajax.js' ;
2015-03-12 05:19:30 +01:00
$config [ 'additional_javascript' ][] = 'js/quick-reply.js' ;
2014-10-23 04:18:23 +02:00
$config [ 'additional_javascript' ][] = 'js/show-own-posts.js' ;
2014-10-20 14:33:09 +02:00
$config [ 'additional_javascript' ][] = 'js/youtube.js' ;
2014-11-02 00:00:39 +01:00
$config [ 'additional_javascript' ][] = 'js/comment-toolbar.js' ;
2014-11-10 08:23:38 +01:00
$config [ 'additional_javascript' ][] = 'js/catalog-search.js' ;
2014-11-13 06:08:48 +01:00
$config [ 'additional_javascript' ][] = 'js/thread-stats.js' ;
2014-12-03 09:19:02 +01:00
$config [ 'additional_javascript' ][] = 'js/quote-selection.js' ;
2014-12-24 15:14:33 +01:00
$config [ 'additional_javascript' ][] = 'js/flag-previews.js' ;
2015-02-28 14:06:50 +01:00
$config [ 'additional_javascript' ][] = 'js/post-menu.js' ;
2015-02-20 05:52:53 +01:00
$config [ 'additional_javascript' ][] = 'js/post-filter.js' ;
2015-02-28 14:06:50 +01:00
$config [ 'additional_javascript' ][] = 'js/fix-report-delete-submit.js' ;
2015-02-21 02:15:40 +01:00
$config [ 'additional_javascript' ][] = 'js/image-hover.js' ;
2015-02-26 03:07:22 +01:00
$config [ 'additional_javascript' ][] = 'js/auto-scroll.js' ;
2015-03-11 00:18:28 +01:00
$config [ 'additional_javascript' ][] = 'js/twemoji/twemoji.js' ;
2015-03-20 04:22:17 +01:00
$config [ 'additional_javascript' ][] = 'js/file-selector.js' ;
2015-03-11 10:58:07 +01:00
// Oekaki (now depends on config.oekaki so can be in all scripts)
$config [ 'additional_javascript' ][] = 'js/jquery-ui.custom.min.js' ;
$config [ 'additional_javascript' ][] = 'js/wPaint/lib/wColorPicker.min.js' ;
$config [ 'additional_javascript' ][] = 'js/wPaint/wPaint.min.js' ;
$config [ 'additional_javascript' ][] = 'js/wPaint/plugins/main/wPaint.menu.main.min.js' ;
$config [ 'additional_javascript' ][] = 'js/wPaint/plugins/text/wPaint.menu.text.min.js' ;
$config [ 'additional_javascript' ][] = 'js/wPaint/plugins/shapes/wPaint.menu.main.shapes.min.js' ;
$config [ 'additional_javascript' ][] = 'js/wPaint/plugins/file/wPaint.menu.main.file.min.js' ;
$config [ 'additional_javascript' ][] = 'js/wpaint.js' ;
2015-03-14 08:03:36 +01:00
// Code tags (fix because we no longer have different scripts for each board)
2015-03-15 13:08:07 +01:00
$config [ 'additional_javascript' ][] = 'js/code_tags/run_prettify.js' ;
2014-05-17 22:01:14 +02:00
2014-10-10 01:58:00 +02:00
//$config['font_awesome_css'] = '/netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css';
2013-10-31 23:14:19 +01:00
2014-09-20 17:21:09 +02:00
$config [ 'stylesheets' ][ 'Dark' ] = 'dark.css' ;
2014-09-23 03:29:06 +02:00
$config [ 'stylesheets' ][ 'Photon' ] = 'photon.css' ;
2015-02-21 02:15:40 +01:00
$config [ 'stylesheets' ][ 'Redchanit' ] = 'redchanit.css' ;
2014-09-20 17:21:09 +02:00
2013-10-31 23:14:19 +01:00
$config [ 'stylesheets_board' ] = true ;
$config [ 'markup' ][] = array ( " /^[ | \t ]*==(.+?)==[ | \t ]* $ /m " , " <span class= \" heading \" > \$ 1</span> " );
$config [ 'markup' ][] = array ( " / \ [spoiler \ ](.+?) \ [ \ /spoiler \ ]/ " , " <span class= \" spoiler \" > \$ 1</span> " );
2014-05-17 22:01:14 +02:00
$config [ 'markup' ][] = array ( " /~~(.+?)~~/ " , " <s> \$ 1</s> " );
2014-10-17 03:53:59 +02:00
$config [ 'markup' ][] = array ( " /__(.+?)__/ " , " <u> \$ 1</u> " );
2014-12-14 12:25:43 +01:00
$config [ 'markup' ][] = array ( " /###([^ \ s']+)###/ " , " <a href='/boards.html# \$ 1'>### \$ 1###</a> " );
2014-05-17 22:01:14 +02:00
2015-02-20 04:14:55 +01:00
$config [ 'boards' ] = array ( array ( '<i class="fa fa-home" title="Home"></i>' => '/' , '<i class="fa fa-tags" title="Boards"></i>' => '/boards.html' , '<i class="fa fa-question" title="FAQ"></i>' => '/faq.html' , '<i class="fa fa-random" title="Random"></i>' => '/random.php' , '<i class="fa fa-plus" title="New board"></i>' => '/create.php' , '<i class="fa fa-ban" title="Public ban list"></i>' => '/bans.html' , '<i class="fa fa-search" title="Search"></i>' => '/search.php' , '<i class="fa fa-cog" title="Manage board"></i>' => '/mod.php' , '<i class="fa fa-quote-right" title="Chat"></i>' => 'https://qchat.rizon.net/?channels=#8chan' ), array ( 'b' , 'news+' , 'boards' ), array ( 'operate' , 'meta' ), array ( '<i class="fa fa-twitter" title="Twitter"></i>' => 'https://twitter.com/infinitechan' ));
2014-10-07 03:01:01 +02:00
//$config['boards'] = array(array('<i class="fa fa-home" title="Home"></i>' => '/', '<i class="fa fa-tags" title="Boards"></i>' => '/boards.html', '<i class="fa fa-question" title="FAQ"></i>' => '/faq.html', '<i class="fa fa-random" title="Random"></i>' => '/random.php', '<i class="fa fa-plus" title="New board"></i>' => '/create.php', '<i class="fa fa-search" title="Search"></i>' => '/search.php', '<i class="fa fa-cog" title="Manage board"></i>' => '/mod.php', '<i class="fa fa-quote-right" title="Chat"></i>' => 'https://qchat.rizon.net/?channels=#8chan'), array('b', 'meta', 'int'), array('v', 'a', 'tg', 'fit', 'pol', 'tech', 'mu', 'co', 'sp', 'boards'), array('<i class="fa fa-twitter" title="Twitter"></i>'=>'https://twitter.com/infinitechan'));
2013-10-31 23:14:19 +01:00
2015-01-22 08:49:15 +01:00
$config [ 'footer' ][] = 'All posts on 8chan are the responsibility of the individual poster and not the administration of 8chan, pursuant to 47 U.S.C. § 230.' ;
2014-12-03 09:19:02 +01:00
$config [ 'footer' ][] = 'We have not been served any secret court orders and are not under any gag orders.' ;
$config [ 'footer' ][] = 'To make a DMCA request or report illegal content, please email <a href="mailto:admin@8chan.co">admin@8chan.co</a>.' ;
2014-05-17 22:01:14 +02:00
$config [ 'search' ][ 'enable' ] = true ;
2013-10-31 23:14:19 +01:00
2014-06-12 05:07:16 +02:00
$config [ 'syslog' ] = true ;
2013-10-31 23:14:19 +01:00
2015-02-28 14:08:48 +01:00
$config [ 'hour_max_threads' ] = 10 ;
2015-01-01 07:37:38 +01:00
$config [ 'filters' ][] = array (
'condition' => array (
'custom' => function ( $post ) {
global $config , $board ;
if ( ! $config [ 'hour_max_threads' ]) return false ;
if ( $post [ 'op' ]) {
$query = prepare ( sprintf ( 'SELECT COUNT(*) AS `count` FROM ``posts_%s`` WHERE `thread` IS NULL AND FROM_UNIXTIME(`time`) > DATE_SUB(NOW(), INTERVAL 1 HOUR);' , $board [ 'uri' ]));
$query -> bindValue ( ':ip' , $_SERVER [ 'REMOTE_ADDR' ]);
$query -> execute () or error ( db_error ( $query ));
$r = $query -> fetch ( PDO :: FETCH_ASSOC );
return ( $r [ 'count' ] > $config [ 'hour_max_threads' ]);
}
}
),
'action' => 'reject' ,
2015-02-28 14:08:48 +01:00
'message' => 'On this board, to prevent raids the number of threads that can be created per hour is limited. Please try again later, or post in an existing thread.'
2015-01-01 07:37:38 +01:00
);
2014-07-19 20:40:06 +02:00
$config [ 'gzip_static' ] = false ;
2014-12-03 09:15:24 +01:00
$config [ 'hash_masked_ip' ] = true ;
2014-12-14 12:25:43 +01:00
$config [ 'force_subject_op' ] = false ;
$config [ 'min_links' ] = 0 ;
$config [ 'min_body' ] = 0 ;
2015-01-01 07:31:43 +01:00
$config [ 'early_404' ] = false ;
$config [ 'early_404_page' ] = 5 ;
$config [ 'early_404_replies' ] = 10 ;
$config [ 'cron_bans' ] = true ;
$config [ 'mask_db_error' ] = true ;
2015-01-06 10:34:27 +01:00
$config [ 'ban_appeals' ] = true ;
2015-01-22 08:49:15 +01:00
$config [ 'show_sages' ] = false ;
2015-02-26 02:16:44 +01:00
$config [ 'katex' ] = false ;
2015-02-28 03:16:38 +01:00
$config [ 'enable_antibot' ] = false ;
2015-02-26 10:12:12 +01:00
$config [ 'spam' ][ 'unicode' ] = false ;
2015-03-12 05:19:30 +01:00
$config [ 'twig_cache' ] = false ;
2015-03-13 05:45:57 +01:00
$config [ 'report_captcha' ] = true ;
2014-10-29 07:23:17 +01:00
// 8chan specific mod pages
require '8chan-mod-pages.php' ;
2015-03-11 10:58:07 +01:00
// Load database credentials
require " secrets.php " ;
2015-03-12 02:22:42 +01:00