From 9c29cec6598331589a9020e5be627260e659e977 Mon Sep 17 00:00:00 2001 From: czaks Date: Sun, 26 May 2013 18:03:20 -0400 Subject: Moved ukko to a proper location --- templates/themes/ukko/info.php | 53 +++++++++++++++++++ templates/themes/ukko/theme.php | 111 ++++++++++++++++++++++++++++++++++++++++ templates/themes/ukko/thumb.png | Bin 0 -> 15123 bytes templates/themes/ukko/ukko.js | 37 ++++++++++++++ 4 files changed, 201 insertions(+) create mode 100644 templates/themes/ukko/info.php create mode 100644 templates/themes/ukko/theme.php create mode 100644 templates/themes/ukko/thumb.png create mode 100644 templates/themes/ukko/ukko.js (limited to 'templates/themes') diff --git a/templates/themes/ukko/info.php b/templates/themes/ukko/info.php new file mode 100644 index 00000000..34d59d4e --- /dev/null +++ b/templates/themes/ukko/info.php @@ -0,0 +1,53 @@ + 'Board name', + 'name' => 'title', + 'type' => 'text', + 'default' => 'Ukko' + ); + $theme['config'][] = Array( + 'title' => 'Board URI', + 'name' => 'uri', + 'type' => 'text', + 'comment' => '(ukko for example)' + ); + $theme['config'][] = Array( + 'title' => 'Subtitle', + 'name' => 'subtitle', + 'type' => 'text', + 'comment' => '(%s = thread limit. for example "%s freshly bumped threads")' + ); + $theme['config'][] = Array( + 'title' => 'Excluded boards', + 'name' => 'exclude', + 'type' => 'text', + 'comment' => '(space seperated)' + ); + $theme['config'][] = Array( + 'title' => 'Number of threads', + 'name' => 'thread_limit', + 'type' => 'text', + 'default' => '15', + ); + // Unique function name for building everything + $theme['build_function'] = 'ukko_build'; + $theme['install_callback'] = 'ukko_install'; + + if(!function_exists('ukko_install')) { + function ukko_install($settings) { + if (!file_exists($settings['uri'])) + @mkdir($settings['uri'], 0777) or error("Couldn't create " . $settings['uri'] . ". Check permissions.", true); + } + } + diff --git a/templates/themes/ukko/theme.php b/templates/themes/ukko/theme.php new file mode 100644 index 00000000..6fa5fa7e --- /dev/null +++ b/templates/themes/ukko/theme.php @@ -0,0 +1,111 @@ +settings = $settings; + $ukko->build(); + } + + class ukko { + public $settings; + public function build($mod = false) { + global $config; + $boards = listBoards(); + + $body = ''; + $overflow = array(); + $board = array( + 'url' => $this->settings['uri'], + 'name' => $this->settings['title'], + 'title' => sprintf($this->settings['subtitle'], $this->settings['thread_limit']) + ); + + $query = ''; + foreach($boards as &$_board) { + if(in_array($_board['uri'], explode(' ', $this->settings['exclude']))) + continue; + $query .= sprintf("SELECT *, '%s' AS `board` FROM `posts_%s` WHERE `thread` IS NULL UNION ALL ", $_board['uri'], $_board['uri']); + } + $query = preg_replace('/UNION ALL $/', 'ORDER BY `bump` DESC', $query); + $query = query($query) or error(db_error()); + + $count = 0; + $threads = array(); + while($post = $query->fetch()) { + + if(!isset($threads[$post['board']])) { + $threads[$post['board']] = 1; + } else { + $threads[$post['board']] += 1; + } + + if($count < $this->settings['thread_limit']) { + openBoard($post['board']); + $thread = new Thread( + $post['id'], $post['subject'], $post['email'], $post['name'], $post['trip'], $post['capcode'], $post['body'], $post['time'], + $post['thumb'], $post['thumbwidth'], $post['thumbheight'], $post['file'], $post['filewidth'], $post['fileheight'], $post['filesize'], + $post['filename'], $post['ip'], $post['sticky'], $post['locked'], $post['sage'], $post['embed'], $mod ? '?/' : $config['root'], $mod + ); + + $posts = prepare(sprintf("SELECT * FROM `posts_%s` WHERE `thread` = :id ORDER BY `id` DESC LIMIT :limit", $post['board'])); + $posts->bindValue(':id', $post['id']); + $posts->bindValue(':limit', ($post['sticky'] ? $config['threads_preview_sticky'] : $config['threads_preview']), PDO::PARAM_INT); + $posts->execute() or error(db_error($posts)); + + $num_images = 0; + while ($po = $posts->fetch()) { + if ($po['file']) + $num_images++; + + $thread->add(new Post( + $po['id'], $post['id'], $po['subject'], $po['email'], $po['name'], $po['trip'], $po['capcode'], $po['body'], $po['time'], + $po['thumb'], $po['thumbwidth'], $po['thumbheight'], $po['file'], $po['filewidth'], $po['fileheight'], $po['filesize'], + $po['filename'], $po['ip'], $po['embed'], $mod ? '?/' : $config['root'], $mod) + ); + + } + if ($posts->rowCount() == ($post['sticky'] ? $config['threads_preview_sticky'] : $config['threads_preview'])) { + $ct = prepare(sprintf("SELECT COUNT(`id`) as `num` FROM `posts_%s` WHERE `thread` = :thread UNION ALL SELECT COUNT(`id`) FROM `posts_%s` WHERE `file` IS NOT NULL AND `thread` = :thread", $post['board'], $post['board'])); + $ct->bindValue(':thread', $post['id'], PDO::PARAM_INT); + $ct->execute() or error(db_error($count)); + + $c = $ct->fetch(); + $thread->omitted = $c['num'] - ($post['sticky'] ? $config['threads_preview_sticky'] : $config['threads_preview']); + + $c = $ct->fetch(); + $thread->omitted_images = $c['num'] - $num_images; + } + + + $thread->posts = array_reverse($thread->posts); + $body .= '

