Merged lainchan with vichan master at 25/9/2016 0bd63149b7 @czaks czaks committed on GitHub 2 days ago

This commit is contained in:
Benjamin Southall 2016-09-25 16:34:47 +09:00
commit c58e37ce39
114 changed files with 5580 additions and 898 deletions

View file

@ -4,12 +4,12 @@
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<script type='text/javascript'>
active_page = "catalog";
var active_page = "catalog"
, board_name = "{{ board }}";
</script>
{% include 'header.html' %}
<title>{{ settings.title }} (/{{ board }}/)</title>
</head>
<body class="theme-catalog board-{{ board }}">
<body class="8chan vichan {% if mod %}is-moderator{% else %}is-not-moderator{% endif %} theme-catalog active-catalog" data-stylesheet="{% if config.default_stylesheet.1 != '' %}{{ config.default_stylesheet.1 }}{% else %}default{% endif %}">
<div class="top bar topbar">
{{ boardlist.top }}
</div>
@ -42,14 +42,16 @@
</select>
</div>
<div class="threads">
<ul id="Grid">
{% for post in recent_posts %}
<li class="mix"
<div class="threads">
<div id="Grid">
{% for post in recent_posts %}
<div class="mix"
data-reply="{{ post.reply_count }}"
data-bump="{{ post.bump }}"
data-time="{{ post.time }}"
data-board="{{ post.board }}"
data-bump="{{ post.bump }}"
data-time="{{ post.time }}"
data-id="{{ post.id }}"
data-sticky="{% if post.sticky %}true{% else %}false{% endif %}"
data-locked="{% if post.locked %}true{% else %}false{% endif %}"
>
<div class="thread grid-li grid-size-small">
<a href="{{post.link}}">
@ -61,7 +63,7 @@
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>
<strong>R: {{ post.reply_count }} / I: {{ post.image_count }}{% if post.sticky %} (sticky){% endif %}</strong>
{% if post.subject %}
<p class="intro">
<span class="subject">
@ -75,9 +77,9 @@
{{ post.body }}
</div>
</div>
</li>
</div>
{% endfor %}
</ul>
</div>
</div>
<hr/>

View file

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
<channel>
<title>/{{ board.uri }}/ - {{ board.title|e }}</title>
<link>{{ config.root }}{{ board.uri }}/</link>
<description>Live feed of new threads on the board /{{ board.uri }}/ - {{ board.title|e }}.</description>
<atom:link href="{{ config.root }}{{ board.uri }}/index.rss" rel="self" type="application/rss+xml"/>
{% for post in recent_posts %}
<item>
<title>{% if post.subject %}{{ post.subject|e }}{% else %}{{ post.body_nomarkup[:256]|remove_modifiers|e }}{% endif %}</title>
<link>{{ config.root }}{{ board.uri }}/res/{{ post.id }}.html</link>
<guid>{{ config.root }}{{ board.uri }}/res/{{ post.id }}.html</guid>
<comments>{{ config.root }}{{ board.uri }}/res/{{ post.id }}.html</comments>
<pubDate>{{ post.pubdate }}</pubDate>
<description><![CDATA[ <a href='{{ config.root }}{{ board.uri }}/res/{{ post.id }}.html' target=_blank><img style='float:left;margin:8px' border=0 src='{% if not config.uri_thumb %}{{ config.root }}{% endif %}{{ post.file }}'></a> {{ post.body }} ]]></description>
</item>
{% endfor %}
</channel>
</rss>

View file

@ -15,23 +15,30 @@
// - post-thread (a thread has been made)
if ($action === 'all') {
foreach ($boards as $board) {
if ($config['smart_build']) {
$b = new Catalog();
$action = generation_strategy("sb_catalog", array($board));
if ($action == 'delete') {
file_unlink($config['dir']['home'] . $board . '/catalog.html');
} else {
$b->build($board);
file_unlink($config['dir']['home'] . $board . '/index.rss');
}
elseif ($action == 'rebuild') {
$b->build($settings, $board);
}
}
} elseif (in_array($board, $boards) &&
$action == 'post-thread' ||
($settings['update_on_posts'] && $action == 'post') ||
($settings['update_on_posts'] && $action == 'post-delete'))
{
if ($config['smart_build']) {
} elseif ($action == 'post-thread' || ($settings['update_on_posts'] && $action == 'post') || ($settings['update_on_posts'] && $action == 'post-delete') && in_array($board, $boards)) {
$b = new Catalog();
$action = generation_strategy("sb_catalog", array($board));
if ($action == 'delete') {
file_unlink($config['dir']['home'] . $board . '/catalog.html');
} else {
$b->build($board);
file_unlink($config['dir']['home'] . $board . '/index.rss');
}
}
elseif ($action == 'rebuild') {
$b->build($settings, $board);
}
}
// FIXME: Check that Ukko is actually enabled
if ($settings['enable_ukko'] && (
@ -210,10 +217,13 @@
$post['file'] = $config['uri_thumb'] . $files[0]->thumb;
}
}
} else {
$post['file'] = $config['root'] . $config['image_deleted'];
}
if (empty($post['image_count']))
$post['image_count'] = 0;
$post['pubdate'] = date('r', $post['time']);
$posts[] = $post;
}
@ -247,5 +257,11 @@
'board' => $board_name,
'link' => $board_link
)));
file_write($config['dir']['home'] . $board_name . '/index.rss', Element('themes/catalog/index.rss', Array(
'config' => $config,
'recent_posts' => $recent_posts,
'board' => $board
)));
}
}