PHP Classes

File: example_minimum.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  Classes of Anis uddin ahmad  >  Universal Feed Generator  >  example_minimum.php  >  Download  
File: example_minimum.php
Role: Example script
Content type: text/plain
Description: A minimum example (RSS 2.0)
Class: Universal Feed Generator
Generate feeds in RSS 1.0, 2.0 an Atom formats
Author: By
Last change:
Date: 7 years ago
Size: 1,354 bytes


Class file image Download
// This is a minimum example of using the class
//Creating an instance of FeedWriter class.
$TestFeed = new FeedWriter(RSS2);
//Setting the channel elements
  //Use wrapper functions for common channel elements
$TestFeed->setTitle('Testing & Checking the RSS writer class');
$TestFeed->setDescription('This is test of creating a RSS 2.0 feed Universal Feed Writer');
//Image title and link must match with the 'title' and 'link' channel elements for valid RSS 2.0
$TestFeed->setImage('Testing the RSS writer class','','');
//Retriving informations from database addin feeds
$result = $db->result;

$row = mysql_fetch_array($result, MYSQL_ASSOC))
//Create an empty FeedItem
$newItem = $TestFeed->createNewItem();
//Add elements to the feed item
//Now add the feed item
//OK. Everything is done. Now genarate the feed.