Ejemplo n.º 1
0
function misc_productsfeed()
{
    global $set, $db, $apx;
    $apx->tmpl->loaddesign('blank');
    header('Content-type: application/rss+xml');
    $apx->lang->drop('types', 'products');
    $type = $_REQUEST['type'];
    $alltypes = array('normal', 'game', 'software', 'hardware', 'music', 'movie', 'book');
    if (!in_array($type, $alltypes)) {
        $type = '';
    }
    $data = $db->fetch("SELECT * FROM " . PRE . "_products WHERE active='1' " . iif($type, " AND type='" . $type . "'") . " ORDER BY addtime DESC LIMIT 20");
    if (count($data)) {
        foreach ($data as $res) {
            ++$i;
            //Link
            $link = mklink('products.php?id=' . $res['id'], 'products,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]['TYPE'] = $res['type'];
            $tabledata[$i]['LINK'] = HTTP_HOST . $link;
        }
    }
    $apx->tmpl->assign('WEBSITENAME', $set['main']['websitename']);
    $apx->tmpl->assign('PRODUCT', $tabledata);
    $apx->tmpl->parse('rss', 'products');
}
Ejemplo n.º 2
0
function misc_articlesfeed()
{
    global $set, $db, $apx;
    $apx->tmpl->loaddesign('blank');
    header('Content-type: application/rss+xml');
    //Verwendete Variablen
    $parse = $apx->tmpl->used_vars('rss', 'articles');
    //Baum holen, wenn nur eine bestimmte Kategorie gezeigt werden soll
    $cattree = articles_tree($_REQUEST['catid']);
    $data = $db->fetch("SELECT a.id,a.type,a.catid,a.title,a.subtitle,a.teaser,a.starttime,a.top,b.username,b.email,b.pub_hidemail FROM " . PRE . "_articles 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");
    //Kategorien auslesen
    $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');
            //Text: Teaser oder Artikelseite
            if ($res['teaser'] && $set['articles']['teaser']) {
                $text = $res['teaser'];
            } else {
                list($text) = $db->first("SELECT text FROM " . PRE . "_articles_pages WHERE artid='" . $res['id'] . "' ORDER BY ord ASC LIMIT 1");
                $text = $text;
            }
            $tabledata[$i]['ID'] = $res['id'];
            $tabledata[$i]['TITLE'] = rss_replace($res['title']);
            $tabledata[$i]['SUBTITLE'] = rss_replace($res['subtitle']);
            $tabledata[$i]['TIME'] = date('r', $res['starttime']);
            //Kein TIMEDIFF weil Zeitverschiebung mit angegeben!
            $tabledata[$i]['TEXT'] = rss_replace(preg_replace('#{IMAGE\\(([0-9]+)\\)}#s', '', $text));
            $tabledata[$i]['CATTITLE'] = rss_replace($catinfo[$res['catid']]['title']);
            $tabledata[$i]['LINK'] = HTTP_HOST . $link;
            $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]['TOP'] = $res['top'];
        }
    }
    $apx->tmpl->assign('WEBSITENAME', $set['main']['websitename']);
    $apx->tmpl->assign('ARTICLE', $tabledata);
    $apx->tmpl->parse('rss', 'articles');
}
Ejemplo n.º 3
0
function misc_linksfeed()
{
    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 = links_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 . "_links 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 . "_links_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('links.php?id=' . $res['id'], 'links,id' . $res['id'] . urlformat($res['title']) . '.html');
            $tabledata[$i]['ID'] = $res['id'];
            $tabledata[$i]['TITLE'] = rss_replace($res['title']);
            $tabledata[$i]['URL'] = $res['url'];
            $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]['TOP'] = $res['top'];
        }
    }
    $apx->tmpl->assign('WEBSITENAME', $set['main']['websitename']);
    $apx->tmpl->assign('LINK', $tabledata);
    $apx->tmpl->parse('rss', 'links');
}
Ejemplo n.º 4
0
function misc_galleryfeed()
{
    global $set, $db, $apx;
    $apx->tmpl->loaddesign('blank');
    header('Content-type: application/rss+xml');
    $data = $db->fetch("SELECT id,title,description,starttime FROM " . PRE . "_gallery WHERE ( ( '" . time() . "' BETWEEN starttime AND endtime ) " . section_filter() . " ) ORDER BY starttime DESC LIMIT 20");
    if (count($data)) {
        foreach ($data as $res) {
            ++$i;
            //Link
            $link = mklink('gallery.php?id=' . $res['id'], 'gallery,list' . $res['id'] . ',1' . 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]['DESCRIPTION'] = rss_replace($res['description']);
            $tabledata[$i]['LINK'] = HTTP_HOST . $link;
        }
    }
    $apx->tmpl->assign('WEBSITENAME', $set['main']['websitename']);
    $apx->tmpl->assign('GALLERY', $tabledata);
    $apx->tmpl->parse('rss', 'gallery');
}
Ejemplo n.º 5
0
function misc_eventsfeed()
{
    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 = calendar_tree($_REQUEST['catid']);
    if ($catid) {
        $cattree = calendar_tree($catid);
        if (count($cattree)) {
            $catfilter = " AND a.catid IN (" . implode(',', $cattree) . ") ";
        }
    }
    $todaystamp = date('Ymd', time() - TIMEDIFF);
    $data = $db->fetch("SELECT a.*,b.username,b.email,b.pub_hidemail FROM " . PRE . "_calendar_events AS a LEFT JOIN " . PRE . "_user AS b USING(userid) WHERE a.active!=0 AND a.private='0' AND '" . $todaystamp . "'<=endday " . section_filter(true, 'a.secid') . " " . $catfilter . $modefilter . " ORDER BY startday ASC, starttime ASC, title ASC LIMIT 20");
    //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');
    }
    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');
            //Start berechnen
            $startday = $starttime = $endday = $endtime = 0;
            $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 ($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;
                }
            }
            $event['ID'] = $res['id'];
            $event['TITLE'] = rss_replace($res['title']);
            $event['TEXT'] = rss_replace($res['text']);
            $event['LINK'] = HTTP_HOST . $link;
            $event['LOCATION'] = $res['location'];
            $event['LOCATION_LINK'] = $res['location_link'];
            $event['STARTDAY'] = $startday;
            $event['STARTTIME'] = $starttime;
            $event['ENDDAY'] = $endday;
            $event['ENDTIME'] = $endtime;
            $event['ADDTIME'] = $res['addtime'];
            $event['TIME'] = date('r', $res['addtime']);
            $event['CATID'] = $res['catid'];
            $event['CATTITLE'] = $catinfo['title'];
            $event['CATICON'] = $catinfo['icon'];
            $tabledata[] = $event;
        }
    }
    $apx->tmpl->assign('WEBSITENAME', $set['main']['websitename']);
    $apx->tmpl->assign('EVENT', $tabledata);
    $apx->tmpl->parse('rss', 'calendar');
}