/' . $post['board'] . '/

'; + $body .= $thread->build(true); + } else { + $page = 'index'; + if(floor($threads[$post['board']] / $config['threads_per_page']) > 0) { + $page = floor($threads[$post['board']] / $config['threads_per_page']) + 1; + } + $overflow[] = array('id' => $post['id'], 'board' => $post['board'], 'page' => $page . '.html'); + } + + $count += 1; + } + + $body .= ''; + $body .= ''; + + file_write($this->settings['uri'] . '/index.html', Element('index.html', array( + 'config' => $config, + 'board' => $board, + 'no_post_form' => true, + 'body' => $body, + 'boardlist' => createBoardlist($mod) + ))); + + file_write($this->settings['uri'] . '/ukko.js', Element('themes/ukko/ukko.js', array())); + } + + }; + +?> diff --git a/templates/themes/ukko/thumb.png b/templates/themes/ukko/thumb.png new file mode 100644 index 00000000..49c4237b Binary files /dev/null and b/templates/themes/ukko/thumb.png differ diff --git a/templates/themes/ukko/ukko.js b/templates/themes/ukko/ukko.js new file mode 100644 index 00000000..baf0f78d --- /dev/null +++ b/templates/themes/ukko/ukko.js @@ -0,0 +1,37 @@ +var cache = new Array(), + thread = false, + loading = false; +$(document).ready(function() { + $(window).on('scroll', function() { + if($(window).scrollTop() + $(window).height() + 100 > $(document).height() && !loading && overflow.length > 0) { + var page = '../' + overflow[0].board + '/' + overflow[0].page; + if($.inArray(page, cache) != -1) { + thread = $('div#thread_' + overflow[0].id); + if(thread.length > 0) { + thread.prepend('

/' + overflow[0].board + '/

