$tabledata[$i]['COMMENT_COUNT'] = $coms->count(); $tabledata[$i]['COMMENT_LINK'] = $coms->link($link); $tabledata[$i]['DISPLAY_COMMENTS'] = 1; if (in_template(array('VIDEO.COMMENT_LAST_USERID', 'VIDEO.COMMENT_LAST_NAME', 'VIDEO.COMMENT_LAST_TIME'), $parse)) { $tabledata[$i]['COMMENT_LAST_USERID'] = $coms->last_userid(); $tabledata[$i]['COMMENT_LAST_NAME'] = $coms->last_name(); $tabledata[$i]['COMMENT_LAST_TIME'] = $coms->last_time(); } } //Bewertungen if ($apx->is_module('ratings') && $set['videos']['ratings'] && $res['allowrating']) { require_once BASEDIR . getmodulepath('ratings') . 'class.ratings.php'; if (!isset($rate)) { $rate = new ratings('videos', $res['id']); } else { $rate->mid = $res['id']; } $tabledata[$i]['RATING'] = $rate->display(); $tabledata[$i]['RATING_VOTES'] = $rate->count(); $tabledata[$i]['DISPLAY_RATING'] = 1; } } } //Sortby ordervars($orderdef, mklink('videos.php?catid=' . $_REQUEST['catid'], 'videos,' . $_REQUEST['catid'] . ',1.html')); $apx->tmpl->assign('VIDEO', $tabledata); $apx->tmpl->parse('index'); //////////////////////////////////////////////////////////////////////////////////////////////////////// require 'lib/_end.php'; /////////////////////////////////////////////////////////// SCRIPT BEENDEN /// ////////////////////////////////////////////////////////////////////////////////////////////////////////
function products_print($data, $template) { global $set, $db, $apx, $user; $tmpl = new tengine(); $apx->lang->drop('fields', 'products'); //Verwendet Variablen auslesen $parse = $apx->tmpl->used_vars($template, 'products'); $ids = get_ids($data, 'id'); $types = get_ids($data, 'type'); if (count($data)) { $unitvars = array('PRODUCT.DEVELOPER', 'PRODUCT.DEVELOPER_WEBSITE', 'PRODUCT.DEVELOPER_LINK', 'PRODUCT.PUBLISHER', 'PRODUCT.PUBLISHER_WEBSITE', 'PRODUCT.PUBLISHER_LINK', 'PRODUCT.MANUFACTURER', 'PRODUCT.MANUFACTURER_WEBSITE', 'PRODUCT.MANUFACTURER_LINK', 'PRODUCT.STUDIO', 'PRODUCT.STUDIO_WEBSITE', 'PRODUCT.STUDIO_LINK', 'PRODUCT.LABEL', 'PRODUCT.LABEL_WEBSITE', 'PRODUCT.LABEL_LINK', 'PRODUCT.ARTIST', 'PRODUCT.ARTIST_WEBSITE', 'PRODUCT.ARTIST_LINK', 'PRODUCT.AUTHOR', 'PRODUCT.AUTHOR_WEBSITE', 'PRODUCT.AUTHOR_LINK'); //Einheiten auslesen $unitinfo = array(); if (in_template($unitvars, $parse)) { $unitids = array_merge(get_ids($data, 'manufacturer'), get_ids($data, 'publisher')); $unitinfo = $db->fetch_index("SELECT id,title,website FROM " . PRE . "_products_units WHERE id IN (" . implode(',', $unitids) . ")", 'id'); } //Gruppen auslesen $groupinfo = array(); $groups = array(); /*if ( in_template(array('PRODUCT.MEDIA'),$parse) ) $groups = array_merge($groups,get_ids($data,'media')); if ( in_array('PRODUCT.GENRE',$parse) ) $groups = array_merge($groups,get_ids($data,'genre')); if ( in_array('game',$types) && in_template(array('PRODUCT.RELEASE.SYSTEM','PRODUCT.RELEASE.SYSTEM_ICON','PRODUCT.SYSTEM'),$parse) ) { if ( count($groups)==0 ) $groups = array(0); $groupinfo = $db->fetch_index("SELECT id,title,icon FROM ".PRE."_products_groups WHERE id IN (".implode(',',$groups).") OR grouptype='system'",'id'); } elseif ( in_array('movie',$types) && in_template(array('PRODUCT.RELEASE.MEDIA','PRODUCT.RELEASE.MEDIA_ICON','PRODUCT.MEDIA'),$parse) ) { if ( count($groups)==0 ) $groups = array(0); $groupinfo = $db->fetch_index("SELECT id,title,icon FROM ".PRE."_products_groups WHERE id IN (".implode(',',$groups).") OR grouptype='media'",'id'); } elseif ( count($groups) ) { $groupinfo = $db->fetch_index("SELECT id,title,icon FROM ".PRE."_products_groups WHERE id IN (".implode(',',$groups).")",'id'); }*/ $groupinfo = $db->fetch_index("SELECT id,title,icon FROM " . PRE . "_products_groups", 'id'); //Veröffentlichungs-Daten auslesen $releaseinfo = array(); if (in_array('PRODUCT.RELEASE', $parse)) { $releasedata = $db->fetch("SELECT prodid,system,data,stamp FROM " . PRE . "_products_releases WHERE prodid IN (" . implode(',', $ids) . ") ORDER BY stamp ASC"); if (count($releasedata)) { foreach ($releasedata as $relres) { $info = unserialize($relres['data']); $releasedate = products_format_release($info); $relentry = array('stamp' => $relres['stamp'], 'DATE' => $releasedate, 'SYSTEM' => $groupinfo[$relres['system']]['title'], 'SYSTEM_ICON' => $groupinfo[$relres['system']]['icon'], 'MEDIA' => $groupinfo[$relres['system']]['title'], 'MEDIA_ICON' => $groupinfo[$relres['system']]['icon']); $releaseinfo[$relres['prodid']][] = $relentry; } } } //Produkte auflisten foreach ($data as $res) { ++$i; //Link $link = mklink('products.php?id=' . $res['id'], 'products,id' . $res['id'] . urlformat($res['title']) . '.html'); //Produktbild if (in_array('PRODUCT.PICTURE', $parse) || in_array('PRODUCT.PICTURE_POPUP', $parse) || in_array('PRODUCT.PICTURE_POPUPPATH', $parse)) { list($picture, $picture_popup, $picture_popuppath) = products_pic($res['picture']); } //Teaserbild if (in_array('PRODUCT.TEASERPIC', $parse) || in_array('PRODUCT.TEASERPIC_POPUP', $parse) || in_array('PRODUCT.TEASERPIC_POPUPPATH', $parse)) { list($teaserpic, $teaserpic_popup, $teaserpic_popuppath) = products_pic($res['teaserpic']); } //Text $text = ''; if (in_array('PRODUCT.TEXT', $parse)) { $text = mediamanager_inline($res['text']); if ($apx->is_module('glossar')) { $text = glossar_highlight($text); } } //Datehead if ($laststamp != date('Y/m/d', $res['addtime'] - TIMEDIFF)) { $tabledata[$i]['DATEHEAD'] = $res['addtime']; } //Tags if (in_array('PRODUCT.TAG', $parse) || in_array('PRODUCT.TAG_IDS', $parse) || in_array('PRODUCT.KEYWORDS', $parse)) { list($tagdata, $tagids, $keywords) = products_tags($res['id']); } //Standard-Platzhalter $tabledata[$i]['ID'] = $res['id']; $tabledata[$i]['TYPE'] = $res['type']; $tabledata[$i]['LINK'] = $link; $tabledata[$i]['TITLE'] = $res['title']; $tabledata[$i]['TEXT'] = $text; $tabledata[$i]['TIME'] = $res['addtime']; $tabledata[$i]['WEBSITE'] = $res['website']; $tabledata[$i]['BUYLINK'] = $res['buylink']; $tabledata[$i]['PRICE'] = $res['price']; $tabledata[$i]['HITS'] = $res['hits']; $tabledata[$i]['PICTURE'] = $picture; $tabledata[$i]['PICTURE_POPUP'] = $picture_popup; $tabledata[$i]['PICTURE_POPUPPATH'] = $picture_popuppath; $tabledata[$i]['TEASERPIC'] = $teaserpic; $tabledata[$i]['TEASERPIC_POPUP'] = $teaserpic_popup; $tabledata[$i]['TEASERPIC_POPUPPATH'] = $teaserpic_popuppath; $tabledata[$i]['PRODUCT_ID'] = $res['prodid']; $tabledata[$i]['RECOMMENDED_PRICE'] = $res['recprice']; $tabledata[$i]['GUARANTEE'] = $res['guarantee']; //Sammlung if ($user->info['userid']) { if (!products_in_coll($res['id'])) { $tabledata[$i]['LINK_COLLECTION_ADD'] = mklink('products.php?id=' . $res['id'] . '&addcoll=1', 'products,id' . $res['id'] . urlformat($res['title']) . '.html?addcoll=1'); } else { $tabledata[$i]['LINK_COLLECTION_REMOVE'] = mklink('products.php?id=' . $res['id'] . '&removecoll=1', 'products,id' . $res['id'] . urlformat($res['title']) . '.html?removecoll=1'); } } //Tags $tabledata[$i]['TAG'] = $tagdata; $tabledata[$i]['TAG_IDS'] = $tagids; $tabledata[$i]['KEYWORDS'] = $keywords; //NORMAL if ($res['type'] == 'normal') { $manulink = mklink('manufacturers.php?id=' . $res['manufacturer'], 'manufacturers,id' . $res['manufacturer'] . urlformat($unitinfo[$res['manufacturer']]['title']) . '.html'); $tabledata[$i]['MANUFACTURER'] = $unitinfo[$res['manufacturer']]['title']; $tabledata[$i]['MANUFACTURER_WEBSITE'] = $unitinfo[$res['manufacturer']]['website']; $tabledata[$i]['MANUFACTURER_LINK'] = $manulink; } elseif ($res['type'] == 'game') { //System-Liste $systemdata = array(); if (in_array('PRODUCT.SYSTEM', $parse)) { $systems = dash_unserialize($res['systems']); if (!is_array($systems)) { $systems = array(); } foreach ($systems as $sysid) { ++$ii; $systemdata[$ii]['TITLE'] = $groupinfo[$sysid]['title']; $systemdata[$ii]['ICON'] = $groupinfo[$sysid]['icon']; } } //Media-Liste $media = dash_unserialize($res['media']); if (!is_array($media)) { $media = array(); } $mediadata = array(); foreach ($media as $medid) { ++$ii; $mediadata[$ii]['TITLE'] = $groupinfo[$medid]['title']; $mediadata[$ii]['ICON'] = $groupinfo[$medid]['icon']; } $manulink = mklink('manufacturers.php?id=' . $res['manufacturer'], 'manufacturers,id' . $res['manufacturer'] . urlformat($unitinfo[$res['manufacturer']]['title']) . '.html'); $publink = mklink('manufacturers.php?id=' . $res['publisher'], 'manufacturers,id' . $res['publisher'] . urlformat($unitinfo[$res['publisher']]['title']) . '.html'); $tabledata[$i]['DEVELOPER'] = $unitinfo[$res['manufacturer']]['title']; $tabledata[$i]['DEVELOPER_WEBSITE'] = $unitinfo[$res['manufacturer']]['website']; $tabledata[$i]['DEVELOPER_LINK'] = $manulink; $tabledata[$i]['PUBLISHER'] = $unitinfo[$res['publisher']]['title']; $tabledata[$i]['PUBLISHER_WEBSITE'] = $unitinfo[$res['publisher']]['website']; $tabledata[$i]['PUBLISHER_LINK'] = $publink; $tabledata[$i]['USK'] = $res['sk']; $tabledata[$i]['GENRE'] = $groupinfo[$res['genre']]['title']; $tabledata[$i]['MEDIA'] = $mediadata; $tabledata[$i]['SYSTEM'] = $systemdata; $tabledata[$i]['REQUIREMENTS'] = $res['requirements']; } elseif ($res['type'] == 'hardware') { $manulink = mklink('manufacturers.php?id=' . $res['manufacturer'], 'manufacturers,id' . $res['manufacturer'] . urlformat($unitinfo[$res['manufacturer']]['title']) . '.html'); $tabledata[$i]['MANUFACTURER'] = $unitinfo[$res['manufacturer']]['title']; $tabledata[$i]['MANUFACTURER_WEBSITE'] = $unitinfo[$res['manufacturer']]['website']; $tabledata[$i]['MANUFACTURER_LINK'] = $manulink; $tabledata[$i]['EQUIPMENT'] = $res['equipment']; } elseif ($res['type'] == 'software') { //Media-Liste $media = dash_unserialize($res['media']); if (!is_array($media)) { $media = array(); } $mediadata = array(); foreach ($media as $medid) { ++$ii; $mediadata[$ii]['TITLE'] = $groupinfo[$medid]['title']; $mediadata[$ii]['ICON'] = $groupinfo[$medid]['icon']; } $manulink = mklink('manufacturers.php?id=' . $res['manufacturer'], 'manufacturers,id' . $res['manufacturer'] . urlformat($unitinfo[$res['manufacturer']]['title']) . '.html'); $tabledata[$i]['MANUFACTURER'] = $unitinfo[$res['manufacturer']]['title']; $tabledata[$i]['MANUFACTURER_WEBSITE'] = $unitinfo[$res['manufacturer']]['website']; $tabledata[$i]['MANUFACTURER_LINK'] = $manulink; $tabledata[$i]['OS'] = $res['os']; $tabledata[$i]['LANGUAGES'] = $res['languages']; $tabledata[$i]['REQUIREMENTS'] = $res['requirements']; $tabledata[$i]['LICENSE'] = $res['license']; $tabledata[$i]['VERSION'] = $res['version']; $tabledata[$i]['MEDIA'] = $mediadata; } elseif ($res['type'] == 'music') { //Media-Liste $media = dash_unserialize($res['media']); if (!is_array($media)) { $media = array(); } $mediadata = array(); foreach ($media as $medid) { ++$ii; $mediadata[$ii]['TITLE'] = $groupinfo[$medid]['title']; $mediadata[$ii]['ICON'] = $groupinfo[$medid]['icon']; } $manulink = mklink('manufacturers.php?id=' . $res['manufacturer'], 'manufacturers,id' . $res['manufacturer'] . urlformat($unitinfo[$res['manufacturer']]['title']) . '.html'); $publink = mklink('manufacturers.php?id=' . $res['publisher'], 'manufacturers,id' . $res['publisher'] . urlformat($unitinfo[$res['publisher']]['title']) . '.html'); $tabledata[$i]['ARTIST'] = $unitinfo[$res['manufacturer']]['title']; $tabledata[$i]['ARTIST_WEBSITE'] = $unitinfo[$res['manufacturer']]['website']; $tabledata[$i]['ARTIST_LINK'] = $manulink; $tabledata[$i]['LABEL'] = $unitinfo[$res['publisher']]['title']; $tabledata[$i]['LABEL_WEBSITE'] = $unitinfo[$res['publisher']]['website']; $tabledata[$i]['LABEL_LINK'] = $publink; $tabledata[$i]['FSK'] = $res['sk']; $tabledata[$i]['GENRE'] = $groupinfo[$res['genre']]['title']; $tabledata[$i]['MEDIA'] = $mediadata; } elseif ($res['type'] == 'movie') { //Media-Liste $media = dash_unserialize($res['media']); if (!is_array($media)) { $media = array(); } $mediadata = array(); foreach ($media as $medid) { ++$ii; $mediadata[$ii]['TITLE'] = $groupinfo[$medid]['title']; $mediadata[$ii]['ICON'] = $groupinfo[$medid]['icon']; } $publink = mklink('manufacturers.php?id=' . $res['publisher'], 'manufacturers,id' . $res['publisher'] . urlformat($unitinfo[$res['publisher']]['title']) . '.html'); $tabledata[$i]['STUDIO'] = $unitinfo[$res['publisher']]['title']; $tabledata[$i]['STUDIO_WEBSITE'] = $unitinfo[$res['publisher']]['website']; $tabledata[$i]['STUDIO_LINK'] = $publink; $tabledata[$i]['REGISSEUR'] = $res['regisseur']; $tabledata[$i]['ACTORS'] = $res['actors']; $tabledata[$i]['LENGTH'] = $res['length']; $tabledata[$i]['FSK'] = $res['sk']; $tabledata[$i]['GENRE'] = $groupinfo[$res['genre']]['title']; $tabledata[$i]['MEDIA'] = $mediadata; } elseif ($res['type'] == 'book') { //Media-Liste $media = dash_unserialize($res['media']); if (!is_array($media)) { $media = array(); } $mediadata = array(); foreach ($media as $medid) { ++$ii; $mediadata[$ii]['TITLE'] = $groupinfo[$medid]['title']; $mediadata[$ii]['ICON'] = $groupinfo[$medid]['icon']; } $manulink = mklink('manufacturers.php?id=' . $res['manufacturer'], 'manufacturers,id' . $res['manufacturer'] . urlformat($unitinfo[$res['manufacturer']]['title']) . '.html'); $publink = mklink('manufacturers.php?id=' . $res['publisher'], 'manufacturers,id' . $res['publisher'] . urlformat($unitinfo[$res['publisher']]['title']) . '.html'); $tabledata[$i]['AUTHOR'] = $unitinfo[$res['manufacturer']]['title']; $tabledata[$i]['AUTHOR_WEBSITE'] = $unitinfo[$res['manufacturer']]['website']; $tabledata[$i]['AUTHOR_LINK'] = $manulink; $tabledata[$i]['PUBLISHER'] = $unitinfo[$res['publisher']]['title']; $tabledata[$i]['PUBLISHER_WEBSITE'] = $unitinfo[$res['publisher']]['website']; $tabledata[$i]['PUBLISHER_LINK'] = $publink; $tabledata[$i]['GENRE'] = $groupinfo[$res['genre']]['title']; $tabledata[$i]['MEDIA'] = $mediadata; $tabledata[$i]['ISBN'] = $res['isbn']; } //Benutzerdefinierte Felder for ($ii = 1; $ii <= 10; $ii++) { $tabledata[$i]['CUSTOM' . $ii . '_NAME'] = replace($set['products']['custom_' . $res['type']][$ii - 1]); $tabledata[$i]['CUSTOM' . $ii] = $res['custom' . $ii]; } //Veröffentlichung if (in_array('PRODUCT.RELEASE', $parse)) { if ($res['releasestamp']) { $temprel = $releaseinfo[$res['id']]; foreach ($temprel as $rel) { if ($rel['stamp'] != $res['releasestamp']) { continue; } ++$ii; $tabledata[$i]['RELEASE'][$ii] = $rel; } } else { $tabledata[$i]['RELEASE'] = $releaseinfo[$res['id']]; } } //Kommentare if ($apx->is_module('comments') && $set['products']['coms'] && $res['allowcoms']) { require_once BASEDIR . getmodulepath('comments') . 'class.comments.php'; if (!isset($coms)) { $coms = new comments('products', $res['id']); } else { $coms->mid = $res['id']; } $link = mklink('products.php?id=' . $res['id'], 'products,id' . $res['id'] . urlformat($res['title']) . '.html'); $tabledata[$i]['COMMENT_COUNT'] = $coms->count(); $tabledata[$i]['COMMENT_LINK'] = $coms->link($link); $tabledata[$i]['DISPLAY_COMMENTS'] = 1; if (in_template(array('PRODUCT.COMMENT_LAST_USERID', 'PRODUCT.COMMENT_LAST_NAME', 'PRODUCT.COMMENT_LAST_TIME'), $parse)) { $tabledata[$i]['COMMENT_LAST_USERID'] = $coms->last_userid(); $tabledata[$i]['COMMENT_LAST_NAME'] = $coms->last_name(); $tabledata[$i]['COMMENT_LAST_TIME'] = $coms->last_time(); } } //Bewertungen if ($apx->is_module('ratings') && $set['products']['ratings'] && $res['allowrating']) { require_once BASEDIR . getmodulepath('ratings') . 'class.ratings.php'; if (!isset($rate)) { $rate = new ratings('products', $res['id']); } else { $rate->mid = $res['id']; } $tabledata[$i]['RATING'] = $rate->display(); $tabledata[$i]['RATING_VOTES'] = $rate->count(); $tabledata[$i]['DISPLAY_RATING'] = 1; } $laststamp = date('Y/m/d', $res['addtime'] - TIMEDIFF); } } $tmpl->assign('PRODUCT', $tabledata); $tmpl->parse($template, 'products'); }
function links_print($data, $template) { global $set, $db, $apx, $user; $tmpl = new tengine(); $apx->lang->drop('global', 'links'); //Verwendete Variablen auslesen $parse = $apx->tmpl->used_vars($template, 'links'); //Kategorien auslesen if (in_array('LINK.CATTITLE', $parse) || in_array('LINK.CATTEXT', $parse) || in_array('LINK.CATICON', $parse) || in_array('LINK.CATLINK', $parse)) { $catids = get_ids($data, 'catid'); if (count($catids)) { $catdata = $db->fetch("SELECT id,title,text,icon FROM " . PRE . "_links_cat WHERE id IN (" . implode(',', $catids) . ")"); if (count($catdata)) { foreach ($catdata as $catres) { $catinfo[$catres['id']] = $catres; } } } } if (count($data)) { foreach ($data as $res) { ++$i; //Dateillink $link = mklink('links.php?id=' . $res['id'], 'links,id' . $res['id'] . urlformat($res['title']) . '.html'); //Neu? if ($res['starttime'] + $set['links']['new'] * 24 * 3600 >= time()) { $new = 1; } else { $new = 0; } //Goto-Link $gotolink = 'misc.php?action=gotolink&id=' . $res['id'] . iif($apx->section_id(), '&sec=' . $apx->section_id()); //Linkpic if (in_array('LINK.PICTURE', $parse) || in_array('LINK.PICTURE_POPUP', $parse) || in_array('LINK.PICTURE_POPUPPATH', $parse)) { list($picture, $picture_popup, $picture_popuppath) = links_linkpic($res['linkpic']); } //Username + eMail if ($res['userid']) { $author = $res['username']; $author_email = iif(!$res['pub_hidemail'], $res['email']); } else { $author = $res['send_username']; $author_email = $res['send_email']; } //Text $text = ''; if (in_array('LINK.TEXT', $parse)) { $text = mediamanager_inline($res['text']); if ($apx->is_module('glossar')) { $text = glossar_highlight($text); } } //Datehead if ($laststamp != date('Y/m/d', $res['starttime'] - TIMEDIFF)) { $tabledata[$i]['DATEHEAD'] = $res['starttime']; } //Tags if (in_array('LINK.TAG', $parse) || in_array('LINK.TAG_IDS', $parse) || in_array('LINK.KEYWORDS', $parse)) { list($tagdata, $tagids, $keywords) = links_tags($res['id']); } $tabledata[$i]['ID'] = $res['id']; $tabledata[$i]['TITLE'] = $res['title']; $tabledata[$i]['URL'] = $res['url']; $tabledata[$i]['TEXT'] = $text; $tabledata[$i]['LINK'] = $link; $tabledata[$i]['PICTURE'] = $picture; $tabledata[$i]['PICTURE_POPUP'] = $picture_popup; $tabledata[$i]['PICTURE_POPUPPATH'] = $picture_popuppath; $tabledata[$i]['HITS'] = number_format($res['hits'], 0, '', '.'); $tabledata[$i]['TIME'] = $res['starttime']; $tabledata[$i]['TOP'] = $res['top']; $tabledata[$i]['RESTRICTED'] = $res['restricted']; $tabledata[$i]['NEW'] = $new; $tabledata[$i]['GOTO'] = $gotolink; //Tags $tabledata[$i]['TAG'] = $tagdata; $tabledata[$i]['TAG_IDS'] = $tagids; $tabledata[$i]['KEYWORDS'] = $keywords; //Autor $tabledata[$i]['USERID'] = $res['userid']; $tabledata[$i]['USERNAME'] = replace($author); $tabledata[$i]['EMAIL'] = replace($author_email); $tabledata[$i]['EMAIL_ENCRYPTED'] = replace(cryptMail($author_email)); //Kategorien $tabledata[$i]['CATID'] = $res['catid']; $tabledata[$i]['CATTITLE'] = $catinfo[$res['catid']]['title']; $tabledata[$i]['CATTEXT'] = $catinfo[$res['catid']]['text']; $tabledata[$i]['CATICON'] = $catinfo[$res['catid']]['icon']; $tabledata[$i]['CATLINK'] = mklink('links.php?catid=' . $res['catid'], 'links,' . $res['catid'] . ',1' . urlformat($catinfo[$res['catid']]['title']) . '.html'); //Galerie if ($apx->is_module('gallery') && $res['galid']) { $galinfo = gallery_info($res['galid']); $tabledata[$i]['GALLERY_ID'] = $galinfo['id']; $tabledata[$i]['GALLERY_TITLE'] = $galinfo['title']; $tabledata[$i]['GALLERY_LINK'] = mklink('gallery.php?id=' . $galinfo['id'], 'gallery,list' . $galinfo['id'] . ',1' . urlformat($galinfo['title']) . '.html'); } //Kommentare if ($apx->is_module('comments') && $set['links']['coms'] && $res['allowcoms']) { require_once BASEDIR . getmodulepath('comments') . 'class.comments.php'; if (!isset($coms)) { $coms = new comments('links', $res['id']); } else { $coms->mid = $res['id']; } $link = mklink('links.php?id=' . $res['id'], 'links,id' . $res['id'] . urlformat($res['title']) . '.html'); $tabledata[$i]['COMMENT_COUNT'] = $coms->count(); $tabledata[$i]['COMMENT_LINK'] = $coms->link($link); $tabledata[$i]['DISPLAY_COMMENTS'] = 1; if (in_template(array('LINK.COMMENT_LAST_USERID', 'LINK.COMMENT_LAST_NAME', 'LINK.COMMENT_LAST_TIME'), $parse)) { $tabledata[$i]['COMMENT_LAST_USERID'] = $coms->last_userid(); $tabledata[$i]['COMMENT_LAST_NAME'] = $coms->last_name(); $tabledata[$i]['COMMENT_LAST_TIME'] = $coms->last_time(); } } //Bewertungen if ($apx->is_module('ratings') && $set['links']['ratings'] && $res['allowrating']) { require_once BASEDIR . getmodulepath('ratings') . 'class.ratings.php'; if (!isset($rate)) { $rate = new ratings('links', $res['id']); } else { $rate->mid = $res['id']; } $tabledata[$i]['RATING'] = $rate->display(); $tabledata[$i]['RATING_VOTES'] = $rate->count(); $tabledata[$i]['DISPLAY_RATING'] = 1; } $laststamp = date('Y/m/d', $res['starttime'] - TIMEDIFF); } } $tmpl->assign('LINK', $tabledata); $tmpl->parse($template, 'links'); }
function downloads_print($data, $template) { global $set, $db, $apx, $user; $tmpl = new tengine(); $apx->lang->drop('global', 'downloads'); //Verwendete Variablen auslesen $parse = $apx->tmpl->used_vars($template, 'downloads'); //Kategorien auslesen if (in_array('DOWNLOAD.CATTITLE', $parse) || in_array('DOWNLOAD.CATTEXT', $parse) || in_array('DOWNLOAD.CATICON', $parse) || in_array('DOWNLOAD.CATLINK', $parse)) { $catids = get_ids($data, 'catid'); if (count($catids)) { $catdata = $db->fetch("SELECT id,title,text,icon FROM " . PRE . "_downloads_cat WHERE id IN (" . implode(',', $catids) . ")"); if (count($catdata)) { foreach ($catdata as $catres) { $catinfo[$catres['id']] = $catres; } } } } //User auslesen $userinfo = array(); if (in_template(array('DOWNLOAD.UPLOADER', 'DOWNLOAD.UPLOADER_EMAIL', 'DOWNLOAD.UPLOADER_EMAIL_ENCRYPTED'), $parse)) { $userids = get_ids($data, 'userid'); if ($userids) { $userinfo = $db->fetch_index("\n\t\t\t\tSELECT userid, username, email, pub_hidemail\n\t\t\t\tFROM " . PRE . "_user\n\t\t\t\tWHERE userid IN (" . implode(',', $userids) . ")\n\t\t\t", 'userid'); } } if (count($data)) { foreach ($data as $res) { ++$i; //Link $link = mklink('downloads.php?id=' . $res['id'], 'downloads,id' . $res['id'] . urlformat($res['title']) . '.html'); //Teaserbild if (in_array('DOWNLOAD.TEASERPIC', $parse) || in_array('DOWNLOAD.TEASERPIC_POPUP', $parse) || in_array('DOWNLOAD.TEASERPIC_POPUPPATH', $parse)) { list($picture, $picture_popup, $picture_popuppath) = downloads_teaserpic($res['teaserpic']); } //Dateigröße auslesen if (in_array('DOWNLOAD.SIZE', $parse)) { $thefsize = downloads_filesize($res); } //Download-Link if (!$set['downloads']['regonly'] && !$res['regonly'] || $user->info['userid']) { $sechash = md5($_SERVER['HTTP_HOST'] . $res['file'] . date('Y/m/d', time() - TIMEDIFF)); $dllink = 'misc.php?action=downloadfile&id=' . $res['id'] . '&sechash=' . $sechash . iif($apx->section_id(), '&sec=' . $apx->section_id()); } else { $dllink = mklink('user.php', 'user.html'); } //Bilder if (in_array('DOWNLOAD.PICTURE', $parse)) { $picdata = downloads_pictures($res['pictures']); } //Neu? if ($res['addtime'] + $set['downloads']['new'] * 24 * 3600 >= time()) { $new = 1; } else { $new = 0; } //Username + eMail if ($res['userid']) { $userdata = $userinfo[$res['userid']]; $uploader = $userdata['username']; $uploader_email = iif(!$userdata['pub_hidemail'], $userdata['email']); } else { $uploader = $res['send_username']; $uploader_email = $res['send_email']; } //Datehead if ($laststamp != date('Y/m/d', $res['starttime'] - TIMEDIFF)) { $tabledata[$i]['DATEHEAD'] = $res['starttime']; } //Text $text = ''; if (in_array('DOWNLOAD.TEXT', $parse)) { $text = mediamanager_inline($res['text']); if ($apx->is_module('glossar')) { $text = glossar_highlight($text); } } //Tags if (in_array('DOWNLOAD.TAG', $parse) || in_array('DOWNLOAD.TAG_IDS', $parse) || in_array('DOWNLOAD.KEYWORDS', $parse)) { list($tagdata, $tagids, $keywords) = downloads_tags($res['id']); } $tabledata[$i]['ID'] = $res['id']; $tabledata[$i]['SECID'] = $res['secid']; $tabledata[$i]['TITLE'] = $res['title']; $tabledata[$i]['TEXT'] = $text; $tabledata[$i]['LINK'] = $link; $tabledata[$i]['TEASERPIC'] = $picture; $tabledata[$i]['TEASERPIC_POPUP'] = $picture_popup; $tabledata[$i]['TEASERPIC_POPUPPATH'] = $picture_popuppath; $tabledata[$i]['SIZE'] = downloads_getsize($thefsize); $tabledata[$i]['FORMAT'] = downloads_getformat($res); $tabledata[$i]['HITS'] = number_format($res['hits'], 0, '', '.'); $tabledata[$i]['TIME'] = $res['starttime']; $tabledata[$i]['PICTURE'] = $picdata; $tabledata[$i]['TOP'] = $res['top']; $tabledata[$i]['RESTRICTED'] = $res['restricted']; $tabledata[$i]['NEW'] = $new; $tabledata[$i]['DOWNLOADLINK'] = $dllink; //Tags $tabledata[$i]['TAG'] = $tagdata; $tabledata[$i]['TAG_IDS'] = $tagids; $tabledata[$i]['KEYWORDS'] = $keywords; //Kategorien $tabledata[$i]['CATID'] = $res['catid']; $tabledata[$i]['CATTITLE'] = $catinfo[$res['catid']]['title']; $tabledata[$i]['CATTEXT'] = $catinfo[$res['catid']]['text']; $tabledata[$i]['CATICON'] = $catinfo[$res['catid']]['icon']; $tabledata[$i]['CATLINK'] = mklink('downloads.php?catid=' . $res['catid'], 'downloads,' . $res['catid'] . ',1' . urlformat($catinfo[$res['catid']]['title']) . '.html'); //Produkt $tabledata[$i]['PRODUCT_ID'] = $res['prodid']; //Uploader $tabledata[$i]['UPLOADER_ID'] = $res['userid']; $tabledata[$i]['UPLOADER'] = replace($uploader); $tabledata[$i]['UPLOADER_EMAIL'] = replace($uploader_email); $tabledata[$i]['UPLOADER_EMAIL_ENCRYPTED'] = replace(cryptMail($uploader_email)); //Autor $tabledata[$i]['AUTHOR'] = replace($res['author']); $tabledata[$i]['AUTHOR_LINK'] = replace($res['author_link']); //Galerie if ($apx->is_module('gallery') && $res['galid']) { $galinfo = gallery_info($res['galid']); $tabledata[$i]['GALLERY_ID'] = $galinfo['id']; $tabledata[$i]['GALLERY_TITLE'] = $galinfo['title']; $tabledata[$i]['GALLERY_LINK'] = mklink('gallery.php?id=' . $galinfo['id'], 'gallery,list' . $galinfo['id'] . ',1' . urlformat($galinfo['title']) . '.html'); } //Kommentare if ($apx->is_module('comments') && $set['downloads']['coms'] && $res['allowcoms']) { require_once BASEDIR . getmodulepath('comments') . 'class.comments.php'; if (!isset($coms)) { $coms = new comments('downloads', $res['id']); } else { $coms->mid = $res['id']; } $link = mklink('downloads.php?id=' . $res['id'], 'downloads,id' . $res['id'] . urlformat($res['title']) . ',1.html'); $tabledata[$i]['COMMENT_COUNT'] = $coms->count(); $tabledata[$i]['COMMENT_LINK'] = $coms->link($link); $tabledata[$i]['DISPLAY_COMMENTS'] = 1; if (in_template(array('DOWNLOAD.COMMENT_LAST_USERID', 'DOWNLOAD.COMMENT_LAST_NAME', 'DOWNLOAD.COMMENT_LAST_TIME'), $parse)) { $tabledata[$i]['COMMENT_LAST_USERID'] = $coms->last_userid(); $tabledata[$i]['COMMENT_LAST_NAME'] = $coms->last_name(); $tabledata[$i]['COMMENT_LAST_TIME'] = $coms->last_time(); } } //Bewertungen if ($apx->is_module('ratings') && $set['downloads']['ratings'] && $res['allowrating']) { require_once BASEDIR . getmodulepath('ratings') . 'class.ratings.php'; if (!isset($rate)) { $rate = new ratings('downloads', $res['id']); } else { $rate->mid = $res['id']; } $tabledata[$i]['RATING'] = $rate->display(); $tabledata[$i]['RATING_VOTES'] = $rate->count(); $tabledata[$i]['DISPLAY_RATING'] = 1; } $laststamp = date('Y/m/d', $res['starttime'] - TIMEDIFF); } } $tmpl->assign('DOWNLOAD', $tabledata); $tmpl->parse($template, 'downloads'); }
function videos_print($data, $template) { global $set, $db, $apx, $user; $tmpl = new tengine(); $apx->lang->drop('globalwohl', 'videos'); //Verwendete Variablen auslesen $parse = $apx->tmpl->used_vars($template, 'videos'); //Kategorien auslesen if (in_array('VIDEO.CATTITLE', $parse) || in_array('VIDEO.CATTEXT', $parse) || in_array('VIDEO.CATICON', $parse) || in_array('VIDEO.CATLINK', $parse)) { $catids = get_ids($data, 'catid'); if (count($catids)) { $catdata = $db->fetch("SELECT id,title,text,icon FROM " . PRE . "_videos_cat WHERE id IN (" . implode(',', $catids) . ")"); if (count($catdata)) { foreach ($catdata as $catres) { $catinfo[$catres['id']] = $catres; } } } } if (count($data)) { foreach ($data as $res) { ++$i; //Link $link = mklink('videos.php?id=' . $res['id'], 'videos,id' . $res['id'] . urlformat($res['title']) . '.html'); //Teaserbild if (in_array('VIDEO.PICTURE', $parse) || in_array('VIDEO.PICTURE_POPUP', $parse) || in_array('VIDEO.PICTURE_POPUPPATH', $parse)) { list($picture, $picture_popup, $picture_popuppath) = videos_teaserpic($res['teaserpic']); } //Dateigröße auslesen if (in_array('VIDEO.SIZE', $parse)) { $thefsize = videos_filesize($res); } //Download-Link if (!$set['videos']['regonly'] && !$res['regonly'] || $user->info['userid']) { $sechash = md5($_SERVER['HTTP_HOST'] . $res['file'] . date('Y/m/d', time() - TIMEDIFF)); $dllink = 'misc.php?action=videofile&id=' . $res['id'] . '&sechash=' . $sechash . iif($apx->section_id(), '&sec=' . $apx->section_id()); } else { $dllink = mklink('user.php', 'user.html'); } //Bilder if (in_array('VIDEO.SCREENSHOT', $parse)) { $picdata = videos_screenshots($res['id']); } //Neu? if ($res['addtime'] + $set['videos']['new'] * 24 * 3600 >= time()) { $new = 1; } else { $new = 0; } //Username + eMail if ($res['userid']) { $uploader = $res['username']; $uploader_email = iif(!$res['pub_hidemail'], $res['email']); } else { $uploader = $res['send_username']; $uploader_email = $res['send_email']; } //Datehead if ($laststamp != date('Y/m/d', $res['starttime'] - TIMEDIFF)) { $tabledata[$i]['DATEHEAD'] = $res['starttime']; } //Text $text = ''; if (in_array('VIDEO.TEXT', $parse)) { $text = mediamanager_inline($res['text']); if ($apx->is_module('glossar')) { $text = glossar_highlight($text); } } //Tags if (in_array('VIDEO.TAG', $parse) || in_array('VIDEO.TAG_IDS', $parse) || in_array('VIDEO.KEYWORDS', $parse)) { list($tagdata, $tagids, $keywords) = videos_tags($res['id']); } //Embeded? if ($res['source'] != 'apexx' && $res['source'] != 'external') { $embedcode = videos_embedcode($res['source'], $res['flvfile']); $file = ''; $flvfile = ''; $dllink = ''; } elseif ($res['source'] == 'external') { $embedcode = ''; $flvfile = $res['flvfile']; if ($res['file']) { $file = $res['file']; } else { $dllink = ''; } } else { $embedcode = ''; $flvfile = HTTPDIR . getpath('uploads') . $res['flvfile']; if ($res['file']) { $file = HTTP_HOST . HTTPDIR . getpath('uploads') . $res['file']; } else { $dllink = ''; } } $tabledata[$i]['ID'] = $res['id']; $tabledata[$i]['SECID'] = $res['secid']; $tabledata[$i]['USERID'] = $res['userid']; $tabledata[$i]['USERNAME'] = replace($uploader); $tabledata[$i]['EMAIL'] = replace($uploader_email); $tabledata[$i]['EMAIL_ENCRYPTED'] = replace(cryptMail($uploader_email)); $tabledata[$i]['TITLE'] = $res['title']; $tabledata[$i]['TEXT'] = $text; $tabledata[$i]['LINK'] = $link; $tabledata[$i]['PICTURE'] = $picture; $tabledata[$i]['PICTURE_POPUP'] = $picture_popup; $tabledata[$i]['PICTURE_POPUPPATH'] = $picture_popuppath; $tabledata[$i]['SIZE'] = videos_getsize($thefsize); $tabledata[$i]['HITS'] = number_format($res['hits'], 0, '', '.'); $tabledata[$i]['TIME'] = $res['starttime']; $tabledata[$i]['SCREENSHOT'] = $picdata; $tabledata[$i]['SOURCE'] = $res['source'] == 'external' ? 'apexx' : $res['source']; $tabledata[$i]['VIDEOFILE'] = $flvfile; $tabledata[$i]['EMBEDCODE'] = $embedcode; $tabledata[$i]['LOCAL'] = $res['source'] == 'apexx'; $tabledata[$i]['TOP'] = $res['top']; $tabledata[$i]['RESTRICTED'] = $res['restricted']; $tabledata[$i]['NEW'] = $new; $tabledata[$i]['DOWNLOADLINK'] = $dllink; $tabledata[$i]['DOWNLOADFILE'] = $file; $tabledata[$i]['DOWNLOADS'] = number_format($res['downloads'], 0, '', '.'); //Tags $tabledata[$i]['TAG'] = $tagdata; $tabledata[$i]['TAG_IDS'] = $tagids; $tabledata[$i]['KEYWORDS'] = $keywords; //Kategorie $tabledata[$i]['CATID'] = $res['catid']; $tabledata[$i]['CATTITLE'] = $catinfo[$res['catid']]['title']; $tabledata[$i]['CATTEXT'] = $catinfo[$res['catid']]['text']; $tabledata[$i]['CATICON'] = $catinfo[$res['catid']]['icon']; //Produkt $tabledata[$i]['PRODUCT_ID'] = $res['prodid']; //Kommentare if ($apx->is_module('comments') && $set['videos']['coms'] && $res['allowcoms']) { require_once BASEDIR . getmodulepath('comments') . 'class.comments.php'; if (!isset($coms)) { $coms = new comments('videos', $res['id']); } else { $coms->mid = $res['id']; } $link = mklink('videos.php?id=' . $res['id'], 'videos,id' . $res['id'] . urlformat($res['title']) . '.html'); $tabledata[$i]['COMMENT_COUNT'] = $coms->count(); $tabledata[$i]['COMMENT_LINK'] = $coms->link($link); $tabledata[$i]['DISPLAY_COMMENTS'] = 1; if (in_template(array('VIDEO.COMMENT_LAST_USERID', 'VIDEO.COMMENT_LAST_NAME', 'VIDEO.COMMENT_LAST_TIME'), $parse)) { $tabledata[$i]['COMMENT_LAST_USERID'] = $coms->last_userid(); $tabledata[$i]['COMMENT_LAST_NAME'] = $coms->last_name(); $tabledata[$i]['COMMENT_LAST_TIME'] = $coms->last_time(); } } //Bewertungen if ($apx->is_module('ratings') && $set['videos']['ratings'] && $res['allowrating']) { require_once BASEDIR . getmodulepath('ratings') . 'class.ratings.php'; if (!isset($rate)) { $rate = new ratings('videos', $res['id']); } else { $rate->mid = $res['id']; } $tabledata[$i]['RATING'] = $rate->display(); $tabledata[$i]['RATING_VOTES'] = $rate->count(); $tabledata[$i]['DISPLAY_RATING'] = 1; } $laststamp = date('Y/m/d', $res['starttime'] - TIMEDIFF); } } $tmpl->assign('VIDEO', $tabledata); $tmpl->parse($template, 'videos'); }
function news_print($data, $template) { global $set, $db, $apx, $user; $tmpl = new tengine(); $apx->lang->drop('func', 'news'); //Verwendete Variablen auslesen $parse = $apx->tmpl->used_vars($template, 'news'); //Kategorien auslesen if (in_array('NEWS.CATID', $parse) || in_array('NEWS.CATTITLE', $parse) || in_array('NEWS.CATICON', $parse) || in_array('NEWS.CATLINK', $parse)) { $catinfo = news_catinfo(get_ids($data, 'catid')); } if (count($data)) { foreach ($data as $res) { ++$i; //Link $link = mklink('news.php?id=' . $res['id'], 'news,id' . $res['id'] . urlformat($res['title']) . '.html'); //Newspic if (in_array('NEWS.PICTURE', $parse) || in_array('NEWS.PICTURE_POPUP', $parse) || in_array('NEWS.PICTURE_POPUPPATH', $parse)) { list($picture, $picture_popup, $picture_popuppath) = news_newspic($res['newspic']); } //Username + eMail if ($res['userid']) { $username = $res['username']; $email = iif(!$res['pub_hidemail'], $res['email']); } else { $username = $res['send_username']; $email = $res['send_email']; } //Datehead if ($laststamp != date('Y/m/d', $res['starttime'] - TIMEDIFF)) { $tabledata[$i]['DATEHEAD'] = $res['starttime']; } //Links if (in_array('NEWS.RELATED', $parse)) { $tabledata[$i]['RELATED'] = news_links($res['links']); } //Text $text = ''; if (in_array('NEWS.TEXT', $parse)) { $text = mediamanager_inline($res['text']); if ($apx->is_module('glossar')) { $text = glossar_highlight($text); } } //Teaser $teaser = ''; if (in_array('NEWS.TEASER', $parse) && $set['news']['teaser']) { $teaser = mediamanager_inline($res['teaser']); if ($apx->is_module('glossar')) { $teaser = glossar_highlight($teaser); } } //Tags if (in_array('NEWS.TAG', $parse) || in_array('NEWS.TAG_IDS', $parse) || in_array('NEWS.KEYWORDS', $parse)) { list($tagdata, $tagids, $keywords) = news_tags($res['id']); } $tabledata[$i]['ID'] = $res['id']; $tabledata[$i]['SECID'] = $res['secid']; $tabledata[$i]['TITLE'] = $res['title']; $tabledata[$i]['SUBTITLE'] = $res['subtitle']; $tabledata[$i]['LINK'] = $link; $tabledata[$i]['TEASER'] = $teaser; $tabledata[$i]['TEXT'] = $text; $tabledata[$i]['TIME'] = $res['starttime']; $tabledata[$i]['PICTURE'] = $picture; $tabledata[$i]['PICTURE_POPUP'] = $picture_popup; $tabledata[$i]['PICTURE_POPUPPATH'] = $picture_popuppath; $tabledata[$i]['USERID'] = $res['userid']; $tabledata[$i]['USERNAME'] = replace($username); $tabledata[$i]['EMAIL'] = replace($email); $tabledata[$i]['EMAIL_ENCRYPTED'] = replace(cryptMail($email)); $tabledata[$i]['HITS'] = number_format($res['hits'], 0, '', '.'); $tabledata[$i]['TOP'] = $res['top']; $tabledata[$i]['RESTRICTED'] = $res['restricted']; //Tags $tabledata[$i]['TAG'] = $tagdata; $tabledata[$i]['TAG_IDS'] = $tagids; $tabledata[$i]['KEYWORDS'] = $keywords; //Kategorie $tabledata[$i]['CATID'] = $res['catid']; $tabledata[$i]['CATTITLE'] = $catinfo[$res['catid']]['title']; $tabledata[$i]['CATICON'] = $catinfo[$res['catid']]['icon']; $tabledata[$i]['CATLINK'] = $catinfo[$res['catid']]['link']; //Produkt $tabledata[$i]['PRODUCT_ID'] = $res['prodid']; //Galerie if ($apx->is_module('gallery') && $res['galid']) { $galinfo = gallery_info($res['galid']); $tabledata[$i]['GALLERY_ID'] = $galinfo['id']; $tabledata[$i]['GALLERY_TITLE'] = $galinfo['title']; $tabledata[$i]['GALLERY_LINK'] = mklink('gallery.php?id=' . $galinfo['id'], 'gallery,list' . $galinfo['id'] . ',1' . urlformat($galinfo['title']) . '.html'); } //Kommentare if ($apx->is_module('comments') && $set['news']['coms'] && $res['allowcoms']) { require_once BASEDIR . getmodulepath('comments') . 'class.comments.php'; if (!isset($coms)) { $coms = new comments('news', $res['id']); } else { $coms->mid = $res['id']; } $link = mklink('news.php?id=' . $res['id'], 'news,id' . $res['id'] . urlformat($res['title']) . '.html'); $tabledata[$i]['COMMENT_COUNT'] = $coms->count(); $tabledata[$i]['COMMENT_LINK'] = $coms->link($link); $tabledata[$i]['DISPLAY_COMMENTS'] = 1; if (in_template(array('NEWS.COMMENT_LAST_USERID', 'NEWS.COMMENT_LAST_NAME', 'NEWS.COMMENT_LAST_TIME'), $parse)) { $tabledata[$i]['COMMENT_LAST_USERID'] = $coms->last_userid(); $tabledata[$i]['COMMENT_LAST_NAME'] = $coms->last_name(); $tabledata[$i]['COMMENT_LAST_TIME'] = $coms->last_time(); } } //Bewertungen if ($apx->is_module('ratings') && $set['news']['ratings'] && $res['allowrating']) { require_once BASEDIR . getmodulepath('ratings') . 'class.ratings.php'; if (!isset($rate)) { $rate = new ratings('news', $res['id']); } else { $rate->mid = $res['id']; } $tabledata[$i]['RATING'] = $rate->display(); $tabledata[$i]['RATING_VOTES'] = $rate->count(); $tabledata[$i]['DISPLAY_RATING'] = 1; } $laststamp = date('Y/m/d', $res['starttime'] - TIMEDIFF); } } $tmpl->assign('NEWS', $tabledata); $tmpl->parse($template, 'news'); }
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'); }
$pre['POSTS'] = number_format($res['posts'] - 1, 0, '', '.'); $pre['VIEWS'] = number_format($res['views'], 0, '', '.'); $pre['HOT'] = iif($res['posts'] >= $set['forum']['hot_posts'] || $res['views'] >= $set['forum']['hot_views'], 1, 0); $pre['MOVED'] = $res['moved']; $pre['NEWPOSTS'] = iif($res['lastposttime'] && $res['lastposttime'] > $lastview, 1, 0); $pre['CLOSED'] = !$res['open']; $pre['DELETED'] = $res['del']; //Bewertungen if ($apx->is_module('ratings') && $set['forum']['ratings']) { require_once BASEDIR . getmodulepath('ratings') . 'class.ratings.php'; if (!isset($rate)) { $rate = new ratings('forum', $res['threadid']); } else { $rate->mid = $res['threadid']; } $pre['RATING'] = $rate->display(); $pre['RATING_VOTES'] = $rate->count(); $pre['DISPLAY_RATING'] = 1; } if ($res['sticky'] && !$res['del']) { $pinneddata[] = $pre; } else { $threaddata[] = $pre; } } } //Sortieren nach... ordervars($orderdef, mkrellink('forum.php?id=' . $foruminfo['forumid'], 'forum,' . $foruminfo['forumid'] . ',1' . urlformat($foruminfo['title']) . '.html')); //Moderatoren if (count($foruminfo['moderator'])) { $data = $db->fetch("SELECT userid,username FROM " . PRE . "_user WHERE userid IN (" . implode(',', $foruminfo['moderator']) . ") ORDER BY username ASC");
function glossar_print($data, $template, $alphabetical = false) { global $set, $db, $apx, $user; $tmpl = new tengine(); $apx->lang->drop('func', 'glossar'); //Verwendete Variablen auslesen $parse = $apx->tmpl->used_vars($template, 'glossar'); //Kategorien auslesen & Info vorbereiten if (in_array('INDEX.CATID', $parse) || in_array('INDEX.CATTITLE', $parse) || in_array('INDEX.CATTEXT', $parse) || in_array('INDEX.CATICON', $parse)) { $catids = get_ids($data, 'catid'); if (count($catids)) { $catdata = $db->fetch("SELECT * FROM " . PRE . "_glossar_cat WHERE id IN (" . implode(',', $catids) . ")"); foreach ($catdata as $res) { $catinfo[$res['id']] = $res; $catinfo[$res['id']]['link'] = mklink('glossar.php?catid=' . $res['id'], 'glossar,' . $res['id'] . ',0,1' . urlformat($res['title']) . '.html'); } } } //Begriffe auflisten if (count($data)) { //Nach Buchstaben sortieren $letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ#'; for ($i = 0; $i < strlen($letters); $i++) { $index[$letters[$i]] = array(); } if ($alphabetical) { foreach ($data as $res) { $letter = glossar_letter($res['title']); $index[$letter][] = $res; } } else { foreach ($data as $res) { $index[0][] = $res; } } //Index erstellen foreach ($index as $letter => $data) { //Link: Nur Begriffe mit diesem Buchstaben $letterlink = mklink('glossar.php?catid=' . $_REQUEST['catid'] . '&letter=' . iif($letter == '#', 'spchar', strtolower($letter)), 'glossar,' . $_REQUEST['catid'] . ',' . iif($letter == '#', 'spchar', strtolower($letter)) . ',1' . urlformat($catinfo['title']) . '.html'); foreach ($data as $res) { ++$i; //Link $link = mklink('glossar.php?id=' . $res['id'], 'glossar,id' . $res['id'] . urlformat($res['title']) . '.html'); //Tags if (in_array('INDEX.TAG', $parse) || in_array('INDEX.TAG_IDS', $parse) || in_array('INDEX.KEYWORDS', $parse)) { list($tagdata, $tagids, $keywords) = glossar_tags($res['id']); } $tabledata[$i]['LETTER'] = $letter; $tabledata[$i]['LETTERLINK'] = $letterlink; $tabledata[$i]['TITLE'] = $res['title']; $tabledata[$i]['TEXT'] = $res['text']; $tabledata[$i]['SPELLING'] = $res['spelling']; $tabledata[$i]['LINK'] = $link; $tabledata[$i]['TIME'] = $res['starttime']; $tabledata[$i]['HITS'] = number_format($res['hits'], 0, '', '.'); //Tags $tabledata[$i]['TAG'] = $tagdata; $tabledata[$i]['TAG_IDS'] = $tagids; $tabledata[$i]['KEYWORDS'] = $keywords; $tabledata[$i]['CATID'] = $catinfo[$res['catid']]['id']; $tabledata[$i]['CATTITLE'] = $catinfo[$res['catid']]['title']; $tabledata[$i]['CATTEXT'] = $catinfo[$res['catid']]['text']; $tabledata[$i]['CATICON'] = $catinfo[$res['catid']]['icon']; $tabledata[$i]['CATLINK'] = $catinfo[$res['catid']]['link']; //Kommentare if ($apx->is_module('comments') && $set['glossar']['coms'] && $res['allowcoms']) { require_once BASEDIR . getmodulepath('comments') . 'class.comments.php'; if (!isset($coms)) { $coms = new comments('glossar', $res['id']); } else { $coms->mid = $res['id']; } $link = mklink('glossar.php?id=' . $res['id'], 'glossar,id' . $res['id'] . urlformat($res['title']) . '.html'); $tabledata[$i]['COMMENT_COUNT'] = $coms->count(); $tabledata[$i]['COMMENT_LINK'] = $coms->link($link); $tabledata[$i]['DISPLAY_COMMENTS'] = 1; if (in_template(array('INDEX.COMMENT_LAST_USERID', 'INDEX.COMMENT_LAST_NAME', 'INDEX.COMMENT_LAST_TIME'), $parse)) { $tabledata[$i]['COMMENT_LAST_USERID'] = $coms->last_userid(); $tabledata[$i]['COMMENT_LAST_NAME'] = $coms->last_name(); $tabledata[$i]['COMMENT_LAST_TIME'] = $coms->last_time(); } } //Bewertungen if ($apx->is_module('ratings') && $set['glossar']['ratings'] && $res['allowrating']) { require_once BASEDIR . getmodulepath('ratings') . 'class.ratings.php'; if (!isset($rate)) { $rate = new ratings('glossar', $res['id']); } else { $rate->mid = $res['id']; } $tabledata[$i]['RATING'] = $rate->display(); $tabledata[$i]['RATING_VOTES'] = $rate->count(); $tabledata[$i]['DISPLAY_RATING'] = 1; } } } } $tmpl->assign('INDEX', $tabledata); $tmpl->parse($template, 'glossar'); }
function articles_print($data, $template, $bestreviews = false) { global $set, $db, $apx, $user; $tmpl = new tengine(); $apx->lang->drop('global', 'articles'); //Verwendete Variablen auslesen $parse = $apx->tmpl->used_vars($template, 'articles'); //Datensatz erweitern durch Preview/Review-Daten, nur wenn keine Reviewbestenliste if (!$bestreviews) { $data = articles_extend_data($data, $parse); } //Kategorien auslesen if (in_array('ARTICLE.CATID', $parse) || in_array('ARTICLE.CATTITLE', $parse) || in_array('ARTICLE.CATICON', $parse) || in_array('ARTICLE.CATLINK', $parse)) { $catinfo = articles_catinfo(get_ids($data, 'catid')); } if (count($data)) { foreach ($data as $res) { ++$i; //Wohin soll verlinkt werden? if ($res['type'] == 'normal') { $link2file = 'articles'; } else { $link2file = $res['type'] . 's'; } //Link $link = mklink($link2file . '.php?id=' . $res['id'], $link2file . ',id' . $res['id'] . ',0' . urlformat($res['title']) . '.html'); //Artikelpic if (in_array('ARTICLE.PICTURE', $parse) || in_array('ARTICLE.PICTURE_POPUP', $parse) || in_array('ARTICLE.PICTURE_POPUPPATH', $parse)) { list($picture, $picture_popup, $picture_popuppath) = articles_artpic($res['artpic']); } //Artikeltext if (in_array('ARTICLE.TEXT', $parse)) { list($page1text) = $db->first("SELECT text FROM " . PRE . "_articles_pages WHERE artid='" . $res['id'] . "' ORDER BY ord ASC LIMIT 1"); $page1text = mediamanager_inline($page1text); if ($apx->is_module('glossar')) { $page1text = glossar_highlight($page1text); } } //Datehead if ($laststamp != date('Y/m/d', $res['starttime'] - TIMEDIFF)) { $tabledata[$i]['DATEHEAD'] = $res['starttime']; } //Links if (in_array('ARTICLE.RELATED', $parse)) { $tabledata[$i]['RELATED'] = articles_links($res['links']); } //Bilderserie if (in_array('ARTICLE.PICSERIES', $parse)) { $tabledata[$i]['PICSERIES'] = articles_picseries($res['pictures'], $res['id'], $link2file); } //Teaser $teaser = ''; if (in_array('ARTICLE.TEASER', $parse)) { $teaser = mediamanager_inline($res['teaser']); if ($apx->is_module('glossar')) { $teaser = glossar_highlight($teaser); } } //Tags if (in_array('ARTICLE.TAG', $parse) || in_array('ARTICLE.TAG_IDS', $parse) || in_array('ARTICLE.KEYWORDS', $parse)) { list($tagdata, $tagids, $keywords) = articles_tags($res['id']); } //Index $pageIndex = array(); if (in_array('ARTICLE.INDEX', $parse)) { $pageIndex = articles_index($res['id'], $res['title'], $link2file); } $tabledata[$i]['ID'] = $res['id']; $tabledata[$i]['SECID'] = $res['secid']; $tabledata[$i]['TYPE'] = $res['type']; $tabledata[$i]['TITLE'] = $res['title']; $tabledata[$i]['SUBTITLE'] = $res['subtitle']; $tabledata[$i]['TEASER'] = $teaser; $tabledata[$i]['TEXT'] = $page1text; $tabledata[$i]['LINK'] = $link; $tabledata[$i]['TIME'] = $res['starttime']; $tabledata[$i]['INDEX'] = $pageIndex; $tabledata[$i]['PICTURE'] = $picture; $tabledata[$i]['PICTURE_POPUP'] = $picture_popup; $tabledata[$i]['PICTURE_POPUPPATH'] = $picture_popuppath; $tabledata[$i]['USERID'] = $res['userid']; $tabledata[$i]['USERNAME'] = replace($res['username']); $tabledata[$i]['EMAIL'] = replace(iif(!$res['pub_hidemail'], $res['email'])); $tabledata[$i]['EMAIL_ENCRYPTED'] = replace(iif(!$res['pub_hidemail'], cryptMail($res['email']))); $tabledata[$i]['HITS'] = number_format($res['hits'], 0, '', '.'); $tabledata[$i]['TOP'] = $res['top']; $tabledata[$i]['RESTRICTED'] = $res['restricted']; //Tags $tabledata[$i]['TAG'] = $tagdata; $tabledata[$i]['TAG_IDS'] = $tagids; $tabledata[$i]['KEYWORDS'] = $keywords; //Kategorie $tabledata[$i]['CATID'] = $res['catid']; $tabledata[$i]['CATTITLE'] = $catinfo[$res['catid']]['title']; $tabledata[$i]['CATICON'] = $catinfo[$res['catid']]['icon']; $tabledata[$i]['CATLINK'] = $catinfo[$res['catid']]['link']; //Produkt $tabledata[$i]['PRODUCT_ID'] = $res['prodid']; //Zusätzliche Felder: PREVIEWS if ($res['type'] == 'preview') { for ($ii = 1; $ii <= 10; $ii++) { if (!$set['articles']['custom_preview'][$ii - 1]) { continue; } $tabledata[$i]['CUSTOM' . $ii . '_TITLE'] = $set['articles']['custom_preview'][$ii - 1]; $tabledata[$i]['CUSTOM' . $ii] = $res['custom' . $ii]; } $tabledata[$i]['IMPRESSION'] = $res['impression']; } elseif ($res['type'] == 'review') { for ($ii = 1; $ii <= 10; $ii++) { if (!$set['articles']['custom_review'][$ii - 1]) { continue; } $tabledata[$i]['CUSTOM' . $ii . '_TITLE'] = $set['articles']['custom_review'][$ii - 1]; $tabledata[$i]['CUSTOM' . $ii] = $res['custom' . $ii]; } $tabledata[$i]['FINAL_RATING'] = $res['final_rate']; $tabledata[$i]['POSITIVE'] = $res['positive']; $tabledata[$i]['NEGATIVE'] = $res['negative']; $tabledata[$i]['AWARD'] = $res['award']; } //Galerie if ($apx->is_module('gallery') && $res['galid']) { $galinfo = gallery_info($res['galid']); $tabledata[$i]['GALLERY_ID'] = $galinfo['id']; $tabledata[$i]['GALLERY_TITLE'] = $galinfo['title']; $tabledata[$i]['GALLERY_LINK'] = mklink('gallery.php?id=' . $galinfo['id'], 'gallery,list' . $galinfo['id'] . ',1' . urlformat($galinfo['title']) . '.html'); } //Kommentare if ($apx->is_module('comments') && $set['articles']['coms'] && $res['allowcoms']) { require_once BASEDIR . getmodulepath('comments') . 'class.comments.php'; if (!isset($coms)) { $coms = new comments('articles', $res['id']); } else { $coms->mid = $res['id']; } $link = mklink($link2file . '.php?id=' . $res['id'], $link2file . ',id' . $res['id'] . ',1' . urlformat($res['title']) . '.html'); $tabledata[$i]['COMMENT_COUNT'] = $coms->count(); $tabledata[$i]['COMMENT_LINK'] = $coms->link($link); $tabledata[$i]['DISPLAY_COMMENTS'] = 1; if (in_template(array('ARTICLE.COMMENT_LAST_USERID', 'ARTICLE.COMMENT_LAST_NAME', 'ARTICLE.COMMENT_LAST_TIME'), $parse)) { $tabledata[$i]['COMMENT_LAST_USERID'] = $coms->last_userid(); $tabledata[$i]['COMMENT_LAST_NAME'] = $coms->last_name(); $tabledata[$i]['COMMENT_LAST_TIME'] = $coms->last_time(); } } //Bewertungen if ($apx->is_module('ratings') && $set['articles']['ratings'] && $res['allowrating']) { require_once BASEDIR . getmodulepath('ratings') . 'class.ratings.php'; if (!isset($rate)) { $rate = new ratings('articles', $res['id']); } else { $rate->mid = $res['id']; } $tabledata[$i]['RATING'] = $rate->display(); $tabledata[$i]['RATING_VOTES'] = $rate->count(); $tabledata[$i]['DISPLAY_RATING'] = 1; } $laststamp = date('Y/m/d', $res['starttime'] - TIMEDIFF); } } $tmpl->assign('ARTICLE', $tabledata); $tmpl->parse($template, 'articles'); }
$threaddata[$i]['VIEWS'] = $res['views']; $threaddata[$i]['NEWPOSTS'] = iif($res['lastposttime'] && $res['lastposttime'] > $lastview, 1, 0); $threaddata[$i]['CLOSED'] = !$res['open']; //Forum $threaddata[$i]['FORUM_ID'] = $res['forumid']; $threaddata[$i]['FORUM_TITLE'] = replace($foruminfo[$res['forumid']]['title']); $threaddata[$i]['FORUM_LINK'] = $foruminfo[$res['forumid']]['link']; //Bewertungen if ($apx->is_module('ratings') && $set['forum']['ratings']) { require_once BASEDIR . getmodulepath('ratings') . 'class.ratings.php'; if (!isset($rate)) { $rate = new ratings('forum', $res['threadid']); } else { $rate->mid = $res['threadid']; } $threaddata[$i]['RATING'] = $rate->display(); $threaddata[$i]['RATING_VOTES'] = $rate->count(); $threaddata[$i]['DISPLAY_RATING'] = 1; } } } //Sortieren nach... ordervars($orderdef, 'search.php?search=' . $search['id'] . '&hash=' . $_REQUEST['hash']); //Hot-Parameter in Sprachplatzhalter $langvar = strtr($apx->lang->get('HOTTHREAD'), array('{HOT_POSTS}' => $set['forum']['hot_posts'], '{HOT_VIEWS}' => $set['forum']['hot_views'])); $apx->lang->langpack['HOTTHREAD'] = $langvar; $apx->tmpl->assign('HOT_POSTS', $set['forum']['hot_posts']); $apx->tmpl->assign('HOT_VIEWS', $set['forum']['hot_views']); $apx->tmpl->assign('IGNORED', implode(', ', $ignored)); $apx->tmpl->assign('SEARCHTIME', round($search['time'], 2)); $apx->tmpl->assign('THREAD', $threaddata);