Merge remote-tracking branch 'upstream/master' into vichan-merge

This commit is contained in:
Simon McFarlane 2015-05-26 23:31:47 -07:00
commit 4b40f69a4e
223 changed files with 65256 additions and 2969 deletions

View file

@ -61,7 +61,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 &copy; 2010-2014 Tinyboard Development Group
<br><a href="https://int.vichan.net/devel/">vichan</a> Copyright &copy; 2012-2014 vichan-devel</p>
<br><a href="https://engine.vichan.net/">vichan</a> Copyright &copy; 2012-2015 vichan-devel</p>
</footer>
</body>
</html>

View file

@ -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
@ -62,7 +68,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 +98,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
@ -124,15 +130,21 @@
$query = query($query) or error(db_error());
$stats['unique_posters'] = number_format($query->fetchColumn());
/*$query = 'SELECT SUM(`filesize`) FROM (';
// Active content
$query = 'SELECT DISTINCT(`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) {
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,