Beispiel #1
0
function misc_videosfeed()
{
    global $set, $db, $apx;
    $apx->tmpl->loaddesign('blank');
    header('Content-type: application/rss+xml');
    //Baum holen, wenn nur eine bestimmte Kategorie gezeigt werden soll
    $cattree = videos_tree($_REQUEST['catid']);
    $data = $db->fetch("SELECT a.id,a.catid,a.title,a.text,a.starttime,a.top,b.username,b.email,b.pub_hidemail FROM " . PRE . "_videos AS a LEFT JOIN " . PRE . "_user AS b USING (userid) WHERE ( ( '" . time() . "' BETWEEN starttime AND endtime ) " . iif(count($cattree), "AND catid IN (" . @implode(',', $cattree) . ")") . " " . section_filter() . " ) ORDER BY starttime DESC LIMIT 20");
    if (count($data)) {
        //Kategorien auslesen
        $catids = get_ids($data, 'catid');
        if (count($catids)) {
            $catdata = $db->fetch("SELECT id,title FROM " . PRE . "_videos_cat WHERE id IN (" . implode(',', $catids) . ")");
            if (count($catdata)) {
                foreach ($catdata as $catres) {
                    $catinfo[$catres['id']] = $catres;
                }
            }
        }
        foreach ($data as $res) {
            ++$i;
            //Link
            $link = mklink('videos.php?id=' . $res['id'], 'videos,id' . $res['id'] . urlformat($res['title']) . '.html');
            $tabledata[$i]['ID'] = $res['id'];
            $tabledata[$i]['TITLE'] = rss_replace($res['title']);
            $tabledata[$i]['TIME'] = date('r', $res['starttime']);
            //Kein TIMEDIFF weil Zeitverschiebung mit angegeben!
            $tabledata[$i]['TEXT'] = rss_replace(preg_replace('#{IMAGE\\(([0-9]+)\\)}#s', '', $res['text']));
            $tabledata[$i]['CATTITLE'] = rss_replace($catinfo[$res['catid']]['title']);
            $tabledata[$i]['LINK'] = HTTP_HOST . $link;
            $tabledata[$i]['USERNAME'] = rss_replace($res['username']);
            $tabledata[$i]['EMAIL'] = rss_replace(iif(!$res['pub_hidemail'], $res['email']));
            $tabledata[$i]['EMAIL_ENCRYPTED'] = rss_replace(iif(!$res['pub_hidemail'], cryptMail($res['email'])));
            $tabledata[$i]['TOP'] = $res['top'];
        }
    }
    $apx->tmpl->assign('WEBSITENAME', $set['main']['websitename']);
    $apx->tmpl->assign('VIDEO', $tabledata);
    $apx->tmpl->parse('rss', 'videos');
}
Beispiel #2
0
     $tagid = getTagId($_REQUEST['tag']);
     if ($tagid) {
         $data = $db->fetch("SELECT id FROM " . PRE . "_videos_tags WHERE tagid='" . $tagid . "'");
         $ids = get_ids($data, 'id');
         if ($ids) {
             $where .= iif($where, ' AND ') . ' id IN (' . implode(',', $ids) . ') ';
         } else {
             $where .= iif($where, ' AND ') . ' 0 ';
         }
     } else {
         $where .= iif($where, ' AND ') . ' 0 ';
     }
 }
 //Kategorie
 if ($_REQUEST['catid']) {
     $cattree = videos_tree($_REQUEST['catid']);
     if (count($cattree)) {
         $where .= iif($where, ' AND ') . 'catid IN (' . @implode(',', $cattree) . ')';
     }
 }
 //Zeitperiode
 if ($_REQUEST['start_day'] && $_REQUEST['start_month'] && $_REQUEST['start_year'] && $_REQUEST['end_day'] && $_REQUEST['end_month'] && $_REQUEST['end_year']) {
     $where .= iif($where, ' AND ') . "starttime BETWEEN '" . (mktime(0, 0, 0, intval($_REQUEST['start_month']), intval($_REQUEST['start_day']), intval($_REQUEST['start_year'])) + TIMEDIFF) . "' AND '" . (mktime(0, 0, 0, intval($_REQUEST['end_month']), intval($_REQUEST['end_day']) + 1, intval($_REQUEST['end_year'])) - 1 + TIMEDIFF) . "'";
 }
 //Keine Suchkriterien vorhanden
 if (!$where) {
     message($apx->lang->get('CORE_BACK'), 'javascript:history.back();');
     require 'lib/_end.php';
 } else {
     $data = $db->fetch("SELECT id FROM " . PRE . "_videos WHERE " . $where);
     $resultIds = get_ids($data, 'id');
Beispiel #3
0
function videos_product($prodid = 0, $count = 5, $start = 0, $catid = false, $template = 'productvideos')
{
    global $set, $db, $apx, $user;
    $prodid = (int) $prodid;
    $count = (int) $count;
    $start = (int) $start;
    $catid = (int) $catid;
    if (!$prodid) {
        return;
    }
    $cattree = videos_tree($catid);
    $data = $db->fetch("SELECT a.*,b.userid,b.username,b.email,b.pub_hidemail FROM " . PRE . "_videos AS a LEFT JOIN " . PRE . "_user AS b USING(userid) WHERE a.status='finished' AND ( ( '" . time() . "' BETWEEN starttime AND endtime )  AND prodid='" . $prodid . "' " . iif(count($cattree), " AND catid IN (" . @implode(',', $cattree) . ") ") . " " . section_filter() . " ) ORDER BY starttime DESC LIMIT " . iif($start, $start . ',') . $count);
    videos_print($data, 'functions/' . $template);
}