You get a News Management System (hereinafter 'NMS'). In this tutorial I will take you though the process of creating your NMS!
Step 1: Your Free Blog
To get your free blog, you probably pay enough for your website alone, go to http://wordpress.com and click on the big orange button that says 'Sign up now'. Go through the registration filling in everything (You can keep most of the default values!) and then validating your account. Go to your news blog and login.
Step 2: Setting up the posts
First of all just go and delete all the default posts, pages and comments (we won't need them) and then go to the new post page. In the Category section click on the Add New Category link to bring up a text box. Type in Site News and CLICK the button, then create some more post categories that you want. Now post all your existing news on your site as posts on your Wordpress blog starting with the oldest and finishing with the newest. Remember to g each news article the correct category and feel free to add any categories that you missed out.
Step 3: Simple Page with SimplePie
Go to http://simplepie.org/ and download the latest version of SimplePie. When downloaded just take the file named
simplepie.inc and copy it over to your website. Now on the page that you want to put the news on put the following PHP code:
code:
<?php
require_once("path/to/simplepie.inc"); // Include SimplePie
$feed = new SimplePie(); // Call Simple Pie
$feed ->set_feed_url(array("http://blog.address.wordpress.com/feed")); // Set the feed url
$feed ->init(); // Run SimplePie
$feed ->handle_content_type(); // Handle the content type
?>
Now, in the body section, where you want the news to be, put the following code:
code:
<table width="100%">
<?php foreach($feed->get_items() as $post) : ?>
<?php
$category = $post->get_category()->get_label();
?>
<tr>
<th><?php print $category ?> | <?php print $post->get_title(); ?> by <?php print $post->get_author()->get_name() ?></th>
</tr>
<tr>
<td><?php print $post->get_content(); ?></td>
</tr>
<?php endforeach; ?>
</table>
Your time
Now, using this as a base you can extend it even further by using icons to represent the categories using str_replace();, filter by category etc. If you want to post a link to your news here. My version (The Original) of this is located
here!
Comments Please