From bdb6001f3f7e93e0b9655c0491bbef6f1df8a5fa Mon Sep 17 00:00:00 2001
From: czaks
Date: Tue, 10 Mar 2015 12:48:59 +0100
Subject: support for slugified links; may introduce a few bugs
---
templates/themes/recent/theme.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'templates/themes/recent')
diff --git a/templates/themes/recent/theme.php b/templates/themes/recent/theme.php
index b1153477..2ea6a7b9 100644
--- a/templates/themes/recent/theme.php
+++ b/templates/themes/recent/theme.php
@@ -62,7 +62,7 @@
// board settings won't be available in the template file, so generate links now
$post['link'] = $config['root'] . $board['dir'] . $config['dir']['res']
- . sprintf($config['file_page'], ($post['thread'] ? $post['thread'] : $post['id'])) . '#' . $post['id'];
+ . link_for($post) . '#' . $post['id'];
if ($files) {
if ($files[0]->thumb == 'spoiler') {
@@ -92,7 +92,7 @@
while ($post = $query->fetch(PDO::FETCH_ASSOC)) {
openBoard($post['board']);
- $post['link'] = $config['root'] . $board['dir'] . $config['dir']['res'] . sprintf($config['file_page'], ($post['thread'] ? $post['thread'] : $post['id'])) . '#' . $post['id'];
+ $post['link'] = $config['root'] . $board['dir'] . $config['dir']['res'] . link_for($post) . '#' . $post['id'];
if ($post['body'] != "")
$post['snippet'] = pm_snippet($post['body'], 30);
else
--
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/themes/recent')
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/themes/recent')
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 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/themes/recent')
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 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/themes/recent')
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: [](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 %}