|
Um Rss-generator zu benutzen, müssen Sie zum Admin Interface vom Framework WebSite-PHP gehen. Wenn Sie sich eingeloggt haben gehen Sie zum Menü Konfiguration -> Module Konfigurieren und aktivieren das Modul Rss-generator. Tutorial 1 : Simple RSS
<rss version="2.0">
<channel>
<title>WebSite-PHP Framework PHP</title>
<link>https://www.website-php.com/</link>
<description>WebSite-PHP est un FrameWork PHP 100% objet. Plus besoin de connaître le HTML, il suffit d'instancier les bons objets.</description>
<pubDate>Wed, 01 Aug 2007 00:00:00 +0200</pubDate>
<image>
<url>https://www.website-php.com/img/logo_128x400_de.png</url>
<title>WebSite-PHP Framework PHP</title>
<link>https://www.website-php.com/</link>
<width>128</width>
<height>400</height>
</image>
<lastBuildDate>Sun, 06 Oct 2024 00:00:00 +0200</lastBuildDate>
<ttl></ttl>
<webMaster>contact@website-php.com (WebSite-PHP Framework)</webMaster>
<item>
<title>Test</title>
<link>https://www.website-php.com/</link>
<description>Test description</description>
<pubDate>Sun, 06 Oct 2024 12:58:42 +0200</pubDate>
<author>contact@website-php.com (WebSite-PHP Framework)</author>
<guid isPermaLink="true">https://www.website-php.com/</guid>
</item>
</channel>
</rss>
Datei: /pages/tutorials/rss-generator/rss-generator-01.php
<?php // Use: http://YOUR_DOMAIN/tutorials/rss/rss-01.xml
class RssGenerator01 extends Page { public function InitializeComponent() { parent::$PAGE_TITLE = "Simple RSS"; // Create the new instance of the RSS Feed $rssFeed = new RSSFeed('utf-8'); // Activate the string protection $rssFeed->setProtectString(true); // Set the feed title $rssFeed->setTitle(__(SITE_NAME)); // Set the feed description $rssFeed->setDescription(__(SITE_DESC)); // Set the feed link $rssFeed->setLink(BASE_URL); // Set the feed publication date $rssFeed->setPubDate('2007-08-01'); // Set the feed last build date $rssFeed->setLastBuildDate(date('Y-m-d')); // Set the feed webmaster $rssFeed->setWebMaster(__(SMTP_MAIL), __(SMTP_NAME)); // Set the feed managing editor $rssFeed->setManagingEditor(__(SMTP_MAIL), __(SMTP_NAME)); // Set the feed image $rssFeed->setImage($this->getBaseURL()."img/". "logo_128x400_".$this->getLanguage().".png", __(SITE_NAME), $this->getBaseURL(), __(SITE_DESC), 128, 400); // Creating a new feed item $rssItem = new RSSFeedItem(); $rssItem->setTitle('Test'); $rssItem->setDescription('Test description'); $rssItem->setLink(BASE_URL); $rssItem->setGuid(BASE_URL, true); $rssItem->setAuthor(__(SMTP_MAIL), __(SMTP_NAME)); $rssItem->setPubDate(date('Y-m-d H:i:s')); // Add the item to the feed $rssFeed->appendItem($rssItem); $this->render = $rssFeed; } } ?>
|
|
|
|
|