Merge pull request #80 from marlencrabapple/catalog-fixes

A few catalog theme fixes
This commit is contained in:
Marcin Łabanowski 2014-09-17 20:50:04 +02:00
commit c369377c84

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;
}