summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorczaks <marcin@6irc.net>2013-08-28 12:41:36 -0400
committerczaks <marcin@6irc.net>2013-08-28 12:41:36 -0400
commit8503e65858ce3145a11f8daec4104e3a7249c889 (patch)
treec619ac3da567cacb96ed9b95a75bb3c1cbbcc87a /templates
parent753b67aa71963f32ec3c3bc7c18f53bb00f2e4f8 (diff)
parent7a4e481333c3ab39ea63c2d961a7c05016b12460 (diff)
Merge branch 'master' of https://github.com/savetheinternet/Tinyboard
Conflicts: inc/config.php inc/functions.php install.php stylesheets/dark_roach.css
Diffstat (limited to 'templates')
-rw-r--r--templates/posts.sql3
-rw-r--r--templates/themes/catalog/theme.php2
-rw-r--r--templates/themes/recent/theme.php2
-rw-r--r--templates/themes/sitemap/info.php9
-rw-r--r--templates/themes/sitemap/theme.php9
5 files changed, 21 insertions, 4 deletions
diff --git a/templates/posts.sql b/templates/posts.sql
index 4eef3a0d..1e092985 100644
--- a/templates/posts.sql
+++ b/templates/posts.sql
@@ -28,6 +28,7 @@ CREATE TABLE IF NOT EXISTS ``posts_{{ board }}`` (
UNIQUE KEY `id` (`id`),
KEY `thread_id` (`thread`,`id`),
KEY `time` (`time`),
- FULLTEXT KEY `body` (`body`)
+ FULLTEXT KEY `body` (`body`),
+ KEY `ip` (`ip`),
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 AUTO_INCREMENT=1 ;
\ No newline at end of file
diff --git a/templates/themes/catalog/theme.php b/templates/themes/catalog/theme.php
index 96550683..424a813b 100644
--- a/templates/themes/catalog/theme.php
+++ b/templates/themes/catalog/theme.php
@@ -20,7 +20,7 @@
$b = new Catalog();
$b->build($settings, $board);
}
- } elseif ($action == 'post-thread' || ($settings['update_on_posts'] && $action == 'post') && 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)) {
$b = new Catalog();
$b->build($settings, $board);
}
diff --git a/templates/themes/recent/theme.php b/templates/themes/recent/theme.php
index 08d910f8..4bbf1469 100644
--- a/templates/themes/recent/theme.php
+++ b/templates/themes/recent/theme.php
@@ -24,7 +24,7 @@
$this->excluded = explode(' ', $settings['exclude']);
- if ($action == 'all' || $action == 'post' || $action == 'post-thread')
+ if ($action == 'all' || $action == 'post' || $action == 'post-thread' || $action == 'post-delete')
file_write($config['dir']['home'] . $settings['html'], $this->homepage($settings));
}
diff --git a/templates/themes/sitemap/info.php b/templates/themes/sitemap/info.php
index 43b529fa..0ea2ba9d 100644
--- a/templates/themes/sitemap/info.php
+++ b/templates/themes/sitemap/info.php
@@ -35,6 +35,15 @@
'default' => 'hourly',
'size' => '20'
);
+
+ $theme['config'][] = Array(
+ 'title' => 'Minimum time between regenerating',
+ 'name' => 'regen_time',
+ 'type' => 'text',
+ 'comment' => '(in seconds)',
+ 'default' => '0',
+ 'size' => '8'
+ );
$__boards = listBoards();
$__default_boards = Array();
diff --git a/templates/themes/sitemap/theme.php b/templates/themes/sitemap/theme.php
index 226f8357..1e36422d 100644
--- a/templates/themes/sitemap/theme.php
+++ b/templates/themes/sitemap/theme.php
@@ -11,9 +11,16 @@
// - post (a post has been made)
// - thread (a thread has been made)
- if ($action != 'post' && $action != 'post-thread')
+ if ($action != 'post-thread' && $action != 'post-delete')
return;
+ if ($settings['regen_time'] > 0) {
+ if ($last_gen = @filemtime($settings['path'])) {
+ if (time() - $last_gen < (int)$settings['regen_time'])
+ return; // Too soon
+ }
+ }
+
$boards = explode(' ', $settings['boards']);
$threads = array();