当前位置: 首页>>代码示例>>PHP>>正文


PHP comments::count方法代码示例

本文整理汇总了PHP中comments::count方法的典型用法代码示例。如果您正苦于以下问题:PHP comments::count方法的具体用法?PHP comments::count怎么用?PHP comments::count使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在comments的用法示例。


在下文中一共展示了comments::count方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: products_print

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');
//.........这里部分代码省略.........
开发者ID:bigfraggle,项目名称:open-apexx,代码行数:101,代码来源:tfunctions.php

示例2: getmodulepath

 $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'];
开发者ID:bigfraggle,项目名称:open-apexx,代码行数:31,代码来源:videos.php

示例3: calendar_print

function calendar_print($data, $template)
{
    global $set, $db, $apx, $user;
    $tmpl = new tengine();
    $parse = $tmpl->used_vars($template, 'calendar');
    //Kategorie-Info
    $catids = get_ids($data, 'catid');
    $catdata = array();
    if (count($catids)) {
        $catdata = $db->fetch_index("SELECT * FROM " . PRE . "_calendar_cat WHERE id IN (" . implode(',', $catids) . ")", 'id');
    }
    //Termine auflisten
    if (count($data)) {
        foreach ($data as $res) {
            ++$i;
            $event = array();
            //Kategorie-Info
            $catinfo = $catdata[$res['catid']];
            //Link zum Termin
            $link = mklink('events.php?id=' . $res['id'], 'events,id' . $res['id'] . urlformat($res['title']) . '.html');
            //Aufmacher
            $picture = $picture_popup = '';
            if (in_template(array('EVENT.PICTURE', 'EVENT.PICTURE_POPUP', 'EVENT.PICTURE_POPUPPATH'), $parse)) {
                list($picture, $picture_popup, $picture_popuppath) = calendar_pic($res['picture']);
            }
            //Start berechnen
            $startday = $starttime = $endday = $endtime = 0;
            if (in_template(array('EVENT.STARTDAY', 'EVENT.STARTTIME'), $parse)) {
                $startday = calendar_stamp2time($res['startday']);
                if ($res['starttime'] != -1) {
                    $time_comp = calendar_explode_stamp($res['startday']);
                    $tmpstamp = sprintf('%04d', $res['starttime']);
                    $time_comp['hour'] = substr($tmpstamp, 0, 2);
                    $time_comp['minute'] = substr($tmpstamp, 2, 2);
                    $starttime = mktime($time_comp['hour'], $time_comp['minute'], 0, $time_comp['month'], $time_comp['day'], $time_comp['year']) + TIMEDIFF;
                }
            }
            //Ende berechnen (falls nötig)
            if (in_template(array('EVENT.ENDDAY', 'EVENT.ENDTIME'), $parse)) {
                if ($res['endday'] != $res['startday'] || $res['endtime'] != -1) {
                    $endday = calendar_stamp2time($res['endday']);
                    if ($res['endtime'] != -1) {
                        $time_comp = calendar_explode_stamp($res['endday']);
                        $tmpstamp = sprintf('%04d', $res['endtime']);
                        $time_comp['hour'] = substr($tmpstamp, 0, 2);
                        $time_comp['minute'] = substr($tmpstamp, 2, 2);
                        $endtime = mktime($time_comp['hour'], $time_comp['minute'], 0, $time_comp['month'], $time_comp['day'], $time_comp['year']) + TIMEDIFF;
                    }
                }
            }
            //Username + eMail
            if ($res['userid']) {
                $username = $res['username'];
                $email = iif(!$res['pub_hidemail'], $res['email']);
            } else {
                $username = $res['send_username'];
                $email = $res['send_email'];
            }
            //Text
            $eventtext = '';
            if (in_array('EVENT.TEXT', $parse)) {
                $eventtext = mediamanager_inline($res['text']);
                if ($apx->is_module('glossar')) {
                    $eventtext = glossar_highlight($eventtext);
                }
            }
            //Datehead
            if ($laststamp != $res['startday']) {
                $event['DATEHEAD'] = $startday;
            }
            //Tags
            if (in_array('EVENT.TAG', $parse) || in_array('EVENT.TAG_IDS', $parse) || in_array('EVENT.KEYWORDS', $parse)) {
                list($tagdata, $tagids, $keywords) = calendar_tags($res['id']);
            }
            $event['ID'] = $res['id'];
            $event['TITLE'] = $res['title'];
            $event['TEXT'] = $eventtext;
            $event['LINK'] = $link;
            $event['LOCATION'] = compatible_hsc($res['location']);
            $event['LOCATION_LINK'] = compatible_hsc($res['location_link']);
            $event['PRIORITY'] = $res['priority'];
            $event['RESTRICTED'] = $res['restricted'];
            $event['PRIVATE'] = $res['private'];
            $event['HITS'] = $res['hits'];
            $event['RELATED'] = calendar_links($res['links']);
            $event['PICTURE'] = $picture;
            $event['PICTURE_POPUP'] = $picture_popup;
            $event['PICTURE_POPUPPATH'] = $picture_popuppath;
            $event['STARTDAY'] = $startday;
            $event['STARTTIME'] = $starttime;
            $event['ENDDAY'] = $endday;
            $event['ENDTIME'] = $endtime;
            $event['USERID'] = $res['userid'];
            $event['USERNAME'] = replace($username);
            $event['EMAIL'] = replace($email);
            $event['EMAIL_ENCRYPTED'] = replace(cryptMail($email));
            $event['CATID'] = $res['catid'];
            $event['CATTITLE'] = $catinfo['title'];
            $event['CATICON'] = $catinfo['icon'];
            //Tags
//.........这里部分代码省略.........
开发者ID:bigfraggle,项目名称:open-apexx,代码行数:101,代码来源:tfunctions.php

示例4: links_print

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)) {
//.........这里部分代码省略.........
开发者ID:bigfraggle,项目名称:open-apexx,代码行数:101,代码来源:tfunctions.php

示例5: downloads_print

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
//.........这里部分代码省略.........
开发者ID:bigfraggle,项目名称:open-apexx,代码行数:101,代码来源:tfunctions.php

示例6: videos_print

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);
//.........这里部分代码省略.........
开发者ID:bigfraggle,项目名称:open-apexx,代码行数:101,代码来源:tfunctions.php

示例7: news_print

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'];
                }
