1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-29 01:34:31 +01:00

Catalog 8chan fixes

This commit is contained in:
8chan Admin 2014-04-05 21:04:46 +00:00
parent 84e165344f
commit a4f75ffd7d
4 changed files with 26 additions and 10 deletions

View File

@ -53,4 +53,7 @@ if (subtitle) {
}
}
}
$(document).ready(catalog);
if (!parseInt($('input[name="mod"]').val())) {
$(document).ready(catalog);
}

View File

@ -2,11 +2,8 @@
<!doctype html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>{{ settings.title }}</title>
<link rel="stylesheet" media="screen" href="{{ config.url_stylesheet }}"/>
{% include "header.html" %}
<link rel="stylesheet" media="screen" href="{{ config.root }}{{ settings.css }}"/>
{% if config.url_favicon %}<link rel="shortcut icon" href="{{ config.url_favicon }}" />{% endif %}
</head>
<body>
{{ boardlist.top }}
@ -18,9 +15,11 @@
<ul>
{% for post in recent_posts %}
<div class="thread">
<a href="{{post.link}}">
<img src="{{post.file}}" class="{{post.board}}" title="{{post.bump|date('%b %d %H:%M')}}">
</a>
<div class="image">
<a href="{{post.link}}">
<img src="{{post.file}}" class="{{post.board}}" title="{{post.bump|date('%b %d %H:%M')}}">
</a>
</div>
<span class="replies">
<strong>{% trans %}1 reply{% plural post.reply_count %}{{ count }} replies{% endtrans %}</strong><br/>
{{ post.body }}

View File

@ -29,6 +29,13 @@
'comment' => '(space seperated)',
'default' => implode(' ', $__default_boards)
);
$theme['config'][] = Array(
'title' => 'Use all boards - &infin;chan',
'name' => 'all',
'type' => 'checkbox',
'default' => false
);
$theme['config'][] = Array(
'title' => 'CSS file',

View File

@ -11,7 +11,14 @@
// - post (a reply has been made)
// - post-thread (a thread has been made)
$boards = explode(' ', $settings['boards']);
if ($settings['all']) {
$_boards = listBoards();
$boards = array();
foreach ($_boards as $i => $b)
$boards[] = $b['uri'];
} else {
$boards = explode(' ', $settings['boards']);
}
if ($action == 'all') {
copy('templates/themes/catalog/catalog.css', $config['dir']['home'] . $settings['css']);
@ -20,7 +27,7 @@
$b = new Catalog();
$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)) {
} elseif ($action == 'post-thread' || ($settings['update_on_posts'] && $action == 'post') || ($settings['update_on_posts'] && $action == 'post-delete') && (in_array($board, $boards) | $settings['all'])) {
$b = new Catalog();
$b->build($settings, $board);
}