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
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
פרייסז - השוואת מחירים בסופר
ZeroLag.com
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 : Football News Aggregator
Categories : PHP, Object Oriented, PHP Classes, Rich Site Summary (RSS), HTML and PHP Click here to Update Your Picture
Tiong Lim
Date : Oct 23rd 2010
Grade : 4 of 5 (graded 4 times)
Viewed : 7244
File : 5059.png
Images : No Images for this code example.
Search : More code by Tiong Lim
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 PHP script allow you to parse multiple feeds from different sources
into separate pages using SimplePie class. A fast and efficient way to
serve fresh content to your site as to provides the most up-to-date
information to the readers.

<?php
/**************************************************************************
This PHP script allow you to parse multiple feeds from different sources
into separate pages using SimplePie class. A fast and efficient way to
serve fresh content to your site as to provides the most up-to-date
information to the readers.

This is also a basic guide on how to create an RSS Aggregator like the one
on recentfootballnews.com. To improve the script functionality, you might
need to be familiar with using SimplePie.

Requirements: http://simplepie.org/wiki/setup/requirements

Documentation: http://simplepie.org/wiki/

Copyright (c) 2010, recentfootballnews.com
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice,
   this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
   notice, this list of conditions and the following disclaimer in the
   documentation and/or other materials provided with the distribution.
* Neither the name of Recent Football News nor the names of its
   contributors may be used to endorse or promote products derived from
   this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***************************************************************************/
require 'simplepie.inc';
$feed = new SimplePie();
$feed->set_feed_url(array('http://feeds.feedburner.com/recentfootballnews',
             
'http://www.fifa.com/rss/index.xml')); // Add your favorites RSS feeds
$success = $feed->init();
$feed->handle_content_type();
if(!isset(
$_GET['page'])){
$page = 1;
} else {
$page = $_GET['page'];
}
$limit = 10; // Configure how many items to display per page
$start = (($page * $limit) );
$end = (($page * $limit) + $limit);
?><html>
<head>
<title>Recent Football News</title>
</head>
<body>
<?php if($success): ?>
<?php
$new
= array();
$new2 = array();
foreach(
$feed->get_items() as $item)
{
$yesterday = time() - (24*60*60);
if(
$item->get_date('U') > $yesterday)
{
$new[] = $item;
}
}
$max = ceil(count($new) / $limit);
foreach(
$new AS $key => $val)
{
if(
$key >= $start && $key < $end)
$new2[] = $new[$key];
}
foreach(
$new2 as $item): ?>
<div>
<h2><?php echo $item->get_title(); ?></h2>
<p><small><?php echo $item->get_date('r'); ?></small></p>
<p><?php echo $item->get_description(); ?></p>
<p><a href='<?php echo $item->get_permalink(); ?>' target='_blank'>Read more →</a></p>
</div>
<?php endforeach; ?>
<?php
endif; ?>
<div>
<?php
$max
= $max -1;
if(
$page > 1)
{
$back = ($page - 1);
echo
"<a href='?page=$back'>Back</a>";
}
for(
$i = 1; $i <= $max; $i++){
if((
$page) == $i){
echo
"<span class='current'>$i</span>";
} else {
echo
"<a href='?page=$i'>$i</a>";
}
}
if(
$page < $max){
$next = ($page + 1);
echo
"<a href='?page=$next'>Next</a>";
}
?>
</div>
</body>
</html>



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
Customizable Calendar Class
Categories : HTML and PHP, Date Time, PHP, PHP Classes, Calendar
Class to build a select tag in html, useful to build select boxes from a data base
Categories : PHP, HTML and PHP, PHP Classes
A simple class with some HTML output functions that would come in handy for consistent page layout etc.
Categories : PHP, PHP Classes, HTML and PHP, HTML, Navigation
Access_user Class - an easy to use system for protecting pages and register users.
Categories : PHP, Classes and Objects, Object Oriented, PHP Classes, Authentication
SPL and ITERATOR : examples
Categories : PHP, Object Oriented, PHP Classes, Sessions
Simple class to build tables with style sheets
Categories : HTML and PHP, PHP Classes, 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)
AutoRSS
Categories : PHP, Rich Site Summary (RSS), PHP Classes
An updated OOP - Inheritance
Categories : PHP, PHP Classes, Object Oriented
phpFormGenerator for Dynamic Form Generation from MySQL
Categories : PHP, PHP Classes, MySQL, Databases, HTML and PHP
class formHTML build your HTML Forms from PHP
Categories : PHP, PHP Classes, HTML and PHP, HTML
Vote-Poll script that has a wrapper class that allows the user to create multiple polls on the same page with little trouble.
Categories : PHP, PHP Classes, HTML and PHP
My Box - PHP Class that calculates the volumetric weight of a package.
Categories : PHP, Object Oriented, PHP Classes, Beginner Guides, Payment Gateways
XTemplate, a template class for PHP
Categories : PHP Classes, HTML and PHP, PHP