<?php
/***************************************************************************
-Copyright (C) 2005 - 2006 Scuttle project
-http://sourceforge.net/projects/scuttle/
+Copyright (c) 2005 - 2006 Marcus Campbell
http://scuttle.org/
This program is free software; you can redistribute it and/or modify
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***************************************************************************/
-require_once('header.inc.php');
+require_once 'header.inc.php';
// POST
if (isset($_POST['terms'])) {
// GET
} else {
- $bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
- $templateservice =& ServiceFactory::getServiceInstance('TemplateService');
- $userservice =& ServiceFactory::getServiceInstance('UserService');
+ $sf = new ServiceFactory();
+ $bookmarkservice =& $sf->getServiceInstance('BookmarkService');
+ $templateservice =& $sf->getServiceInstance('TemplateService');
+ $userservice =& $sf->getServiceInstance('UserService');
$logged_on_userid = $userservice->getCurrentUserId();
- list($url, $range, $terms, $page) = explode('/', $_SERVER['PATH_INFO']);
+
+ # explode the path
+ $path_exploded = explode('/', $_SERVER['PATH_INFO']);
+ $url = (count($path_exploded) > 0 ? $path_exploded[0] : NULL);
+ $range = (count($path_exploded) > 1 ? $path_exploded[1] : NULL);
+ $terms = (count($path_exploded) > 2 ? $path_exploded[2] : NULL);
+ $page = (count($path_exploded) > 3 ? $path_exploded[3] : NULL);
$tplvars = array();
$tplVars['loadjs'] = true;