Commit c62e348f authored by fettesvieh's avatar fettesvieh

- added comments mod to gallery and files modules

- bug fix to gallery details.php
parent cf54eb16
......@@ -11,4 +11,8 @@
<a href="{uri args="files/details/id_`$file.id`/action_download"}" class="download-file">{lang values="files|download_file"} ({$file.size})</a>
</div>
</div>
</div>
\ No newline at end of file
</div>
{if isset($comments)}
<hr />
{$comments}
{/if}
\ No newline at end of file
{if isset($picture)}
<div class="picture">
<img src="{uri args="gallery/image/id_`$picture.id`/action_thumb"}" alt="" />
<div class="content">
......@@ -16,8 +15,7 @@
</div>
</div>
</div>
{else}
<div class="error">
<h5>{lang values="gallery|no_pictures"}</h5>
</div>
{if isset($comments)}
<hr />
{$comments}
{/if}
\ No newline at end of file
......@@ -37,6 +37,11 @@ if (validate::isNumber($uri->id) && $db->countRows('*', 'files', 'id = \'' . $ur
$file[0]['date'] = $date->format($file[0]['start']);
$tpl->assign('file', $file[0]);
if (modules::check('comments', 'functions')) {
include_once ACP3_ROOT . 'modules/comments/functions.php';
$tpl->assign('comments', comments('files', $uri->id));
}
$content = $tpl->fetch('files/details.html');
}
} else {
......
......@@ -13,28 +13,33 @@ if (!defined('IN_ACP3'))
$time = $date->timestamp();
$period = ' AND (g.start = g.end AND g.start <= \'' . $time . '\' OR g.start != g.end AND g.start <= \'' . $time . '\' AND g.end >= \'' . $time . '\')';
if (validate::isNumber($uri->id) && $db->select('COUNT(g.id)', 'gallery AS g, ' . CONFIG_DB_PRE . 'gallery_pictures AS p', 'p.id = \'' . $uri->id . '\' AND p.gallery_id = g.id' . $period) == 1) {
if (validate::isNumber($uri->id) && $db->select('COUNT(g.id)', 'gallery AS g, ' . CONFIG_DB_PRE . 'gallery_pictures AS p', 'p.id = \'' . $uri->id . '\' AND p.gallery_id = g.id' . $period) > 0) {
$picture = $db->select('g.id AS gallery_id, g.name, p.id, p.pic, p.description', 'gallery AS g, ' . CONFIG_DB_PRE . 'gallery_pictures AS p', 'p.id = \'' . $uri->id . '\' AND p.gallery_id = g.id');
if (count($picture) > 0) {
// Brotkrümelspur
breadcrumb::assign($lang->t('gallery', 'gallery'), uri('gallery'));
breadcrumb::assign($picture[0]['name'], uri('gallery/pics/id_' . $picture[0]['gallery_id']));
breadcrumb::assign($lang->t('gallery', 'details'));
// Brotkrümelspur
breadcrumb::assign($lang->t('gallery', 'gallery'), uri('gallery'));
breadcrumb::assign($picture[0]['name'], uri('gallery/pics/id_' . $picture[0]['gallery_id']));
breadcrumb::assign($lang->t('gallery', 'details'));
$picture[0]['description'] = $db->escape($picture[0]['description'], 3);
$tpl->assign('picture', $picture[0]);
$picture[0]['description'] = $db->escape($picture[0]['description'], 3);
$tpl->assign('picture', $picture[0]);
$picture_back = $db->select('id', 'gallery_pictures', 'pic < \'' . $picture[0]['pic'] . '\' AND gallery_id = \'' . $picture[0]['gallery_id'] . '\'', 'pic DESC', 1);
$picture_next = $db->select('id', 'gallery_pictures', 'pic > \'' . $picture[0]['pic'] . '\' AND gallery_id = \'' . $picture[0]['gallery_id'] . '\'', 'pic ASC', 1);
$picture_back = $db->select('id', 'gallery_pictures', 'pic < \'' . $picture[0]['pic'] . '\' AND gallery_id = \'' . $picture[0]['gallery_id'] . '\'', 'pic DESC', 1);
$picture_next = $db->select('id', 'gallery_pictures', 'pic > \'' . $picture[0]['pic'] . '\' AND gallery_id = \'' . $picture[0]['gallery_id'] . '\'', 'pic ASC', 1);
// Vorheriges Bild
if (count($picture_back) > 0)
$tpl->assign('picture_back', $picture_back[0]);
// Nächstes Bild
if (count($picture_next) > 0)
$tpl->assign('picture_next', $picture_next[0]);
// Vorheriges Bild
if (count($picture_back) > 0)
$tpl->assign('picture_back', $picture_back[0]);
// Nächstes Bild
if (count($picture_next) > 0)
$tpl->assign('picture_next', $picture_next[0]);
if (modules::check('comments', 'functions')) {
include_once ACP3_ROOT . 'modules/comments/functions.php';
$tpl->assign('comments', comments('gallery', $uri->id));
}
$content = $tpl->fetch('gallery/details.html');
} else {
redirect('errors/404');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment