forked from leftypol/leftypol
Merge remote-tracking branch 'upstream/master' into vichan-merge
This commit is contained in:
commit
4b40f69a4e
223 changed files with 65256 additions and 2969 deletions
|
@ -50,45 +50,53 @@
|
|||
data-bump="{{ post.bump }}"
|
||||
data-time="{{ post.time }}"
|
||||
>
|
||||
<div class="thread grid-li grid-size-small">
|
||||
<a href="{{post.link}}">
|
||||
{% if post.youtube %}
|
||||
<img src="http://img.youtube.com/vi/{{ post.youtube }}/0.jpg"
|
||||
{% else %}
|
||||
<img src="{{post.file}}"
|
||||
{% endif %}
|
||||
id="img-{{ post.id }}" data-subject="{% if post.subject %}{{ post.subject|e }}{% endif %}" data-name="{{ post.name|e }}" data-muhdifference="{{ post.muhdifference }}" class="{{post.board}} thread-image" title="{{post.bump|date('%b %d %H:%M')}}">
|
||||
</a>
|
||||
<div class="replies">
|
||||
<strong>R: {{ post.reply_count }} / I: {{ post.image_count }}</strong>
|
||||
{% if post.subject %}
|
||||
<p class="intro">
|
||||
<span class="subject">
|
||||
{{ post.subject|e }}
|
||||
</span>
|
||||
</p>
|
||||
{% else %}
|
||||
<br />
|
||||
{% endif %}
|
||||
|
||||
{{ post.body }}
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="thread grid-li grid-size-small">
|
||||
<a href="{{post.link}}">
|
||||
{% if post.youtube %}
|
||||
<img src="//img.youtube.com/vi/{{ post.youtube }}/0.jpg"
|
||||
{% else %}
|
||||
<img src="{{post.file}}"
|
||||
{% endif %}
|
||||
id="img-{{ post.id }}" data-subject="{% if post.subject %}{{ post.subject|e }}{% endif %}" data-name="{{ post.name|e }}" data-muhdifference="{{ post.muhdifference }}" class="{{post.board}} thread-image" title="{{post.bump|date('%b %d %H:%M')}}">
|
||||
</a>
|
||||
<div class="replies">
|
||||
<strong>R: {{ post.reply_count }} / I: {{ post.image_count }}</strong>
|
||||
{% if post.subject %}
|
||||
<p class="intro">
|
||||
<span class="subject">
|
||||
{{ post.subject|e }}
|
||||
</span>
|
||||
</p>
|
||||
{% else %}
|
||||
<br />
|
||||
{% endif %}
|
||||
|
||||
{{ post.body }}
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<hr/>
|
||||
<footer>
|
||||
<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 © 2010-2014 Tinyboard Development Group
|
||||
<br><a href="https://int.vichan.net/devel/">vichan</a> Copyright © 2012-2014 vichan-devel</p>
|
||||
<br><a href="http://tinyboard.org/">Tinyboard</a> Copyright © 2010-2014 Tinyboard Development Group
|
||||
<br><a href="https://engine.vichan.net/">vichan</a> Copyright © 2012-2015 vichan-devel</p>
|
||||
</footer>
|
||||
<script type="text/javascript">
|
||||
<script type="text/javascript">{% raw %}
|
||||
var styles = {
|
||||
{% endraw %}
|
||||
{% for name, uri in config.stylesheets %}{% raw %}'{% endraw %}{{ name|addslashes }}{% raw %}' : '{% endraw %}/stylesheets/{{ uri|addslashes }}{% raw %}',
|
||||
{% endraw %}{% endfor %}{% raw %}
|
||||
}; onready(init);
|
||||
{% endraw %}</script>
|
||||
|
||||
<script type="text/javascript">{% raw %}
|
||||
ready();
|
||||
</script>
|
||||
{% endraw %}</script>
|
||||
</body>
|
||||
</html>
|
||||
{% endfilter %}
|
||||
|
|
|
@ -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();
|
||||
|
@ -42,35 +57,37 @@
|
|||
$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'] . sprintf($config['file_page'], ($post['thread'] ? $post['thread'] : $post['id']));
|
||||
$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)) {
|
||||
$post['youtube'] = $matches[2];
|
||||
}
|
||||
|
||||
if (isset($post['files'])) {
|
||||
if (isset($post['files']) && $post['files']) {
|
||||
$files = json_decode($post['files']);
|
||||
|
||||
if ($files[0]->file == 'deleted') {
|
||||
if (count($files) > 1) {
|
||||
foreach ($files as $file) {
|
||||
if (($file == $files[0]) || ($file->file == 'deleted')) continue;
|
||||
$post['file'] = $config['uri_thumb'] . $file->thumb;
|
||||
}
|
||||
if ($files[0]) {
|
||||
if ($files[0]->file == 'deleted') {
|
||||
if (count($files) > 1) {
|
||||
foreach ($files as $file) {
|
||||
if (($file == $files[0]) || ($file->file == 'deleted')) continue;
|
||||
$post['file'] = $config['uri_thumb'] . $file->thumb;
|
||||
}
|
||||
|
||||
if (empty($post['file'])) $post['file'] = $config['image_deleted'];
|
||||
if (empty($post['file'])) $post['file'] = $config['image_deleted'];
|
||||
}
|
||||
else {
|
||||
$post['file'] = $config['image_deleted'];
|
||||
}
|
||||
}
|
||||
else if($files[0]->thumb == 'spoiler') {
|
||||
$post['file'] = '/' . $config['spoiler_image'];
|
||||
}
|
||||
else {
|
||||
$post['file'] = $config['image_deleted'];
|
||||
$post['file'] = $config['uri_thumb'] . $files[0]->thumb;
|
||||
}
|
||||
}
|
||||
else if($files[0]->thumb == 'spoiler') {
|
||||
$post['file'] = '/' . $config['spoiler_image'];
|
||||
}
|
||||
else {
|
||||
$post['file'] = $config['uri_thumb'] . $files[0]->thumb;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($post['image_count'])) $post['image_count'] = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue