Example #1
0
     filenotfound();
 }
 //Altersabfrage
 if ($res['restricted']) {
     checkage();
 }
 //Counter
 $db->query("UPDATE " . PRE . "_videos SET hits=hits+1 WHERE ( " . time() . " BETWEEN starttime AND endtime AND id='" . $_REQUEST['id'] . "' " . section_filter() . " )");
 //Headline
 titlebar($apx->lang->get('HEADLINE') . ': ' . $res['title']);
 //Kategorie-Info
 if (in_array('CATTITLE', $parse) || in_array('CATTEXT', $parse) || in_array('CATICON', $parse) || in_array('CATLINK', $parse) || in_array('CATCOUNT', $parse)) {
     //Tree-Manager
     require_once BASEDIR . 'lib/class.recursivetree.php';
     $tree = new RecursiveTree(PRE . '_videos_cat', 'id');
     $catinfo = $tree->getNode($res['catid'], array('*'));
 }
 //Videos in der Kategorien
 $catcount = 0;
 if (in_array('CATCOUNT', $parse)) {
     $wholetree = array_merge(array($res['catid']), $catinfo['children']);
     list($catcount) = $db->first("SELECT count(id) FROM " . PRE . "_videos WHERE ( catid IN (" . implode(',', $wholetree) . ") AND ( '" . time() . "' BETWEEN starttime AND endtime ) " . section_filter() . " )");
 }
 //Link
 $link = mklink('videos.php?id=' . $res['id'], 'videos,id' . $res['id'] . urlformat($res['title']) . '.html');
 //Teaserbild
 if (in_array('PICTURE', $parse) || in_array('PICTURE_POPUP', $parse) || in_array('PICTURE_POPUPPATH', $parse)) {
     list($picture, $picture_popup, $picture_popuppath) = videos_teaserpic($res['teaserpic']);
 }
 //Dateigröße auslesen
 $thefsize = videos_filesize($res);
Example #2
0
function setGalleryUpdatetime($galId)
{
    global $db;
    require_once BASEDIR . 'lib/class.recursivetree.php';
    $tree = new RecursiveTree(PRE . '_gallery', 'id');
    $gallery = $tree->getNode($galId);
    if (!$gallery) {
        return;
    }
    $updateIds = array_merge($gallery['parents'], array($gallery['id']));
    foreach ($updateIds as $id) {
        $gallery = $tree->getNode($id);
        $searchIds = array_merge($gallery['children'], array($gallery['id']));
        list($updatetime) = $db->first("\n\t\t\tSELECT max(addtime)\n\t\t\tFROM " . PRE . "_gallery_pics\n\t\t\tWHERE galid IN (" . implode(',', $searchIds) . ") AND active=1\n\t\t");
        $db->query("\n\t\t\tUPDATE " . PRE . "_gallery\n\t\t\tSET lastupdate='" . $updatetime . "'\n\t\t\tWHERE id='" . $id . "'\n\t\t\tLIMIT 1\n\t\t");
    }
}
Example #3
0
define('APXRUN', true);
////////////////////////////////////////////////////////////////////////////////////////////////////////
require 'lib/_start.php';
//////////////////////////////////////////////////////////// SYSTEMSTART ///
////////////////////////////////////////////////////////////////////////////////////////////////////////
$apx->module('faq');
$apx->lang->drop('faq');
headline($apx->lang->get('HEADLINE'), mklink('faq.php', 'faq.html'));
titlebar($apx->lang->get('HEADLINE'));
$_REQUEST['id'] = (int) $_REQUEST['id'];
////////////////////////////////////////////////////////////////////////////////////////////////////////
require_once BASEDIR . 'lib/class.recursivetree.php';
$tree = new RecursiveTree(PRE . '_faq', 'id');
if ($_REQUEST['id']) {
    $db->query("UPDATE " . PRE . "_faq SET hits=hits+1 WHERE id='" . $_REQUEST['id'] . "' LIMIT 1");
    $node = $tree->getNode($_REQUEST['id'], array('*'));
    if (!$node || !$user->is_team_member() && $node['starttime'] == 0) {
        filenotfound();
    }
    $node['level'] = 0;
    $subData = $tree->getTree(array('*'), $_REQUEST['id'], "starttime!='0'");
    $data = array_merge(array($node), $subData);
} else {
    $data = $tree->getTree(array('*'), null, "starttime!='0'");
}
$first = null;
if (count($data)) {
    foreach ($data as $res) {
        ++$i;
        if (!$first) {
            $first = $res;
Example #4
0
function navi_node($nodeid = 0, $template = 'node')
{
    global $set, $db, $apx;
    $nodeid = (int) $nodeid;
    if (!$nodeid) {
        return;
    }
    $tmpl = new tengine();
    require_once BASEDIR . 'lib/class.recursivetree.php';
    $tree = new RecursiveTree(PRE . '_navi', 'id');
    $res = $tree->getNode($nodeid, array('*'));
    $tmpl->assign('ID', $res['id']);
    $tmpl->assign('LEVEL', $res['level']);
    $tmpl->assign('CHILDREN', $res['children']);
    $tmpl->assign('TEXT', $res['text']);
    $tmpl->assign('LINK', $res['link']);
    $tmpl->assign('POPUP', $res['link_popup']);
    $tmpl->assign('CODE', $res['code']);
    $tmpl->parse($template, 'navi');
}