diff --git a/boards.php b/boards.php index 2ca61816..233b81e2 100644 --- a/boards.php +++ b/boards.php @@ -81,7 +81,6 @@ $searchHTML = Element("8chan/boards-search.html", array( "founding_date" => $founding_date, "page_updated" => date('r'), - "uptime" => shell_exec('uptime -p'), "html_boards" => $boardsHTML, "html_tags" => $tagsHTML @@ -91,7 +90,8 @@ $searchHTML = Element("8chan/boards-search.html", array( $pageHTML = Element("page.html", array( "title" => _("Boardlist"), "config" => $config, - "body" => $searchHTML + "body" => $searchHTML, + "title" => _("Boards on ∞chan") ) ); @@ -103,7 +103,15 @@ if (php_sapi_name() == 'cli') { file_write("boards.html", $pageHTML); file_write("boards.json", json_encode($nonAssociativeBoardList)); - file_write("boards-top20.json", json_encode(array_splice($nonAssociativeBoardList, 0, 48))); + + $topbar = array(); + foreach ($boards as $i => $b) { + if (!in_array($b['uri'], $config['no_top_bar_boards'])) { + $topbar[] = $b; + } + } + + file_write("boards-top20.json", json_encode(array_splice($topbar, 0, 48))); } -echo $pageHTML; \ No newline at end of file +echo $pageHTML; diff --git a/inc/display.php b/inc/display.php index 3cbeb818..0f8e3e68 100644 --- a/inc/display.php +++ b/inc/display.php @@ -417,10 +417,10 @@ class Post { )); } - public function getClean( ) { + public function getClean($actually_do = false) { global $board, $config; - if( !isset( $this->clean ) ) { + if( !isset( $this->clean ) && $actually_do ) { if ($config['cache']['enabled'] && $this->clean = cache::get("post_clean_{$board['uri']}_{$this->id}")) { return $this->clean; } @@ -443,8 +443,10 @@ class Post { if ($config['cache']['enabled']) cache::set("post_clean_{$board['uri']}_{$this->id}", $this->clean); } + } else { + $this->clean = array(); } - + return $this->clean; } }; diff --git a/inc/functions.php b/inc/functions.php index 675e5932..242e9610 100755 --- a/inc/functions.php +++ b/inc/functions.php @@ -628,47 +628,41 @@ function purge($uri) { function file_write($path, $data, $simple = false, $skip_purge = false) { global $config, $debug; - + if (preg_match('/^remote:\/\/(.+)\:(.+)$/', $path, $m)) { if (isset($config['remote'][$m[1]])) { require_once 'inc/remote.php'; - + $remote = new Remote($config['remote'][$m[1]]); $remote->write($data, $m[2]); return; - } - else { + } else { error('Invalid remote server: ' . $m[1]); } } - else { - // This will convert a local, relative path like "b/index.html" to a full path. - // dio_open does not work with relative paths on Windows machines. - $path = realpath(dirname($path)) . DIRECTORY_SEPARATOR . basename($path); - } - - if (!$fp = dio_open( $path, O_WRONLY | O_CREAT | O_TRUNC, 0644)) { + + if (!$fp = dio_open($path, O_WRONLY | O_CREAT, 0644)) error('Unable to open file for writing: ' . $path); - } - + // File locking - if (function_exists("dio_fcntl") && dio_fcntl($fp, F_SETLKW, array('type' => F_WRLCK)) === -1) { + if (dio_fcntl($fp, F_SETLKW, array('type' => F_WRLCK)) === -1) { error('Unable to lock file: ' . $path); } - + + // Truncate file + if (!dio_truncate($fp, 0)) + error('Unable to truncate file: ' . $path); + // Write data - if (($bytes = dio_write($fp, $data)) === false) { + if (($bytes = dio_write($fp, $data)) === false) error('Unable to write to file: ' . $path); - } - + // Unlock - if (function_exists("dio_fcntl")) { - dio_fcntl($fp, F_SETLK, array('type' => F_UNLCK)); - } - + dio_fcntl($fp, F_SETLK, array('type' => F_UNLCK)); + // Close dio_close($fp); - + /** * Create gzipped file. * @@ -1265,6 +1259,8 @@ function deleteFile($id, $remove_entirely_if_already=true, $file=null) { $files = json_decode($post['files']); $file_to_delete = $file !== false ? $files[(int)$file] : (object)array('file' => false); + if (!$files[0]) error(_('That post has no files.')); + if ($files[0]->file == 'deleted' && $post['num_files'] == 1 && !$post['thread']) return; // Can't delete OP's image completely. diff --git a/inc/instance-config.php b/inc/instance-config.php index c6fb8cea..cacaf6ee 100644 --- a/inc/instance-config.php +++ b/inc/instance-config.php @@ -197,7 +197,7 @@ 'fr' => "Français", 'hu' => "Magyar", 'it' => "Italiano", - 'jp' => "日本語", + 'ja' => "日本語", 'jbo' => "Lojban", 'lt' => "Lietuvių Kalba", 'lv' => "Latviešu Valoda", @@ -233,7 +233,7 @@ $config['page_404'] = 'page_404'; // Flavor and design. $config['site_name'] = "∞chan"; -$config['site_logo'] = "/static/logo_33.svg"; +#$config['site_logo'] = "/static/logo_33.svg"; // 8chan specific mod pages require '8chan-mod-config.php'; diff --git a/inc/mod/pages.php b/inc/mod/pages.php index 97a33487..45cb92ba 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -2507,7 +2507,7 @@ function mod_reports() { } // Fetch clean status. - $po->getClean(); + $po->getClean(true); $clean = $po->clean; diff --git a/js/fix-report-delete-submit.js b/js/fix-report-delete-submit.js index c6122db7..47a04f16 100644 --- a/js/fix-report-delete-submit.js +++ b/js/fix-report-delete-submit.js @@ -11,7 +11,7 @@ if (active_page == 'thread' || active_page == 'index') { $(document).ready(function(){ -if ($('.delete #password').length) { +if ($('#delete-fields #password').length) { Menu.add_item("delete_post_menu", _("Delete post")); Menu.add_item("delete_file_menu", _("Delete file")); Menu.onclick(function(e, $buf) { @@ -53,9 +53,8 @@ Menu.onclick(function(e, $buf) { }); $(document).on('new_post', function(){ - $('div.delete').hide(); $('input.delete').hide(); }); -$('div.delete').hide(); $('input.delete').hide(); +$('#post-moderation-fields').hide(); })} diff --git a/js/quick-post-controls.js b/js/quick-post-controls.js index 67c4bc51..784a4f4f 100644 --- a/js/quick-post-controls.js +++ b/js/quick-post-controls.js @@ -14,83 +14,6 @@ */ $(document).ready(function(){ - var open_form = function() { - var thread = $(this).parent().parent().hasClass('op'); - var id = $(this).attr('name').match(/^delete_(\d+)$/)[1]; - var submitButton; - - if(this.checked) { - var post_form = $('
'); - post_form - .attr('action', $('form[name="post"]:first').attr('action')) - .append($('input[name=board]:first').clone()) - .find('input:not([type="checkbox"]):not([type="submit"]):not([type="hidden"])').keypress(function(e) { - if(e.which == 13) { - e.preventDefault(); - if($(this).attr('name') == 'password') { - post_form.find('input[name=delete]').click(); - } else if($(this).attr('name') == 'reason') { - post_form.find('input[name=report]').click(); - } - - return false; - } - - return true; - }); - - post_form.find('input[type="password"]').val(localStorage.password); - - if(thread) { - post_form.prependTo($(this).parent().parent().find('div.body')); - } else { - post_form.appendTo($(this).parent().parent()); - //post_form.insertBefore($(this)); - } - - $(window).trigger('quick-post-controls', post_form); - } else { - var elm = $(this).parent().parent().find('form'); - - if(elm.attr('class') == 'post-actions') - elm.remove(); - } - }; - - var init_qpc = function() { - $(this).change(open_form); - if(this.checked) - $(this).trigger('change'); - }; - - $('div.post input[type=checkbox].delete').each(init_qpc); - - $(document).on('new_post', function(e, post) { - $(post).find('input[type=checkbox].delete').each(init_qpc); - }); - // Bottom of the page quick reply function $("#thread-quick-reply").show(); $("#link-quick-reply").on( 'click', function(event) { @@ -98,4 +21,4 @@ $(document).ready(function(){ $(window).trigger('cite', ['']); return false; } ); -} ); \ No newline at end of file +} ); diff --git a/js/thread-stats.js b/js/thread-stats.js index a4dda669..fe487e10 100644 --- a/js/thread-stats.js +++ b/js/thread-stats.js @@ -14,9 +14,8 @@ $(document).ready(function(){ var thread_id = (document.location.pathname + document.location.search).split('/'); thread_id = thread_id[thread_id.length -1].split('+')[0].split('.')[0]; - $('form[name="postcontrols"] > .delete') - .first() - .before(''); + $('#thread-links') + .after(''); var el = $('#thread_stats'); el.prepend('Page ?'); if (IDsupport){ diff --git a/stylesheets/style.css b/stylesheets/style.css index 4e0846e4..79d8878c 100644 --- a/stylesheets/style.css +++ b/stylesheets/style.css @@ -72,6 +72,9 @@ table.mod.config-editor input[type="text"] { width: 98%; } +.longtable p { + margin: 0; +} /* Uncategorized */ #post-form-outer { @@ -367,7 +370,6 @@ p.intro a { color: maroon; } -p.body-line, div.post p { display: block; margin: 0; @@ -378,12 +380,15 @@ div.post p { } div.post div.body { - margin-left: 1.8em; margin-top: 0.8em; padding-right: 3em; padding-bottom: 0.3em; } +div.post.reply div.body { + margin-left: 1.8em; +} + div.post.reply.highlighted { background: #D6BAD0; } @@ -392,10 +397,6 @@ div.post.reply div.body a { color: #D00; } -div.post { - padding-left: 20px; -} - div.post div.body { word-wrap: break-word; white-space: pre-wrap; @@ -1614,4 +1615,8 @@ td.board-tags a.tag-link { font-size: 0; width: 0; } -} \ No newline at end of file +} + +#post-moderation-fields { + display: none; +} diff --git a/templates/8chan/index.html b/templates/8chan/index.html index d8c6d40a..14f614b2 100644 --- a/templates/8chan/index.html +++ b/templates/8chan/index.html @@ -2,6 +2,7 @@ +