forked from leftypol/leftypol
Add board data on all catalogs, rename overboard 'replies' and 'images' fields to keep consistency
This commit is contained in:
parent
dc63ff61ee
commit
3a5081e73d
3 changed files with 8 additions and 8 deletions
|
@ -48,7 +48,7 @@
|
|||
<div id="Grid">
|
||||
{% for post in recent_posts %}
|
||||
<div class="mix"
|
||||
data-reply="{{ post.reply_count }}"
|
||||
data-reply="{{ post.replies }}"
|
||||
data-bump="{{ post.bump }}"
|
||||
data-time="{{ post.time }}"
|
||||
data-id="{{ post.id }}"
|
||||
|
@ -65,7 +65,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 }}{% if post.sticky %} (sticky){% endif %}{% if post.locked %} <span class="fa fa-lock"> </span>{% endif %}</strong>
|
||||
<strong>R: {{ post.replies }} / I: {{ post.images }}{% if post.sticky %} (sticky){% endif %}{% if post.locked %} <span class="fa fa-lock"> </span>{% endif %}</strong>
|
||||
{% if post.subject %}
|
||||
<p class="intro">
|
||||
<span class="subject">
|
||||
|
|
|
@ -337,8 +337,8 @@
|
|||
|
||||
private function buildThreadsQuery($board) {
|
||||
$sql = "SELECT *, `id` AS `thread_id`, " .
|
||||
"(SELECT COUNT(`id`) FROM ``posts_$board`` WHERE `thread` = `thread_id`) AS `reply_count`, " .
|
||||
"(SELECT SUM(`num_files`) FROM ``posts_$board`` WHERE `thread` = `thread_id` AND `num_files` IS NOT NULL) AS `image_count`, " .
|
||||
"(SELECT COUNT(`id`) FROM ``posts_$board`` WHERE `thread` = `thread_id`) AS `replies`, " .
|
||||
"(SELECT SUM(`num_files`) FROM ``posts_$board`` WHERE `thread` = `thread_id` AND `num_files` IS NOT NULL) AS `images`, " .
|
||||
"'$board' AS `board` FROM ``posts_$board`` WHERE `thread` IS NULL";
|
||||
|
||||
return $sql;
|
||||
|
@ -445,8 +445,8 @@
|
|||
$post['file'] = $config['root'] . $config['image_deleted'];
|
||||
}
|
||||
|
||||
if (empty($post['image_count']))
|
||||
$post['image_count'] = 0;
|
||||
if (empty($post['images']))
|
||||
$post['images'] = 0;
|
||||
$post['pubdate'] = date('r', $post['time']);
|
||||
|
||||
$posts[] = $post;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue