Home 
 
 
 
 
 Blog 
 
 
 
Sytling Image

Posts Tagged ‘webdev’

PHP RSS Feed Reader

September 8th, 2009 - Be the First Comment!

I decided to add some RSS feeds to the home page area of my site. This is relatively easy to do, especially with MagpieRSS. Here is an example for this blogs RSS:

<?php
// Limit the number of items to display
$rssItemsToDisplay = 5;
// Find the rss_fetch scrip in the MagpieRSS directory
require_once 'include/magpierss/rss_fetch.inc';
// Specify the location of the RSS feed
$uri = 'http://feeds.feedburner.com/BrokenBytes?format=xml';
if ($rss = fetch_rss( $uri )) {
    // This limits the number of items to display using the variable declared earlier
    $items = array_slice($rss->items, 0, $rssItemsToDisplay);
    // Loop through the RSS items
    foreach ($items as $item) {
        $url = $item['link'];
        $title = htmlspecialchars($item['title']);
        $date = $item['pubdate'];
        if(!$date) {
            $date = $item['dc']['date'];
        }
        print '<p>';
        print '<div class="rss_title">'."\n";
        if ($date) {
            print '<span class="rss_date">'."\n";
            // cut off + or - of date
            print substr($date, 0, 25);
            print '</span><br />';
        }
        print '<a href="'.$url.'">'.$title.'</a>'."\n";
        print '</div>\n\n';
        print '</p>\n\n';
    }
}
?>

As you can see it is pretty simple! Now go out and add your favorite RSS feeds into you website!

Interesting Errors

May 19th, 2009 - Be the First Comment!

Well I’m back once again with some intereting errors I experienced at work.

This error I received a couple weeks ago while working with Google Maps and developing a custom map at work. This one I find kind of mind boggling. Oh well, there has to be millions of lines of code in VS 08, not a surprise there are some problems.

undo error

IE8

March 3rd, 2009 - 1 Comment

So I decided it would be a wonderful idea to try out IE8. Now let it be said before I continue that, in general, I don’t like IE. With that being said, I downloaded and installed it which went well. No installation errors is always a plus. I thought I would try out the CSS I have been making for a forum on my Clan’s website, so I proceed to view it. Unfortunately the font size is grandma sized. I could stand across the room and give an eye test with this junk. It is that large. So I check my CSS and yup, sure enough, I have it set to 1em. Now mind you, everything looks wonderful in Firefox, Safari, and Opera. Apparently IE8 wanted to be original and go jitterbug style with its font sizes. So I adjust the CSS to find a middle ground. I also decide to turn off some of the stupid microsoft bloatish add-ons. Well I reload the page and everything looks decent, but there some little pop down from my toolbar saying, “Internet Explorer is currently running with add-ons disabled. Click here to manage, disable, or remove your add-ons.” I click the x to close the bar. I do some more changes to the CSS, re-upload it, and refresh the page. Once again, the add-ons message is back. I close it again, don’t do anything and refresh the page again. IT COMES BACK AGAIN. WTFBBQ STOP INVADING MY BROWSER SPACE KABOOM. Well there goes the possibility of me using IE8 for an extended period of time. I search for the thing in help and there seems to be no way to disable. Oh and they actually call it enable. That is right, when you want to turn OFF a feature, you ENABLE IT. What the hell, honestly. Please fix this.

Styling Image