//Vorschau-Bild if (!$res['password'] && in_template(array('GALLERY.PREVIEW', 'GALLERY.PREVIEW_FULLSIZE'), $parse)) { if ($res['preview'] && file_exists(BASEDIR . getpath('uploads') . $res['preview'])) { $preview = getpath('uploads') . $res['preview']; } else { list($image) = $db->first("SELECT thumbnail FROM " . PRE . "_gallery_pics WHERE ( galid IN (" . implode(', ', $subtreeIds) . ") AND active='1' ) ORDER BY addtime DESC,id DESC LIMIT 1"); $preview = getpath('uploads') . $image; } $fullsize_preview = str_replace('-thumb', '', $preview); if (!file_exists(BASEDIR . $fullsize_preview)) { $fullsize_preview = ''; } } //Tags if (in_array('GALLERY.TAG', $parse) || in_array('GALLERY.TAG_IDS', $parse) || in_array('GALLERY.KEYWORDS', $parse)) { list($tagdata, $tagids, $keywords) = gallery_tags($res['id']); } $tabledata[$i]['SECID'] = $res['secid']; $tabledata[$i]['ID'] = $res['id']; $tabledata[$i]['TITLE'] = $res['title']; $tabledata[$i]['DESCRIPTION'] = $res['description']; $tabledata[$i]['RESTRICTED'] = $res['restricted']; $tabledata[$i]['TIME'] = $res['starttime']; $tabledata[$i]['UPDATETIME'] = $updatetime; $tabledata[$i]['LINK'] = $link; $tabledata[$i]['COUNT'] = $count; $tabledata[$i]['PREVIEW'] = iif($preview, HTTPDIR . $preview); $tabledata[$i]['PREVIEW_FULLSIZE'] = iif($fullsize_preview, HTTPDIR . $fullsize_preview); $tabledata[$i]['PRODUCT_ID'] = $res['prodid']; //Tags $tabledata[$i]['TAG'] = $tagdata;
function gallery_printsingle($res, $template) { global $set, $db, $apx, $user; if (!$res['id']) { return; } $tmpl = new tengine(); //Voreinstellungen if (!$set['gallery']['picwidth'] || !$set['gallery']['picheight']) { $set['gallery']['picwidth'] = 9999999; $set['gallery']['picheight'] = 9999999; } //Verwendete Variablen auslesen $parse = $apx->tmpl->used_vars($template, 'gallery'); //GALERIE if (in_template(array('GALLERY_TITLE', 'GALLERY_DESCRIPTION', 'GALLERY_LINK', 'GALLERY_TIME', 'GALLERY_PRODUCT_ID', 'GALLERY_RESTRICTED'), $parse)) { $galinfo = $db->first("SELECT secid,title,prodid,description,restricted,starttime FROM " . PRE . "_gallery WHERE id='" . $res['galid'] . "'"); } $gallink = mklink('gallery.php?id=' . $res['galid'], 'gallery,list' . $res['galid'] . ',1' . urlformat($galinfo['title']) . '.html'); //Tags if (in_array('GALLERY_TAG', $parse) || in_array('GALLERY_TAG_IDS', $parse) || in_array('GALLERY_KEYWORDS', $parse)) { list($tagdata, $tagids, $keywords) = gallery_tags($res['galid']); } $tmpl->assign('GALLERY_ID', $res['galid']); $tmpl->assign('GALLERY_SECID', $galinfo['secid']); $tmpl->assign('GALLERY_TITLE', $galinfo['title']); $tmpl->assign('GALLERY_DESCRIPTION', $galinfo['description']); $tmpl->assign('GALLERY_RESTRICTED', $galinfo['restricted']); $tmpl->assign('GALLERY_TIME', $galinfo['starttime']); $tmpl->assign('GALLERY_LINK', $gallink); $tmpl->assign('GALLERY_PRODUCT_ID', $galinfo['prodid']); //Tags $tmpl->assign('TAG_IDS', $tagids); $tmpl->assign('TAG', $tagdata); $tmpl->assign('KEYWORDS', $keywords); //Enthaltene Bilder, Letzte Aktualisierung if (in_template(array('GALLERY_COUNT', 'GALLERY_UPDATETIME'), $parse)) { list($galcount, $updatetime) = $db->first("SELECT count(id), max(addtime) FROM " . PRE . "_gallery_pics WHERE ( galid='" . $res['galid'] . "' AND active='1' )"); $tmpl->assign('GALLERY_COUNT', $galcount); $tmpl->assign('GALLERY_COUNT', $updatetime); } //BILD $link = mklink('gallery.php?pic=' . $res['id'], 'gallery,pic' . $res['id'] . urlformat($res['caption']) . '.html'); if ($set['gallery']['popup']) { $link = "javascript:popupwin('" . $link . "','" . $set['gallery']['picwidth'] . "','" . $set['gallery']['picheight'] . "'," . iif($set['gallery']['popup_resizeable'], 1, 0) . ")"; } $tmpl->assign('CAPTION', $res['caption']); $tmpl->assign('IMAGE', getpath('uploads') . $res['thumbnail']); $tmpl->assign('FULLSIZE', getpath('uploads') . $res['picture']); $tmpl->assign('LINK', $link); $tmpl->assign('TIME', $res['addtime']); $tmpl->assign('HITS', number_format($res['hits'], 0, '', '.')); //Kommentare if ($apx->is_module('comments') && $set['gallery']['coms'] && $res['allowcoms']) { require_once BASEDIR . getmodulepath('comments') . 'class.comments.php'; $coms = new comments('gallery', $res['id']); //Link $gallink = mklink('gallery.php?id=' . $res['galid'], 'gallery,list' . $res['galid'] . ',1' . urlformat($galinfo['title']) . '.html'); $tmpl->assign('COMMENT_COUNT', $coms->count()); $tmpl->assign('COMMENT_LINK', $coms->link($link)); $tmpl->assign('DISPLAY_COMMENTS', 1); } //Bewertungen if ($apx->is_module('ratings') && $set['gallery']['ratings'] && $res['allowrating']) { require_once BASEDIR . getmodulepath('ratings') . 'class.ratings.php'; $rate = new ratings('gallery', $res['id']); $tmpl->assign('RATING', $rate->display()); $tmpl->assign('RATING_VOTES', $rate->count()); $tmpl->assign('DISPLAY_RATING', 1); } $tmpl->parse($template, 'gallery'); }