diff --git a/inc/anti-bot.php b/inc/anti-bot.php index 6f9d2a0b..ab321ccd 100644 --- a/inc/anti-bot.php +++ b/inc/anti-bot.php @@ -185,8 +185,6 @@ class AntiBot { public function hash() { global $config; - print_err("compute hash for post page"); - // This is the tricky part: create a hash to validate it after // First, sort the keys in alphabetical order (A-Z) $inputs = $this->inputs; @@ -195,7 +193,6 @@ class AntiBot { $hash = ''; // Iterate through each input foreach ($inputs as $name => $value) { - print_err("<- " . $name . ' : ' . $value); $hash .= $name . '=' . $value; } // Add a salt to the hash diff --git a/inc/config.php b/inc/config.php index d9b7f35c..8326dc18 100644 --- a/inc/config.php +++ b/inc/config.php @@ -244,6 +244,8 @@ * */ + $config['spam']['enabled'] = true; + // Number of hidden fields to generate. $config['spam']['hidden_inputs_min'] = 4; $config['spam']['hidden_inputs_max'] = 12; diff --git a/inc/display.php b/inc/display.php index 05f91c2b..c5065044 100644 --- a/inc/display.php +++ b/inc/display.php @@ -416,7 +416,7 @@ class Thread { $file = ($index && $config['file_board']) ? 'post_thread_fileboard.html' : 'post_thread.html'; $built = Element($file, array('config' => $config, 'board' => $board, 'post' => &$this, 'index' => $index, 'hasnoko50' => $hasnoko50, 'isnoko50' => $isnoko50, 'mod' => $this->mod)); - + return $built; } }; diff --git a/inc/instance-config.php b/inc/instance-config.php index 823fd330..013a288e 100644 --- a/inc/instance-config.php +++ b/inc/instance-config.php @@ -8,28 +8,6 @@ * You can copy values from config.php (defaults) and paste them here. */ - $config['boards'] = array( - array('leftypol', 'b'), - array('GET', 'ref'), - array('gulag' => 'http://status.example.org/') - ); - // Board categories. Only used in the "Categories" theme. - $config['categories'] = array( - 'Leftypol' => array('leftypol', 'b'), - 'GET' => array('GET', 'ref'), - 'Meta' => array('gulag') - ); - // Optional for the Categories theme. This is an array of name => (title, url) groups for categories - // with non-board links. - $config['custom_categories'] = array( - 'Links' => array( - 'Leftypedia' => 'http://example.org', - 'Staff application' => 'staff_applications.html', - 'FAQ' => 'faq.html', - 'Donate' => 'donate.html' - ) - ); - $config['db']['server'] = 'localhost'; $config['db']['database'] = 'lainchan'; @@ -39,173 +17,25 @@ $config['cookies']['mod'] = 'mod'; - $config['cookies']['salt'] = 'ZGZkYWU3NGUwZDNiYjU2MDEwZmRkMW'; + $config['cookies']['salt'] = 'MGYwNjhlNjU5Y2QxNWU3YjQ3MzQ1Yj'; - $config['flood_time'] = 10; - $config['flood_time_ip'] = 120; - $config['flood_time_same'] = 30; - $config['max_body'] = 1800; + $config['flood_time'] = 0; + $config['flood_time_ip'] = 0; + $config['flood_time_same'] = 0; + $config['max_body'] = 100000; $config['reply_limit'] = 250; - $config['max_links'] = 20; - $config['max_filesize'] = 10485760; + $config['max_links'] = 40; + $config['max_filesize'] = 52428800; $config['thumb_width'] = 255; $config['thumb_height'] = 255; $config['max_width'] = 10000; $config['max_height'] = 10000; - $config['max_images'] = 4; $config['threads_per_page'] = 10; - $config['max_pages'] = 50; + $config['max_pages'] = 36; $config['threads_preview'] = 5; $config['root'] = '/'; - $config['secure_trip_salt'] = 'MzdhNTJiMjNkMTM5Nzc5NDcwOGViMD'; - - $config['thumb_method'] = 'gm+gifsicle'; - $config['gnu_md5'] = '1'; - - // < Added by Zero > - // Sun Aug 30 17:44:19 UTC 2020 - - // Allowed image file extensions. - $config['allowed_ext'][] = 'jpg'; - $config['allowed_ext'][] = 'jpeg'; - $config['allowed_ext'][] = 'bmp'; - $config['allowed_ext'][] = 'gif'; - $config['allowed_ext'][] = 'png'; - - // TODO test section, please remove - $config['allowed_ext'][] = 'mp4'; - $config['allowed_ext'][] = 'webm'; - $config['allowed_ext_files'][] = 'webm'; - $config['webm']['use_ffmpeg'] = true; - $config['additional_javascript'][] = 'js/options.js'; - $config['additional_javascript'][] = 'js/webm-settings.js'; - $config['additional_javascript'][] = 'js/expand-video.js'; - $config['max_filesize'] = 50 * 1024 * 1024; // 50MB - $config['webm']['allow_audio'] = true; - $config['webm']['max_length'] = 1000; - //end test section - - - $config['allowed_ext_files'][] = 'mp4'; - $config['allowed_ext_files'][] = 'pdf'; - $config['allowed_ext_files'][] = 'txt'; - $config['allowed_ext_files'][] = 'zip'; - $config['allowed_ext_files'][] = 'epub'; - - $config['api']['enabled'] = false; - - /* - * From Config: - // Always regenerate markup. This isn't recommended and should only be used for debugging; by default, - // Tinyboard only parses post markup when it needs to, and keeps post-markup HTML in the database. This - // will significantly impact performance when enabled. - * - */ - $config['markup_repair_tidy'] = false; - - - $config['image_reject_repost'] = false; - $config['flood_time'] = 0; - // Minimum time between between each post with the exact same content AND same IP address. - $config['flood_time_ip'] = 0; - - $config['filters'] = array(); - $config['always_noko'] = false; // the migration script now relies on this default behavior, we can turn this on later. - // - -// Changes made via web editor by "admin" @ Tue, 02 Jun 2020 23:16:58 -0700: -$config['debug'] = true; - - -// Changes made via web editor by "admin" @ Tue, 02 Jun 2020 23:24:29 -0700: -$config['debug'] = false; -$config['verbose_errors'] = false; - - -/* - * ==================== - * Javascript - * ==================== - */ - - // Additional Javascript files to include on board index and thread pages. See js/ for available scripts. - $config['additional_javascript'][] = 'js/jquery.min.js'; - $config['additional_javascript'][] = 'js/inline-expanding.js'; - $config['additional_javascript'][] = 'js/multi-image.js'; // required when using multi file upload - $config['additional_javascript'][] = 'js/local-time.js'; - $config['additional_javascript'][] = 'js/auto-reload.js'; - $config['additional_javascript'][] = 'js/post-hover.js'; - $config['additional_javascript'][] = 'js/style-select.js'; - - // Some scripts require jQuery. Check the comments in script files to see what's needed. When enabling - // jQuery, you should first empty the array so that "js/query.min.js" can be the first, and then re-add - // "js/inline-expanding.js" or else the inline-expanding script might not interact properly with other - // scripts. - // $config['additional_javascript'] = array(); - // $config['additional_javascript'][] = 'js/jquery.min.js'; - // $config['additional_javascript'][] = 'js/inline-expanding.js'; - // $config['additional_javascript'][] = 'js/auto-reload.js'; - // $config['additional_javascript'][] = 'js/post-hover.js'; - // $config['additional_javascript'][] = 'js/style-select.js'; - - // Where these script files are located on the web. Defaults to $config['root']. - // $config['additional_javascript_url'] = 'http://static.example.org/tinyboard-javascript-stuff/'; - - // Compile all additional scripts into one file ($config['file_script']) instead of including them seperately. - $config['additional_javascript_compile'] = false; - - // Minify Javascript using http://code.google.com/p/minify/. - $config['minify_js'] = false; - - // Dispatch thumbnail loading and image configuration with JavaScript. It will need a certain javascript - // code to work. - $config['javascript_image_dispatch'] = false; - - $config['multiimage_method'] = 'each'; - - - $config['mod']['show_ip'] = DISABLED; - $config['mod']['move'] = MOD; - -// Changes made via web editor by "admin" @ Sun, 23 Aug 2020 16:45:14 -0700: -$config['force_image_op'] = false; - - -// Changes made via web editor by "admin" @ Sun, 23 Aug 2020 16:48:22 -0700: -$config['force_body_op'] = false; - - -// Changes made via web editor by "admin" @ Sun, 23 Aug 2020 17:38:52 -0700: -$config['flood_time'] = 0; -$config['flood_time_ip'] = 0; -$config['flood_time_same'] = 0; - - -// Changes made via web editor by "admin" @ Wed, 26 Aug 2020 20:15:11 -0700: -$config['min_body'] = 5; - - -// Changes made via web editor by "admin" @ Wed, 26 Aug 2020 20:15:44 -0700: -$config['force_image_op'] = true; -$config['min_body'] = 15; - - -// Changes made via web editor by "admin" @ Sat, 29 Aug 2020 13:26:51 -0700: -$config['force_image_op'] = false; - - -// Changes made via web editor by "admin" @ Sat, 29 Aug 2020 23:13:46 -0700: -$config['cookies']['salt'] = 'ZGZkYWU3NGUwZDNiYjU2MDEwZmRkMX'; - - -// Changes made via web editor by "admin" @ Sat, 29 Aug 2020 23:21:09 -0700: -$config['cookies']['salt'] = 'ZGZkYWU3NGUwZDNiYjU2MDEwZmRkMA'; - - -// Changes made via web editor by "admin" @ Sun, 30 Aug 2020 10:48:36 -0700: -$config['max_body'] = 100000; - + $config['secure_trip_salt'] = 'ODQ2NDM0ODlmMmRhNzk2M2EyNjJlOW'; -// Changes made via web editor by "admin" @ Sun, 30 Aug 2020 15:25:41 -0700: -$config['max_links'] = 40; + $config['thumb_method'] = 'gm+gifsicle'; + $config['gnu_md5'] = '1'; diff --git a/inc/instance-config.php.snapshot-20-dec-2020 b/inc/instance-config.php.snapshot-20-dec-2020 new file mode 100644 index 00000000..013a288e --- /dev/null +++ b/inc/instance-config.php.snapshot-20-dec-2020 @@ -0,0 +1,41 @@ +\r\n" : "was unable to be submitted.

\r\n"; + $displaymessage = "

Your staff application " . $sentmessage; + } + + } + else + { + $displaymessage = "

ANTISPAM VALUE INCORRECT

\r\n"; + + } +} +else { +$displaymessage = "

ANTISPAM NOT SET

\r\n"; +} +$displaymessage .= '[ Return Home ]'; + +echo Element('page.html', array( + 'index' => $config['root'], + 'title' => _('Staff Application'), + 'config' => $config, + 'boardlist' => createBoardlist(isset($mod) ? $mod : false), + 'body' => $displaymessage, + ) + ); +?> diff --git a/templates/post_reply.html b/templates/post_reply.html index 14aea5c3..936d19c3 100644 --- a/templates/post_reply.html +++ b/templates/post_reply.html @@ -30,5 +30,4 @@ -
{% endfilter %} diff --git a/templates/themes/catalog/theme.php b/templates/themes/catalog/theme.php index 19c40cc4..2b5b6c66 100644 --- a/templates/themes/catalog/theme.php +++ b/templates/themes/catalog/theme.php @@ -25,6 +25,7 @@ file_unlink($config['dir']['home'] . $board . '/index.rss'); } elseif ($action == 'rebuild') { + print_err("catalog_build calling Catalog.build 1. board: $board"); $b->build($settings, $board); } } @@ -38,6 +39,7 @@ file_unlink($config['dir']['home'] . $board . '/index.rss'); } elseif ($action == 'rebuild') { + print_err("catalog_build calling Catalog.build 2"); $b->build($settings, $board); } } @@ -297,21 +299,28 @@ error(sprintf(_("Board %s doesn't exist"), $board_name)); } } + print_err("Catalog.build 1"); if (array_key_exists($board_name, $this->threadsCache)) { $threads = $this->threadsCache[$board_name]; } else { + print_err("Catalog.build calling buildThreadsQuery. boardname: $board_name"); $sql = $this->buildThreadsQuery($board_name); + print_err("Catalog.build calling buildThreadsQuery ok"); $query = query($sql . ' ORDER BY `bump` DESC') or error(db_error()); $threads = $query->fetchAll(PDO::FETCH_ASSOC); + print_err("Catalog.build has threads"); // Save for posterity $this->threadsCache[$board_name] = $threads; } + print_err("Catalog.build 2"); // Generate data for the template $recent_posts = $this->generateRecentPosts($threads); + print_err("Catalog.build 3"); $this->saveForBoard($board_name, $recent_posts); + print_err("Catalog.build 4"); } private function buildThreadsQuery($board) { diff --git a/templates/thread2_old.html b/templates/thread2_old.html new file mode 100644 index 00000000..0ba7c81a --- /dev/null +++ b/templates/thread2_old.html @@ -0,0 +1,119 @@ + + + + + + + + + + {% include 'header.html' %} + + {% set meta_subject %}{% if config.thread_subject_in_title and thread.subject %}{{ thread.subject|e }}{% else %}{{ thread.body_nomarkup[:256]|remove_modifiers|e }}{% endif %}{% endset %} + + + + + + + {% if thread.files.0.thumb %}{% endif %} + + + {{ board.url }} - {{ meta_subject }} + + +
+ {{ boardlist.top }} +
+ + {% if pm %}
You have an unread PM{% if pm.waiting > 0 %}, plus {{ pm.waiting }} more waiting{% endif %}.

{% endif %} + {% if config.url_banner %}{% endif %} +
+
+

{{ board.url }} - {{ board.title|e }}

+
+ {% if board.subtitle %} + {% if config.allow_subtitle_html %} + {{ board.subtitle }} + {% else %} + {{ board.subtitle|e }} + {% endif %} + {% endif %} + {% if mod %}

{% trans %}Return to dashboard{% endtrans %}

{% endif %} +
+
+ + {% include 'attention_bar.html' %} + + + {{ config.ad.top }} + + {% include 'post_form.html' %} + + {% if config.global_message %}
{{ config.global_message }}
{% endif %} +
+ +
+
+ + {% if mod %}{% endif %} + + {{ body }} + +
+ + [{% trans %}Return{% endtrans %}] + [{% trans %}Go to top{% endtrans %}] + {% if config.catalog_link %} + [{% trans %}Catalog{% endtrans %}] + {% endif %} + {% if config.home_link %} + | [{% trans %}Home{% endtrans %}] + {% endif %} + + + + [{% trans %}Post a Reply{% endtrans %}] + + + {% include 'report_delete.html' %} +
+ +
+
+ + {{ boardlist.bottom }} + + {{ config.ad.bottom }} + + +
+
+ +
+
+ + + +