From e94ae94f6cbca31030c0df3d20ecdec023468927 Mon Sep 17 00:00:00 2001 From: 8chan Date: Wed, 24 Sep 2014 20:17:59 +0000 Subject: [PATCH 1/9] Add extra non-synced file for 8chan.co secrets (passwords etc) --- inc/secrets.php | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 inc/secrets.php diff --git a/inc/secrets.php b/inc/secrets.php new file mode 100644 index 00000000..b5d51a7c --- /dev/null +++ b/inc/secrets.php @@ -0,0 +1,4 @@ + Date: Wed, 24 Sep 2014 20:19:58 +0000 Subject: [PATCH 2/9] Require secrets.php --- inc/instance-config.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/inc/instance-config.php b/inc/instance-config.php index e2410fea..2f014fa9 100644 --- a/inc/instance-config.php +++ b/inc/instance-config.php @@ -7,9 +7,8 @@ * * You can copy values from config.php (defaults) and paste them here. */ -require_once "lib/htmlpurifier-4.5.0/library/HTMLPurifier.auto.php"; -require_once "8chan-functions.php"; - + require_once "lib/htmlpurifier-4.5.0/library/HTMLPurifier.auto.php"; + require_once "8chan-functions.php"; $config['db']['server'] = 'localhost'; $config['db']['database'] = '8chan'; @@ -43,6 +42,8 @@ require_once "8chan-functions.php"; $config['thread_subject_in_title'] = true; $config['spam']['hidden_inputs_max_pass'] = 128; + require_once "secrets.php"; + // Image shit $config['thumb_method'] = 'gm+gifsicle'; $config['thumb_ext'] = ''; From 9b892d8d3201d3720b7b515b6110d5f6f6a92a7b Mon Sep 17 00:00:00 2001 From: 8chan Date: Wed, 24 Sep 2014 20:23:38 +0000 Subject: [PATCH 3/9] Include secrets file. --- inc/instance-config.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/inc/instance-config.php b/inc/instance-config.php index e2410fea..2f014fa9 100644 --- a/inc/instance-config.php +++ b/inc/instance-config.php @@ -7,9 +7,8 @@ * * You can copy values from config.php (defaults) and paste them here. */ -require_once "lib/htmlpurifier-4.5.0/library/HTMLPurifier.auto.php"; -require_once "8chan-functions.php"; - + require_once "lib/htmlpurifier-4.5.0/library/HTMLPurifier.auto.php"; + require_once "8chan-functions.php"; $config['db']['server'] = 'localhost'; $config['db']['database'] = '8chan'; @@ -43,6 +42,8 @@ require_once "8chan-functions.php"; $config['thread_subject_in_title'] = true; $config['spam']['hidden_inputs_max_pass'] = 128; + require_once "secrets.php"; + // Image shit $config['thumb_method'] = 'gm+gifsicle'; $config['thumb_ext'] = ''; From beff737c9e7df035021bc23e4585ee2664537b78 Mon Sep 17 00:00:00 2001 From: 8chan Date: Wed, 24 Sep 2014 21:29:12 +0000 Subject: [PATCH 4/9] Add timer to auto reload js --- js/auto-reload.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/js/auto-reload.js b/js/auto-reload.js index 4e786be1..548d947e 100644 --- a/js/auto-reload.js +++ b/js/auto-reload.js @@ -28,7 +28,7 @@ $(document).ready(function(){ var poll_interval; // Add an update link - $('.boardlist.bottom').prev().after("["+_("Update thread")+"]"); + $('.boardlist.bottom').prev().after("["+_("Update thread")+"] ()"); // Grab the settings var settings = new script_settings('auto-reload'); @@ -39,6 +39,7 @@ $(document).ready(function(){ // number of ms to wait before reloading var poll_interval_delay = poll_interval_mindelay_bottom; + var poll_current_time = poll_interval_delay; var end_of_page = false; @@ -70,6 +71,14 @@ $(document).ready(function(){ window_active = false; }); + var timer_update = function() { + $('#update_secs').text(poll_current_time/1000); + } + + var decrement_timer = function() { + poll_current_time = poll_current_time - 1000; + } + var recheck_activated = function() { if (new_posts && window_active && $(window).scrollTop() + $(window).height() >= @@ -117,6 +126,7 @@ $(document).ready(function(){ } poll_interval = setTimeout(poll, poll_interval_delay); + poll_current_time = poll_interval_delay; }; $(window).scroll(function() { @@ -130,11 +140,15 @@ $(document).ready(function(){ clearTimeout(poll_interval); poll_interval = setTimeout(poll, poll_interval_shortdelay); + poll_current_time = poll_interval_shortdelay; end_of_page = true; }).trigger('scroll'); $('#update_thread').on('click', poll); + setInterval(timer_update, 1000); + setInterval(decrement_timer, 1000); - poll_interval = setTimeout(poll, poll_interval_delay); + poll_interval = setInterval(poll, poll_interval_delay); + timer_update(); }); From 48ca125eaf3fa11c30560c69389cbd274b0022d9 Mon Sep 17 00:00:00 2001 From: 8chan Date: Thu, 25 Sep 2014 20:49:46 +0000 Subject: [PATCH 5/9] include instead of require --- inc/instance-config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/instance-config.php b/inc/instance-config.php index 2f014fa9..96f32bb4 100644 --- a/inc/instance-config.php +++ b/inc/instance-config.php @@ -42,7 +42,7 @@ $config['thread_subject_in_title'] = true; $config['spam']['hidden_inputs_max_pass'] = 128; - require_once "secrets.php"; + include "secrets.php"; // Image shit $config['thumb_method'] = 'gm+gifsicle'; From 4ecdcd292ff89eaef637f3b6739cd7152149aa0c Mon Sep 17 00:00:00 2001 From: 8chan Date: Thu, 25 Sep 2014 20:50:09 +0000 Subject: [PATCH 6/9] auto reload better --- js/auto-reload.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/auto-reload.js b/js/auto-reload.js index 548d947e..535b9a04 100644 --- a/js/auto-reload.js +++ b/js/auto-reload.js @@ -144,7 +144,7 @@ $(document).ready(function(){ end_of_page = true; }).trigger('scroll'); - $('#update_thread').on('click', poll); + $('#update_thread').on('click', function(e) {e.preventDefault(); poll();}); setInterval(timer_update, 1000); setInterval(decrement_timer, 1000); From 2565a0e056bdb30a7864243cd0f2238889ced737 Mon Sep 17 00:00:00 2001 From: 8chan Date: Thu, 25 Sep 2014 20:50:25 +0000 Subject: [PATCH 7/9] no secrets --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 69317f82..add30777 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,8 @@ /*/config.php /*.html +/inc/secrets.php + # include some files though !/templates/*.html !/inc/config.php From 4911017e8e4df0f99a4dbcdf4b63e0327b20c52c Mon Sep 17 00:00:00 2001 From: 8chan Date: Thu, 25 Sep 2014 20:50:37 +0000 Subject: [PATCH 8/9] show board titles in boards list --- boards.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/boards.php b/boards.php index 46bddb38..22a76816 100644 --- a/boards.php +++ b/boards.php @@ -33,7 +33,7 @@ th.headerSortDown { } CSS; -$body .= ''; +$body .= '
LBoardPosts in last hourTotal postsCreated
'; $total_posts_hour = 0; $total_posts = 0; @@ -80,7 +80,7 @@ foreach ($boards as $i => &$board) { } $locale = isset($boardCONFIG['locale'])?$boardCONFIG['locale']:'en'; - $board['title'] = htmlentities(utf8tohtml($board['title'])); + $board['title'] = utf8tohtml($board['title']); $locale_arr = explode('_', $locale); $locale_short = isset($locale_arr[1]) ? strtolower($locale_arr[1]) : strtolower($locale_arr[0]); $locale_short = str_replace('.utf-8', '', $locale_short); @@ -97,7 +97,8 @@ foreach ($boards as $i => &$board) { $board['ago'] = human_time_diff(strtotime($board['time'])); $body .= ""; $body .= ""; - $body .= ""; + $body .= ""; + $body .= ""; $body .= ""; $body .= ""; $body .= ""; @@ -121,7 +122,7 @@ $body .= <<
Date: Thu, 25 Sep 2014 20:51:04 +0000 Subject: [PATCH 9/9] update $bannedWords --- create.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/create.php b/create.php index f01a97cb..306829fd 100644 --- a/create.php +++ b/create.php @@ -4,7 +4,7 @@ include "inc/functions.php"; include "inc/lib/ayah/ayah.php"; include "inc/mod/auth.php"; checkBan('*'); -$bannedWords = array('/^cake$/', '8ch', '/^cp$/', 'child', '/^inc$/', '/^static$/', '/^templates$/', '/^js$/', '/^stylesheets$/', '/^tools$/'); +$bannedWords = array('/^cake$/', '8ch', '/^cp$/', 'child', '/^inc$/', '/^static$/', '/^templates$/', '/^js$/', '/^stylesheets$/', '/^tools$/', '/^pedo$/'); $ayah = new AYAH();
LBoardBoard titlePosts in last hourTotal postsCreated
$img/{$board['uri']}/$lock/{$board['uri']}/$lock{$board['title']}{$board['pph']}{$board['max']}{$board['time']} ({$board['ago']} ago)