$row = mysql_fetch_assoc($result); $tempCompanyEmail = $row['value']; // Get SystemURL $query = "Select * FROM tblconfiguration where setting='SystemURL' limit 0,1"; $result = mysql_query($query) or die("tblconfiguration: SystemURL not found"); if (mysql_num_rows($result) == 0) { die("tblconfiguration: SystemURL not found"); } $row = mysql_fetch_assoc($result); $tempSystemURL = $row['value']; ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// $rss = new rss('utf-8'); $rss->channel($tempCompanyName . ' Tickets', $tempSystemURL, $tempCompanyName . ' Tickets'); $rss->language('en-us'); $rss->copyright('Copyright ' . $tempCompanyName); $rss->managingEditor($tempCompanyEmail); $rss->category('CategoryName'); $rss->startRSS(); $query = "Select * FROM tbltickets " . $tempSQL . " order by lastreply desc limit 0," . $constTicketsToDisplay; $result = mysql_query($query) or die("No Tickets Found"); if (mysql_num_rows($result) == 0) { die("No Tickets Found"); } while ($row = mysql_fetch_assoc($result)) { $rss->itemTitle("<![CDATA[" . $row['title'] . "]]>"); $rss->itemLink("<![CDATA[" . $tempSystemURL . "/admin/supporttickets.php?action=viewticket&id=" . $row['id'] . "]]>"); $rss->itemDescription("<![CDATA[" . $row['message'] . "]]>"); $rss->itemAuthor($row['name'] . " " . $row['email']); $rss->addItem(); } echo $rss->RSSdoneVar();
} } } else { $params['1'] = '1'; } $count = 20; $DOCS = $POD->getContents($params); $description = "{$scope} {$type} " . implode(" and ", $conditions) . " from " . $POD->siteName(false); $year = date("Y"); $rss = new rss('utf-8'); $rss->channel(xmlformat($description), $POD->siteRoot(false), xmlformat($description)); $rss->language('en-us'); $rss->copyright('Copyright ' . $year . ' ' . $POD->siteName(false)); $rss->startRSS(); while ($doc = $DOCS->getNext()) { $rss->itemTitle(xmlformat($doc->get('headline'))); if ($doc->get('link')) { $rss->itemLink($doc->get('link')); } else { $rss->itemLink($doc->get('permalink')); } $nTimestamp = strtotime($doc->get('date')); $sISO8601 = date('Y-m-d\\Th:i:s', $nTimestamp) . substr_replace(date('O', $nTimestamp), ':', 3, 0); $rss->itemPubDate($sISO8601); if ($doc->get('img')) { $rss->itemDescription(xmlformat('<img src="' . $doc->get('img') . '" /><br />' . $doc->get('body'))); } else { $rss->itemDescription(xmlformat($doc->get('body'))); } $rss->itemAuthor(xmlformat($doc->author('nick') . "<" . $doc->author('permalink') . ">")); $rss->itemGuid($doc->get('permalink'));
if (!empty($_GET['dcat'])) { $where = 'WHERE `#__category`.`cat_chpu`=\'' . PHP_slashes(htmlspecialchars($_GET['dcat'])) . '\''; } else { $where = ''; } $news = $DB->getAll('SELECT `#__news`.*, `#__category`.`name`, `#__category`.`cat_chpu` FROM `#__news` LEFT JOIN `#__category` ON `#__news`.`cat`=`#__category`.`id` ' . $where . ' ORDER BY `#__news`.`date` DESC LIMIT 10'); if (count($news) == 0) { header("Location: /"); } $config['domen'] = $_SERVER['HTTP_HOST']; $config['site_title'] = $DB->getOne('SELECT `#__setting`.`value` FROM `#__setting` WHERE `#__setting`.`name`=\'site_title\' LIMIT 1'); $rss = new rss('utf-8'); $rss->channel('RSS - ' . $news[0]['name'], 'http://' . $config['domen'], $config['site_title']); $rss->language('ru-RU'); $rss->copyright('Copyright by ' . $config['domen'] . ' ' . date('Y')); $rss->managingEditor('support@' . str_replace('www.', '', $config['domen'])); $rss->category($news[0]['name']); $rss->startRSS(); foreach ($news as $ne) { $rss->itemTitle($ne['title']); $rss->itemLink('http://' . $config['domen'] . '/doc/' . $ne['cat_chpu'] . '/' . $ne['chpu'] . '/'); $rss->itemDescription(strip_tags($ne['text'])); $rss->itemAuthor('support@' . str_replace('www.', '', $config['domen'])); $rss->itemGuid('http://' . $config['domen'] . '/doc/' . $ne['cat_chpu'] . '/' . $ne['chpu'] . '/'); $rss->itemSource($config['site_title'], 'http:/' . $config['domen'] . '/rss/' . $ne['name'] . '/'); $rss->addItem(); $count++; } echo $rss->RSSdone(); exit;
public function make_RSS($title, $description, $date, $slides, $location = '.', $filename = 'rss') { $rss = new rss('utf-8'); $rss->channel($title, 'http://www.slideshare.net', $description); $rss->language('en-us'); $rss->copyright('Copyright by SlideShare 2006'); $rss->managingEditor('*****@*****.**'); $rss->startRSS($location, $filename); for ($i = 0; $i < count($slides); $i++) { $rss->itemTitle($slides[$i]['TITLE']); $rss->itemLink($slides[$i]['PERMALINK']); $rss->itemDescription('<![CDATA[ <img style="border: 1px solid rgb(195, 230, 216);" src="' . $slides[$i]['THUMBNAIL'] . '" align="right" border="0" width="120" height="90" vspace="4" hspace="4" /> <p> ' . $slides[$i]['DESCRIPTION'] . ' </p> ]]>'); $rss->itemGuid($slides[$i]['PERMALINK'], true); $rss->itemComments($slides[$i]['PERMALINK']); $rss->itemSource('Slideshare', 'http://www.slideshare.net'); $rss->addItem(); } $rss->RSSdone(); }
/** * Действие просмотр rss ленты всех постов: */ public function rssAllAction(Application $application, Template $template) { $posts = Blog_BlogPostsModel::GetAllPosts(0, 20, false); if ($posts) { $rss = new rss('utf-8'); $rss->channel('Первый канал - Все', 'http://1chan.ru/', 'Новости имиджборд и не только.'); $rss->language('ru-ru'); $rss->copyright('Все права пренадлежат вам © 2010'); $rss->managingEditor('*****@*****.**'); $rss->category('Все'); $rss->startRSS(); foreach ($posts as $key => $post) { $title = $post['category'] ? TemplateHelper::BlogCategory($post['category'], 'title') . ' — ' . $post['title'] : $post['title']; $rss->itemTitle($title); $rss->itemLink('http://' . TemplateHelper::getSiteUrl() . '/news/res/' . $post['id'] . '/'); $rss->itemDescription($post['link'] ? '<a href="' . $post['link'] . '">' . $post['link'] . '</a><br />' . $post['text'] : $post['text']); $rss->itemAuthor('anonymous'); $rss->itemGuid('http://' . TemplateHelper::getSiteUrl() . '/news/res/' . $post['id'] . '/', true); $rss->itemPubDate(date('D, d M Y H:i:s O', $post['created_at'])); $rss->addItem(); } $result = $rss->RSSdone(); } EventModel::getInstance()->Broadcast('view_rss_all_post'); $template->headerOk(); $template->headerContentType('application/rss+xml', 'UTF-8'); echo $result; return false; }