'); + $('div[id*="thread_"]').last().after(thread.attr('data-board', overflow[0].board).css('display', 'block')); + overflow.shift(); + } + } else { + loading = true; + $.get(page, function(data) { + cache.push(page); + + $(data).find('div[id*="thread_"]').each(function() { + $('body').prepend($(this).css('display', 'none').attr('data-board', overflow[0].board)); + }); + + thread = $('div#thread_' + overflow[0].id + '[data-board="' + overflow[0].board + '"]'); + if(thread.length > 0) { + thread.prepend('

/' + overflow[0].board + '/

'); + $('div[id*="thread_"]').last().after(thread.attr('data-board', overflow[0].board).css('display', 'block')); + overflow.shift(); + } + + loading = false; + }); + } + } + }); + +}); \ No newline at end of file -- cgit v1.3 From 7e95e80c25e2f35b8a49ebd73f95671b0233be6f Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Wed, 17 Jul 2013 10:17:28 -0400 Subject: New theme: XML sitemap generator --- templates/themes/sitemap/info.php | 53 ++++++++++++++++++++++++++++++++++++ templates/themes/sitemap/sitemap.xml | 19 +++++++++++++ templates/themes/sitemap/theme.php | 28 +++++++++++++++++++ 3 files changed, 100 insertions(+) create mode 100644 templates/themes/sitemap/info.php create mode 100644 templates/themes/sitemap/sitemap.xml create mode 100644 templates/themes/sitemap/theme.php (limited to 'templates/themes') diff --git a/templates/themes/sitemap/info.php b/templates/themes/sitemap/info.php new file mode 100644 index 00000000..e16448ee --- /dev/null +++ b/templates/themes/sitemap/info.php @@ -0,0 +1,53 @@ + 'Sitemap Path', + 'name' => 'path', + 'type' => 'text', + 'default' => 'sitemap.xml', + 'size' => '20' + ); + + $theme['config'][] = Array( + 'title' => 'URL prefix', + 'name' => 'url', + 'type' => 'text', + 'comment' => '(with trailing slash)', + 'default' => 'http://' . $_SERVER['HTTP_HOST'] . $config['root'], + 'size' => '20' + ); + + $theme['config'][] = Array( + 'title' => 'Thread change frequency', + 'name' => 'changefreq', + 'type' => 'text', + 'comment' => '(eg. "hourly", "daily", etc.)', + 'default' => 'hourly', + 'size' => '20' + ); + + $__boards = listBoards(); + $__default_boards = Array(); + foreach ($__boards as $__board) + $__default_boards[] = $__board['uri']; + + $theme['config'][] = Array( + 'title' => 'Boards', + 'name' => 'boards', + 'type' => 'text', + 'comment' => '(boards to include; space seperated)', + 'size' => 24, + 'default' => implode(' ', $__default_boards) + ); + + $theme['build_function'] = 'sitemap_build'; diff --git a/templates/themes/sitemap/sitemap.xml b/templates/themes/sitemap/sitemap.xml new file mode 100644 index 00000000..733da607 --- /dev/null +++ b/templates/themes/sitemap/sitemap.xml @@ -0,0 +1,19 @@ +{% filter remove_whitespace %} + + + {% for board in boards %} + + {{ settings.url ~ (config.board_path | format(board)) ~ config.file_index }} + + {% endfor %} + {% for board, thread_list in threads %} + {% for thread in thread_list %} + + {{ settings.url ~ (config.board_path | format(board)) ~ config.dir.res ~ (config.file_page | format(thread.thread_id)) }} + {{ thread.lastmod | date('%Y-%m-%dT%H:%M:%S') }}{{ timezone() }} + {{ settings.changefreq }} + + {% endfor %} + {% endfor %} + +{% endfilter %} \ No newline at end of file diff --git a/templates/themes/sitemap/theme.php b/templates/themes/sitemap/theme.php new file mode 100644 index 00000000..372d292d --- /dev/null +++ b/templates/themes/sitemap/theme.php @@ -0,0 +1,28 @@ +fetchAll(PDO::FETCH_ASSOC); + } + + file_write($settings['path'], Element('themes/sitemap/sitemap.xml', Array( + 'settings' => $settings, + 'config' => $config, + 'threads' => $threads, + 'boards' => $boards, + ))); + } -- cgit v1.3 From f5d378fab5eca1147923bbc268cc7ea1e864041c Mon Sep 17 00:00:00 2001 From: copypaste Date: Thu, 18 Jul 2013 11:30:00 -0400 Subject: Catalog theme --- templates/themes/catalog/catalog.css | 38 +++++++++++++++++++++ templates/themes/catalog/info.php | 42 +++++++++++++++++++++++ templates/themes/catalog/theme.php | 64 ++++++++++++++++++++++++++++++++++++ 3 files changed, 144 insertions(+) create mode 100644 templates/themes/catalog/catalog.css create mode 100644 templates/themes/catalog/info.php create mode 100644 templates/themes/catalog/theme.php (limited to 'templates/themes') diff --git a/templates/themes/catalog/catalog.css b/templates/themes/catalog/catalog.css new file mode 100644 index 00000000..048dd656 --- /dev/null +++ b/templates/themes/catalog/catalog.css @@ -0,0 +1,38 @@ +img { + float:none!important; + margin: auto; + margin-bottom: 12px; + max-height: 150px; + max-width: 200px; + box-shadow: 0 0 4px rgba(0, 0, 0, 0.55); + border: 2px solid rgba(153, 153, 153, 0); +} + +/* +img:hover { + border: 2px solid rgba(153, 153, 153, 0.27); +} +*/ + +div.thread { + display: inline-block; + vertical-align: top; + margin-bottom:25px; + margin-left: 20px; + margin-right: 15px; + text-align:center; + font-weight:normal; + width:205px; + overflow:hidden; + position: relative; + font-size:11px; + padding: 15px; + background: rgba(182, 182, 182, 0.12); + border: 2px solid rgba(111, 111, 111, 0.34); + max-height:300px; +} + +div.thread:hover { + background: #D6DAF0; + border-color: #B7C5D9; +} \ No newline at end of file diff --git a/templates/themes/catalog/info.php b/templates/themes/catalog/info.php new file mode 100644 index 00000000..1b9831ae --- /dev/null +++ b/templates/themes/catalog/info.php @@ -0,0 +1,42 @@ + 'Title', + 'name' => 'title', + 'type' => 'text', + 'default' => 'Catalog' + ); + + $__boards = listBoards(); + $__default_boards = Array(); + foreach ($__boards as $__board) + $__default_boards[] = $__board['uri']; + + $theme['config'][] = Array( + 'title' => 'Included boards', + 'name' => 'boards', + 'type' => 'text', + 'comment' => '(space seperated)', + 'default' => implode(' ', $__default_boards) + ); + + $theme['config'][] = Array( + 'title' => 'CSS file', + 'name' => 'css', + 'type' => 'text', + 'default' => 'catalog.css', + 'comment' => '(eg. "catalog.css")' + ); + + // Unique function name for building everything + $theme['build_function'] = 'catalog_build'; diff --git a/templates/themes/catalog/theme.php b/templates/themes/catalog/theme.php new file mode 100644 index 00000000..356933ba --- /dev/null +++ b/templates/themes/catalog/theme.php @@ -0,0 +1,64 @@ +build($action, $settings); + } + + // Wrap functions in a class so they don't interfere with normal Tinyboard operations + class Catalog { + public function build($action, $settings) { + global $config, $_theme; + + if ($action == 'all') { + copy('templates/themes/catalog/catalog.css', $config['dir']['home'] . $settings['css']); + } + + $boards = explode(' ', $settings['boards']); + foreach ($boards as $board) { + if ($action == 'all' || $action == 'post') + file_write($config['dir']['home'] . $board . '/catalog.html', $this->homepage($settings, $board)); + } + + } + + public function homepage($settings, $board_name) { + global $config, $board; + + $recent_images = array(); + $recent_posts = array(); + $stats = array(); + + $query = query(sprintf("SELECT *, `id` AS `thread_id`, (SELECT COUNT(*) FROM `posts_%s` WHERE `thread` = `thread_id`) AS `reply_count`, '%s' AS `board` FROM `posts_%s` WHERE `thread` IS NULL ORDER BY `bump` DESC", $board_name, $board_name, $board_name)) or error(db_error()); + + while ($post = $query->fetch()) { + openBoard($post['board']); + + $post['link'] = $config['root'] . $board['dir'] . $config['dir']['res'] . sprintf($config['file_page'], ($post['thread'] ? $post['thread'] : $post['id'])); + $post['board_name'] = $board['name']; + $post['file'] = $config['uri_thumb'] . $post['thumb']; + $recent_posts[] = $post; + } + + + return Element('themes/catalog/catalog.html', Array( + 'settings' => $settings, + 'config' => $config, + 'boardlist' => createBoardlist(), + 'recent_images' => $recent_images, + 'recent_posts' => $recent_posts, + 'stats' => $stats, + 'board' => $board_name, + 'link' => $config['root'] . $board['dir'] + )); + } + }; + +?> -- cgit v1.3 From 461d98b9457f90a6ff87534081f760572301e6f9 Mon Sep 17 00:00:00 2001 From: copypaste Date: Thu, 18 Jul 2013 11:34:04 -0400 Subject: Catalog theme --- templates/themes/catalog/catalog.html | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 templates/themes/catalog/catalog.html (limited to 'templates/themes') diff --git a/templates/themes/catalog/catalog.html b/templates/themes/catalog/catalog.html new file mode 100644 index 00000000..501117a8 --- /dev/null +++ b/templates/themes/catalog/catalog.html @@ -0,0 +1,35 @@ +{% filter remove_whitespace %} + + + + + {{ settings.title }} + + + {% if config.url_favicon %}{% endif %} + + + {{ boardlist.top }} +
+

