From 7d92a05bd8b283a79764e8ed5435661b9a8b27f2 Mon Sep 17 00:00:00 2001 From: czaks Date: Tue, 10 Mar 2015 13:23:40 +0100 Subject: ... --- templates/themes/catalog/theme.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'templates') diff --git a/templates/themes/catalog/theme.php b/templates/themes/catalog/theme.php index b3b7caf7..f8f1146e 100644 --- a/templates/themes/catalog/theme.php +++ b/templates/themes/catalog/theme.php @@ -42,7 +42,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)) { -- cgit v1.3 From 4aa1d387f8a90d33207d28afc637958759e2ce6e Mon Sep 17 00:00:00 2001 From: czaks Date: Tue, 10 Mar 2015 13:34:02 +0100 Subject: ... --- templates/themes/sitemap/theme.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'templates') diff --git a/templates/themes/sitemap/theme.php b/templates/themes/sitemap/theme.php index 1cebcdb6..41a7f304 100644 --- a/templates/themes/sitemap/theme.php +++ b/templates/themes/sitemap/theme.php @@ -26,7 +26,7 @@ $threads = array(); foreach ($boards as $board) { - $query = query(sprintf("SELECT `id`, `slug`, (SELECT `time` FROM ``posts_%s`` WHERE `thread` = `thread_id` OR `id` = `thread_id` ORDER BY `time` DESC LIMIT 1) AS `lastmod` FROM ``posts_%s`` WHERE `thread` IS NULL", $board, $board)) or error(db_error()); + $query = query(sprintf("SELECT `id`, `id` AS `thread_id`, `slug`, (SELECT `time` FROM ``posts_%s`` WHERE `thread` = `thread_id` OR `id` = `thread_id` ORDER BY `time` DESC LIMIT 1) AS `lastmod` FROM ``posts_%s`` WHERE `thread` IS NULL", $board, $board)) or error(db_error()); $threads[$board] = $query->fetchAll(PDO::FETCH_ASSOC); } -- cgit v1.3 From d6e91ec62f0364c0ea430bd872c5eec3c7169bdb Mon Sep 17 00:00:00 2001 From: Jason Puglisi Date: Thu, 19 Mar 2015 19:35:28 -0400 Subject: Added space after Google image search link --- templates/post/image_identification.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'templates') diff --git a/templates/post/image_identification.html b/templates/post/image_identification.html index fa2f30b3..cd37b901 100644 --- a/templates/post/image_identification.html +++ b/templates/post/image_identification.html @@ -8,7 +8,7 @@ Exif {% endif %} {% if config.image_identification_google %} - Google + Google {% endif %} {% if config.image_identification_iqdb %} iqdb -- cgit v1.3 From 1283e51ca50c9085a0f1b763fa4928c91b7c8e69 Mon Sep 17 00:00:00 2001 From: Jason Puglisi Date: Thu, 19 Mar 2015 21:49:57 -0400 Subject: Fixed and re-enabled active content stat for recent theme --- templates/themes/recent/theme.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'templates') diff --git a/templates/themes/recent/theme.php b/templates/themes/recent/theme.php index 2ea6a7b9..9307c6a9 100644 --- a/templates/themes/recent/theme.php +++ b/templates/themes/recent/theme.php @@ -125,15 +125,18 @@ $stats['unique_posters'] = number_format($query->fetchColumn()); // Active content - /*$query = 'SELECT SUM(`filesize`) FROM ('; + $query = 'SELECT `files` FROM ('; foreach ($boards as &$_board) { if (in_array($_board['uri'], $this->excluded)) continue; - $query .= sprintf("SELECT `filesize` FROM ``posts_%s`` UNION ALL ", $_board['uri']); + $query .= sprintf("SELECT `files` FROM ``posts_%s`` UNION ALL ", $_board['uri']); } - $query = preg_replace('/UNION ALL $/', ') AS `posts_all`', $query); + $query = preg_replace('/UNION ALL $/', ' WHERE `num_files` > 0) AS `posts_all`', $query); $query = query($query) or error(db_error()); - $stats['active_content'] = $query->fetchColumn();*/ + $files = $query->fetchAll(); + $stats['active_content'] = 0; + foreach ($files as &$file) + $stats['active_content'] += intval(preg_replace('/.*"size":([0-9]*).*/', '$1', $file[0])); return Element('themes/recent/recent.html', Array( 'settings' => $settings, -- cgit v1.3 From 034b288a1317a940c3a5722c6d2864d1ea08f5db Mon Sep 17 00:00:00 2001 From: Jason Puglisi Date: Fri, 20 Mar 2015 09:47:40 -0400 Subject: Fixed to work with multiple images --- templates/themes/recent/theme.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'templates') diff --git a/templates/themes/recent/theme.php b/templates/themes/recent/theme.php index 9307c6a9..ce64c80e 100644 --- a/templates/themes/recent/theme.php +++ b/templates/themes/recent/theme.php @@ -125,7 +125,7 @@ $stats['unique_posters'] = number_format($query->fetchColumn()); // Active content - $query = 'SELECT `files` FROM ('; + $query = 'SELECT DISTINCT(`files`) FROM ('; foreach ($boards as &$_board) { if (in_array($_board['uri'], $this->excluded)) continue; @@ -135,8 +135,10 @@ $query = query($query) or error(db_error()); $files = $query->fetchAll(); $stats['active_content'] = 0; - foreach ($files as &$file) - $stats['active_content'] += intval(preg_replace('/.*"size":([0-9]*).*/', '$1', $file[0])); + foreach ($files as &$file) { + preg_match_all('/"size":([0-9]*)/', $file[0], $matches); + $stats['active_content'] += array_sum($matches[1]); + } return Element('themes/recent/recent.html', Array( 'settings' => $settings, -- cgit v1.3 From 81afc17b671e16cd95923c1b2461509a5fc4aa81 Mon Sep 17 00:00:00 2001 From: czaks Date: Mon, 23 Mar 2015 00:35:13 +0100 Subject: image identification: url encode --- templates/post/image_identification.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'templates') diff --git a/templates/post/image_identification.html b/templates/post/image_identification.html index fa2f30b3..408a338c 100644 --- a/templates/post/image_identification.html +++ b/templates/post/image_identification.html @@ -8,7 +8,7 @@ Exif {% endif %} {% if config.image_identification_google %} - Google + Google {% endif %} {% if config.image_identification_iqdb %} iqdb -- cgit v1.3 From 3bd7f94861e9a2a8b9a7f8f972f04eb6eaa45453 Mon Sep 17 00:00:00 2001 From: marktaiwan Date: Wed, 18 Mar 2015 18:44:47 +0800 Subject: Fallback for browsers that disables javascript Conflicts: stylesheets/style.css templates/post_form.html --- js/file-selector.js | 3 +- stylesheets/style.css | 81 ++++++++++++++++++++++++++++++++++++++++++++++++ templates/post_form.html | 8 +++++ 3 files changed, 91 insertions(+), 1 deletion(-) (limited to 'templates') diff --git a/js/file-selector.js b/js/file-selector.js index c820db48..ddae2d09 100644 --- a/js/file-selector.js +++ b/js/file-selector.js @@ -140,7 +140,8 @@ var dropHandlers = { } }; -$('.dropzone').css('user-select', 'none') // let jquery add browser specific prefix +$('#upload input[type=file]').hide(); // hide the original file selector +$('.dropzone-wrap').css('user-select', 'none').show(); // let jquery add browser specific prefix // attach handlers $(document).on(dropHandlers, '.dropzone'); diff --git a/stylesheets/style.css b/stylesheets/style.css index e0ce08c5..56140561 100644 --- a/stylesheets/style.css +++ b/stylesheets/style.css @@ -959,3 +959,84 @@ span.pln { cursor: pointer; } +#youtube-size input { + width: 50px; +} + +/* File selector */ +.dropzone { + color: #000; + cursor: default; + margin: auto; + padding: 0px 4px; + text-align: center; + min-height: 50px; + max-height: 140px; + transition: 0.2s; + background-color: rgba(200, 200, 200, 0.5); + overflow-y: auto; +} +.dropzone-wrap { + width: 100%; +} +.dropzone .file-hint { + color: rgba(0, 0, 0, 0.5); + cursor: pointer; + position: relative; + margin-bottom: 5px; + padding: 10px 0px; + top: 5px; + transition: 0.2s; + border: 2px dashed rgba(125, 125, 125, 0.4); +} +.file-hint:hover, .dropzone.dragover .file-hint { + color: rgba(0, 0, 0, 1); + border-color: rgba(125, 125, 125, 0.8); +} +.dropzone.dragover { + background-color: rgba(200, 200, 200, 1); +} +.dropzone .file-thumbs { + text-align: left; + width: 100%; +} +.dropzone .tmb-container { + padding: 3px; + overflow-x: hidden; + white-space: nowrap; +} +.dropzone .file-tmb { + height: 40px; + width: 70px; + cursor: pointer; + display: inline-block; + text-align: center; + background-color: rgba(187, 187, 187, 0.5); + background-size: cover; + background-position: center; +} +.dropzone .file-tmb span { + font-weight: 600; + position: relative; + top: 13px; +} +.dropzone .tmb-filename { + display: inline-block; + vertical-align: bottom; + bottom: 12px; + position: relative; + margin-left: 5px; +} +.dropzone .remove-btn { + cursor: pointer; + color: rgba(125, 125, 125, 0.5); + display: inline-block; + vertical-align: bottom; + bottom: 10px; + position: relative; + margin-right: 5px; + font-size: 20px +} +.dropzone .remove-btn:hover { + color: rgba(125, 125, 125, 1); +} diff --git a/templates/post_form.html b/templates/post_form.html index 1846adb5..9596ee6b 100644 --- a/templates/post_form.html +++ b/templates/post_form.html @@ -98,6 +98,14 @@ + + + {% if config.allow_upload_by_url %}
: -- cgit v1.3 From 0005f11098890ad76c1b9963792cd686493649a9 Mon Sep 17 00:00:00 2001 From: marktaiwan Date: Wed, 18 Mar 2015 21:35:58 +0800 Subject: initialize file selector soon as it's loaded Conflicts: templates/post_form.html --- js/file-selector.js | 44 +++++++++++++++++++------------------------- templates/post_form.html | 2 ++ 2 files changed, 21 insertions(+), 25 deletions(-) (limited to 'templates') diff --git a/js/file-selector.js b/js/file-selector.js index ddae2d09..b4589706 100644 --- a/js/file-selector.js +++ b/js/file-selector.js @@ -5,34 +5,29 @@ * $config['additional_javascript'][] = 'js/jquery.min.js'; * $config['additional_javascript'][] = 'js/file-selector.js'; */ +function init_file_selector() { -if (active_page == 'index' || active_page == 'thread') { $(document).ready(function () { + // add options panel item + if (window.Options && Options.get_tab('general')) { + Options.extend_tab('general', ''); + + $('#file-drag-drop>input').on('click', function() { + if ($('#file-drag-drop>input').is(':checked')) { + localStorage.file_dragdrop = 'true'; + } else { + localStorage.file_dragdrop = 'false'; + } + }); -// add options panel item -if (window.Options && Options.get_tab('general')) { - Options.extend_tab('general', ''); - - $('#file-drag-drop>input').on('click', function() { - if ($('#file-drag-drop>input').is(':checked')) { - localStorage.file_dragdrop = 'true'; - } else { - localStorage.file_dragdrop = 'false'; - } - }); - - if (localStorage.file_dragdrop === 'undefined') localStorage.file_dragdrop = 'true'; - if (localStorage.file_dragdrop === 'true') $('#file-drag-drop>input').prop('checked', true); -} + if (localStorage.file_dragdrop === 'undefined') localStorage.file_dragdrop = 'true'; + if (localStorage.file_dragdrop === 'true') $('#file-drag-drop>input').prop('checked', true); + } +}); // disabled by user, or incompatible browser. -// fallback to old -if (localStorage.file_dragdrop == 'false' || !(window.FileReader && window.File)) { - $('.dropzone-wrap').remove(); - $('#upload_file').show(); - +if (localStorage.file_dragdrop == 'false' || !(window.FileReader && window.File)) return; -} // multipost not enabled if (typeof max_images == 'undefined') { @@ -40,6 +35,8 @@ if (typeof max_images == 'undefined') { } var files = []; +$('#upload_file').hide(); // hide the original file selector +$('.dropzone-wrap').css('user-select', 'none').show(); // let jquery add browser specific prefix function addFile(file) { if (files.length == max_images) @@ -140,8 +137,6 @@ var dropHandlers = { } }; -$('#upload input[type=file]').hide(); // hide the original file selector -$('.dropzone-wrap').css('user-select', 'none').show(); // let jquery add browser specific prefix // attach handlers $(document).on(dropHandlers, '.dropzone'); @@ -184,5 +179,4 @@ $(document).on('paste', function (e) { } }); -}); } diff --git a/templates/post_form.html b/templates/post_form.html index 9596ee6b..809230f0 100644 --- a/templates/post_form.html +++ b/templates/post_form.html @@ -106,6 +106,8 @@
+ + {% if config.allow_upload_by_url %}
: -- cgit v1.3 From 6e84a25f9a882bc4c2cbd1e376416ac34ca9943b Mon Sep 17 00:00:00 2001 From: marktaiwan Date: Fri, 20 Mar 2015 08:53:57 +0800 Subject: Adds keyboard focus to file selector --- js/file-selector.js | 10 +++++++++- templates/post_form.html | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'templates') diff --git a/js/file-selector.js b/js/file-selector.js index e5451f1a..dbe8ea82 100644 --- a/js/file-selector.js +++ b/js/file-selector.js @@ -135,13 +135,21 @@ var dropHandlers = { $(document).on(dropHandlers, '.dropzone'); $(document).on('click', '.dropzone .remove-btn', function (e) { + e.stopPropagation(); + var file = $(e.target).parent().data('file-ref'); getThumbElement(file).remove(); removeFile(file); }); -$(document).on('click', '.dropzone .file-hint', function (e) { +$(document).on('keypress click', '.dropzone, .dropzone .file-hint', function (e) { + e.stopPropagation(); + + // accept mosue click or Enter + if (e.which != 1 || e.which != 13) + return; + var $fileSelector = $(''); $fileSelector.on('change', function (e) { diff --git a/templates/post_form.html b/templates/post_form.html index 809230f0..7cdcc7d3 100644 --- a/templates/post_form.html +++ b/templates/post_form.html @@ -100,7 +100,7 @@ - + {% if config.allow_upload_by_url %}
-- cgit v1.3 From 765dea599bd010bc00a3a40df58953b239ec0e9d Mon Sep 17 00:00:00 2001 From: czaks Date: Tue, 31 Mar 2015 06:50:05 +0200 Subject: trivial fixes to file-selector.js --- js/file-selector.js | 11 ++++++++++- js/upload-selection.js | 2 ++ templates/post_form.html | 7 ------- 3 files changed, 12 insertions(+), 8 deletions(-) (limited to 'templates') diff --git a/js/file-selector.js b/js/file-selector.js index fc9c83e2..6aad9382 100644 --- a/js/file-selector.js +++ b/js/file-selector.js @@ -34,8 +34,16 @@ if (typeof max_images == 'undefined') { var max_images = 1; } +$(''+ +'
').prependTo('#upload td'); + var files = []; -$('#upload_file').hide(); // hide the original file selector +$('#upload_file').remove(); // remove the original file selector $('.dropzone-wrap').css('user-select', 'none').show(); // let jquery add browser specific prefix function addFile(file) { @@ -83,6 +91,7 @@ $(document).on('ajax_before_post', function (e, formData) { for (var i=0; i 0) key += i + 1; + if (typeof files[i] === 'undefined') break; formData.append(key, files[i]); } }); diff --git a/js/upload-selection.js b/js/upload-selection.js index e2032748..b342a134 100644 --- a/js/upload-selection.js +++ b/js/upload-selection.js @@ -25,6 +25,7 @@ $(function(){ $("#upload_url").hide(); $("#upload_embed").hide(); $(".add_image").hide(); + $(".dropzone-wrap").hide(); $('[id^=upload_file]').each(function(i, v) { $(v).val(''); @@ -40,6 +41,7 @@ $(function(){ enable_file = function() { disable_all(); $("#upload").show(); + $(".dropzone-wrap").show(); $(".file_separator").show(); $("[id^=upload_file]").show(); $(".add_image").show(); diff --git a/templates/post_form.html b/templates/post_form.html index 00390daf..d6a77452 100644 --- a/templates/post_form.html +++ b/templates/post_form.html @@ -99,13 +99,6 @@ - - {% if config.allow_upload_by_url %} -- cgit v1.3 From 745bdc2b6cf5af863a7ae86f5b95b14746f5f2e4 Mon Sep 17 00:00:00 2001 From: czaks Date: Tue, 31 Mar 2015 07:01:51 +0200 Subject: password is text nao, fuck you chrome --- templates/post_form.html | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'templates') diff --git a/templates/post_form.html b/templates/post_form.html index d6a77452..d2e644b3 100644 --- a/templates/post_form.html +++ b/templates/post_form.html @@ -146,14 +146,9 @@ {% trans %}Password{% endtrans %} {{ antibot.html() }} - - - - - - + {% trans %}(For file deletion.){% endtrans %} {{ antibot.html() }} -- cgit v1.3 From 960053af750a9e8ce196a3855c9fbee69f9ec0ba Mon Sep 17 00:00:00 2001 From: czaks Date: Tue, 31 Mar 2015 07:48:03 +0200 Subject: catalog: fix for embed youtube on https --- templates/themes/catalog/catalog.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'templates') diff --git a/templates/themes/catalog/catalog.html b/templates/themes/catalog/catalog.html index aef6c139..acf538f0 100644 --- a/templates/themes/catalog/catalog.html +++ b/templates/themes/catalog/catalog.html @@ -48,7 +48,7 @@
{% if post.youtube %} - Date: Wed, 1 Apr 2015 19:37:06 +0200 Subject: main.js vs new file uploader --- templates/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'templates') diff --git a/templates/main.js b/templates/main.js index e948fd82..59a632d7 100644 --- a/templates/main.js +++ b/templates/main.js @@ -254,7 +254,7 @@ function dopost(form) { saved[document.location] = form.elements['body'].value; sessionStorage.body = JSON.stringify(saved); - return form.elements['body'].value != "" || form.elements['file'].value != "" || (form.elements.file_url && form.elements['file_url'].value != ""); + return form.elements['body'].value != "" || (form.elements['file'] && form.elements['file'].value != "") || (form.elements.file_url && form.elements['file_url'].value != ""); } function citeReply(id, with_link) { -- cgit v1.3 From 61d2729a40e8249fef8b3c0c584a9b5f7ae0777c Mon Sep 17 00:00:00 2001 From: czaks Date: Thu, 2 Apr 2015 20:54:28 +0200 Subject: themes can use smart_build now --- templates/themes/catalog/theme.php | 23 +++++++++++++++++++---- templates/themes/recent/theme.php | 10 ++++++++-- templates/themes/ukko/theme.php | 10 +++++++++- 3 files changed, 36 insertions(+), 7 deletions(-) (limited to 'templates') diff --git a/templates/themes/catalog/theme.php b/templates/themes/catalog/theme.php index f8f1146e..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(); diff --git a/templates/themes/recent/theme.php b/templates/themes/recent/theme.php index ce64c80e..f44e2529 100644 --- a/templates/themes/recent/theme.php +++ b/templates/themes/recent/theme.php @@ -24,8 +24,14 @@ $this->excluded = explode(' ', $settings['exclude']); - if ($action == 'all' || $action == 'post' || $action == 'post-thread' || $action == 'post-delete') - file_write($config['dir']['home'] . $settings['html'], $this->homepage($settings)); + if ($action == 'all' || $action == 'post' || $action == 'post-thread' || $action == 'post-delete') { + if ($config['smart_build']) { + file_unlink($config['dir']['home'] . $settings['html']); + } + else { + file_write($config['dir']['home'] . $settings['html'], $this->homepage($settings)); + } + } } // Build news page diff --git a/templates/themes/ukko/theme.php b/templates/themes/ukko/theme.php index 058fc77b..e1fa0a3f 100644 --- a/templates/themes/ukko/theme.php +++ b/templates/themes/ukko/theme.php @@ -2,6 +2,8 @@ require 'info.php'; function ukko_build($action, $settings) { + global $config; + $ukko = new ukko(); $ukko->settings = $settings; @@ -9,7 +11,13 @@ return; } - file_write($settings['uri'] . '/index.html', $ukko->build()); + if ($config['smart_build']) { + file_unlink($settings['uri'] . '/index.html'); + } + else { + file_write($settings['uri'] . '/index.html', $ukko->build()); + } + file_write($settings['uri'] . '/ukko.js', Element('themes/ukko/ukko.js', array())); } -- cgit v1.3 From e2731113404bda42ee506e29b6927165b7576f61 Mon Sep 17 00:00:00 2001 From: czaks Date: Fri, 3 Apr 2015 05:57:39 +0200 Subject: sitemap theme for smart_build --- smart_build.php | 9 ++++++++ templates/themes/sitemap/theme.php | 47 ++++++++++++++++++++++---------------- 2 files changed, 36 insertions(+), 20 deletions(-) (limited to 'templates') diff --git a/smart_build.php b/smart_build.php index fb467233..43734e4f 100644 --- a/smart_build.php +++ b/smart_build.php @@ -105,6 +105,11 @@ function sb_recent() { return true; } +function sb_sitemap() { + rebuildTheme("sitemap", "all"); + return true; +} + $entrypoints = array(); $entrypoints['/%b/'] = 'sb_board'; @@ -130,6 +135,7 @@ $entrypoints['/*/'] = 'sb_ukko'; $entrypoints['/*/index.html'] = 'sb_ukko'; $entrypoints['/recent.html'] = 'sb_recent'; $entrypoints['/%b/catalog.html'] = 'sb_catalog'; +$entrypoints['/sitemap.xml'] = 'sb_sitemap'; $reached = false; @@ -185,6 +191,9 @@ if ($reached) { elseif (preg_match('/\.js$/', $request)) { header("Content-Type", "text/javascript; charset=utf-8"); } + elseif (preg_match('/\.xml$/', $request)) { + header("Content-Type", "application/xml"); + } else { header("Content-Type", "text/html; charset=utf-8"); } diff --git a/templates/themes/sitemap/theme.php b/templates/themes/sitemap/theme.php index 41a7f304..52779d53 100644 --- a/templates/themes/sitemap/theme.php +++ b/templates/themes/sitemap/theme.php @@ -10,30 +10,37 @@ // - boards (board list changed) // - post (a post has been made) // - thread (a thread has been made) + + if ($action != 'all') { + if ($action != 'post-thread' && $action != 'post-delete') + return; - if ($action != 'post-thread' && $action != 'post-delete') - return; - - if (isset($settings['regen_time']) && $settings['regen_time'] > 0) { - if ($last_gen = @filemtime($settings['path'])) { - if (time() - $last_gen < (int)$settings['regen_time']) - return; // Too soon + if (isset($settings['regen_time']) && $settings['regen_time'] > 0) { + if ($last_gen = @filemtime($settings['path'])) { + if (time() - $last_gen < (int)$settings['regen_time']) + return; // Too soon + } } } + + if ($config['smart_build']) { + file_unlink($settings['path']); + } + else { + $boards = explode(' ', $settings['boards']); - $boards = explode(' ', $settings['boards']); - - $threads = array(); + $threads = array(); - foreach ($boards as $board) { - $query = query(sprintf("SELECT `id`, `id` AS `thread_id`, `slug`, (SELECT `time` FROM ``posts_%s`` WHERE `thread` = `thread_id` OR `id` = `thread_id` ORDER BY `time` DESC LIMIT 1) AS `lastmod` FROM ``posts_%s`` WHERE `thread` IS NULL", $board, $board)) or error(db_error()); - $threads[$board] = $query->fetchAll(PDO::FETCH_ASSOC); - } + foreach ($boards as $board) { + $query = query(sprintf("SELECT `id`, `id` AS `thread_id`, `slug`, (SELECT `time` FROM ``posts_%s`` WHERE `thread` = `thread_id` OR `id` = `thread_id` ORDER BY `time` DESC LIMIT 1) AS `lastmod` FROM ``posts_%s`` WHERE `thread` IS NULL", $board, $board)) or error(db_error()); + $threads[$board] = $query->fetchAll(PDO::FETCH_ASSOC); + } - file_write($settings['path'], Element('themes/sitemap/sitemap.xml', Array( - 'settings' => $settings, - 'config' => $config, - 'threads' => $threads, - 'boards' => $boards, - ))); + file_write($settings['path'], Element('themes/sitemap/sitemap.xml', Array( + 'settings' => $settings, + 'config' => $config, + 'threads' => $threads, + 'boards' => $boards, + ))); + } } -- cgit v1.3 From 1f9e36868e82fe563028f8c35aaee3c9ba21fa23 Mon Sep 17 00:00:00 2001 From: czaks Date: Sun, 5 Apr 2015 16:20:59 +0200 Subject: ukko: small optimization: move js creation to install time --- templates/themes/ukko/info.php | 1 + templates/themes/ukko/theme.php | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'templates') diff --git a/templates/themes/ukko/info.php b/templates/themes/ukko/info.php index 45a687fc..9a0a53e6 100644 --- a/templates/themes/ukko/info.php +++ b/templates/themes/ukko/info.php @@ -49,6 +49,7 @@ function ukko_install($settings) { if (!file_exists($settings['uri'])) @mkdir($settings['uri'], 0777) or error("Couldn't create " . $settings['uri'] . ". Check permissions.", true); + file_write($settings['uri'] . '/ukko.js', Element('themes/ukko/ukko.js', array())); } } diff --git a/templates/themes/ukko/theme.php b/templates/themes/ukko/theme.php index e1fa0a3f..d6fc303c 100644 --- a/templates/themes/ukko/theme.php +++ b/templates/themes/ukko/theme.php @@ -17,8 +17,6 @@ else { file_write($settings['uri'] . '/index.html', $ukko->build()); } - - file_write($settings['uri'] . '/ukko.js', Element('themes/ukko/ukko.js', array())); } class ukko { -- cgit v1.3 From 4060bf10eda3b17513907332890575566cf6e890 Mon Sep 17 00:00:00 2001 From: czaks Date: Sun, 12 Apr 2015 03:17:12 +0200 Subject: update copyright years & vichan website --- README.md | 4 ++-- templates/generic_page.html | 2 +- templates/index.html | 2 +- templates/page.html | 2 +- templates/themes/basic/index.html | 2 +- templates/themes/catalog/catalog.html | 2 +- templates/themes/categories/news.html | 2 +- templates/themes/frameset/news.html | 2 +- templates/themes/recent/recent.html | 2 +- templates/thread.html | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) (limited to 'templates') diff --git a/README.md b/README.md index e47dd597..c3383b32 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ vichan is a fork of (now defunc'd) [Tinyboard](http://github.com/savetheinternet a great imageboard package, actively building on it and adding a lot of features and other improvements. -Support and announcements: https://int.vichan.net/devel/ +Support and announcements: https://engine.vichan.net/ Requirements ------------ @@ -90,7 +90,7 @@ links may be helpful for you as well: Donations --------- Do you like our work? You can motivate us financially to do better ;) -* Bitcoin: [![tip for next commit](http://tip4commit.com/projects/708.svg)](http://tip4commit.com/projects/708) +* Bitcoin: 1GjZEdLaTQ8JWVFGZW921Yv4x59f9oiZME You can also ask us to develop some feature specially for you <3. Join our IRC channel and ask for a quote (there are a few of us, who work with the codebase diff --git a/templates/generic_page.html b/templates/generic_page.html index 0fe1f9c5..965cbc2c 100644 --- a/templates/generic_page.html +++ b/templates/generic_page.html @@ -39,7 +39,7 @@

- Tinyboard + vichan {{ config.version }} -
Tinyboard Copyright © 2010-2014 Tinyboard Development Group -
vichan Copyright © 2012-2014 vichan-devel

+
vichan Copyright © 2012-2015 vichan-devel

{% for footer in config.footer %}

{{ footer }}

{% endfor %}