//.........这里部分代码省略.........
开发者ID:bigfraggle,项目名称:open-apexx,代码行数:101,代码来源:tfunctions.php

示例8: user_blogs_last

function user_blogs_last($count = 5, $start = 0, $friendsonly = false, $userid = 0, $template = 'lastblogs')
{
    global $set, $db, $apx, $user;
    $tmpl = new tengine();
    $count = (int) $count;
    $start = (int) $start;
    $userid = (int) $userid;
    //Verwendete Variablen auslesen
    $parse = $apx->tmpl->used_vars('functions/' . $template, 'user');
    //Nach Freunde filtern
    $friendfilter = '';
    if ($friendsonly) {
        $friends = $user->get_buddies();
        $friends[] = -1;
        $friendfilter = " AND userid IN (" . implode(',', $friends) . ") ";
    }
    //Nach Benutzer filtern
    $userfilter = '';
    if ($userid) {
        $userfilter = " AND userid='" . $userid . "'";
    }
    $data = $db->fetch("SELECT * FROM " . PRE . "_user_blog WHERE 1 " . $userfilter . $friendfilter . " ORDER BY time DESC LIMIT " . iif($start, $start . ',') . $count);
    if (count($data)) {
        //Benutzer-Infos auslesen
        $userdata = array();
        if (in_template(array('BLOG.USERNAME', 'BLOG.REALNAME', 'BLOG.AVATAR', 'BLOG.AVATER_TITLE'), $parse)) {
            $userids = get_ids($data, 'userid');
            $userdata = $user->get_info_multi($userids, 'username,realname,avatar,avatar_title');
        }
        //Blogs auflisten
        $tabledata = array();
        foreach ($data as $res) {
            ++$i;
            $link = mklink('user.php?action=blog&id=' . $res['userid'] . '&blogid=' . $res['id'], 'user,blog,' . $res['userid'] . ',id' . $res['id'] . urlformat($res['title']) . '.html');
            //Text
            $text = '';
            if (in_array('BLOG.TEXT', $parse)) {
                $text = $res['text'];
                $text = badwords($text);
                $text = replace($text, 1);
                $text = dbsmilies($text);
                $text = dbcodes($text);
            }
            $tabledata[$i]['ID'] = $res['id'];
            $tabledata[$i]['TITLE'] = replace($res['title']);
            $tabledata[$i]['TEXT'] = $res['text'];
            $tabledata[$i]['LINK'] = $link;
            $tabledata[$i]['TIME'] = $res['time'];
            //Userinfo
            $userinfo = $userdata[$res['userid']];
            $tabledata[$i]['USERID'] = $res['userid'];
            $tabledata[$i]['USERNAME'] = replace($userinfo['username']);
            $tabledata[$i]['REALNAME'] = replace($userinfo['realname']);
            $tabledata[$i]['AVATAR'] = $user->mkavatar($userinfo);
            $tabledata[$i]['AVATAR_TITLE'] = $user->mkavtitle($userinfo);
            //Kommentare
            if ($apx->is_module('comments') && $res['allowcoms']) {
                require_once BASEDIR . getmodulepath('comments') . 'class.comments.php';
                if (!isset($coms)) {
                    $coms = new comments('userblog', $res['id']);
                } else {
                    $coms->mid = $res['id'];
                }
                $link = mklink('user.php?action=blog&id=' . $res['userid'] . '&blogid=' . $res['id'], 'user,blog,' . $res['userid'] . ',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('BLOG.COMMENT_LAST_USERID', 'BLOG.COMMENT_LAST_NAME', 'BLOG.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();
                }
            }
        }
    }
    $tmpl->assign('BLOG', $tabledata);
    //Template ausgeben
    $tmpl->parse('functions/' . $template, 'user');
}
开发者ID:bigfraggle,项目名称:open-apexx,代码行数:79,代码来源:tfunctions.php

