Example #1
0
<?php

header('Content-Type: application/xml');
require_once 'init.php';
//$appscount = $API->DB->get_row_count("apps");
$apps = $API->DB->query_return("SELECT trackid, added, last_parse_itunes ,image, apps.name, genres.name AS gname, artists.name AS pname FROM apps LEFT JOIN genres ON apps.genre_id=genres.id LEFT JOIN artists ON apps.artist_id=artists.id ORDER BY added DESC LIMIT 50");
if ($apps) {
    foreach ($apps as $a) {
        $itdata = json_decode($a['last_parse_itunes'], true);
        $to_rss[] = array('title' => $a['name'] . " by " . $a['pname'] . " ({$a['gname']})", 'pubDate' => $a['added'], 'link' => $API->SEO->make_link('view', 'trackid', $a['trackid']), 'description' => $itdata['description'], 'image' => $a['image'], 'trackid' => $a['trackid']);
    }
    require_once 'classes' . DS . 'rss.class.php';
    $rss = new rss_generator('appaddict.org ' . $API->LANG->_('RSS feed'));
    $rss->link = $CONFIG['defaultbaseurl'];
    $rss->description = $API->LANG->_('RSS Feed showing new content');
    $output = $rss->get($to_rss);
}
print $output;
Example #2
0
                }
                $len = strlen($file) - 4;
                $filesmile = ':' . substr($file, 0, $len) . ':';
                $text = str_replace($filesmile, "", $text);
            }
        }
        return $text;
    }
    $items = array();
    $sel = myquery("SELECT forum_topics.last_user AS last_user, forum_topics.id AS id, forum_topics.top AS top, forum_topics.text AS text FROM forum_topics,forum_kat,forum_main WHERE forum_main.level='' AND forum_main.id=forum_kat.main_id AND forum_kat.id = forum_topics.kat_id AND forum_kat.clan='0' order by forum_topics.last_date DESC limit 15");
    while ($w = mysql_fetch_array($sel)) {
        list($last_otvet) = mysql_fetch_array(myquery("SELECT text FROM forum_otv WHERE topics_id=" . $w['id'] . " ORDER BY id DESC LIMIT 1"));
        $last_otvet = convert_in_tags($last_otvet);
        $items[] = array("title" => $w['top'], "description" => $last_otvet, "link" => 'http://' . domain_name . '/forum/?act=topic&id=' . $w['id'] . '&page=n');
    }
    $feed = new rss_generator('Средиземье :: Зал Палантиров');
    $feed->__set('title', 'Средиземье :: Зал Палантиров');
    $feed->__set('description', 'Последние сообщения из Зала Палантиров СРЕДИЗЕМЬЯ');
    $feed->__set('link', 'http://' . domain_name . '/forum/');
    header('Content-type: application/xml');
    echo $feed->get($items);
    if (function_exists("save_debug")) {
        save_debug();
    }
    exit;
} else {
    session_start();
    if ($option == 'register') {
        Header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
        // Дата в прошлом
        Header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT");