WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : AutoRSS
Categories : PHP, Rich Site Summary (RSS), PHP Classes
ROBERTO ALEMAN
Date : Dec 06th 2009
Grade : 1 of 5 (graded 4 times)
Viewed : 5211
File : 5009.zip
Images : Image 1
Search : More code by ROBERTO ALEMAN
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
Like this code?
Show the author your appreciation.
 

This class can be used to generate a RSS feed from files pf a directory.

It can read the list of files available in a given server directory and generates an RSS 2.0 feed with the list of files.

The base URL for the files and other details are configurable options.

index.php
<?php
/* Class AutoRSS v 1.0
Autor : Roberto Aleman
Email : ventics@gmail.com
General Public Licence , GPL */

// call to auto rss class
require_once("autorss.php");

//create new object
$newrss = new autorss();

/* example of use and orden of vars :
$document_type : document type, default : Content-type:text/xml
$path: absolute path of your folder, example path : http://ventics.com/autorss/
$xmlversion : XML file version , default : 1.0
$encoding : encondig : default :utf-8
$rssversion : RSS version, default : 2.0
$atomversion : ATOM version , default : http://www.w3.org/2005/Atom
$title: Title of your RSS autoengine channel : example: CLASS AUTORSS
$homelink: Link os your RSS autoengine channerl: example: http://www.ventics.com/autorss/
$description: description about your autoengine channel : example : CLASS AUTORSS TEST by ROBERTO ALEMAN
$language: language of xml file definition , ISO format is require, example: en-us
$lastupdate: Date of last update xml file autoengine, example : Sun, 31 May 2009 09:41:01 GMT
$callfile: file to calle autorss class, example : index.php
$generator: channel generator
$permalink: if permalink? true or false
$category: category of each file

change log :

22/06/09: Add tags : generator in channel definition and pubDate, isPermalink, category domain in item definition
and add lstat option to get info about file, where:
$info[7],  size in bytes
$info[9], 9 mtime last modified (Unix time)

*/
//send parameters and engine rss
$newrss->show("Content-type:text/xml","http://localhost/autorss/", "1.0","utf-8","2.0","http://www.w3.org/2005/Atom","CLASS AUTORSS","http://localhost/autorss/","CLASS AUTORSS TEST by ROBERTO ALEMAN","en-us","Sun, 31 May 2009 09:41:01 GMT","index.php","CLASS AUTORSS","true","My Pics");
?>



autorss.php
<?php
/* CLASS AUTORSS V 1.0 Autor : Roberto Aleman Email : ventics@gmail.com
This class is to automatic read and show  the files in a directory as rss 2.0 version,
only configure the config.php file with de globals vars and xml and rss versions,
the directory path and put config, callfile and autorss in directory to show at rss channel.
i apply to read a folder of images and show images gallery to rss channel with feedreader. Enjoy!!
GENERAL PUBLIC LICENCE , GPL */
class autorss
{
    public function
show($document_type,$path,$xmlversion,$encoding,$rssversion,$atomversion,$title,$homelink,$description,$language,$lastupdate,$callfile,$generator,$permalink,$category)
    {
       
header($document_type); // define document type header
       
$dir=getcwd(); // get directory where is script
       
$dr=@opendir($dir); //asign path to $dr var
       
if(!$dr){
            echo
"<error/>"; //if error, stop! and exit!
           
exit;
        return;
        }
        else
        {
//begin write xml file whith vars
echo "<?xml version='".$xmlversion."' encoding='".$encoding."'?>
<rss version='"
.$rssversion."' xmlns:atom='".$atomversion."'>
<channel>
<atom:link href='"
.$path."' rel='self' type='application/rss+xml'/>
<title>"
.$title."</title>
<link>"
.$homelink."</link>
<description>"
.$description."</description>
<language>"
.$language."</language>
<lastBuildDate>"
.$lastupdate."</lastBuildDate>
<generator>"
.$generator."</generator>";
while ((
$archivo = readdir($dr)) !== false){
    if(
$archivo!="autorss.php" AND $archivo!="." AND $archivo!=".." AND $archivo!="error_log" AND $archivo!=$callfile )    {
       
clearstatcache() ;
       
$info = lstat($archivo);
        echo
"
        <item>
        <title>"
.$path.$archivo."</title>
        <link>"
.$path.$archivo."</link>
        <pubDate>"
.date('r' ,$info[9])."</pubDate>
        <description><![CDATA[<img src="
.$path.$archivo."></img><br/>File Size :".$info[7]." Bytes, Modified:".date('r',$info[9])."]]></description>
        <guid isPermaLink='"
.$permalink."'>".$path.$archivo."</guid>
        <category domain='"
.$path."'>".$category."</category>
        </item>"
;
    }
}
echo
"</channel></rss>";
           
closedir($dr);
            return;
        }
    }
}
?>



Football News Aggregator
Categories : PHP, Object Oriented, PHP Classes, Rich Site Summary (RSS), HTML and PHP
RSS parser. Parses RSS into an array. Quick and nasty but does the job. No checking is done for correct Tags, only correct XML. PHP4 needed to display result (uses print_r).
Categories : PHP, XML, PHP Classes, Rich Site Summary (RSS)
Cool guestbook
Categories : PHP, Complete Programs, PHP Classes
Recordset Class like ADO Recordset (plus DataBase Splitting feature) using ODBC functions
Categories : PHP Classes, ODBC, Databases, PHP
Automatic generation of HTML code for a table. OO interface. Can define colspan, rowspan, table style, cell style, and data style. Simple, but effective.
Categories : PHP, PHP Classes, HTML, HTML and PHP
Setting up InnoDB on MySQL and using Transactions Begin, Commit, Rollback in PHP.
Categories : PHP Classes, Databases, PHP, MySQL, InnoDB
A class for sending email; it has support for To:, Cc:, Bcc: and Reply-To: headers. It requires that you have sendmail installed.
Categories : Email, PHP Classes, PHP
A class to draw real 3D graphics with surface area
Categories : Graphics, PHP, PHP Classes
Optimized Online users class
Categories : PHP, PHP Classes, Sessions
Specify your connection settings and create a link to a MySQL database.
Categories : PHP, PHP Classes, Databases, MySQL, Beginner Guides
ADODB Database Wrapper Abstraction Library for PHP: MySQL, MSSQL, Oracle, Interbase,ODBC, Microsoft Access and FoxPro.
Categories : PHP Classes, Databases, PHP, General SQL, ODBC
A Custom Error Handling And Debugging Class
Categories : PHP, PHP Classes, Debugging, Errors and Logging
file class , uploade file , download file already uploaded on another website
Categories : PHP, PHP Classes, Filesystem, Web Services
PHP MIME Decoder. This class decodes Mime Encoded email message. Attachments are stored in a director. Works with Multipart/alternative, multipart/mixed etc. see http://p3mail.com for example.
Categories : PHP, PHP Classes, Email
crop and resize image class using gd library function
Categories : PHP, PHP Classes, GD image library, Graphics