Fixed blank catalog image count when zero image replies and threads with deleted files from being excluded

This commit is contained in:
Ian Bradley 2014-09-16 13:10:54 -07:00
parent 39cecea579
commit cff2af99d5

View File

@ -51,10 +51,26 @@
if (isset($post['files'])) {
$files = json_decode($post['files']);
if ($files[0]->file == 'deleted') continue;
$post['file'] = $config['uri_thumb'] . $files[0]->thumb;
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'];
}
else {
$post['file'] = $config['image_deleted'];
}
}
else {
$post['file'] = $config['uri_thumb'] . $files[0]->thumb;
}
}
if (empty($post['image_count'])) $post['image_count'] = 0;
$recent_posts[] = $post;
}