BCS - Business Computing Solutions

creating the future, today

  • Increase font size
  • Default font size
  • Decrease font size
Web

RSS Feed Class

One of the most irritating things I find with websites is actually writing the content to go in them! I love coding them and doing all the technical stuff but I hate actually writing the English at the front.

My solution to this was to write a library to download RSS feeds on the server, process them and spit out the articles. I did this doing a HTTP GET request on the server, putting the XML through the XML Reader class of PHP, before splitting it into arrays of general information and articles within the class.

I couldn't see a nice class that would do this, so today I release my RSS feed class to the public! I don't really have any thoughts about upgrading this class at the moment, but if I get lots of emails telling me how great I am and where my class is being used, I might be persuaded to add some more features in.

This class is covered by GPLv3 licence, which allows you to modify and redistrobute how you like, as long as you also distrobute it under the GPLv3 licence. If you do do any modifications, let me know, and I'll get the class updated here too!

Attachments:
FileDescriptionFile size
Download this file (rss.php.txt)RSS_ClassThis class contains all you need for grabbing a RSS feed on your PHP web server, and converting it into content for your page1 Kb
 

Tableless web design

All web design used to revolve around tables, putting everything into cells and putting tables inside tables until everything fitted in place, but this amount of code was horrible to maintain and it became very hard to manipulate.

Now in all major websites the layout will be made out of <div> tags, called tableless or div layouts. These are made to "float" in the correct places, and works a bit like text being wrapped around a picture.

Simple 3 box layout The layout to the left is a typical layout design for a webpage. It consists of a header space, left sidebar and main content area. With a table design it would have been made by making a 2x2 table and merging the top two cells to become one. Now this would be made up of three div tags.

 The top div tag would be the heading. This would be a simple tag, as shown below.

<div>This is the heading section</div>

After this the two other div areas would be added:

<div style="float: left;">Left sidebar</div>
<div>Main content</div> 

This would give us our final layout with coding as follows:

<html>
<head>
<title>My Page Title</title>
</head>
<body>
<div>This is the heading section</div>
<div style="float: left;">Left sidebar</div>
<div>Main content</div>
</body>
</html>
 

Your first webpage

To begin a webpage you don't need any fancy programs, all you need is a simple text editor! Notepad is perfect for the job, but if you have to have a gadget for this then use something like Notepad++ (http://notepad-plus.sourceforge.net/)

Start by putting into your page:

<html>
<head><title>My first test</title></head>
<body>My content</body>
</html> 

And then just get typing! Character returns don't work in HTML, instead you add a <br /> tag where you need to start a newline, and by putting <p> at the beginning of a paragraph and </p> at the end.

You might want to notice here that the code is formatted very carefully with every "start element" (e.g. <html>) having a matching "end element" (e.g. </html>) which allows the computer to see where your blocks start and finish.