示例9: gallery_printsingle

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');
}
开发者ID:bigfraggle,项目名称:open-apexx,代码行数:72,代码来源:tfunctions.php

示例10: glossar_print

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'] . '&amp;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');
}
开发者ID:bigfraggle,项目名称:open-apexx,代码行数:100,代码来源:tfunctions.php

示例11: poll_similar

function poll_similar($tagids = array(), $count = 5, $start = 0, $template = 'similar')
{
    global $set, $db, $apx, $user;
    $count = (int) $count;
    $start = (int) $start;
    $tmpl = new tengine();
    //Verwendete Variablen auslesen
    $parse = $apx->tmpl->used_vars('functions/' . $template, 'poll');
    if (!is_array($tagids)) {
        $tagids = getTagIds(strval($tagids));
    }
    $ids = poll_search_tags($tagids);
    $ids[] = -1;
    $tagfilter = " AND id IN (" . implode(', ', $ids) . ") ";
    $data = $db->fetch("SELECT id,question,addtime,starttime,days,allowcoms FROM " . PRE . "_poll WHERE ( '" . time() . "' BETWEEN starttime AND endtime " . $tagfilter . " " . section_filter() . " ) ORDER BY starttime DESC LIMIT " . $count);
    if (count($data)) {
        foreach ($data as $res) {
            ++$i;
            //Tags
            if (in_array('POLL.TAG', $parse) || in_array('POLL.TAG_IDS', $parse) || in_array('POLL.KEYWORDS', $parse)) {
                list($tagdata, $tagids, $keywords) = poll_tags($res['id']);
            }
            $tabledata[$i]['QUESTION'] = $res['question'];
            $tabledata[$i]['ID'] = $res['id'];
            $tabledata[$i]['STARTTIME'] = $res['starttime'];
            $tabledata[$i]['ENDTIME'] = $res['starttime'] + $res['days'] * 24 * 3600;
            //Tags
            $tabledata[$i]['TAG'] = $tagdata;
            $tabledata[$i]['TAG_IDS'] = $tagids;
            $tabledata[$i]['KEYWORDS'] = $keywords;
            $tabledata[$i]['LINK'] = mklink('poll.php?id=' . $res['id'], 'poll,' . $res['id'] . urlformat($res['question']) . '.html');
            //Kommentare
            if ($apx->is_module('comments') && $set['poll']['coms'] && $res['allowcoms']) {
                require_once BASEDIR . getmodulepath('comments') . 'class.comments.php';
                if (!isset($coms)) {
                    $coms = new comments('poll', $res['id']);
                } else {
                    $coms->mid = $res['id'];
                }
                $link = mklink('poll.php?id=' . $res['id'], 'poll,' . $res['id'] . urlformat($res['question']) . '.html');
                $tabledata[$i]['COMMENT_COUNT'] = $coms->count();
                $tabledata[$i]['COMMENT_LINK'] = $coms->link($link);
                $tabledata[$i]['DISPLAY_COMMENTS'] = 1;
                if (in_template(array('POLL.COMMENT_LAST_USERID', 'POLL.COMMENT_LAST_NAME', 'POLL.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();
                }
            }
        }
    }
    $tmpl->assign('POLL', $tabledata);
    $tmpl->parse('functions/' . $template, 'poll');
}
开发者ID:bigfraggle,项目名称:open-apexx,代码行数:54,代码来源:tfunctions.php

示例12: articles_print

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') {
//.........这里部分代码省略.........
开发者ID:bigfraggle,项目名称:open-apexx,代码行数:101,代码来源:tfunctions.php


注:本文中的comments::count方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。