I just ran into this error when upgrading a OsCommerce Site:

Fatal error: Call to a member function buildBlocks() on a non-object in public_html/includes/template_top.php on line 13

I saw that others had this error, but no one was able to help them. In case anyone else runs into this error check the following:

In catalog/includes/application_top.php you want to make sure you instantiate oscTemplate.

@@ -420,6 +420,9 @@
require(DIR_WS_FUNCTIONS . 'specials.php');

+ require(DIR_WS_CLASSES . 'osc_template.php');
+ $oscTemplate = new oscTemplate();

// calculate category path
if (isset($HTTP_GET_VARS['cPath'])) {
$cPath = $HTTP_GET_VARS['cPath'];

This code snippet comes from the OsCommerce V2.2RC2a to V2.3 Upgrade guide found here

I was recently asked to work on a site running FMyScript. The problem was this every time a voting link was clicked the link would just disappear and the votes were not updated.

The solution was two fold:

Part 1:
The first problem was the voting links has a ‘ in the string such as “I’m really sad to hear that” So I just changed the string instead of finding all the places I might have to escape it. I figured I am is better grammar anyways.

Part 2:
The domain must the config file. That means if you set up your site with the www in the url and someone goes to your site without the www in the url the voting system will not work.

I modified the .htaccess files to force www by adding the following lines:

RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.your_domain.com$
RewriteRule ^(.*)$ http://www.your_domain.com/$1 [R=301]

I hope this helps someone.

So in one of my recent projects I had to parse a Flickr feed and extract the image urls the code I came up with is as follows:

/* Author: Samuel Haddad
 * SimpleXML Flicker Feed Parser
//Feed URL in RSS Format
$url ="http://api.flickr.com/services/feeds/photos_public.gne?lang=en-us&format=rss_200"; //FEED URL

//Use simple XML to parse the feed
$xml = simplexml_load_file($url);
$items = $xml->xpath('/rss/channel/item');
foreach($items as $item){
 $nsmedia = $item->children('http://search.yahoo.com/mrss/');
 $img = $nsmedia->content->attributes();
 echo $img; //URL of Image
 echo "<br/>";

Of course my code did more then just extract the URL, but I will leave the rest up to the creative developers.