Beispiel #1
0
function mediamanager_inline_code($ids)
{
    global $set, $db, $apx;
    $tmpl = new tengine();
    $data = $db->fetch("SELECT id,picture,popup,text,align FROM " . PRE . "_inlinescreens WHERE id IN (" . implode(',', $ids) . ")");
    if (!count($data)) {
        array();
    }
    //Codes generieren
    ob_start();
    $code = array();
    foreach ($data as $res) {
        if ($res['popup']) {
            $size = getimagesize(BASEDIR . getpath('uploads') . $res['popup']);
            $tmpl->assign('POPUP', "javascript:popuppic('misc.php?action=picture&pic=" . $res['popup'] . "','" . $size[0] . "','" . $size[1] . "',0);");
        }
        $tmpl->assign('ID', $res['id']);
        $tmpl->assign('PICTURE', HTTPDIR . getpath('uploads') . $res['picture']);
        $tmpl->assign('FULLSIZE', HTTPDIR . getpath('uploads') . $res['popup']);
        $tmpl->assign('TEXT', $res['text']);
        $tmpl->assign('ALIGN', $res['align']);
        $tmpl->parse('inlinepic', 'main');
        $imagecode = ob_get_contents();
        ob_clean();
        $code[$res['id']] = $imagecode;
    }
    ob_end_clean();
    //Replacement
    $replace = array();
    foreach ($ids as $id) {
        $replace['{IMAGE(' . $id . ')}'] = $code[intval($id)];
    }
    return $replace;
}
Beispiel #2
0
function comments_stats($template = 'stats')
{
    global $set, $db, $apx, $user;
    $tmpl = new tengine();
    $parse = $tmpl->used_vars('functions/' . $template, 'comments');
    $apx->lang->drop('func_stats', 'comments');
    if (in_array('COUNT_COMMENTS', $parse)) {
        list($count) = $db->first("\n\t\t\tSELECT count(id) FROM " . PRE . "_comments\n\t\t\tWHERE active=1\n\t\t");
        $tmpl->assign('COUNT_COMMENTS', $count);
    }
    $tmpl->parse('functions/' . $template, 'comments');
}
Beispiel #3
0
function faq_stats($template = 'stats')
{
    global $set, $db, $apx, $user;
    $tmpl = new tengine();
    $parse = $tmpl->used_vars('functions/' . $template, 'faq');
    $apx->lang->drop('func_stats', 'faq');
    if (in_template(array('COUNT_ARTICLES', 'AVG_HITS'), $parse)) {
        list($count, $hits) = $db->first("\n\t\t\tSELECT count(id), avg(hits) FROM " . PRE . "_faq\n\t\t\tWHERE starttime!=0\n\t\t");
        $tmpl->assign('COUNT_FAQ', $count);
        $tmpl->assign('AVG_HITS', round($hits));
    }
    $tmpl->parse('functions/' . $template, 'faq');
}
Beispiel #4
0
function content_stats($template = 'stats')
{
    global $set, $db, $apx, $user;
    $tmpl = new tengine();
    $parse = $tmpl->used_vars('functions/' . $template, 'content');
    $apx->lang->drop('func_stats', 'content');
    if (in_template(array('COUNT', 'AVG_HITS'), $parse)) {
        list($count, $hits) = $db->first("\n\t\t\tSELECT count(id), avg(hits) FROM " . PRE . "_content\n\t\t\tWHERE active=1\n\t\t");
        $tmpl->assign('COUNT', $count);
        $tmpl->assign('AVG_HITS', round($hits));
    }
    $tmpl->parse('functions/' . $template, 'content');
}
Beispiel #5
0
function teaser_show($count = 0, $start = 0, $group = 0, $template = 'teaser')
{
    global $set, $db, $apx;
    $count = (int) $count;
    $start = (int) $start;
    $group = (int) $group;
    $tmpl = new tengine();
    $groupfilter = '';
    if ($group) {
        $groupfilter = " AND `group`='" . $group . "'";
    }
    if ($set['teaser']['orderby'] == 1) {
        $data = $db->fetch("SELECT id,title,text,link,image,hits FROM " . PRE . "_teaser WHERE '" . time() . "' BETWEEN starttime AND endtime " . $groupfilter . section_filter() . " ORDER BY ord ASC" . iif($count, " LIMIT " . iif($start, $start . ',') . $count));
    } elseif ($set['teaser']['orderby'] == 2) {
        $data = $db->fetch("SELECT id,title,text,link,image,hits FROM " . PRE . "_teaser WHERE '" . time() . "' BETWEEN starttime AND endtime " . $groupfilter . section_filter() . " ORDER BY addtime DESC" . iif($count, " LIMIT " . iif($start, $start . ',') . $count));
    } else {
        $data = $db->fetch("SELECT id,title,text,link,image,hits FROM " . PRE . "_teaser WHERE '" . time() . "' BETWEEN starttime AND endtime" . $groupfilter . section_filter());
        if (count($data)) {
            srand((double) microtime() * 1000000);
            shuffle($data);
            if ($count) {
                foreach ($data as $res) {
                    ++$ii;
                    $newdata[] = $res;
                    if ($ii == $count) {
                        break;
                    }
                }
                $data = $newdata;
                unset($newdata);
            }
        }
    }
    if (count($data)) {
        $apx->lang->drop('teaser', 'teaser');
        foreach ($data as $res) {
            ++$i;
            $affdata[$i]['TITLE'] = $res['title'];
            $affdata[$i]['TEXT'] = $res['text'];
            $affdata[$i]['URL'] = $res['link'];
            $affdata[$i]['IMAGE'] = iif($res['image'], HTTPDIR . getpath('uploads') . $res['image']);
            $affdata[$i]['HITS'] = number_format($res['hits'], 0, '', '.');
            $affdata[$i]['LINK'] = HTTPDIR . 'misc.php?action=teaserlink&id=' . $res['id'];
        }
    }
    $tmpl->assign('TEASER', $affdata);
    $tmpl->parse($template, 'teaser');
}
Beispiel #6
0
function affiliates_show($count = 0, $start = 0, $template = 'affiliates')
{
    global $set, $db, $apx;
    $count = (int) $count;
    $start = (int) $start;
    $tmpl = new tengine();
    if ($set['affiliates']['orderby'] == 1) {
        $data = $db->fetch("SELECT id,title,image,link,hits FROM " . PRE . "_affiliates WHERE active='1' ORDER BY ord ASC" . iif($count, " LIMIT " . iif($start, $start . ',') . $count));
    } elseif ($set['affiliates']['orderby'] == 2) {
        $data = $db->fetch("SELECT id,title,image,link,hits FROM " . PRE . "_affiliates WHERE active='1' ORDER BY hits DESC" . iif($count, " LIMIT " . iif($start, $start . ',') . $count));
    } elseif ($set['affiliates']['orderby'] == 3) {
        $data = $db->fetch("SELECT id,title,image,link,hits FROM " . PRE . "_affiliates WHERE active='1' ORDER BY hits ASC" . iif($count, " LIMIT " . iif($start, $start . ',') . $count));
    } else {
        $data = $db->fetch("SELECT id,title,image,hits FROM " . PRE . "_affiliates WHERE active='1'");
        if (count($data)) {
            srand((double) microtime() * 1000000);
            shuffle($data);
            if ($count) {
                foreach ($data as $res) {
                    ++$ii;
                    $newdata[] = $res;
                    if ($ii == $count) {
                        break;
                    }
                }
                $data = $newdata;
                unset($newdata);
            }
        }
    }
    if (count($data)) {
        $apx->lang->drop('affiliates', 'affiliates');
        foreach ($data as $res) {
            ++$i;
            $affdata[$i]['TITLE'] = $res['title'];
            $affdata[$i]['IMAGE'] = iif($res['image'], getpath('uploads') . $res['image']);
            $affdata[$i]['HITS'] = number_format($res['hits'], 0, '', '.');
            $affdata[$i]['LINK'] = HTTPDIR . 'misc.php?action=afflink&id=' . $res['id'];
            $affdata[$i]['URL'] = $res['link'];
        }
    }
    $tmpl->assign('AFFILIATE', $affdata);
    $tmpl->parse($template, 'affiliates');
}
Beispiel #7
0
function newsletter_form()
{
    global $set, $db, $apx, $user;
    $tmpl = new tengine();
    $apx->lang->drop('form', 'newsletter');
    //Kategorien
    $catinfo = $set['newsletter']['categories'];
    if (!is_array($set['newsletter']['categories'])) {
        $set['newsletter']['categories'] = array();
    }
    asort($catinfo);
    foreach ($catinfo as $id => $name) {
        ++$i;
        $catdata[$i]['ID'] = $id;
        $catdata[$i]['TITLE'] = $name;
    }
    $tmpl->assign('CATEGORY', $catdata);
    $tmpl->parse('functions/form', 'newsletter');
}
Beispiel #8
0
function stats_counter()
{
    global $set, $db, $apx;
    $apx->lang->drop('counter', 'stats');
    $tmpl = new tengine();
    list($count_record, $record_time) = $db->first("SELECT sum(uniques) AS count,time FROM " . PRE . "_stats GROUP BY daystamp ORDER BY count DESC LIMIT 1");
    list($count_total, $hits_total) = $db->first("SELECT sum(uniques),sum(hits) FROM " . PRE . "_stats");
    list($count_today, $hits_today) = $db->first("SELECT sum(uniques),sum(hits) FROM " . PRE . "_stats WHERE daystamp='" . date('Ymd', time() - TIMEDIFF) . "'");
    list($count_yesterday, $hits_yesterday) = $db->first("SELECT sum(uniques),sum(hits) FROM " . PRE . "_stats WHERE daystamp='" . date('Ymd', time() - 24 * 3600 - TIMEDIFF) . "'");
    $count_total += $set['stats']['startcount'];
    $tmpl->assign('VISITS_RECORD', number_format($count_record, 0, '', '.'));
    $tmpl->assign('VISITS_RECORD_TIME', $record_time);
    $tmpl->assign('VISITS_TOTAL', number_format($count_total, 0, '', '.'));
    $tmpl->assign('VISITS_TODAY', number_format($count_today, 0, '', '.'));
    $tmpl->assign('VISITS_YESTERDAY', number_format($count_yesterday, 0, '', '.'));
    $tmpl->assign('HITS_TOTAL', number_format($hits_total, 0, '', '.'));
    $tmpl->assign('HITS_TODAY', number_format($hits_today, 0, '', '.'));
    $tmpl->assign('HITS_YESTERDAY', number_format($hits_yesterday, 0, '', '.'));
    $tmpl->parse('counter', 'stats');
}
Beispiel #9
0
function navi_breadcrumb($nid = 1, $template = 'breadcrumb')
{
    global $set, $db, $apx;
    $nid = (int) $nid;
    if (!$nid) {
        return;
    }
    $tmpl = new tengine();
    require_once BASEDIR . 'lib/class.recursivetree.php';
    $tree = new RecursiveTree(PRE . '_navi', 'id');
    $data = $tree->getTree(array('*'), null, "nid='" . $nid . "'");
    $selected = navi_get_selected($data);
    $selectedPath = null;
    $path = array();
    $selectedNodeLevel = 0;
    foreach ($data as $res) {
        if (in_array($res['id'], $selected)) {
            //Tiefere Pfadteile entfernen
            $dellevel = $res['level'];
            while (isset($path[$dellevel])) {
                unset($path[$dellevel]);
                ++$dellevel;
            }
            //Node zum Pfad hinzufügen
            $path[$res['level']] = $res;
            //Dieser Pfad ist länger als der bisherige längste
            if ($res['level'] > $selectedNodeLevel) {
                $selectedPath = $path;
                $selectedNodeLevel = $res['level'];
            }
        }
    }
    if (count($selectedPath)) {
        foreach ($selectedPath as $res) {
            ++$i;
            $tabledata[$i]['ID'] = $res['id'];
            $tabledata[$i]['LEVEL'] = $res['level'];
            $tabledata[$i]['CHILDREN'] = $res['children'];
            $tabledata[$i]['TEXT'] = $res['text'];
            $tabledata[$i]['LINK'] = $res['link'];
            $tabledata[$i]['POPUP'] = $res['link_popup'];
            $tabledata[$i]['CODE'] = $res['code'];
            $tabledata[$i]['SELECTED'] = true;
        }
    }
    $tmpl->assign('NAVI', $tabledata);
    $tmpl->parse($template, 'navi');
}
Beispiel #10
0
function downloads_stats($template = 'stats')
{
    global $set, $db, $apx, $user;
    $tmpl = new tengine();
    $parse = $tmpl->used_vars('functions/' . $template, 'downloads');
    $apx->lang->drop('func_stats', 'downloads');
    if (in_array('COUNT_CATEGORIES', $parse)) {
        list($count) = $db->first("SELECT count(id) FROM " . PRE . "_downloads_cat");
        $tmpl->assign('COUNT_CATEGORIES', $count);
    }
    if (in_template(array('COUNT_DOWNLOADS', 'AVG_HITS'), $parse)) {
        list($count, $hits) = $db->first("\n\t\t\tSELECT count(id), avg(hits) FROM " . PRE . "_downloads\n\t\t\tWHERE " . time() . " BETWEEN starttime AND endtime\n\t\t");
        $tmpl->assign('COUNT_DOWNLOADS', $count);
        $tmpl->assign('AVG_HITS', round($hits));
    }
    $tmpl->parse('functions/' . $template, 'downloads');
}
Beispiel #11
0
function forum_stats($template = 'stats')
{
    global $set, $db, $apx, $user;
    $tmpl = new tengine();
    $parse = $tmpl->used_vars('functions/' . $template, 'forum');
    $apx->lang->drop('func_stats', 'forum');
    if (in_array('COUNT_POSTS', $parse)) {
        list($count) = $db->first("SELECT count(postid) FROM " . PRE . "_forum_posts WHERE del=0");
        $tmpl->assign('COUNT_POSTS', $count);
    }
    if (in_template(array('COUNT_THREADS', 'AVG_HITS'), $parse)) {
        list($count, $hits) = $db->first("\n\t\t\tSELECT count(threadid), avg(views) FROM " . PRE . "_forum_threads\n\t\t\tWHERE del=0 AND moved=0\n\t\t");
        $tmpl->assign('COUNT_THREADS', $count);
        $tmpl->assign('AVG_HITS', round($hits));
    }
    $tmpl->parse('functions/' . $template, 'forum');
}
Beispiel #12
0
function vbthreads_threads_print($from, $data, $template)
{
    global $set, $db, $apx, $user;
    $tmpl = new tengine();
    $forumurl = $set['forum_url'];
    if (count($data)) {
        foreach ($data as $res) {
            ++$i;
            if ($from == 'new') {
                $link = $forumurl . 'showthread.php?t=' . $res['threadid'];
            } else {
                $link = $forumurl . 'showthread.php?goto=lastpost&t=' . $res['threadid'];
            }
            $tabledata[$i]['ID'] = $res['threadid'];
            $tabledata[$i]['TITLE'] = $res['title'];
            $tabledata[$i]['LINK'] = $link;
            $tabledata[$i]['TIME'] = $res['dateline'];
            $tabledata[$i]['STARTER'] = $res['postusername'];
            $tabledata[$i]['LASTPOST'] = $res['lastpost'];
            $tabledata[$i]['LASTPOSTER'] = $res['lastposter'];
            $tabledata[$i]['POSTS'] = $res['replycount'];
            $tabledata[$i]['VIEWS'] = $res['views'];
        }
    }
    $tmpl->assign('THREAD', $tabledata);
    $tmpl->parse($template, 'vbforum');
}
Beispiel #13
0
function articles_stats($template = 'stats')
{
    global $set, $db, $apx, $user;
    $tmpl = new tengine();
    $parse = $tmpl->used_vars('functions/' . $template, 'articles');
    $apx->lang->drop('func_stats', 'articles');
    if (in_array('COUNT_CATGEORIES', $parse)) {
        list($count) = $db->first("SELECT count(id) FROM " . PRE . "_articles_cat");
        $tmpl->assign('COUNT_CATGEORIES', $count);
    }
    if (in_template(array('COUNT_ARTICLES', 'AVG_HITS'), $parse)) {
        list($count, $hits) = $db->first("\n\t\t\tSELECT count(id), avg(hits) FROM " . PRE . "_articles\n\t\t\tWHERE " . time() . " BETWEEN starttime AND endtime\n\t\t");
        $tmpl->assign('COUNT_ARTICLES', $count);
        $tmpl->assign('AVG_HITS', round($hits));
    }
    if (in_array('COUNT_NORMAL', $parse)) {
        list($count) = $db->first("\n\t\t\tSELECT count(id), avg(hits) FROM " . PRE . "_articles\n\t\t\tWHERE " . time() . " BETWEEN starttime AND endtime AND type='normal'\n\t\t");
        $tmpl->assign('COUNT_NORMAL', $count);
    }
    if (in_array('COUNT_REVIEWS', $parse)) {
        list($count) = $db->first("\n\t\t\tSELECT count(id), avg(hits) FROM " . PRE . "_articles\n\t\t\tWHERE " . time() . " BETWEEN starttime AND endtime AND type='review'\n\t\t");
        $tmpl->assign('COUNT_REVIEWS', $count);
    }
    if (in_array('COUNT_PREVIEWS', $parse)) {
        list($count) = $db->first("\n\t\t\tSELECT count(id), avg(hits) FROM " . PRE . "_articles\n\t\t\tWHERE " . time() . " BETWEEN starttime AND endtime AND type='preview'\n\t\t");
        $tmpl->assign('COUNT_PREVIEWS', $count);
    }
    $tmpl->parse('functions/' . $template, 'articles');
}
Beispiel #14
0
function calendar_stats($template = 'stats')
{
    global $set, $db, $apx, $user;
    $tmpl = new tengine();
    $parse = $tmpl->used_vars('functions/' . $template, 'calendar');
    $apx->lang->drop('func_stats', 'calendar');
    if (in_array('COUNT_CATGEORIES', $parse)) {
        list($count) = $db->first("SELECT count(id) FROM " . PRE . "_calendar_cat");
        $tmpl->assign('COUNT_CATGEORIES', $count);
    }
    if (in_template(array('COUNT_EVENTS', 'AVG_HITS'), $parse)) {
        list($count, $hits) = $db->first("\n\t\t\tSELECT count(id), avg(hits) FROM " . PRE . "_calendar_events\n\t\t\tWHERE active!=0\n\t\t");
        $tmpl->assign('COUNT_EVENTS', $count);
        $tmpl->assign('AVG_HITS', round($hits));
    }
    $tmpl->parse('functions/' . $template, 'calendar');
}
Beispiel #15
0
function poll_stats($template = 'stats')
{
    global $set, $db, $apx, $user;
    $tmpl = new tengine();
    $parse = $tmpl->used_vars('functions/' . $template, 'poll');
    $apx->lang->drop('func_stats', 'poll');
    if (in_template(array('COUNT_POLLS', 'AVG_VOTES'), $parse)) {
        list($count, $hits) = $db->first("\n\t\t\tSELECT count(id), avg(a1_c+a2_c+a3_c+a4_c+a5_c+a6_c+a7_c+a8_c+a9_c+a10_c+a11_c+a12_c+a13_c+a14_c+a15_c+a16_c+a17_c+a18_c+a19_c+a20_c) FROM " . PRE . "_poll\n\t\t\tWHERE " . time() . " BETWEEN starttime AND endtime\n\t\t");
        $tmpl->assign('COUNT_POLLS', $count);
        $tmpl->assign('AVG_VOTES', round($hits));
    }
    $tmpl->parse('functions/' . $template, 'poll');
}
Beispiel #16
0
function user_stats($template = 'stats')
{
    global $set, $db, $apx, $user;
    $tmpl = new tengine();
    $parse = $tmpl->used_vars('functions/' . $template, 'user');
    $apx->lang->drop('func_stats', 'user');
    //User
    if (in_array('COUNT_USERS', $parse)) {
        list($count) = $db->first("\n\t\t\tSELECT count(userid) FROM " . PRE . "_user\n\t\t\tWHERE active='1' " . iif($set['user']['listactiveonly'], " AND reg_key='' ") . "\n\t\t");
        $tmpl->assign('COUNT_USERS', $count);
    }
    if (in_array('COUNT_USERS_MALE', $parse)) {
        list($count) = $db->first("\n\t\t\tSELECT count(userid) FROM " . PRE . "_user\n\t\t\tWHERE active='1' AND gender=1 " . iif($set['user']['listactiveonly'], " AND reg_key='' ") . "\n\t\t");
        $tmpl->assign('COUNT_USERS_MALE', $count);
    }
    if (in_array('COUNT_USERS_FEMALE', $parse)) {
        list($count) = $db->first("\n\t\t\tSELECT count(userid) FROM " . PRE . "_user\n\t\t\tWHERE active='1' AND gender=2 " . iif($set['user']['listactiveonly'], " AND reg_key='' ") . "\n\t\t");
        $tmpl->assign('COUNT_USERS_FEMALE', $count);
    }
    //Blogs
    if (in_array('COUNT_BLOGS', $parse)) {
        list($count) = $db->first("\n\t\t\tSELECT count(id) FROM " . PRE . "_user_blog\n\t\t");
        $tmpl->assign('COUNT_BLOGS', $count);
    }
    //Galerien
    if (in_array('COUNT_GALLERIES', $parse)) {
        list($count) = $db->first("\n\t\t\tSELECT count(id) FROM " . PRE . "_user_gallery\n\t\t");
        $tmpl->assign('COUNT_GALLERIES', $count);
    }
    if (in_array('COUNT_PICTURES', $parse)) {
        list($count) = $db->first("\n\t\t\tSELECT count(id) FROM " . PRE . "_user_pictures\n\t\t");
        $tmpl->assign('COUNT_PICTURES', $count);
    }
    $tmpl->parse('functions/' . $template, 'user');
}
Beispiel #17
0
function gallery_stats($template = 'stats')
{
    global $set, $db, $apx, $user;
    $tmpl = new tengine();
    $parse = $tmpl->used_vars('functions/' . $template, 'gallery');
    $apx->lang->drop('func_stats', 'gallery');
    if (in_array('COUNT_GALLERIES', $parse)) {
        list($count) = $db->first("\n\t\t\tSELECT count(id) FROM " . PRE . "_gallery\n\t\t\tWHERE '" . time() . "' BETWEEN starttime AND endtime\n\t\t");
        $tmpl->assign('COUNT_GALLERIES', $count);
    }
    if (in_template(array('COUNT_PICTURES', 'AVG_HITS'), $parse)) {
        list($count, $hits) = $db->first("\n\t\t\tSELECT count(p.id), avg(p.hits) FROM " . PRE . "_gallery_pics AS p\n\t\t\tLEFT JOIN " . PRE . "_gallery AS g ON p.galid=g.id\n\t\t\tWHERE '" . time() . "' BETWEEN g.starttime AND g.endtime AND p.active=1\n\t\t");
        $tmpl->assign('COUNT_PICTURES', $count);
        $tmpl->assign('AVG_HITS', round($hits));
    }
    $tmpl->parse('functions/' . $template, 'gallery');
}
function pages($link, $count, $epp = 0, $varname = 'p')
{
    global $set;
    $count = (int) $count;
    $epp = (int) $epp;
    //Variablen vorbereiten
    $_REQUEST[$varname] = (int) $_REQUEST[$varname];
    if (strpos($link, '?')) {
        $sticky = '&';
    } else {
        $sticky = '?';
    }
    if (!$epp) {
        $epp = $set['main']['admin_epp'];
    }
    $tmpl = new tengine();
    //Seitenzahlen bereichnen, evtl. REQUEST berichtigen
    $pages = ceil($count / $epp);
    if ($_REQUEST[$varname] < 1 || $_REQUEST[$varname] > $pages) {
        $_REQUEST[$varname] = 1;
    }
    //Wenn kein $epp, alle Einträge zeigen -> Seiten (1): [1]
    if ($epp == 0) {
        $tmpl->assign('PAGE_COUNT', 1);
        $tmpl->assign('PAGE', array(array('NUMBER' => 1, 'LINK' => '#')));
        $tmpl->parse('pages', '/');
        return;
    }
    //Wenn es keine Einträge gibt
    if (!$count) {
        $tmpl->assign('PAGE_COUNT', 0);
        $tmpl->parse('pages', '/');
        return;
    }
    //Seitenzahlen generieren
    for ($i = 1; $i <= $pages; $i++) {
        $pagedata[$i]['NUMBER'] = $i;
        $pagedata[$i]['LINK'] = $link . $sticky . $varname . '=' . $i;
    }
    if ($_REQUEST[$varname] > 1) {
        $previous = $link . $sticky . $varname . '=' . ($_REQUEST[$varname] - 1);
    }
    if ($_REQUEST[$varname] < $pages) {
        $next = $link . $sticky . $varname . '=' . ($_REQUEST[$varname] + 1);
    }
    $first = $link . $sticky . $varname . '=1';
    $last = $link . $sticky . $varname . '=' . $pages;
    $tmpl->assign('PAGE_PREVIOUS', $previous);
    $tmpl->assign('PAGE_NEXT', $next);
    $tmpl->assign('PAGE_FIRST', $first);
    $tmpl->assign('PAGE_LAST', $last);
    $tmpl->assign('PAGE_COUNT', $pages);
    $tmpl->assign('PAGE_SELECTED', $_REQUEST[$varname]);
    $tmpl->assign('PAGE', $pagedata);
    $tmpl->parse('pages', '/');
}
Beispiel #19
0
 function layer_footer()
 {
     if (MODE != 'admin') {
         return;
     }
     $tmpl = new tengine();
     $tmpl->assign('SHOWFOOTER', true);
     $tmpl->parse('layer', '/');
 }
