Friday, July 8, 2011

Progress Report P.2

Printing out the blog entries.  I dumped a bunch of blog entries I grabbed off of blogger to use as test data. This is what my vacation entry looks like:


Here is the code I'm using to display it:

Code To Show All the Blog Entries

Right away I pull up the blogs db. then grab all the entries as a Collection. Next I opened a cursor and to the Collection iterated over it.

A couple key points:
  •  I sorted the entries by date (dt) in descending order. 
      • Its a 2 step process. 
        1. Get The Collection
        2. Sort The Results

                             This is different than SQL where I would say something like:
                            SELECT * FROM BLOG ORDER BY DT DESC;
  • The Blog Entry is formatted using Text_Wiki which requires a call to                  require_once("Text/Wiki.php");
           at the beginning of the page. The $wiki object allows me to add links, lists and other formatting  easily in the blog entries. It would be great to add a nice WYSIWYG entry system like blogger uses but I can get a lot of mileage out of wiki text so its a low priority item to upgrade.

So that's where I'm at. Still need lots of features but I'm having fun with it.

Til next time
Cheers,
TheSortedProgrammer

No comments:

Post a Comment