{{ settings.title }} (/{{ board }}/)

+
{{ settings.subtitle }}
+
+ + + +
+

Powered by Tinyboard {{ config.version }} | Tinyboard Copyright © 2010-2013 Tinyboard Development Group

+ + +{% endfilter %} -- cgit v1.3 From de4b5b396246ee5c3cb8687cfef3647c844a3b54 Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Thu, 18 Jul 2013 11:40:21 -0400 Subject: Quick catalog theme bugfix --- templates/themes/catalog/catalog.html | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'templates/themes') diff --git a/templates/themes/catalog/catalog.html b/templates/themes/catalog/catalog.html index 501117a8..7fcae04e 100644 --- a/templates/themes/catalog/catalog.html +++ b/templates/themes/catalog/catalog.html @@ -16,16 +16,17 @@
-- cgit v1.3 From e4bd9a6886af2a812ccc909d8ad957df1bdc5d2b Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Thu, 18 Jul 2013 12:06:26 -0400 Subject: Themes edit: Split "post" into two seperate actions: "post" (replies) and "post-thread". And add a $board variable. --- inc/functions.php | 8 +++--- post.php | 6 ++++- templates/themes/basic/theme.php | 2 +- templates/themes/catalog/theme.php | 50 ++++++++++++++++------------------- templates/themes/categories/theme.php | 2 +- templates/themes/frameset/theme.php | 2 +- templates/themes/recent/theme.php | 5 ++-- templates/themes/rrdtool/theme.php | 2 +- templates/themes/sitemap/theme.php | 6 ++++- 9 files changed, 44 insertions(+), 39 deletions(-) (limited to 'templates/themes') diff --git a/inc/functions.php b/inc/functions.php index 40a2c1fe..af810f31 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -239,12 +239,12 @@ function create_antibot($board, $thread = null) { return _create_antibot($board, $thread); } -function rebuildThemes($action) { +function rebuildThemes($action, $board = false) { // List themes $query = query("SELECT `theme` FROM `theme_settings` WHERE `name` IS NULL AND `value` IS NULL") or error(db_error()); while ($theme = $query->fetch()) { - rebuildTheme($theme['theme'], $action); + rebuildTheme($theme['theme'], $action, $board); } } @@ -261,7 +261,7 @@ function loadThemeConfig($_theme) { return $theme; } -function rebuildTheme($theme, $action) { +function rebuildTheme($theme, $action, $board = false) { global $config, $_theme; $_theme = $theme; @@ -270,7 +270,7 @@ function rebuildTheme($theme, $action) { if (file_exists($config['dir']['themes'] . '/' . $_theme . '/theme.php')) { require_once $config['dir']['themes'] . '/' . $_theme . '/theme.php'; - $theme['build_function']($action, themeSettings($_theme)); + $theme['build_function']($action, themeSettings($_theme), $board); } } diff --git a/post.php b/post.php index 3d718786..97fb263d 100644 --- a/post.php +++ b/post.php @@ -677,7 +677,11 @@ if (isset($_POST['delete'])) { _syslog(LOG_INFO, 'New post: /' . $board['dir'] . $config['dir']['res'] . sprintf($config['file_page'], $post['op'] ? $id : $post['thread']) . (!$post['op'] ? '#' . $id : '')); - rebuildThemes('post'); + if ($post['op']) + rebuildThemes('post-thread', $board['uri']); + else + rebuildThemes('post', $board['uri']); + header('Location: ' . $redirect, true, $config['redirect_http']); } else { if (!file_exists($config['has_installed'])) { diff --git a/templates/themes/basic/theme.php b/templates/themes/basic/theme.php index 806a331a..7ba0d1e7 100644 --- a/templates/themes/basic/theme.php +++ b/templates/themes/basic/theme.php @@ -1,7 +1,7 @@ build($action, $settings); - } - - // Wrap functions in a class so they don't interfere with normal Tinyboard operations - class Catalog { - public function build($action, $settings) { - global $config, $_theme; - - if ($action == 'all') { - copy('templates/themes/catalog/catalog.css', $config['dir']['home'] . $settings['css']); - } + $boards = explode(' ', $settings['boards']); + + if ($action == 'all') { + copy('templates/themes/catalog/catalog.css', $config['dir']['home'] . $settings['css']); - $boards = explode(' ', $settings['boards']); foreach ($boards as $board) { - if ($action == 'all' || $action == 'post') - file_write($config['dir']['home'] . $board . '/catalog.html', $this->homepage($settings, $board)); + $b = new Catalog(); + $b->build($settings, $board); } - + } elseif ($action == 'post-thread' && in_array($board, $boards)) { + $b = new Catalog(); + $b->build($settings, $board); } - - public function homepage($settings, $board_name) { + } + + // Wrap functions in a class so they don't interfere with normal Tinyboard operations + class Catalog { + public function build($settings, $board_name) { global $config, $board; + openBoard($board_name); + $recent_images = array(); $recent_posts = array(); $stats = array(); @@ -39,16 +40,13 @@ $query = query(sprintf("SELECT *, `id` AS `thread_id`, (SELECT COUNT(*) FROM `posts_%s` WHERE `thread` = `thread_id`) AS `reply_count`, '%s' AS `board` FROM `posts_%s` WHERE `thread` IS NULL ORDER BY `bump` DESC", $board_name, $board_name, $board_name)) or error(db_error()); while ($post = $query->fetch()) { - openBoard($post['board']); - $post['link'] = $config['root'] . $board['dir'] . $config['dir']['res'] . sprintf($config['file_page'], ($post['thread'] ? $post['thread'] : $post['id'])); $post['board_name'] = $board['name']; $post['file'] = $config['uri_thumb'] . $post['thumb']; $recent_posts[] = $post; } - - return Element('themes/catalog/catalog.html', Array( + file_write($config['dir']['home'] . $board_name . '/catalog.html', Element('themes/catalog/catalog.html', Array( 'settings' => $settings, 'config' => $config, 'boardlist' => createBoardlist(), @@ -57,8 +55,6 @@ 'stats' => $stats, 'board' => $board_name, 'link' => $config['root'] . $board['dir'] - )); + ))); } }; - -?> diff --git a/templates/themes/categories/theme.php b/templates/themes/categories/theme.php index 11fcbbaf..7d468d0d 100644 --- a/templates/themes/categories/theme.php +++ b/templates/themes/categories/theme.php @@ -1,7 +1,7 @@ build($action, $settings); @@ -23,7 +24,7 @@ $this->excluded = explode(' ', $settings['exclude']); - if ($action == 'all' || $action == 'post') + if ($action == 'all' || $action == 'post' || $action == 'post-thread') file_write($config['dir']['home'] . $settings['html'], $this->homepage($settings)); } diff --git a/templates/themes/rrdtool/theme.php b/templates/themes/rrdtool/theme.php index eed2ac9a..68fc1850 100644 --- a/templates/themes/rrdtool/theme.php +++ b/templates/themes/rrdtool/theme.php @@ -1,7 +1,7 @@ Date: Thu, 18 Jul 2013 15:31:22 -0400 Subject: sitemap theme: fix notice when rebuilding using tools/rebuild.php from CLI --- templates/themes/sitemap/info.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'templates/themes') diff --git a/templates/themes/sitemap/info.php b/templates/themes/sitemap/info.php index e16448ee..1198c2e3 100644 --- a/templates/themes/sitemap/info.php +++ b/templates/themes/sitemap/info.php @@ -23,7 +23,7 @@ 'name' => 'url', 'type' => 'text', 'comment' => '(with trailing slash)', - 'default' => 'http://' . $_SERVER['HTTP_HOST'] . $config['root'], + 'default' => 'http://' . (isset ($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : "localhost") . $config['root'], 'size' => '20' ); -- cgit v1.3 From a5a1f00223ea59658b09a0a503a368bf03425ee9 Mon Sep 17 00:00:00 2001 From: czaks Date: Thu, 18 Jul 2013 16:13:48 -0400 Subject: catalog: translation fix --- templates/themes/catalog/catalog.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'templates/themes') diff --git a/templates/themes/catalog/catalog.html b/templates/themes/catalog/catalog.html index 7fcae04e..986db846 100644 --- a/templates/themes/catalog/catalog.html +++ b/templates/themes/catalog/catalog.html @@ -22,7 +22,7 @@ - {{ post.reply_count }} {% if post.reply_count == 1 %}{% trans 'reply' %}{% else %}{% trans 'replies' %}{% endif %}
+ {% trans %}1 reply{% plural post.omitted %}{{ count }} replies{% endtrans %}
{{ post.body }}
-- cgit v1.3 From 5547591b87f1ca25d9f1f455fa633991c652ac30 Mon Sep 17 00:00:00 2001 From: czaks Date: Thu, 18 Jul 2013 16:16:43 -0400 Subject: catalog: fix previous commit --- templates/themes/catalog/catalog.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'templates/themes') diff --git a/templates/themes/catalog/catalog.html b/templates/themes/catalog/catalog.html index 986db846..7b8c075a 100644 --- a/templates/themes/catalog/catalog.html +++ b/templates/themes/catalog/catalog.html @@ -22,7 +22,7 @@ - {% trans %}1 reply{% plural post.omitted %}{{ count }} replies{% endtrans %}
+ {% trans %}1 reply{% plural post.reply_count %}{{ count }} replies{% endtrans %}
{{ post.body }}
-- cgit v1.3