From ba7e3c4aaa158c0fc1e9ff69605b8c47dfdd85c1 Mon Sep 17 00:00:00 2001 From: 8chan Date: Thu, 16 Oct 2014 18:52:28 -0700 Subject: [PATCH 1/6] use tabs and not spaces --- templates/8chan/index.html | 385 +++++++++++++++++++------------------ 1 file changed, 196 insertions(+), 189 deletions(-) diff --git a/templates/8chan/index.html b/templates/8chan/index.html index 459e7e8e..2bad668d 100644 --- a/templates/8chan/index.html +++ b/templates/8chan/index.html @@ -1,13 +1,13 @@ - - - ∞chan - - + + - + -
+
-
+
- + -
- {% trans %}Welcome to ∞chan, the infinitely expanding imageboard.{% endtrans %} -
- {% trans %}Featured boards:{% endtrans %} - -
- {% trans %}Board of the week:{% endtrans %} /cow/, /fringe/, /desu/ -
-
+
+ {% trans %}Welcome to ∞chan, the infinitely expanding imageboard.{% endtrans %} +
+ {% trans %}Featured boards:{% endtrans %} + +
+ + {% trans %}Boards of the week:{% endtrans %} [  + {% for board in config.boards_of_the_week %} + {% if not loop.first %} {% endif %}{{ board }}{% if not loop.last %} /{% endif %} + {% endfor %} +  ] + +
+
- + -
+
- -
-
-

{% trans %}On ∞chan, you can create your own imageboard for free with no experience or programming knowledge needed. As long as the admin logs in once per week and it gets one new post every 72 hours, the board will be hosted forever.{% endtrans %}

-

{% trans %}Warning: Some boards on this site might contain content of an adult or offensive nature. Please cease use of this site if it is illegal for you to view such content. The boards on this site are made entirely by the users and do not represent the opinions of the administration of 8chan.co. In the interest of free speech, only content that directly violates the DMCA or other US laws is deleted.{% endtrans %}

- -
- - - -
-
+
+
+

{% trans %}On ∞chan, you can create your own imageboard for free with no experience or programming knowledge needed. As long as the admin logs in once per week and it gets one new post every 72 hours, the board will be hosted forever.{% endtrans %}

+

{% trans %}Warning: Some boards on this site might contain content of an adult or offensive nature. Please cease use of this site if it is illegal for you to view such content. The boards on this site are made entirely by the users and do not represent the opinions of the administration of 8chan.co. In the interest of free speech, only content that directly violates the DMCA or other US laws is deleted.{% endtrans %}

