Esempio n. 1
0
function misc_newsfeed()
{
    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 = news_tree($_REQUEST['catid']);
    $data = $db->fetch("SELECT a.id,a.catid,a.title,a.subtitle,a.teaser,a.text,a.starttime,a.top,b.username,b.email,b.pub_hidemail FROM " . PRE . "_news 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 = 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');
            //Text
            if ($set['news']['teaser'] && $res['teaser']) {
                $text = $res['teaser'];
            } else {
                $text = $res['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'] = 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('NEWS', $tabledata);
    $apx->tmpl->parse('rss', 'news');
}
Esempio n. 2
0
        $rate->assign_ratings($parse);
        if (!news_is_recent($res['id']) && !$set['news']['archratings']) {
            $apx->tmpl->assign('RATING_NOFORM', 1);
        }
    }
    $apx->tmpl->parse('detail');
    require 'lib/_end.php';
}
//////////////////////////////////////////////////////////////////////////////////////////////////////// NEWS AUFLISTEN
//Titelleiste
headline($apx->lang->get('HEADLINE'), mklink('news.php', 'news.html'));
titlebar($apx->lang->get('HEADLINE'));
//Verwendete Variablen auslesen
$parse = $apx->tmpl->used_vars('index');
//Kategorie-Baum holen
$cattree = news_tree($_REQUEST['catid']);
//Seitenzahlen generieren
list($count) = $db->first("SELECT count(id) FROM " . PRE . "_news WHERE ( " . time() . " BETWEEN starttime AND endtime " . iif(count($cattree), ' AND catid IN (' . @implode(',', $cattree) . ') ') . section_filter() . ")");
pages(mklink('news.php?catid=' . $_REQUEST['catid'], 'news,' . $_REQUEST['catid'] . ',{P}.html'), $count, $set['news']['epp']);
//News ausgeben
$data = $db->fetch("SELECT a.*,IF(a.sticky>=" . time() . ",1,0) AS sticky,b.userid,b.username,b.email,b.pub_hidemail FROM " . PRE . "_news 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 sticky DESC,starttime DESC " . getlimit($set['news']['epp']));
//Kategorien auslesen
if (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
Esempio n. 3
0
function news_product($prodid = 0, $count = 5, $start = 0, $catid = false, $template = 'productnews')
{
    global $set, $db, $apx, $user;
    $prodid = (int) $prodid;
    $count = (int) $count;
    $start = (int) $start;
    $catid = (int) $catid;
    if (!$prodid) {
        return;
    }
    $cattree = news_tree($catid);
    $data = $db->fetch("SELECT a.*,b.userid,b.username,b.email,b.pub_hidemail FROM " . PRE . "_news AS a LEFT JOIN " . PRE . "_user AS b USING(userid) WHERE ( " . 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);
    news_print($data, 'functions/' . $template);
}