Rollator’s got class – PHP class, that is.

After extensive testing and rewriting, I’ve broken out of my former mold, and have taken dbshim out of the works, instead, I’m now using my rewritten rollatorDB.

While doing so, I re-implemented my RSS feeds, cleaning up quite a bit of the cruft in that code while extending it a bit more.

You, the end user can now decide how many articles you want to view, and if you want to view the entire article, or only a section. By appending “fullcontent” unto your query, it will display the full article within the feed. “num=xx” will allow you to view the last xx entries, and last, but not least, “length=xx” will break the feed at the specified number, by default, 250 characters into the article. Keep in mind that “fullcontent” is a boolean, and will override length.

So, the query of:

http://www.holwegner.com/rss.php?fullcontent&num=30

will display the entire article for the last 30 entries, whereas,

http://www.holwegner.com/rss.php?num=10&length=74

will display the last 10 articles, cutting off at the 74th character, good enough for a brief synopsis (usually).

Working with PHP classes is quite a bit different than just creating, and calling subroutines, but it is a rather pleasant abstraction – with my rollatorDB::fetchAssoc, and rollatorDB::fetchAssocRow making life much easier than manually stepping through everything with the archic ways of old, which looked similar to:

$result = my_db_query(“SELECT …”); while (list($myID, $myTitle, $myContents, $entryDate, $lastModDate, $entryType) = mydb_fetch_row($result)) {; ... do stuff… }

It’s now as simple as:

$myVariable = $rollatorDBvar->fetchAssocRow(“SELECT ….”) ... dostuff…

Of course, due to this the flow has slightly changed, but it’s for the better since I have all of my data in a local array, and all of the DB work is done by the time I’m parsing it, making for a much faster system!