Beispiel #20
0
function products_stats($template = 'stats')
{
    global $set, $db, $apx, $user;
    $tmpl = new tengine();
    $parse = $tmpl->used_vars('functions/' . $template, 'products');
    $apx->lang->drop('func_stats', 'products');
    if (in_template(array('COUNT_PRODUCTS', 'AVG_HITS'), $parse)) {
        list($count, $hits) = $db->first("\n\t\t\tSELECT count(id), avg(hits) FROM " . PRE . "_products\n\t\t\tWHERE active=1\n\t\t");
        $tmpl->assign('COUNT_PRODUCTS', $count);
        $tmpl->assign('AVG_HITS', round($hits));
    }
    $types = array('normal', 'game', 'music', 'movie', 'book', 'software', 'hardware');
    foreach ($types as $type) {
        $varname = 'COUNT_PRODUCTS_' . strtoupper($type);
        if (in_array($varname, $parse)) {
            list($count) = $db->first("\n\t\t\t\tSELECT count(id) FROM " . PRE . "_products\n\t\t\t\tWHERE active=1 AND type='" . $type . "'\n\t\t\t");
            $tmpl->assign($varname, $count);
        }
    }
    $tmpl->parse('functions/' . $template, 'products');
}
Beispiel #21
0
function main_sections($template = 'sections')
{
    global $apx, $set, $db;
    $tmpl = new tengine();
    $secdata = array();
    if (count($apx->sections)) {
        foreach ($apx->sections as $id => $info) {
            ++$i;
            $secdata[$i]['ID'] = $id;
            $secdata[$i]['TITLE'] = $info['title'];
            $secdata[$i]['VIRTUALDIR'] = $info['virtual'];
            $secdata[$i]['LINK'] = mklink('index.php', 'index.html', $id);
        }
    }
    $tmpl->assign('SECTION', $secdata);
    $tmpl->parse('functions/' . $template, 'main');
}