+ +
+ + + +
+
-
+
-
+
From 33371bee9f85a61dc5f6a5d6f40421cd6890e73d Mon Sep 17 00:00:00 2001 From: 8chan Date: Thu, 16 Oct 2014 18:53:52 -0700 Subject: [PATCH 2/6] Allow IP less to show more posts --- inc/instance-config.php | 1 + 1 file changed, 1 insertion(+) diff --git a/inc/instance-config.php b/inc/instance-config.php index 699d1a18..59902a99 100644 --- a/inc/instance-config.php +++ b/inc/instance-config.php @@ -87,6 +87,7 @@ $config['mod']['modlog'] = SUPERMOD; $config['mod']['editpost'] = MOD; $config['mod']['recent_reports'] = 65535; + $config['mod']['ip_less_recentposts'] = 75; $config['ban_show_post'] = true; // Board shit From d50b86a7c2483404d03285bf8d00c40d4a644f46 Mon Sep 17 00:00:00 2001 From: 8chan Date: Thu, 16 Oct 2014 18:53:59 -0700 Subject: [PATCH 3/6] underline --- inc/instance-config.php | 1 + 1 file changed, 1 insertion(+) diff --git a/inc/instance-config.php b/inc/instance-config.php index 59902a99..1d9db89d 100644 --- a/inc/instance-config.php +++ b/inc/instance-config.php @@ -146,6 +146,7 @@ $config['markup'][] = array("/^[ |\t]*==(.+?)==[ |\t]*$/m", "\$1"); $config['markup'][] = array("/\[spoiler\](.+?)\[\/spoiler\]/", "\$1"); $config['markup'][] = array("/~~(.+?)~~/", "\$1"); + $config['markup'][] = array("/__(.+?)__/", "\$1"); $config['boards'] = array(array('' => '/', '' => '/boards.html', '' => '/faq.html', '' => '/random.php', '' => '/create.php', '' => '/bans.html', '' => '/search.php', '' => '/mod.php', '' => 'https://qchat.rizon.net/?channels=#8chan'), array('b', 'meta', 'int'), array(''=>'https://twitter.com/infinitechan')); //$config['boards'] = array(array('' => '/', '' => '/boards.html', '' => '/faq.html', '' => '/random.php', '' => '/create.php', '' => '/search.php', '' => '/mod.php', '' => 'https://qchat.rizon.net/?channels=#8chan'), array('b', 'meta', 'int'), array('v', 'a', 'tg', 'fit', 'pol', 'tech', 'mu', 'co', 'sp', 'boards'), array(''=>'https://twitter.com/infinitechan')); From 3f6805d7dfba7695456a4e3304d931546af04100 Mon Sep 17 00:00:00 2001 From: 8chan Date: Sat, 18 Oct 2014 13:18:04 -0700 Subject: [PATCH 4/6] Break TeX on purpose due to Khan/KaTeX#158 --- js/katex-enable.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/katex-enable.js b/js/katex-enable.js index 66749f09..697b5cab 100644 --- a/js/katex-enable.js +++ b/js/katex-enable.js @@ -7,7 +7,7 @@ * $config['additional_javascript'][] = 'js/jquery.min.js'; * $config['additional_javascript'][] = 'js/katex-enable.js'; */ - +/* function render_katex(el) { try { katex.render($(el).text(), el) @@ -32,3 +32,4 @@ if (active_page == 'thread' || active_page == 'index') { }); }); } +*/ From f1c23888407bf60258223e2de736b96721b2bdd6 Mon Sep 17 00:00:00 2001 From: 8chan Date: Sat, 18 Oct 2014 13:20:46 -0700 Subject: [PATCH 5/6] 8archive.moe --- inc/instance-config.php | 6 ++++-- templates/mod/settings.html | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/inc/instance-config.php b/inc/instance-config.php index 1d9db89d..0a557691 100644 --- a/inc/instance-config.php +++ b/inc/instance-config.php @@ -316,15 +316,15 @@ OEKAKI; if (!(strlen($subtitle) < 200)) error('Invalid subtitle'); - $query = prepare('UPDATE ``boards`` SET `title` = :title, `subtitle` = :subtitle, `indexed` = :indexed, `public_bans` = :public_bans WHERE `uri` = :uri'); + $query = prepare('UPDATE ``boards`` SET `title` = :title, `subtitle` = :subtitle, `indexed` = :indexed, `public_bans` = :public_bans, `8archive` = :8archive WHERE `uri` = :uri'); $query->bindValue(':title', $title); $query->bindValue(':subtitle', $subtitle); $query->bindValue(':uri', $b); $query->bindValue(':indexed', !isset($_POST['meta_noindex'])); $query->bindValue(':public_bans', isset($_POST['public_bans'])); + $query->bindValue(':8archive', isset($_POST['8archive'])); $query->execute() or error(db_error($query)); - $config_file = <<fetchAll(PDO::FETCH_ASSOC))); file_write($b.'/config.php', $config_file); file_write('stylesheets/board/'.$b.'.css', $_POST['css']); file_write($b.'/rules.html', Element('page.html', array('title'=>'Rules', 'subtitle'=>'', 'config'=>$config, 'body'=>'
'.purify($_POST['rules']).'
'))); diff --git a/templates/mod/settings.html b/templates/mod/settings.html index 5268d373..3305555e 100644 --- a/templates/mod/settings.html +++ b/templates/mod/settings.html @@ -33,6 +33,7 @@ {% trans %}Display SAGE! after saged posts{% endtrans %} {% trans %}Automatically convert ... to …{% endtrans %} {% trans %}No index{% endtrans %}
{% trans %}Hide from boards index
and do not index in search engines{% endtrans %}
+ {% trans %}Archive my board on 8archive.moe{% endtrans %}
{% trans %}This archives your board on 8archive.moe if you opt in{% endtrans %} {% trans %}Public bans{% endtrans %}
{% trans %}Displays your bans for the public{% endtrans %} {% trans %}[code] tags{% endtrans %} {% trans %}Oekaki{% endtrans %} From fceea15317af1cb00044a927080e1c5def12304e Mon Sep 17 00:00:00 2001 From: 8chan Date: Sat, 18 Oct 2014 13:21:08 -0700 Subject: [PATCH 6/6] Be smarter about rebuilds --- inc/functions.php | 2 +- inc/instance-config.php | 19 ++++++++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/inc/functions.php b/inc/functions.php index b61f5bb7..b2d945d2 100755 --- a/inc/functions.php +++ b/inc/functions.php @@ -680,7 +680,7 @@ function listBoards($just_uri = false, $indexed_only = false) { if (!$just_uri) { $query = query("SELECT ``boards``.`uri` uri, ``boards``.`title` title, ``boards``.`subtitle` subtitle, ``board_create``.`time` time, ``boards``.`indexed` indexed FROM ``boards``" . ( $indexed_only ? " WHERE `indexed` = 1 " : "" ) . "LEFT JOIN ``board_create`` ON ``boards``.`uri` = ``board_create``.`uri` ORDER BY ``boards``.`uri`") or error(db_error()); - $boards = $query->fetchAll(); + $boards = $query->fetchAll(PDO::FETCH_ASSOC); } else { $boards = array(); $query = query("SELECT `uri` FROM ``boards``" . ( $indexed_only ? " WHERE `indexed` = 1" : "" ) . " ORDER BY ``boards``.`uri`") or error(db_error()); diff --git a/inc/instance-config.php b/inc/instance-config.php index 0a557691..c2df3b5b 100644 --- a/inc/instance-config.php +++ b/inc/instance-config.php @@ -355,13 +355,22 @@ EOT; file_write('stylesheets/board/'.$b.'.css', $_POST['css']); file_write($b.'/rules.html', Element('page.html', array('title'=>'Rules', 'subtitle'=>'', 'config'=>$config, 'body'=>'
'.purify($_POST['rules']).'
'))); file_write($b.'/rules.txt', $_POST['rules']); + + $_config = $config; + openBoard($b); - buildIndex(); - buildJavascript(); - $query = query(sprintf("SELECT `id` FROM ``posts_%s`` WHERE `thread` IS NULL", $b)) or error(db_error()); - while ($post = $query->fetch(PDO::FETCH_ASSOC)) { - buildThread($post['id']); + + // be smarter about rebuilds...only some changes really require us to rebuild all threads + if ($_config['blotter'] != $config['blotter'] || $_config['field_disable_name'] != $config['field_disable_name'] || $_config['show_sages'] != $config['show_sages']) { + buildIndex(); + $query = query(sprintf("SELECT `id` FROM ``posts_%s`` WHERE `thread` IS NULL", $b)) or error(db_error()); + while ($post = $query->fetch(PDO::FETCH_ASSOC)) { + buildThread($post['id']); + } } + + buildJavascript(); + modLog('Edited board settings', $b); }