Posts Tagged SFU

SFU ULife Calendar Refactor

This weekend I was working on some SFU community sites and I decided it would be nice to display the SFU ULife calendar on one website in particular. SFU ULife is a community building initiative which aims to increase the visibility of the community and events at SFU in a pledge to increase student involvement and awareness. Read more about ULife’s goals Here.

As part of this initiative ULife maintains an events calendar that is available both in HTML and RSS formats. I was much more interested in the RSS feed as it can be easily parsed and manipulated by server-side PHP.

How The Refactor Works (In A Nutshell)

The basic operation of the script is very straight-forward.

  1. A copy of the ULife calendar RSS feed is downloaded and cached from https://events.sfu.ca/rss/calendar_id/3.xml.
  2. The RSS feed is parsed by a slightly modified version of Last RSS which converts the feed into PHP associative arrays.
  3. The arrays are then passed to the Smarty Template Engine which makes the output look all pretty

Simple eh? There is a little bit more of business logic, as the user is able to specify the template file to use, the CSS file to use, the number of days to display as well as indicate if the script is to output a full HTML page or just the HTML code needed for the calendar.

Currently the preferred way to include the calendar on a dynamic web-page is to use the PHP readfile (or equivalent) command with the argument being the path to the Refactor script. If the page is not dynamically generated the other option is to use a Javascript include, which uses cross site scripting to fetch the content and write it to the screen.

Right now there is only a single template available – a vertically aligned one, and a single style – a dark one. Users of the script can of course come up with their own style-sheets by simply downloading and editing the dark style sheet to their liking. If there is demand for it, I will write more templates, starting with a horizontally aligned template, along with a couple more style sheets.

To play around with the Calendar Refactor take a look at http://ulife.dustint.com

, , ,

No Comments

SFU Bookswap v2.0

I recently re-launched the SFU Bookswap website at a new address: http://sfubookswap.com. It is still reachable from the old address of http://books.sfu-rha.ca. The new address will provide fast, dedicated hosting which is a step up from the less than reliable system that was previously used.

The new version of the Bookswap website also sports some new features and improved functionality. The process for making an offer has changed slightly: now the seller of the book is immediately notified of offers via email, rather than when the posting expires. This is intended to provide sellers with up-to-date information on people interested in their postings so they can make informed decisions if they are considering selling their book via another means.

Since sellers are notified of offers immediately, it is less important for postings to expire in a timely matter. As a result, the restriction on the time before the posting expires has been removed. This way, sellers can choose to have high-value books expire quickly if they intend on selling them to the bookstore and have books which may take longer to sell persistent on the site.

The interface for selling a book has also been improved. The page has been divided into several steps with additional descriptions of all fields. This is an attempt to help new users navigate the process for the first time while, at the same time, not negatively impacting the speed of experienced users.

Perhaps the greatest change in the new version is the integration of the Google Books Database. Previously, when a user was adding a new book to the database, ISBNDB was queried for the book information and the cover image was searched in a separate step. Now Google Books is the data provider for both book information and cover information. This improves data integrity as there is a lower probability of a title / cover mismatches and, furthermore, the Google Books interface provides better searching over a variety of keyword types.

Check out the new site! Get some cash for your texts:
http://bookswap.dustint.com
http://books.sfu-rha.ca

, ,

1 Comment