Beispiel #1
0
// MySQL Connection
$connection = mysql_connect('localhost', 'root', 'example');
mysql_select_db('website', $connection);
try {
    // 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('My blog : the best in the world');
    // Set the feed description
    $rssFeed->setDescription('A little blog, which talks about Web programming');
    // Set the feed link
    $rssFeed->setLink('http://www.mywebsite.com/blog/rss/posts.php');
    // 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('*****@*****.**', 'John Doe');
    // Set the feed managing editor
    $rssFeed->setManagingEditor('*****@*****.**', 'John Doe');
    // Set the feed image
    $rssFeed->setImage('http://www.mywebsite.com/image/logo.jpg', 'My Logo', 'My blog', 100, 200);
    // Set the feed categories
    $rssFeed->setCategory('http://technorati.com/posts/tag/php', 'PHP Language');
    $rssFeed->setCategory('http://technorati.com/posts/tag/html', 'HTML Language');
    $rssFeed->setCategory('http://technorati.com/posts/tag/java', 'Java Language');
    $rssFeed->setCategory('http://technorati.com/posts/tag/asp', 'ASP Language');
    // Set the feed copyright
    $rssFeed->setCopyright('(C) Copyright 2007 - MyWebsite - All rights reserved');
Beispiel #2
0
    $title_rss .= ': ' . get_nom_prenom_eleve($eleve_l);
    $description_rss = 'Les devoirs à faire de ' . $noms["nom"] . ' ' . $noms["prenom"];
}
// =========================fin des cahiers de textes ===========================
$ServerProtocole = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://';
// Import de la classe RSSFeed
require 'RSSFeed/RSSFeed.class.php';
// Création des entêtes du flux RSS
//$oRssFeed = new RSSFeed('utf-8');
$oRssFeed = new RSSFeed('UTF-8');
$oRssFeed->setCloud($_SERVER["SERVER_NAME"], $_SERVER["REMOTE_PORT"], $gepiPath, '', 'http');
$oRssFeed->setProtectString(true);
$oRssFeed->setTitle($title_rss);
$oRssFeed->setDescription($description_rss);
$oRssFeed->setLink($ServerProtocole . $_SERVER["SERVER_NAME"] . $gepiPath);
$oRssFeed->setPubDate('2007-12-31');
$oRssFeed->setLastBuildDate(date('Y-m-d'));
//$oRssFeed->setWebMaster(getSettingValue("gepiSchoolEmail"),'ADMIN');
//$oRssFeed->setManagingEditor(getSettingValue("gepiSchoolEmail"),'ADMIN');
$oRssFeed->setWebMaster($rss_email_defaut, 'ADMIN');
$oRssFeed->setManagingEditor($rss_email_defaut, 'ADMIN');
$oRssFeed->setImage($gepiPath . '/favicon.ico', 'GEPI', $ServerProtocole . $_SERVER["SERVER_NAME"]);
$oRssFeed->setCopyright('(L) - GEPI ' . getSettingValue('version'));
$oRssFeed->setGenerator('Généré par RSSFeed Class de Hugo "Emacs" HAMON - http://www.apprendre-php.com');
$oRssFeed->setLanguage('fr');
$finfo = finfo_open(FILEINFO_MIME_TYPE);
// Ajout des news au flux
if ($items["cdt_dev"]["count"] != 0) {
    for ($a = 0; $a < $items["cdt_dev"]["count"]; $a++) {
        // On récupère des données
        $donnees = get_group($items["cdt_dev"][$a]["id_groupe"]);