diff --git a/inc/config.php b/inc/config.php
index b5178fc4..80f3c01f 100644
--- a/inc/config.php
+++ b/inc/config.php
@@ -1223,7 +1223,8 @@
// $config['font_awesome'] is false (default).
// $config['image_sticky'] = 'static/sticky.png';
// $config['image_locked'] = 'static/locked.gif';
- // $config['image_bumplocked'] = 'static/sage.png'.
+ // $config['image_bumplocked'] = 'static/sage.png';
+ // $config['image_cycled'] = 'static/cycled.png';
// If you want to put images and other dynamic-static stuff on another (preferably cookieless) domain.
// This will override $config['root'] and $config['dir']['...'] directives. "%s" will get replaced with
diff --git a/inc/instance-config.php b/inc/instance-config.php
index a30dd9ac..4b66f15f 100644
--- a/inc/instance-config.php
+++ b/inc/instance-config.php
@@ -122,6 +122,9 @@ $config['mod']['rawhtml'] = MOD;
$config['mod']['mod_board_log'] = MOD;
$config['mod']['ip_recentposts'] = 350;
+// Allow everyone to see bumplocks
+$config['mod']['view_bumplock'] = -1;
+
$config['allow_thread_deletion'] = false;
// Max attachments per post
diff --git a/inc/mod/pages.php b/inc/mod/pages.php
index 4a2afc73..8e22a1f3 100644
--- a/inc/mod/pages.php
+++ b/inc/mod/pages.php
@@ -2020,18 +2020,18 @@ function mod_edit_post($board, $edit_raw_html, $postID) {
header('Location: ?/' . sprintf($config['board_path'], $board) . $config['dir']['res'] . link_for($post) . '#' . $postID, true, $config['redirect_http']);
} else {
// Remove modifiers
- //$post['body_nomarkup'] = remove_modifiers($post['body_nomarkup']);
+ $post['body_nomarkup'] = remove_modifiers($post['body_nomarkup']);
- //$post['body_nomarkup'] = utf8tohtml($post['body_nomarkup']);
- //$post['body'] = utf8tohtml($post['body']);
- /*if ($config['minify_html']) {
+ $post['body_nomarkup'] = utf8tohtml($post['body_nomarkup']);
+ $post['body'] = utf8tohtml($post['body']);
+ if ($config['minify_html']) {
$post['body_nomarkup'] = str_replace("\n", '
', $post['body_nomarkup']);
$post['body'] = str_replace("\n", '
', $post['body']);
$post['body_nomarkup'] = str_replace("\r", '', $post['body_nomarkup']);
$post['body'] = str_replace("\r", '', $post['body']);
$post['body_nomarkup'] = str_replace("\t", ' ', $post['body_nomarkup']);
$post['body'] = str_replace("\t", ' ', $post['body']);
- }*/
+ }
mod_page(_('Edit post'), 'mod/edit_post_form.html', array('token' => $security_token, 'board' => $board, 'raw' => $edit_raw_html, 'post' => $post));
}
@@ -3219,7 +3219,7 @@ function mod_theme_uninstall($theme_name) {
// Clean cache
Cache::delete("themes");
- Cache::delete("theme_settings_".$theme);
+ Cache::delete("theme_settings_".$theme_name);
header('Location: ?/themes', true, $config['redirect_http']);
}
diff --git a/post.php b/post.php
index 48f7ab90..dfa42cd4 100644
--- a/post.php
+++ b/post.php
@@ -1374,7 +1374,7 @@ function handle_post(){
query('INSERT INTO ``cites`` VALUES ' . implode(', ', $insert_rows)) or error(db_error());
}
- if (!$post['op'] && strtolower($post['email']) != 'sage' && !$thread['sage'] && ($config['reply_limit'] == 0 || $numposts['replies']+1 < $config['reply_limit'])) {
+ if (!$post['op'] && strtolower($post['email']) != 'sage' && !$thread['sage'] && ($config['reply_limit'] == 0 || $numposts['replies'] < $config['reply_limit'])) {
bumpThread($post['thread']);
}
diff --git a/robots.txt b/robots.txt
index 1f53798b..de1da8f7 100644
--- a/robots.txt
+++ b/robots.txt
@@ -1,2 +1,3 @@
User-agent: *
-Disallow: /
+Disallow: /templates/
+Allow: /
diff --git a/stylesheets/dark.css b/stylesheets/dark.css
index 86c9bca9..b36a64c6 100644
--- a/stylesheets/dark.css
+++ b/stylesheets/dark.css
@@ -5,8 +5,8 @@
body {
background: #1E1E1E;
color: #999999;
- font-family: sans-serif;
- font-size: 12px;
+ font-family: Verdana, sans-serif;
+ font-size: 14px;
}
.quote {
color:#B8D962;
diff --git a/templates/post_thread.html b/templates/post_thread.html
index 6b114f6b..448bbd72 100644
--- a/templates/post_thread.html
+++ b/templates/post_thread.html
@@ -21,28 +21,28 @@
{% if config.font_awesome %}
{% else %}
-
+
{% endif %}
{% endif %}
{% if post.locked %}
{% if config.font_awesome %}
{% else %}
-
+
{% endif %}
{% endif %}
- {% if post.bumplocked and (config.mod.view_bumplock < 0 or (post.mod and post.mod|hasPermission(config.mod.view_bumplock, board.uri))) %}
+ {% if post.sage and (config.mod.view_bumplock < 0 or (post.mod and post.mod|hasPermission(config.mod.view_bumplock, board.uri))) %}
{% if config.font_awesome %}
{% else %}
-
+
{% endif %}
{% endif %}
{% if post.cycle %}
{% if config.font_awesome %}
{% else %}
-
+
{% endif %}
{% endif %}
{% if index %}
diff --git a/templates/themes/catalog/catalog.html b/templates/themes/catalog/catalog.html
index cfee935f..128b3187 100644
--- a/templates/themes/catalog/catalog.html
+++ b/templates/themes/catalog/catalog.html
@@ -70,7 +70,7 @@
id="img-{{ post.id }}" data-subject="{% if post.subject %}{{ post.subject|e }}{% endif %}" data-name="{{ post.name|e }}" data-muhdifference="{{ post.muhdifference }}" class="{{post.board}} thread-image" title="{{post.bump|date('%b %d %H:%M')}}">
diff --git a/templates/themes/semirand/theme.php b/templates/themes/semirand/theme.php
index cd670a52..3897a4e4 100644
--- a/templates/themes/semirand/theme.php
+++ b/templates/themes/semirand/theme.php
@@ -97,6 +97,18 @@
return $query->fetchAll(PDO::FETCH_ASSOC);
}
+ /**
+ * Retrieve count of images and posts in a thread
+ */
+ private function fetchThreadCount($board, $thread_id, $preview_count) {
+ $query = prepare("SELECT SUM(t.num_files) as file_count, COUNT(t.id) as post_count FROM (SELECT * FROM ``posts_$board`` WHERE `thread` = :id ORDER BY `time` DESC LIMIT :offset , 18446744073709551615) as t;");
+ $query->bindValue(':id', $thread_id, PDO::PARAM_INT);
+ $query->bindValue(':offset', $preview_count, PDO::PARAM_INT);
+ $query->execute() or error(db_error($query));
+
+ return $query->fetch(PDO::FETCH_ASSOC);
+ }
+
/**
* Intersperse random threads between those in bump order
*/
@@ -138,27 +150,15 @@
$config['threads_preview'];
$replies = $this->fetchReplies($post['board'], $post['id'], $preview_count);
- // Chomp the last few replies
$disp_replies = $replies;
- $disp_img_count = 0;
foreach ($disp_replies as $reply) {
- if ($reply['files'] !== '')
- ++$disp_img_count;
-
// Append the reply to the thread as it's being built
$thread->add(new Post($reply, $mod ? '?/' : $config['root'], $mod));
}
- // Count the number of omitted image replies
- $omitted_img_count = count(array_filter($replies, function($p) {
- return $p['files'] !== '';
- }));
-
- // Set the corresponding omitted numbers on the thread
- if (!empty($replies)) {
- $thread->omitted = count($replies);
- $thread->omitted_images = $omitted_img_count;
- }
+ $threadCount = $this->fetchThreadCount($post['board'], $post['id'], $preview_count);
+ $thread->omitted = $threadCount['post_count'];
+ $thread->omitted_images = $threadCount['file_count'];
// Board name and link
$html = '/' .