From 3301548eeef809d26a03dee386673dee0d58b353 Mon Sep 17 00:00:00 2001 From: 8chan Admin Date: Sat, 5 Apr 2014 16:24:26 +0000 Subject: [PATCH 1/7] fix bug where mods could see bans not on their board on IP page --- inc/mod/pages.php | 1 - templates/mod/view_ip.html | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/inc/mod/pages.php b/inc/mod/pages.php index 3926a013..256571bd 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -799,7 +799,6 @@ function mod_page_ip($ip) { if ($config['mod']['dns_lookup']) $args['hostname'] = rDNS($ip); - $boards = listBoards(); foreach ($boards as $board) { openBoard($board['uri']); diff --git a/templates/mod/view_ip.html b/templates/mod/view_ip.html index cec3f8ad..a4ea17bc 100644 --- a/templates/mod/view_ip.html +++ b/templates/mod/view_ip.html @@ -89,6 +89,7 @@ {{ bans|count }} {% trans bans_on_record %} {% for ban in bans %} + {% if ban.board in mod.boards or mod.boards.0 == '*' %}
@@ -164,6 +165,7 @@ + {% endif %} {% endfor %} {% endif %} From b448fac14935f47ee38b2afd6c55ff633f9869eb Mon Sep 17 00:00:00 2001 From: 8chan Admin Date: Sat, 5 Apr 2014 16:24:53 +0000 Subject: [PATCH 2/7] add column to listBoards --- inc/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/functions.php b/inc/functions.php index d0a4957a..84563794 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -573,7 +573,7 @@ function listBoards() { if ($config['cache']['enabled'] && ($boards = cache::get('all_boards'))) return $boards; - $query = query("SELECT * FROM ``boards`` LEFT JOIN ``board_create`` ON ``boards``.`uri` = ``board_create``.`uri` ORDER BY ``boards``.`uri`") or error(db_error()); + $query = query("SELECT ``boards``.`uri` uri, ``boards``.`title` title, ``boards``.`subtitle` subtitle, ``board_create``.`time` time FROM ``boards`` LEFT JOIN ``board_create`` ON ``boards``.`uri` = ``board_create``.`uri` ORDER BY ``boards``.`uri`") or error(db_error()); $boards = $query->fetchAll(); if ($config['cache']['enabled']) From ec317221d7dfda9e8bce4161dd9b309e0c6b324c Mon Sep 17 00:00:00 2001 From: 8chan Admin Date: Sat, 5 Apr 2014 16:25:05 +0000 Subject: [PATCH 3/7] fix posthover bug introduced by sti --- js/post-hover.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/post-hover.js b/js/post-hover.js index 7dcd3cbf..e00f88d9 100644 --- a/js/post-hover.js +++ b/js/post-hover.js @@ -26,7 +26,7 @@ onready(function(){ return; } - var board = $(this); + /*var board = $(this); var i = 0; while (board.data('board') === undefined) { board = board.parent(); @@ -42,7 +42,7 @@ onready(function(){ var parentboard = board; if ($link.is('[data-thread]')) parentboard = $('form[name="post"] input[name="board"]').val(); - else if (matches[1] !== undefined) board = matches[1]; + else if (matches[1] !== undefined) board = matches[1];*/ var $post = false; var hovering = false; From f0be54b98b1639f980425807eb43658ccf57188a Mon Sep 17 00:00:00 2001 From: 8chan Admin Date: Sat, 5 Apr 2014 16:25:20 +0000 Subject: [PATCH 4/7] add meta_description --- templates/header.html | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/header.html b/templates/header.html index 0ac44114..9d5d52bf 100644 --- a/templates/header.html +++ b/templates/header.html @@ -3,6 +3,7 @@ {% if config.meta_keywords %}{% endif %} + {% if config.meta_description %}{% endif %} {% if config.default_stylesheet.1 != '' and not mod %}{% endif %} {% if config.font_awesome %}{% endif %} From 89fd0a67ade1d4167a8e4f0dc10c4238e549da85 Mon Sep 17 00:00:00 2001 From: 8chan Admin Date: Sat, 5 Apr 2014 16:25:39 +0000 Subject: [PATCH 5/7] add footer to page.html --- templates/page.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/page.html b/templates/page.html index 545576c9..ace4e647 100644 --- a/templates/page.html +++ b/templates/page.html @@ -20,7 +20,7 @@

Powered by Tinyboard {{ config.version }} | Tinyboard Copyright © 2010-2013 Tinyboard Development Group

-

The posts on this website are the property of their respective owners and are not the responsibility of the administrator of 8chan.co.

+ {% for footer in config.footer %}

{{ footer }}

{% endfor %}
From 195c587dc05ada4545feba3703c6ed7be3b79c6f Mon Sep 17 00:00:00 2001 From: 8chan Admin Date: Sat, 5 Apr 2014 21:04:46 +0000 Subject: [PATCH 6/7] Catalog 8chan fixes --- js/catalog-link.js | 5 ++++- templates/themes/catalog/catalog.html | 13 ++++++------- templates/themes/catalog/info.php | 7 +++++++ templates/themes/catalog/theme.php | 11 +++++++++-- 4 files changed, 26 insertions(+), 10 deletions(-) diff --git a/js/catalog-link.js b/js/catalog-link.js index ba53e8cf..66bd1d51 100644 --- a/js/catalog-link.js +++ b/js/catalog-link.js @@ -53,4 +53,7 @@ if (subtitle) { } } } -$(document).ready(catalog); + +if (!parseInt($('input[name="mod"]').val())) { + $(document).ready(catalog); +} diff --git a/templates/themes/catalog/catalog.html b/templates/themes/catalog/catalog.html index 7b8c075a..aaa287f6 100644 --- a/templates/themes/catalog/catalog.html +++ b/templates/themes/catalog/catalog.html @@ -2,11 +2,8 @@ - - {{ settings.title }} - + {% include "header.html" %} - {% if config.url_favicon %}{% endif %} {{ boardlist.top }} @@ -18,9 +15,11 @@
    {% for post in recent_posts %}
    - - - +
    + + + +
    {% trans %}1 reply{% plural post.reply_count %}{{ count }} replies{% endtrans %}
    {{ post.body }} diff --git a/templates/themes/catalog/info.php b/templates/themes/catalog/info.php index c68c9e09..91c68ad4 100644 --- a/templates/themes/catalog/info.php +++ b/templates/themes/catalog/info.php @@ -29,6 +29,13 @@ 'comment' => '(space seperated)', 'default' => implode(' ', $__default_boards) ); + + $theme['config'][] = Array( + 'title' => 'Use all boards - ∞chan', + 'name' => 'all', + 'type' => 'checkbox', + 'default' => false + ); $theme['config'][] = Array( 'title' => 'CSS file', diff --git a/templates/themes/catalog/theme.php b/templates/themes/catalog/theme.php index 424a813b..7a8f2e98 100644 --- a/templates/themes/catalog/theme.php +++ b/templates/themes/catalog/theme.php @@ -11,7 +11,14 @@ // - post (a reply has been made) // - post-thread (a thread has been made) - $boards = explode(' ', $settings['boards']); + if ($settings['all']) { + $_boards = listBoards(); + $boards = array(); + foreach ($_boards as $i => $b) + $boards[] = $b['uri']; + } else { + $boards = explode(' ', $settings['boards']); + } if ($action == 'all') { copy('templates/themes/catalog/catalog.css', $config['dir']['home'] . $settings['css']); @@ -20,7 +27,7 @@ $b = new Catalog(); $b->build($settings, $board); } - } elseif ($action == 'post-thread' || ($settings['update_on_posts'] && $action == 'post') || ($settings['update_on_posts'] && $action == 'post-delete') && in_array($board, $boards)) { + } elseif ($action == 'post-thread' || ($settings['update_on_posts'] && $action == 'post') || ($settings['update_on_posts'] && $action == 'post-delete') && (in_array($board, $boards) | $settings['all'])) { $b = new Catalog(); $b->build($settings, $board); } From e2b3ba02f079778fc102c9060dcb991934ad4768 Mon Sep 17 00:00:00 2001 From: 8chan Admin Date: Sun, 6 Apr 2014 00:47:18 +0000 Subject: [PATCH 7/7] Catalog fix for threads --- js/catalog-link.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/js/catalog-link.js b/js/catalog-link.js index 66bd1d51..057304a4 100644 --- a/js/catalog-link.js +++ b/js/catalog-link.js @@ -15,8 +15,13 @@ function catalog() { var board = $("input[name='board']"); -if (board) { +if (board.length>0) { +if (window.location.href.indexOf("/res/")==-1){ //if we are inside a thread var catalog_url = 'catalog.html'; +} +else { +var catalog_url = '../catalog.html'; +} var pages = document.getElementsByClassName('pages')[0]; var bottom = document.getElementsByClassName('boardlist bottom')[0] var subtitle = document.getElementsByClassName('subtitle')[0];