diff options
| author | czaks <marcin@6irc.net> | 2016-02-09 12:37:03 +0100 |
|---|---|---|
| committer | czaks <marcin@6irc.net> | 2016-02-09 12:37:03 +0100 |
| commit | c53f13bf90716461780fef0a2b4b6e2b5b3cb002 (patch) | |
| tree | 5cd18f303da0b0e6fdc87f175adf5f5f86d881e2 /templates/themes/catalog | |
| parent | fe66c51a19920378885fb790d341cc50c933b046 (diff) | |
| parent | 028fd3df15b2e2edc96c5b84156b0b039ea16562 (diff) | |
Merge branch 'master' of https://github.com/vichan-devel/vichan
Diffstat (limited to 'templates/themes/catalog')
| -rw-r--r-- | templates/themes/catalog/catalog.html | 4 | ||||
| -rw-r--r-- | templates/themes/catalog/theme.php | 25 |
2 files changed, 22 insertions, 7 deletions
diff --git a/templates/themes/catalog/catalog.html b/templates/themes/catalog/catalog.html index aef6c139..381b1924 100644 --- a/templates/themes/catalog/catalog.html +++ b/templates/themes/catalog/catalog.html @@ -48,7 +48,7 @@ <div class="thread grid-li grid-size-small"> <a href="{{post.link}}"> {% if post.youtube %} - <img src="http://img.youtube.com/vi/{{ post.youtube }}/0.jpg" + <img src="//img.youtube.com/vi/{{ post.youtube }}/0.jpg" {% else %} <img src="{{post.file}}" {% endif %} @@ -79,7 +79,7 @@ <p class="unimportant" style="margin-top:20px;text-align:center;">- <a href="http://tinyboard.org/">Tinyboard</a> + <a href='https://int.vichan.net/devel/'>vichan</a> {{ config.version }} - <br><a href="http://tinyboard.org/">Tinyboard</a> Copyright © 2010-2014 Tinyboard Development Group - <br><a href="https://int.vichan.net/devel/">vichan</a> Copyright © 2012-2014 vichan-devel</p> + <br><a href="https://engine.vichan.net/">vichan</a> Copyright © 2012-2015 vichan-devel</p> </footer> <script type="text/javascript">{% raw %} var styles = { diff --git a/templates/themes/catalog/theme.php b/templates/themes/catalog/theme.php index b3b7caf7..34b28e48 100644 --- a/templates/themes/catalog/theme.php +++ b/templates/themes/catalog/theme.php @@ -16,11 +16,22 @@ if ($action == 'all') { foreach ($boards as $board) { $b = new Catalog(); - $b->build($settings, $board); + if ($config['smart_build']) { + file_unlink($config['dir']['home'] . $board . '/catalog.html'); + } + else { + $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)) { $b = new Catalog(); - $b->build($settings, $board); + + if ($config['smart_build']) { + file_unlink($config['dir']['home'] . $board . '/catalog.html'); + } + else { + $b->build($settings, $board); + } } } @@ -28,8 +39,12 @@ class Catalog { public function build($settings, $board_name) { global $config, $board; - - openBoard($board_name); + + if ($board['uri'] != $board_name) { + if (!openBoard($board_name)) { + error(sprintf(_("Board %s doesn't exist"), $board_name)); + } + } $recent_images = array(); $recent_posts = array(); @@ -42,7 +57,7 @@ $board_name, $board_name, $board_name, $board_name, $board_name)) or error(db_error()); while ($post = $query->fetch(PDO::FETCH_ASSOC)) { - $post['link'] = $config['root'] . $board['dir'] . $config['dir']['res'] . link_for($post)); + $post['link'] = $config['root'] . $board['dir'] . $config['dir']['res'] . link_for($post); $post['board_name'] = $board['name']; if ($post['embed'] && preg_match('/^https?:\/\/(\w+\.)?(?:youtube\.com\/watch\?v=|youtu\.be\/)([a-zA-Z0-9\-_]{10,11})(&.+)?$/i', $post['embed'], $matches)) { |
