<?php
/* Service creation: only useful services are created */
-$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
-$tagservice =& ServiceFactory::getServiceInstance('TagService');
-$cdservice =& ServiceFactory::getServiceInstance('CommonDescriptionService');
+$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark');
+$tagservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag');
+$cdservice =SemanticScuttle_Service_Factory::getServiceInstance('CommonDescription');
$pageName = isset($pageName)?$pageName:"";
$this->includeTemplate($GLOBALS['top_include']);
-include('search.inc.php');
+include('search.menu.php');
?>
<?php if($pageName == PAGE_INDEX && $GLOBALS['welcomeMessage']):?>
***************************************************************************/
/* Service creation: only useful services are created */
-$b2tservice = & ServiceFactory :: getServiceInstance('Bookmark2TagService');
+$b2tservice = SemanticScuttle_Service_Factory :: getServiceInstance('Bookmark2Tag');
$logged_on_userid = $userservice->getCurrentUserId();
<?php
-$b2tservice =& ServiceFactory::getServiceInstance('Bookmark2TagService');
+$b2tservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark2Tag');
$commonTags =& $b2tservice->getRelatedTagsByHash($hash);
$commonTags =& $b2tservice->tagCloud($commonTags, 5, 90, 225, 'alphabet_asc');
<?php
/* Service creation: only useful services are created */
-$tag2tagservice =& ServiceFactory::getServiceInstance('Tag2TagService');
+$tag2tagservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag2Tag');
require_once('sidebar.linkedtags.inc.php');
<?php
/* Service creation: only useful services are created */
-$tag2tagservice =& ServiceFactory::getServiceInstance('Tag2TagService');
+$tag2tagservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag2Tag');
require_once('sidebar.linkedtags.inc.php');
<?php
/* Service creation: only useful services are created */
-$tag2tagservice =& ServiceFactory::getServiceInstance('Tag2TagService');
+$tag2tagservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag2Tag');
require_once('sidebar.linkedtags.inc.php');
<?php
/* Service creation: only useful services are created */
-$b2tservice =& ServiceFactory::getServiceInstance('Bookmark2TagService');
+$b2tservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark2Tag');
if(!isset($user)) {
<?php
/* Service creation: only useful services are created */
-$b2tservice =& ServiceFactory::getServiceInstance('Bookmark2TagService');
+$b2tservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark2Tag');
/* Manage input */
$userid = isset($userid)?$userid:NULL;
<?php
/* Service creation: only useful services are created */
-$b2tservice =& ServiceFactory::getServiceInstance('Bookmark2TagService');
+$b2tservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark2Tag');
if(!isset($user)) $user="";
<?php
/* Service creation: only useful services are created */
-$searchhistoryservice =& ServiceFactory::getServiceInstance('SearchHistoryService');
+$searchhistoryservice =SemanticScuttle_Service_Factory::getServiceInstance('SearchHistory');
$logged_on_userid = $userservice->getCurrentUserId();
if ($logged_on_userid === false) {
return array('output' => '', 'stoplist' => $stopList);
}
- $tag2tagservice =& ServiceFactory::getServiceInstance('Tag2TagService');
- $tagstatservice =& ServiceFactory::getServiceInstance('TagStatService');
+ $tag2tagservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag2Tag');
+ $tagstatservice =SemanticScuttle_Service_Factory::getServiceInstance('TagStat');
// link '>'
if($level>1) {
--- /dev/null
+<?php
+class SemanticScuttle_Service
+{
+ /**
+ * SQL database object
+ *
+ * @var sql_db
+ */
+ protected $db;
+
+
+
+ /**
+ * Returns the single service instance
+ *
+ * @internal
+ * This function can be used once PHP 5.3 is minimum, because only
+ * 5.3 supports late static binding. For all lower php versions,
+ * we still need a copy of this method in each service class.
+ *
+ * @param DB $db Database object
+ *
+ * @return SemanticScuttle_Service
+ */
+ public static function getInstance($db)
+ {
+ static $instance;
+ if (!isset($instance)) {
+ $instance = new self($db);
+ }
+ return $instance;
+ }
+
+}
+?>
\ No newline at end of file
<?php
-class BookmarkService {
- var $db;
+class SemanticScuttle_Service_Bookmark extends SemanticScuttle_Service
+{
var $tablename;
- function & getInstance(& $db) {
+ /**
+ * Returns the single service instance
+ *
+ * @param DB $db Database object
+ *
+ * @return SemanticScuttle_Service
+ */
+ public static function getInstance($db)
+ {
static $instance;
- if (!isset ($instance))
- $instance = & new BookmarkService($db);
+ if (!isset($instance)) {
+ $instance = new self($db);
+ }
return $instance;
}
- function BookmarkService(& $db) {
- $this->db = & $db;
+ public function __construct($db)
+ {
+ $this->db = $db;
$this->tablename = $GLOBALS['tableprefix'] .'bookmarks';
}
function _getbookmark($fieldname, $value, $all = false) {
if (!$all) {
- $userservice = & ServiceFactory :: getServiceInstance('UserService');
+ $userservice = SemanticScuttle_Service_Factory :: getServiceInstance('User');
$sId = $userservice->getCurrentUserId();
$range = ' AND uId = '. $sId;
} else {
if ($row = & $this->db->sql_fetchrow($dbresult)) {
if ($include_tags) {
- $b2tservice = & ServiceFactory :: getServiceInstance('Bookmark2TagService');
+ $b2tservice = SemanticScuttle_Service_Factory :: getServiceInstance('Bookmark2Tag');
$row['tags'] = $b2tservice->getTagsForBookmark($bid);
}
$output = $row;
return false;
}
- $userservice = & ServiceFactory::getServiceInstance('UserService');
+ $userservice = SemanticScuttle_Service_Factory::getServiceInstance('User');
$user = $userservice->getCurrentUser();
//user has to be either admin, or owner
// Note that date is expected to be a string that's interpretable by strtotime().
function addBookmark($address, $title, $description, $privateNote, $status, $categories, $date = NULL, $fromApi = false, $fromImport = false, $sId = -1) {
if($sId == -1) {
- $userservice = & ServiceFactory :: getServiceInstance('UserService');
+ $userservice = SemanticScuttle_Service_Factory :: getServiceInstance('User');
$sId = $userservice->getCurrentUserId();
}
$extension = end($uriparts);
unset($uriparts);
- $b2tservice = & ServiceFactory :: getServiceInstance('Bookmark2TagService');
+ $b2tservice = SemanticScuttle_Service_Factory :: getServiceInstance('Bookmark2Tag');
if (!$b2tservice->attachTags($bId, $categories, $fromApi, $extension, false, $fromImport)) {
$this->db->sql_transaction('rollback');
message_die(GENERAL_ERROR, 'Could not insert bookmark', '', __LINE__, __FILE__, $sql, $this->db);
$extension = end($uriparts);
unset($uriparts);
- $b2tservice = & ServiceFactory :: getServiceInstance('Bookmark2TagService');
+ $b2tservice = SemanticScuttle_Service_Factory :: getServiceInstance('Bookmark2Tag');
if (!$b2tservice->attachTags($bId, $categories, $fromApi, $extension)) {
$this->db->sql_transaction('rollback');
message_die(GENERAL_ERROR, 'Could not update bookmark', '', __LINE__, __FILE__, $sql, $this->db);
// bookmarks; otherwise, just get the public bookmarks.
// - if the $user is set and IS the logged-in user, then get all bookmarks.
- $userservice =& ServiceFactory::getServiceInstance('UserService');
- $b2tservice =& ServiceFactory::getServiceInstance('Bookmark2TagService');
- $tag2tagservice =& ServiceFactory::getServiceInstance('Tag2TagService');
+ $userservice =SemanticScuttle_Service_Factory::getServiceInstance('User');
+ $b2tservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark2Tag');
+ $tag2tagservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag2Tag');
$sId = $userservice->getCurrentUserId();
if ($userservice->isLoggedOn()) {
return true;
}
- function deleteBookmarksForUser($uId) {\r
- $query = 'DELETE FROM '. $GLOBALS['tableprefix'] .'bookmarks WHERE uId = '. intval($uId);\r
-\r
- if (!($dbresult = & $this->db->sql_query($query))) {\r
- message_die(GENERAL_ERROR, 'Could not delete bookmarks', '', __LINE__, __FILE__, $query, $this->db);\r
- return false;\r
- }\r
-\r
- return true;\r
+ function deleteBookmarksForUser($uId) {
+ $query = 'DELETE FROM '. $GLOBALS['tableprefix'] .'bookmarks WHERE uId = '. intval($uId);
+
+ if (!($dbresult = & $this->db->sql_query($query))) {
+ message_die(GENERAL_ERROR, 'Could not delete bookmarks', '', __LINE__, __FILE__, $query, $this->db);
+ return false;
+ }
+
+ return true;
}
function countOthers($address) {
return false;
}
- $userservice = & ServiceFactory :: getServiceInstance('UserService');
+ $userservice = SemanticScuttle_Service_Factory :: getServiceInstance('User');
$sId = $userservice->getCurrentUserId();
if ($userservice->isLoggedOn()) {
<?php
-class Bookmark2TagService {
- var $db;
+class SemanticScuttle_Service_Bookmark2Tag extends SemanticScuttle_Service
+{
var $tablename;
- function &getInstance(&$db) {
+
+ /**
+ * Returns the single service instance
+ *
+ * @param DB $db Database object
+ *
+ * @return SemanticScuttle_Service
+ */
+ public static function getInstance($db)
+ {
static $instance;
- if (!isset($instance))
- $instance =& new Bookmark2TagService($db);
+ if (!isset($instance)) {
+ $instance = new self($db);
+ }
return $instance;
}
- function Bookmark2TagService(&$db) {
- $this->db =& $db;
+ public function __construct($db)
+ {
+ $this->db = $db;
$this->tablename = $GLOBALS['tableprefix'] .'bookmarks2tags';
}
}
}
- $tagservice =& ServiceFactory::getServiceInstance('TagService');
+ $tagservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag');
$tags = $tagservice->normalize($tags);
for ($i = 0; $i < $tags_count; $i++) {
$tags[$i] = trim(strtolower($tags[$i]));
if ($fromApi) {
- include_once(dirname(__FILE__) .'/../functions.inc.php');
+ include_once 'SemanticScuttle/functions.php';
$tags[$i] = convertTag($tags[$i], 'in');
}
}
// Media and file types
if (!is_null($extension)) {
- include_once(dirname(__FILE__) .'/../functions.inc.php');
+ include_once 'SemanticScuttle/functions.php';
if ($keys = multi_array_search($extension, $GLOBALS['filetypes'])) {
$tags[] = 'system:filetype:'. $extension;
}
}
- $bs =& ServiceFactory::getServiceInstance('BookmarkService');
- $tts =& ServiceFactory::getServiceInstance('Tag2TagService');
+ $bs =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark');
+ $tts =SemanticScuttle_Service_Factory::getServiceInstance('Tag2Tag');
// Create links between tags
foreach($tags as $key => $tag) {
}
function deleteTag($uId, $tag) {
- $bs =& ServiceFactory::getServiceInstance('BookmarkService');
+ $bs =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark');
$query = 'DELETE FROM '. $this->getTableName();
$query.= ' USING '. $this->getTableName() .', '. $bs->getTableName();
}
/* Allow deletion in admin page */
- function deleteTagsForUser($uId) {\r
- $qmask = 'DELETE FROM %s USING %s, %s WHERE %s.bId = %s.bId AND %s.uId = %d';\r
- $query = sprintf($qmask,\r
- $this->getTableName(),\r
- $this->getTableName(),\r
- $GLOBALS['tableprefix'].'bookmarks',\r
- $this->getTableName(),\r
- $GLOBALS['tableprefix'].'bookmarks',\r
- $GLOBALS['tableprefix'].'bookmarks',\r
- $uId);\r
-\r
- if (!($dbresult =& $this->db->sql_query($query))) {\r
- message_die(GENERAL_ERROR, 'Could not delete tags', '', __LINE__, __FILE__, $query, $this->db);\r
- return false;\r
- }\r
-\r
- return true;\r
+ function deleteTagsForUser($uId) {
+ $qmask = 'DELETE FROM %s USING %s, %s WHERE %s.bId = %s.bId AND %s.uId = %d';
+ $query = sprintf($qmask,
+ $this->getTableName(),
+ $this->getTableName(),
+ $GLOBALS['tableprefix'].'bookmarks',
+ $this->getTableName(),
+ $GLOBALS['tableprefix'].'bookmarks',
+ $GLOBALS['tableprefix'].'bookmarks',
+ $uId);
+
+ if (!($dbresult =& $this->db->sql_query($query))) {
+ message_die(GENERAL_ERROR, 'Could not delete tags', '', __LINE__, __FILE__, $query, $this->db);
+ return false;
+ }
+
+ return true;
}
function &getTagsForBookmark($bookmarkid) {
}
function &getTags($userid = NULL) {
- $userservice =& ServiceFactory::getServiceInstance('UserService');
+ $userservice =SemanticScuttle_Service_Factory::getServiceInstance('User');
$logged_on_user = $userservice->getCurrentUserId();
$query = 'SELECT T.tag, COUNT(B.bId) AS bCount FROM '. $GLOBALS['tableprefix'] .'bookmarks AS B INNER JOIN '. $userservice->getTableName() .' AS U ON B.uId = U.'. $userservice->getFieldName('primary') .' INNER JOIN '. $GLOBALS['tableprefix'] .'bookmarks2tags AS T ON B.bId = T.bId';
// Returns the most popular tags used for a particular bookmark hash
function &getRelatedTagsByHash($hash, $limit = 20) {
- $userservice = & ServiceFactory :: getServiceInstance('UserService');
+ $userservice = SemanticScuttle_Service_Factory :: getServiceInstance('User');
$sId = $userservice->getCurrentUserId();
// Logged in
if ($userservice->isLoggedOn()) {
function &getAdminTags($limit = 30, $logged_on_user = NULL, $days = NULL) {
// look for admin ids
- $userservice = & ServiceFactory :: getServiceInstance('UserService');
+ $userservice = SemanticScuttle_Service_Factory :: getServiceInstance('User');
$adminIds = $userservice->getAdminIds();
// ask for their tags
function &getContactTags($user, $limit = 30, $logged_on_user = NULL, $days = NULL) {
// look for contact ids
- $userservice = & ServiceFactory :: getServiceInstance('UserService');
+ $userservice = SemanticScuttle_Service_Factory :: getServiceInstance('User');
$contacts = $userservice->getWatchlist($user);
// add the user (to show him/her also his/her tags)
}
function renameTag($userid, $old, $new, $fromApi = false) {
- $bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
- $tagservice =& ServiceFactory::getServiceInstance('TagService');
+ $bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark');
+ $tagservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag');
if (is_null($userid) || is_null($old) || is_null($new))
return false;
<?php
-class CacheService {
+class SemanticScuttle_Service_Cache extends SemanticScuttle_Service
+{
var $basedir;
var $fileextension = '.cache';
- function &getInstance() {
- static $instance;
-
- if (!isset($instance))
- $instance =& new CacheService();
-
- return $instance;
- }
+ /**
+ * Returns the single service instance
+ *
+ * @param DB $db Database object
+ *
+ * @return SemanticScuttle_Service
+ */
+ public static function getInstance($db)
+ {
+ static $instance;
+ if (!isset($instance)) {
+ $instance = new self($db);
+ }
+ return $instance;
+ }
- function CacheService() {
+ protected function __construct()
+ {
$this->basedir = $GLOBALS['dir_cache'];
}
<?php
-class CommonDescriptionService {
- var $db;
+class SemanticScuttle_Service_CommonDescription extends SemanticScuttle_Service
+{
var $tablename;
- function &getInstance(&$db) {
+ /**
+ * Returns the single service instance
+ *
+ * @param DB $db Database object
+ *
+ * @return SemanticScuttle_Service
+ */
+ public static function getInstance($db)
+ {
static $instance;
- if (!isset($instance))
- $instance =& new CommonDescriptionService($db);
+ if (!isset($instance)) {
+ $instance = new self($db);
+ }
return $instance;
}
- function CommonDescriptionService(&$db) {
- $this->db =& $db;
+ public function __construct($db)
+ {
+ $this->db = $db;
$this->tablename = $GLOBALS['tableprefix'] .'commondescription';
}
<?php
/* Connect to the database and build services */
-class ServiceFactory {
- function ServiceFactory(&$db, $serviceoverrules = array()) {
+class SemanticScuttle_Service_Factory
+{
+ public function __construct($db, $serviceoverrules = array())
+ {
}
- function &getServiceInstance($name, $servicedir = NULL) {
+ public function getServiceInstance($name, $servicedir = null)
+ {
global $dbhost, $dbuser, $dbpass, $dbname, $dbport, $dbpersist, $dbtype;
static $instances = array();
static $db;
if (!isset($db)) {
- require_once(dirname(__FILE__) .'/../includes/db/'. $dbtype .'.php');
+ require_once 'SemanticScuttle/db/'. $dbtype .'.php';
$db = new sql_db();
$db->sql_connect($dbhost, $dbuser, $dbpass, $dbname, $dbport, $dbpersist);
if(!$db->db_connect_id) {
}
if (!class_exists($name)) {
if (!isset($servicedir)) {
- $servicedir = dirname(__FILE__) .'/';
+ $servicedir = 'SemanticScuttle/Service/';
}
- require_once($servicedir . strtolower($name) . '.php');
+ require_once $servicedir . $name . '.php';
}
- $instances[$name] = call_user_func(array($name, 'getInstance'), $db);
+ $instances[$name] = call_user_func(
+ array('SemanticScuttle_Service_' . $name, 'getInstance'),
+ $db
+ );
}
return $instances[$name];
}
<?php
-class SearchHistoryService {
- var $db;
+class SemanticScuttle_Service_SearchHistory extends SemanticScuttle_Service
+{
var $tablename;
var $sizeSearchHistory;
- function &getInstance(&$db) {
+ /**
+ * Returns the single service instance
+ *
+ * @param DB $db Database object
+ *
+ * @return SemanticScuttle_Service
+ */
+ public static function getInstance($db)
+ {
static $instance;
- if (!isset($instance))
- $instance =& new SearchHistoryService($db);
+ if (!isset($instance)) {
+ $instance = new self($db);
+ }
return $instance;
}
- function SearchHistoryService(& $db) {
- $this->db =& $db;
+ public function __construct($db)
+ {
+ $this->db = $db;
$this->tablename = $GLOBALS['tableprefix'] .'searchhistory';
if(isset($GLOBALS['sizeSearchHistory'])) {
$this->sizeSearchHistory = $GLOBALS['sizeSearchHistory'];
<?php
-class TagService {
- var $db;
+class SemanticScuttle_Service_Tag extends SemanticScuttle_Service
+{
var $tablename;
- function &getInstance(&$db) {
+ /**
+ * Returns the single service instance
+ *
+ * @param DB $db Database object
+ *
+ * @return SemanticScuttle_Service
+ */
+ public static function getInstance($db)
+ {
static $instance;
- if (!isset($instance))
- $instance =& new TagService($db);
+ if (!isset($instance)) {
+ $instance = new self($db);
+ }
return $instance;
}
- function TagService(&$db) {
- $this->db =& $db;
+ public function __construct($db)
+ {
+ $this->db = $db;
$this->tablename = $GLOBALS['tableprefix'] .'tags';
}
<?php
-class Tag2TagService {
- var $db;
- var $tablename;
-
- function &getInstance(&$db) {
+class SemanticScuttle_Service_Tag2Tag extends SemanticScuttle_Service
+{
+ protected $tablename;
+
+ /**
+ * Returns the single service instance
+ *
+ * @param DB $db Database object
+ *
+ * @return SemanticScuttle_Service
+ */
+ public static function getInstance($db)
+ {
static $instance;
- if (!isset($instance))
- $instance =& new Tag2TagService($db);
+ if (!isset($instance)) {
+ $instance = new self($db);
+ }
return $instance;
}
- function Tag2TagService(&$db) {
+
+ function __construct(&$db)
+ {
$this->db =& $db;
$this->tablename = $GLOBALS['tableprefix'] .'tags2tags';
}
function addLinkedTags($tag1, $tag2, $relationType, $uId) {
- $tagservice =& ServiceFactory::getServiceInstance('TagService');
+ $tagservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag');
$tag1 = $tagservice->normalize($tag1);
$tag2 = $tagservice->normalize($tag2);
// Return linked tags just for admin users
function getAdminLinkedTags($tag, $relationType, $inverseRelation = false, $stopList = array()) {
// look for admin ids
- $userservice = & ServiceFactory :: getServiceInstance('UserService');
+ $userservice = SemanticScuttle_Service_Factory :: getServiceInstance('User');
$adminIds = $userservice->getAdminIds();
//ask for their linked tags
}
// try to find data in cache
- $tcs = & ServiceFactory::getServiceInstance('TagCacheService');
+ $tcs = SemanticScuttle_Service_Factory::getServiceInstance('TagCache');
if(count($stopList) == 0) {
$activatedCache = true;
} else {
$query = "SELECT DISTINCT tts.tag1 as tag";
$query.= " FROM `". $this->getTableName() ."` tts";
if($orderBy != null) {
- $tsts =& ServiceFactory::getServiceInstance('TagStatService');
+ $tsts =SemanticScuttle_Service_Factory::getServiceInstance('TagStat');
$query.= ", ".$tsts->getTableName() ." tsts";
}
$query.= " WHERE tts.tag1 <> ALL";
}
function renameTag($uId, $oldName, $newName) {
- $tagservice =& ServiceFactory::getServiceInstance('TagService');
+ $tagservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag');
$newName = $tagservice->normalize($newName);
$query = 'UPDATE `'. $this->getTableName() .'`';
}
function update($tag1, $tag2, $relationType, $uId) {
- $tsts =& ServiceFactory::getServiceInstance('TagStatService');
+ $tsts =SemanticScuttle_Service_Factory::getServiceInstance('TagStat');
$tsts->updateStat($tag1, $relationType, $uId);
- $tcs = & ServiceFactory::getServiceInstance('TagCacheService');
+ $tcs = SemanticScuttle_Service_Factory::getServiceInstance('TagCache');
$tcs->deleteByUser($uId);
}
$query = 'TRUNCATE TABLE `'. $this->getTableName() .'`';
$this->db->sql_query($query);
- $tsts =& ServiceFactory::getServiceInstance('TagStatService');
+ $tsts =SemanticScuttle_Service_Factory::getServiceInstance('TagStat');
$tsts->deleteAll();
}
<?php
-
-/*
- * This class infers on relation between tags by storing all the including tags or synonymous tag.
- * For example, if the user creates: tag1>tag2>tag3, the system can infer that tag is included into tag1.
- * Instead of computing this relation several times, it is saved into this current table.
+/**
+ * This class infers on relation between tags by storing all
+ * the including tags or synonymous tag.
+ * For example, if the user creates: tag1>tag2>tag3, the system
+ * can infer that tag is included into tag1.
+ * Instead of computing this relation several times, it is saved
+ * into this current table.
* For synonymy, this table stores also the group of synonymous tags.
- * The table must be updated for each modification of the relations between tags.
+ * The table must be updated for each modification of
+ * the relations between tags.
*/
-
-class TagCacheService {
- var $db;
+class SemanticScuttle_Service_TagCache extends SemanticScuttle_Service
+{
var $tablename;
- function &getInstance(&$db) {
+ /**
+ * Returns the single service instance
+ *
+ * @param DB $db Database object
+ *
+ * @return SemanticScuttle_Service
+ */
+ public static function getInstance($db)
+ {
static $instance;
- if (!isset($instance))
- $instance =& new TagCacheService($db);
+ if (!isset($instance)) {
+ $instance = new self($db);
+ }
return $instance;
}
- function TagCacheService(&$db) {
- $this->db =& $db;
+ protected function __construct($db)
+ {
+ $this->db =$db;
$this->tablename = $GLOBALS['tableprefix'] .'tagscache';
}
function getChildren($tag1, $uId) {
- $tagservice =& ServiceFactory::getServiceInstance('TagService');
+ $tagservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag');
$tag1 = $tagservice->normalize($tag1);
if($tag1 == '') return false;
}
function addChild($tag1, $tag2, $uId) {
- $tagservice =& ServiceFactory::getServiceInstance('TagService');
+ $tagservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag');
$tag1 = $tagservice->normalize($tag1);
$tag2 = $tagservice->normalize($tag2);
}
function existsChild($tag1, $tag2, $uId) {
- $tagservice =& ServiceFactory::getServiceInstance('TagService');
+ $tagservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag');
$tag1 = $tagservice->normalize($tag1);
$tag2 = $tagservice->normalize($tag2);
}
function _isSynonymKey($tag1, $uId) {
- $tagservice =& ServiceFactory::getServiceInstance('TagService');
+ $tagservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag');
$tag1 = $tagservice->normalize($tag1);
$query = "SELECT tag1 FROM `". $this->getTableName() ."`";
}
function _isSynonymValue($tag2, $uId) {
- $tagservice =& ServiceFactory::getServiceInstance('TagService');
+ $tagservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag');
$tag2 = $tagservice->normalize($tag2);
$query = "SELECT tag2 FROM `". $this->getTableName() ."`";
}
function _getSynonymKey($tag2, $uId) {
- $tagservice =& ServiceFactory::getServiceInstance('TagService');
+ $tagservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag');
$tag2 = $tagservice->normalize($tag2);
if($this->_isSynonymKey($tag2)) return $tag2;
* $tagExcepted allows to hide a value.
*/
function _getSynonymValues($tag1, $uId, $tagExcepted = NULL) {
- $tagservice =& ServiceFactory::getServiceInstance('TagService');
+ $tagservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag');
$tag1 = $tagservice->normalize($tag1);
$tagExcepted = $tagservice->normalize($tagExcepted);
<?php
-class TagStatService {
- var $db;
+class SemanticScuttle_Service_TagStat extends SemanticScuttle_Service
+{
+
var $tablename;
- function &getInstance(&$db) {
+ /**
+ * Returns the single service instance
+ *
+ * @param DB $db Database object
+ *
+ * @return SemanticScuttle_Service
+ */
+ public static function getInstance($db)
+ {
static $instance;
- if (!isset($instance))
- $instance =& new TagStatService($db);
+ if (!isset($instance)) {
+ $instance = new self($db);
+ }
return $instance;
}
- function TagStatService(&$db) {
- $this->db =& $db;
+ protected function __construct($db)
+ {
+ $this->db = $db;
$this->tablename = $GLOBALS['tableprefix'] .'tagsstats';
}
function getNbChildren($tag1, $relationType, $uId) {
- $tts =& ServiceFactory::getServiceInstance('Tag2TagService');
+ $tts =SemanticScuttle_Service_Factory::getServiceInstance('Tag2Tag');
$query = "SELECT tag1, relationType, uId FROM `". $tts->getTableName() ."`";
$query.= " WHERE tag1 = '" .$tag1 ."'";
$query.= " AND relationType = '". $relationType ."'";
return false;
}
- $tts =& ServiceFactory::getServiceInstance('Tag2TagService');
+ $tts =SemanticScuttle_Service_Factory::getServiceInstance('Tag2Tag');
$linkedTags = $tts->getLinkedTags($tag1, $relationType, $uId);
$nbDescendants = 0;
$maxDepth = 0;
}
function updateAllStat() {
- $tts =& ServiceFactory::getServiceInstance('Tag2TagService');
+ $tts =SemanticScuttle_Service_Factory::getServiceInstance('Tag2Tag');
$query = "SELECT tag1, uId FROM `". $tts->getTableName() ."`";
$query.= " WHERE relationType = '>'";
<?php
-class TemplateService {
- var $basedir;
+class SemanticScuttle_Service_Template extends SemanticScuttle_Service
+{
+ protected $basedir;
- function &getInstance() {
+ /**
+ * Returns the single service instance
+ *
+ * @param DB $db Database object
+ *
+ * @return SemanticScuttle_Service
+ */
+ public static function getInstance($db)
+ {
static $instance;
- if (!isset($instance))
- $instance =& new TemplateService();
+ if (!isset($instance)) {
+ $instance = new self($db);
+ }
return $instance;
}
- function TemplateService() {
+ public function __construct()
+ {
$this->basedir = $GLOBALS['TEMPLATES_DIR'];
}
<?php
-class UserService {
- var $db;
- var $fields = array(
+class SemanticScuttle_Service_User extends SemanticScuttle_Service
+{
+ protected $db;
+ protected $fields = array(
'primary' => 'uId',
'username' => 'username',
'password' => 'password');
- var $profileurl;
- var $tablename;
- var $sessionkey;
- var $cookiekey;
- var $cookietime = 1209600; // 2 weeks
-
- function &getInstance(&$db) {
+ protected $profileurl;
+ protected $tablename;
+ protected $sessionkey;
+ protected $cookiekey;
+ protected $cookietime = 1209600; // 2 weeks
+
+ /**
+ * Returns the single service instance
+ *
+ * @param DB $db Database object
+ *
+ * @return SemanticScuttle_Service
+ */
+ public static function getInstance($db)
+ {
static $instance;
- if (!isset($instance))
- $instance =& new UserService($db);
+ if (!isset($instance)) {
+ $instance = new self($db);
+ }
return $instance;
}
- function UserService(& $db) {
- $this->db =& $db;
- $this->tablename = $GLOBALS['tableprefix'] .'users';
+ protected function __construct($db)
+ {
+ $this->db = $db;
+ $this->tablename = $GLOBALS['tableprefix'] .'users';
$this->sessionkey = INSTALLATION_ID.'-currentuserid';
- $this->cookiekey = INSTALLATION_ID.'-login';
+ $this->cookiekey = INSTALLATION_ID.'-login';
$this->profileurl = createURL('profile', '%2$s');
$this->updateSessionStability();
}
return true;
}
- function getAllUsers ( ) {\r
- $query = 'SELECT * FROM '. $this->getTableName();\r
-\r
- if (! ($dbresult =& $this->db->sql_query($query)) ) {\r
- message_die(GENERAL_ERROR, 'Could not get users', '', __LINE__, __FILE__, $query, $this->db);\r
- return false;\r
- }\r
-\r
- $rows = array();\r
-\r
- while ( $row = $this->db->sql_fetchrow($dbresult) ) {\r
- $rows[] = $row;\r
- }\r
- $this->db->sql_freeresult($dbresult);\r
- return $rows;\r
+ function getAllUsers ( ) {
+ $query = 'SELECT * FROM '. $this->getTableName();
+
+ if (! ($dbresult =& $this->db->sql_query($query)) ) {
+ message_die(GENERAL_ERROR, 'Could not get users', '', __LINE__, __FILE__, $query, $this->db);
+ return false;
+ }
+
+ $rows = array();
+
+ while ( $row = $this->db->sql_fetchrow($dbresult) ) {
+ $rows[] = $row;
+ }
+ $this->db->sql_freeresult($dbresult);
+ return $rows;
}
// Returns an array with admin uIds
$admins[] = $this->getIdFromUser($adminName);
}
return $admins;
- }\r
-\r
- function deleteUser($uId) {\r
- $query = 'DELETE FROM '. $this->getTableName() .' WHERE uId = '. intval($uId);\r
-\r
- if (!($dbresult = & $this->db->sql_query($query))) {\r
- message_die(GENERAL_ERROR, 'Could not delete user', '', __LINE__, __FILE__, $query, $this->db);\r
- return false;\r
- }\r
-\r
- return true;\r
- }\r
+ }
+
+ function deleteUser($uId) {
+ $query = 'DELETE FROM '. $this->getTableName() .' WHERE uId = '. intval($uId);
+
+ if (!($dbresult = & $this->db->sql_query($query))) {
+ message_die(GENERAL_ERROR, 'Could not delete user', '', __LINE__, __FILE__, $query, $this->db);
+ return false;
+ }
+
+ return true;
+ }
function sanitisePassword($password) {
function getName() {
// Look for value only if not already set
if(!isset($this->name)) {
- $userservice =& ServiceFactory::getServiceInstance('UserService');
+ $userservice =SemanticScuttle_Service_Factory::getServiceInstance('User');
$user = $userservice->getUser($this->id);
$this->name = $user['name'];
}
function getEmail() {
// Look for value only if not already set
if(!isset($this->email)) {
- $userservice =& ServiceFactory::getServiceInstance('UserService');
+ $userservice =SemanticScuttle_Service_Factory::getServiceInstance('User');
$user = $userservice->getUser($this->id);
$this->email = $user['email'];
}
function getHomepage() {
// Look for value only if not already set
if(!isset($this->homepage)) {
- $userservice =& ServiceFactory::getServiceInstance('UserService');
+ $userservice =SemanticScuttle_Service_Factory::getServiceInstance('User');
$user = $userservice->getUser($this->id);
$this->homepage = $user['homepage'];
}
function getContent() {
// Look for value only if not already set
if(!isset($this->content)) {
- $userservice =& ServiceFactory::getServiceInstance('UserService');
+ $userservice =SemanticScuttle_Service_Factory::getServiceInstance('User');
$user = $userservice->getUser($this->id);
$this->content = $user['uContent'];
}
function getDatetime() {
// Look for value only if not already set
if(!isset($this->content)) {
- $userservice =& ServiceFactory::getServiceInstance('UserService');
+ $userservice =SemanticScuttle_Service_Factory::getServiceInstance('User');
$user = $userservice->getUser($this->id);
$this->datetime = $user['uDatetime'];
}
function isAdmin() {
// Look for value only if not already set
if(!isset($this->isAdmin)) {
- $userservice =& ServiceFactory::getServiceInstance('UserService');
+ $userservice =SemanticScuttle_Service_Factory::getServiceInstance('User');
$this->isAdmin = $userservice->isAdmin($this->id);
}
return $this->isAdmin;
}
function getNbBookmarks($range = 'public') {
- $bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
+ $bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark');
return $bookmarkservice->countBookmarks($this->getId(), $range);
}
}
<?php
-if(!file_exists(dirname(__FILE__) .'/config.inc.php')) {
- die('Please copy "config.inc.php.dist" to "config.inc.php"');
+if(!file_exists(dirname(__FILE__) .'/../../data/config.php')) {
+ die('Please copy "config.php.dist" to "config.php"');
}
+set_include_path(
+ get_include_path() . PATH_SEPARATOR
+ . dirname(__FILE__) . '/../'
+);
// 1 // First requirements part (before debug management)
-require_once(dirname(__FILE__) .'/config.default.inc.php');
-require_once(dirname(__FILE__) .'/config.inc.php');
-require_once(dirname(__FILE__) .'/constants.inc.php'); // some constants are based on variables from config file
+$datadir = dirname(__FILE__) . '/../../data/';
+require_once($datadir . '/config.default.php');
+require_once($datadir . '/config.php');
+require_once 'SemanticScuttle/constants.php'; // some constants are based on variables from config file
// Debug Management using constants
}
// 2 // Second requirements part which could display bugs (must come after debug management)
-require_once(dirname(__FILE__) .'/services/servicefactory.php');
-require_once(dirname(__FILE__) .'/functions.inc.php');
+require_once 'SemanticScuttle/Service.php';
+require_once 'SemanticScuttle/Service/Factory.php';
+require_once 'SemanticScuttle/functions.php';
// 3 // Third requirements part which import functions from includes/ directory
// UTF-8 functions
-require_once(dirname(__FILE__) .'/includes/utf8.php');
+require_once 'SemanticScuttle/utf8.php';
// Translation
-require_once(dirname(__FILE__) .'/includes/php-gettext/gettext.inc');
+require_once 'php-gettext/gettext.inc';
$domain = 'messages';
T_setlocale(LC_MESSAGES, $locale);
T_bindtextdomain($domain, dirname(__FILE__) .'/locales');
session_start();
// 5 // Create mandatory services and objects
-$userservice =& ServiceFactory::getServiceInstance('UserService');
+$userservice =SemanticScuttle_Service_Factory::getServiceInstance('User');
$currentUser = $userservice->getCurrentObjectUser();
-$templateservice =& ServiceFactory::getServiceInstance('TemplateService');
+$templateservice =SemanticScuttle_Service_Factory::getServiceInstance('Template');
$tplVars = array();
$tplVars['currentUser'] = $currentUser;
$tplVars['userservice'] = $userservice;
global $dbhost, $dbuser, $dbpass, $dbname, $dbport, $dbpersist, $dbtype, $tableprefix, $TEMPLATES_DIR, $filetypes, $debugMode;
require_once('./header.inc.php');
- $this->us =& ServiceFactory::getServiceInstance('UserService');
- $this->bs =& ServiceFactory::getServiceInstance('BookmarkService');
+ $this->us =SemanticScuttle_Service_Factory::getServiceInstance('User');
+ $this->bs =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark');
$this->bs->deleteAll();
- $this->b2ts=& ServiceFactory::getServiceInstance('Bookmark2TagService');
+ $this->b2ts=SemanticScuttle_Service_Factory::getServiceInstance('Bookmark2Tag');
$this->b2ts->deleteAll();
- $this->tts =& ServiceFactory::getServiceInstance('Tag2TagService');
+ $this->tts =SemanticScuttle_Service_Factory::getServiceInstance('Tag2Tag');
$this->tts->deleteAll();
- $this->tsts =& ServiceFactory::getServiceInstance('TagStatService');
+ $this->tsts =SemanticScuttle_Service_Factory::getServiceInstance('TagStat');
$this->tsts->deleteAll();
}
global $dbhost, $dbuser, $dbpass, $dbname, $dbport, $dbpersist, $dbtype, $tableprefix;
require_once('./header.inc.php');
- $this->us =& ServiceFactory::getServiceInstance('UserService');
- $this->bs =& ServiceFactory::getServiceInstance('BookmarkService');
+ $this->us =SemanticScuttle_Service_Factory::getServiceInstance('User');
+ $this->bs =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark');
$this->bs->deleteAll();
- $this->b2ts =& ServiceFactory::getServiceInstance('Bookmark2TagService');
+ $this->b2ts =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark2Tag');
$this->b2ts->deleteAll();
- $this->tts =& ServiceFactory::getServiceInstance('Tag2TagService');
+ $this->tts =SemanticScuttle_Service_Factory::getServiceInstance('Tag2Tag');
$this->tts->deleteAll();
- $this->tsts =& ServiceFactory::getServiceInstance('TagStatService');
+ $this->tsts =SemanticScuttle_Service_Factory::getServiceInstance('TagStat');
$this->tsts->deleteAll();
- $this->cds =& ServiceFactory::getServiceInstance('CommonDescriptionService');
+ $this->cds =SemanticScuttle_Service_Factory::getServiceInstance('CommonDescription');
$this->cds->deleteAll();
}
global $dbhost, $dbuser, $dbpass, $dbname, $dbport, $dbpersist, $dbtype, $tableprefix;
require_once('./header.inc.php');
- $this->us =& ServiceFactory::getServiceInstance('UserService');
- $this->bs =& ServiceFactory::getServiceInstance('BookmarkService');
+ $this->us =SemanticScuttle_Service_Factory::getServiceInstance('User');
+ $this->bs =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark');
$this->bs->deleteAll();
- $this->b2ts =& ServiceFactory::getServiceInstance('Bookmark2TagService');
+ $this->b2ts =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark2Tag');
$this->b2ts->deleteAll();
- $this->tts =& ServiceFactory::getServiceInstance('Tag2TagService');
+ $this->tts =SemanticScuttle_Service_Factory::getServiceInstance('Tag2Tag');
$this->tts->deleteAll();
- $this->tsts =& ServiceFactory::getServiceInstance('TagStatService');
+ $this->tsts =SemanticScuttle_Service_Factory::getServiceInstance('TagStat');
$this->tsts->deleteAll();
- $this->shs =& ServiceFactory::getServiceInstance('SearchHistoryService');
+ $this->shs =SemanticScuttle_Service_Factory::getServiceInstance('SearchHistory');
$this->shs->deleteAll();
}
global $dbhost, $dbuser, $dbpass, $dbname, $dbport, $dbpersist, $dbtype, $tableprefix;
require_once('./header.inc.php');
- $this->us =& ServiceFactory::getServiceInstance('UserService');
- $this->bs =& ServiceFactory::getServiceInstance('BookmarkService');
+ $this->us =SemanticScuttle_Service_Factory::getServiceInstance('User');
+ $this->bs =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark');
$this->bs->deleteAll();
- $this->b2ts =& ServiceFactory::getServiceInstance('Bookmark2TagService');
+ $this->b2ts =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark2Tag');
$this->b2ts->deleteAll();
- $this->tts =& ServiceFactory::getServiceInstance('Tag2TagService');
+ $this->tts =SemanticScuttle_Service_Factory::getServiceInstance('Tag2Tag');
$this->tts->deleteAll();
- $this->tsts =& ServiceFactory::getServiceInstance('TagStatService');
+ $this->tsts =SemanticScuttle_Service_Factory::getServiceInstance('TagStat');
$this->tsts->deleteAll();
}
global $dbhost, $dbuser, $dbpass, $dbname, $dbport, $dbpersist, $dbtype, $tableprefix, $TEMPLATES_DIR, $debugMode;
require_once('./header.inc.php');
- $this->us =& ServiceFactory::getServiceInstance('UserService');
- $this->bs =& ServiceFactory::getServiceInstance('BookmarkService');
+ $this->us =SemanticScuttle_Service_Factory::getServiceInstance('User');
+ $this->bs =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark');
$this->bs->deleteAll();
- $this->b2ts =& ServiceFactory::getServiceInstance('Bookmark2TagService');
+ $this->b2ts =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark2Tag');
$this->b2ts->deleteAll();
- $this->tts =& ServiceFactory::getServiceInstance('Tag2TagService');
+ $this->tts =SemanticScuttle_Service_Factory::getServiceInstance('Tag2Tag');
$this->tts->deleteAll();
- $this->tsts =& ServiceFactory::getServiceInstance('TagStatService');
+ $this->tsts =SemanticScuttle_Service_Factory::getServiceInstance('TagStat');
$this->tsts->deleteAll();
- $this->tcs =& ServiceFactory::getServiceInstance('TagCacheService');
+ $this->tcs =SemanticScuttle_Service_Factory::getServiceInstance('TagCache');
$this->tcs->deleteAll();
}
global $dbhost, $dbuser, $dbpass, $dbname, $dbport, $dbpersist, $dbtype, $tableprefix;
require_once('./header.inc.php');
- $this->ts =& ServiceFactory::getServiceInstance('TagService');
+ $this->ts =SemanticScuttle_Service_Factory::getServiceInstance('Tag');
$this->ts->deleteAll();
- $this->us =& ServiceFactory::getServiceInstance('UserService');
- $this->bs =& ServiceFactory::getServiceInstance('BookmarkService');
+ $this->us =SemanticScuttle_Service_Factory::getServiceInstance('User');
+ $this->bs =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark');
$this->bs->deleteAll();
- $this->b2ts =& ServiceFactory::getServiceInstance('Bookmark2TagService');
+ $this->b2ts =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark2Tag');
$this->b2ts->deleteAll();
- $this->tts =& ServiceFactory::getServiceInstance('Tag2TagService');
+ $this->tts =SemanticScuttle_Service_Factory::getServiceInstance('Tag2Tag');
$this->tts->deleteAll();
- $this->tsts =& ServiceFactory::getServiceInstance('TagStatService');
+ $this->tsts =SemanticScuttle_Service_Factory::getServiceInstance('TagStat');
$this->tsts->deleteAll();
}
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***************************************************************************/
-require_once('header.inc.php');
+require_once '../src/SemanticScuttle/header.php';
$tplVars['pagetitle'] = T_('About');
$tplVars['subtitle'] = T_('About');
-<?php\r
-/***************************************************************************\r
- Copyright (C) 2007 - 2008 SemanticScuttle project (fork from Scuttle)\r
- http://sourceforge.net/projects/semanticscuttle/\r\r
-\r
- This program is free software; you can redistribute it and/or modify\r
- it under the terms of the GNU General Public License as published by\r
- the Free Software Foundation; either version 2 of the License, or\r
- (at your option) any later version.\r
-\r
- This program is distributed in the hope that it will be useful,\r
- but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- GNU General Public License for more details.\r
- You should have received a copy of the GNU General Public License\r
- along with this program; if not, write to the Free Software\r
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
- ***************************************************************************/\r
-\r
-require_once('header.inc.php');\r
+<?php
+/***************************************************************************
+ Copyright (C) 2007 - 2008 SemanticScuttle project (fork from Scuttle)
+ http://sourceforge.net/projects/semanticscuttle/
-/* Service creation: only useful services are created */\r
-$bookmark2tagservice = & ServiceFactory :: getServiceInstance('Bookmark2Tagservice');\r
-$bookmarkservice = & ServiceFactory :: getServiceInstance('BookmarkService');
-$tag2tagservice = & ServiceFactory :: getServiceInstance('Tag2TagService');
-$tagcacheservice = & ServiceFactory :: getServiceInstance('TagCacheService');
-$commondescriptionservice = & ServiceFactory :: getServiceInstance('CommonDescriptionService');
-$searchhistoryservice = & ServiceFactory :: getServiceInstance('SearchHistoryService');
-$tagstatservice = & ServiceFactory :: getServiceInstance('TagStatService');\r
-\r
-// Header variables\r
-$tplVars['subtitle'] = T_('Manage users');\r
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ ***************************************************************************/
+
+require_once '../src/SemanticScuttle/header.php';
+
+/* Service creation: only useful services are created */
+$bookmark2tagservice = SemanticScuttle_Service_Factory :: getServiceInstance('Bookmark2Tagservice');
+$bookmarkservice = SemanticScuttle_Service_Factory :: getServiceInstance('Bookmark');
+$tag2tagservice = SemanticScuttle_Service_Factory :: getServiceInstance('Tag2Tag');
+$tagcacheservice = SemanticScuttle_Service_Factory :: getServiceInstance('TagCache');
+$commondescriptionservice = SemanticScuttle_Service_Factory :: getServiceInstance('CommonDescription');
+$searchhistoryservice = SemanticScuttle_Service_Factory :: getServiceInstance('SearchHistory');
+$tagstatservice = SemanticScuttle_Service_Factory :: getServiceInstance('TagStat');
+
+// Header variables
+$tplVars['subtitle'] = T_('Manage users');
$tplVars['loadjs'] = true;
$tplVars['sidebar_blocks'] = array('users' );
$tplVars['error'] = '';
-$tplVars['msg'] = '';\r
-\r
-if ( !$userservice->isLoggedOn() ) {\r
- header('Location: '. createURL('login', ''));\r
- exit();\r
+$tplVars['msg'] = '';
+
+if ( !$userservice->isLoggedOn() ) {
+ header('Location: '. createURL('login', ''));
+ exit();
}
-\r
-if ( !$currentUser->isAdmin() ) {\r
- header('Location: '. createURL('bookmarks', $currentUser->getUsername()));\r
- exit();\r
-}\r
-\r
+
+if ( !$currentUser->isAdmin() ) {
+ header('Location: '. createURL('bookmarks', $currentUser->getUsername()));
+ exit();
+}
+
@list($url, $action, $user) = isset($_SERVER['PATH_INFO']) ? explode('/', $_SERVER['PATH_INFO']) : NULL;
-\r
+
if ( $action
&& (strpos($_SERVER['HTTP_REFERER'], ROOT.'admin') === 0) // Prevent CSRF attacks
-) {\r
- switch ( $action ) {\r
- case 'delete':\r
- if ( $user && ($userinfo = $userservice->getUserByUsername($user)) ) {\r
- $uId = $userinfo['uId'];\r
+) {
+ switch ( $action ) {
+ case 'delete':
+ if ( $user && ($userinfo = $userservice->getUserByUsername($user)) ) {
+ $uId = $userinfo['uId'];
$tagcacheservice->deleteByUser($uId);
- $tag2tagservice->removeLinkedTagsForUser($uId);\r
- $userservice->deleteUser($uId);\r
+ $tag2tagservice->removeLinkedTagsForUser($uId);
+ $userservice->deleteUser($uId);
$bookmark2tagservice->deleteTagsForUser($uId);
$commondescriptionservice->deleteDescriptionsForUser($uId);
$searchhistoryservice->deleteSearchHistoryForUser($uId);
- $tagstatservice->deleteTagStatForUser($uId); \r
- // XXX: don't delete bookmarks before tags, else tags can't be deleted !!!\r
- $bookmarkservice->deleteBookmarksForUser($uId);\r
-\r
- $tplVars['msg'] = sprintf(T_('%s and all his bookmarks and tags were deleted.'), $user);\r
+ $tagstatservice->deleteTagStatForUser($uId);
+ // XXX: don't delete bookmarks before tags, else tags can't be deleted !!!
+ $bookmarkservice->deleteBookmarksForUser($uId);
+
+ $tplVars['msg'] = sprintf(T_('%s and all his bookmarks and tags were deleted.'), $user);
}
break;
case 'checkUrl' :
if(!checkUrl($bookmark['bAddress'])) {
$tplVars['error'].= T_('Problem with ').$bookmark['bAddress'].' ('. $bookmark['username'] .')<br/>';
}
- }\r
- break;\r
- default:\r
- // DO NOTHING\r
- }\r
-}\r
-\r
-$templatename = 'admin.tpl';\r
-$users =& $userservice->getObjectUsers();\r
-\r
-if ( !is_array($users) ) {\r
- $users = array();\r
-}\r
-\r
-$tplVars['users'] =& $users;\r
-\r
-$templateservice->loadTemplate($templatename, $tplVars);\r
+ }
+ break;
+ default:
+ // DO NOTHING
+ }
+}
+
+$templatename = 'admin.tpl';
+$users =& $userservice->getObjectUsers();
+
+if ( !is_array($users) ) {
+ $users = array();
+}
+
+$tplVars['users'] =& $users;
+
+$templateservice->loadTemplate($templatename, $tplVars);
?>
/* Return a json file with list of linked tags */
-require_once('../header.inc.php');
+require_once '../../src/SemanticScuttle/header.php';
/* Service creation: only useful services are created */
-$b2tservice =& ServiceFactory::getServiceInstance('Bookmark2TagService');
-$bookmarkservice =& ServiceFactory::getServiceInstance('TagService');
-$tagstatservice =& ServiceFactory::getServiceInstance('TagStatService');
+$b2tservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark2Tag');
+$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag');
+$tagstatservice =SemanticScuttle_Service_Factory::getServiceInstance('TagStat');
/* Managing all possible inputs */
isset($_GET['tag']) ? define('GET_TAG', $_GET['tag']): define('GET_TAG', '');
function displayTag($tag, $uId) {
$uId = ($uId==0)?NULL:$uId; // if user is nobody, NULL allows to look for every public tags
- $tag2tagservice =& ServiceFactory::getServiceInstance('Tag2TagService');
+ $tag2tagservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag2Tag');
$output = '{ id:'.rand().', name:\''.$tag.'\'';
$linkedTags = $tag2tagservice->getAdminLinkedTags($tag, '>');
/* Return a json file with list of tags according to current user and sort by popularity*/
-require_once('../header.inc.php');
+require_once '../../src/SemanticScuttle/header.php';
/* Service creation: only useful services are created */
-$b2tservice =& ServiceFactory::getServiceInstance('Bookmark2TagService');
-$bookmarkservice =& ServiceFactory::getServiceInstance('TagService');
+$b2tservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark2Tag');
+$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag');
?>
/* Return a json file with list of tags according to current user and sort by popularity*/
-require_once('../header.inc.php');
+require_once '../../src/SemanticScuttle/header.php';
/* Service creation: only useful services are created */
-$b2tservice =& ServiceFactory::getServiceInstance('Bookmark2TagService');
-$bookmarkservice =& ServiceFactory::getServiceInstance('TagService');
+$b2tservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark2Tag');
+$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag');
?>
/* Return a json file with list of linked tags */
-require_once('../header.inc.php');
+require_once '../../src/SemanticScuttle/header.php';
/* Service creation: only useful services are created */
-$b2tservice =& ServiceFactory::getServiceInstance('Bookmark2TagService');
-$bookmarkservice =& ServiceFactory::getServiceInstance('TagService');
-$tagstatservice =& ServiceFactory::getServiceInstance('TagStatService');
+$b2tservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark2Tag');
+$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag');
+$tagstatservice =SemanticScuttle_Service_Factory::getServiceInstance('TagStat');
/* Managing all possible inputs */
isset($_GET['tag']) ? define('GET_TAG', $_GET['tag']): define('GET_TAG', '');
function displayTag($tag, $uId) {
$uId = ($uId==0)?NULL:$uId; // if user is nobody, NULL allows to look for every public tags
- $tag2tagservice =& ServiceFactory::getServiceInstance('Tag2TagService');
+ $tag2tagservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag2Tag');
$output = '{ id:'.rand().', name:\''.$tag.'\'';
$linkedTags = $tag2tagservice->getLinkedTags($tag, '>', $uId);
/* Return a json file with list of tags according to current user and sort by popularity*/
-require_once('../header.inc.php');
+require_once '../../src/SemanticScuttle/header.php';
/* Service creation: only useful services are created */
-$b2tservice =& ServiceFactory::getServiceInstance('Bookmark2TagService');
-$bookmarkservice =& ServiceFactory::getServiceInstance('TagService');
+$b2tservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark2Tag');
+$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag');
?>
header('Content-Type: text/xml; charset=UTF-8');
header('Last-Modified: '. gmdate("D, d M Y H:i:s") .' GMT');
header('Cache-Control: no-cache, must-revalidate');
-require_once('header.inc.php');
+require_once '../src/SemanticScuttle/header.php';
/* Service creation: only useful services are created */
-$bookmarkservice = & ServiceFactory :: getServiceInstance('BookmarkService');
+$bookmarkservice = SemanticScuttle_Service_Factory :: getServiceInstance('Bookmark');
/* Managing all possible inputs */
isset($_GET['id']) ? define('GET_ID', $_GET['id']): define('GET_ID', '');
header("Last-Modified: ". gmdate("D, d M Y H:i:s") ." GMT");
header("Cache-Control: no-cache, must-revalidate");
-require_once('header.inc.php');
+require_once '../src/SemanticScuttle/header.php';
/* Managing all possible inputs */
isset($_GET['url']) ? define('GET_URL', $_GET['url']): define('GET_URL', '');
header("Last-Modified: ". gmdate("D, d M Y H:i:s") ." GMT");
header("Cache-Control: no-cache, must-revalidate");
-require_once('header.inc.php');
+require_once '../src/SemanticScuttle/header.php';
/* Service creation: only useful services are created */
//No specific services
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***************************************************************************/
-require_once('header.inc.php');
+require_once '../src/SemanticScuttle/header.php';
/* Service creation: only useful services are created */
-$b2tservice =& ServiceFactory::getServiceInstance('Bookmark2TagService');
-$cacheservice =& ServiceFactory::getServiceInstance('CacheService');
+$b2tservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark2Tag');
+$cacheservice =SemanticScuttle_Service_Factory::getServiceInstance('Cache');
-<?php\r
-// Export in CSV format in order to allow the import into a spreadsheet tool like Excel\r
-\r
+<?php
+// Export in CSV format in order to allow the import into a spreadsheet tool like Excel
+
// Force HTTP authentication first!
-require_once('httpauth.inc.php');\r
-require_once('../header.inc.php');\r
-
-/* Service creation: only useful services are created */\r
-$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');\r
-\r
-// Check to see if a tag was specified.\r
-if (isset($_REQUEST['tag']) && (trim($_REQUEST['tag']) != ''))\r
- $tag = trim($_REQUEST['tag']);\r
-else\r
- $tag = NULL;\r
-\r
-// Get the posts relevant to the passed-in variables.\r
-$bookmarks =& $bookmarkservice->getBookmarks(0, NULL, $userservice->getCurrentUserId(), $tag, NULL, getSortOrder());\r
-\r
+require_once('httpauth.inc.php');
+require_once '../../src/SemanticScuttle/header.php';
+
+/* Service creation: only useful services are created */
+$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark');
+
+// Check to see if a tag was specified.
+if (isset($_REQUEST['tag']) && (trim($_REQUEST['tag']) != ''))
+ $tag = trim($_REQUEST['tag']);
+else
+ $tag = NULL;
+
+// Get the posts relevant to the passed-in variables.
+$bookmarks =& $bookmarkservice->getBookmarks(0, NULL, $userservice->getCurrentUserId(), $tag, NULL, getSortOrder());
+
header("Content-Type: application/csv-tab-delimited-table;charset=UTF-8");
-header("Content-disposition: filename=exportBookmarks.csv");\r
-\r
+header("Content-disposition: filename=exportBookmarks.csv");
+
//columns titles
echo 'url;title;tags;description';
-echo "\n";\r
-\r
-foreach($bookmarks['bookmarks'] as $row) {\r
- if (is_null($row['bDescription']) || (trim($row['bDescription']) == ''))\r
- $description = '';\r
- else\r
- $description = filter(str_replace(array("\r\n", "\n", "\r"),"", $row['bDescription']), 'xml');\r
-\r
- $taglist = '';\r
- if (count($row['tags']) > 0) {\r
- foreach($row['tags'] as $tag)\r
- $taglist .= convertTag($tag) .',';\r
- $taglist = substr($taglist, 0, -1);\r
- } else {\r
- $taglist = 'system:unfiled';\r
- }\r
-\r
+echo "\n";
+
+foreach($bookmarks['bookmarks'] as $row) {
+ if (is_null($row['bDescription']) || (trim($row['bDescription']) == ''))
+ $description = '';
+ else
+ $description = filter(str_replace(array("\r\n", "\n", "\r"),"", $row['bDescription']), 'xml');
+
+ $taglist = '';
+ if (count($row['tags']) > 0) {
+ foreach($row['tags'] as $tag)
+ $taglist .= convertTag($tag) .',';
+ $taglist = substr($taglist, 0, -1);
+ } else {
+ $taglist = 'system:unfiled';
+ }
+
echo '"'.filter($row['bAddress'], 'xml') .'";"'. filter($row['bTitle'], 'xml') .'";"'. filter($taglist, 'xml') .'";"'. $description .'"';
- echo "\n";\r
-}\r
-\r
-\r
-?>\r
+ echo "\n";
+}
+
+
+?>
// Force HTTP authentication first!
//require_once('httpauth.inc.php');
-require_once('../header.inc.php');
+require_once '../../src/SemanticScuttle/header.php';
if($GLOBALS['enableGoogleCustomSearch'] == false) {
echo "Google Custom Search disabled. You can enable it into the config.inc.php file.";
}
/* Service creation: only useful services are created */
-$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
+$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark');
/*
-<?php\r
-// Implements the del.icio.us API request for all a user's posts, optionally filtered by tag.\r
-\r
-// del.icio.us behavior:\r
-// - doesn't include the filtered tag as an attribute on the root element (we do)\r
-\r
+<?php
+// Implements the del.icio.us API request for all a user's posts, optionally filtered by tag.
+
+// del.icio.us behavior:
+// - doesn't include the filtered tag as an attribute on the root element (we do)
+
// Force HTTP authentication first!
-require_once('httpauth.inc.php');\r
-require_once('../header.inc.php');\r
-
-/* Service creation: only useful services are created */\r
-$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');\r
-\r
-// Check to see if a tag was specified.\r
-if (isset($_REQUEST['tag']) && (trim($_REQUEST['tag']) != ''))\r
- $tag = trim($_REQUEST['tag']);\r
-else\r
- $tag = NULL;\r
-\r
-// Get the posts relevant to the passed-in variables.\r
-$bookmarks =& $bookmarkservice->getBookmarks(0, NULL, $userservice->getCurrentUserId(), $tag, NULL, getSortOrder());\r
-\r
-\r
-// Set up the XML file and output all the posts.\r
+require_once('httpauth.inc.php');
+require_once '../../src/SemanticScuttle/header.php';
+
+/* Service creation: only useful services are created */
+$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark');
+
+// Check to see if a tag was specified.
+if (isset($_REQUEST['tag']) && (trim($_REQUEST['tag']) != ''))
+ $tag = trim($_REQUEST['tag']);
+else
+ $tag = NULL;
+
+// Get the posts relevant to the passed-in variables.
+$bookmarks =& $bookmarkservice->getBookmarks(0, NULL, $userservice->getCurrentUserId(), $tag, NULL, getSortOrder());
+
+
+// Set up the XML file and output all the posts.
echo '<!DOCTYPE NETSCAPE-Bookmark-file-1>'."\r\n";
-echo '<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">';\r
-echo '<!-- This is an automatically generated file. -->'."\r\n";\r
-echo '<TITLE>Bookmarks</TITLE>'."\r\n";\r
-echo '<H1 LAST_MODIFIED="'. date('U') .'">Bookmarks for '. htmlspecialchars($currentUser->getUsername()) .''. (is_null($tag) ? '' : ' tag="'. htmlspecialchars($tag) .'"') ." from " . $sitename ."</H1>\r\n";\r
-echo '<DL><p>'."\r\n";\r
-\r
-\r
-\r
-foreach($bookmarks['bookmarks'] as $row) {\r
- if (is_null($row['bDescription']) || (trim($row['bDescription']) == ''))\r
- $description = '';\r
- else\r
- $description = 'description="'. filter($row['bDescription'], 'xml') .'" ';\r
-\r
- $taglist = '';\r
- if (count($row['tags']) > 0) {\r
- foreach($row['tags'] as $tag)\r
- $taglist .= convertTag($tag) .',';\r
- $taglist = substr($taglist, 0, -1);\r
- } else {\r
- $taglist = 'system:unfiled';\r
- }\r
-\r
- echo "\t<dt><a href=\"". filter($row['bAddress'], 'xml') .'" '. $description .' hash="'. md5($row['bAddress']) .'" tags="'. filter($taglist, 'xml') .'" ADD_DATE="'. date('U', strtotime($row['bDatetime'])) ."\" >" . filter($row['bTitle'], 'xml') ."</a>\r\n";\r
-}\r
-\r
-\r
-echo '</DL><p>';\r
-?>\r
+echo '<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">';
+echo '<!-- This is an automatically generated file. -->'."\r\n";
+echo '<TITLE>Bookmarks</TITLE>'."\r\n";
+echo '<H1 LAST_MODIFIED="'. date('U') .'">Bookmarks for '. htmlspecialchars($currentUser->getUsername()) .''. (is_null($tag) ? '' : ' tag="'. htmlspecialchars($tag) .'"') ." from " . $sitename ."</H1>\r\n";
+echo '<DL><p>'."\r\n";
+
+
+
+foreach($bookmarks['bookmarks'] as $row) {
+ if (is_null($row['bDescription']) || (trim($row['bDescription']) == ''))
+ $description = '';
+ else
+ $description = 'description="'. filter($row['bDescription'], 'xml') .'" ';
+
+ $taglist = '';
+ if (count($row['tags']) > 0) {
+ foreach($row['tags'] as $tag)
+ $taglist .= convertTag($tag) .',';
+ $taglist = substr($taglist, 0, -1);
+ } else {
+ $taglist = 'system:unfiled';
+ }
+
+ echo "\t<dt><a href=\"". filter($row['bAddress'], 'xml') .'" '. $description .' hash="'. md5($row['bAddress']) .'" tags="'. filter($taglist, 'xml') .'" ADD_DATE="'. date('U', strtotime($row['bDatetime'])) ."\" >" . filter($row['bTitle'], 'xml') ."</a>\r\n";
+}
+
+
+echo '</DL><p>';
+?>
<?php
-/* Export data with semantic format (SIOC: http://sioc-project.org/, FOAF, SKOS, Annotea Ontology) */\r
-\r
-require_once('../header.inc.php');
-header('Content-Type: text/xml; charset=utf-8'); //we change headers html defined in headers.inc.php\r
+/* Export data with semantic format (SIOC: http://sioc-project.org/, FOAF, SKOS, Annotea Ontology) */
-/* Service creation: only useful services are created */\r
-$userservice =& ServiceFactory::getServiceInstance('UserService');
-$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
+require_once '../../src/SemanticScuttle/header.php';
+header('Content-Type: text/xml; charset=utf-8'); //we change headers html defined in headers.inc.php
+
+/* Service creation: only useful services are created */
+$userservice =SemanticScuttle_Service_Factory::getServiceInstance('User');
+$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark');
?>
<?php echo "<?xml version=\"1.0\" encoding=\"utf-8\"\n?>"; ?>
<?php
-require_once('../header.inc.php');
+require_once '../../src/SemanticScuttle/header.php';
// Provides HTTP Basic authentication of a user, and sets two variables, sId and username,
// with the user's info.
<?php
-require_once('../header.inc.php');
+require_once '../../src/SemanticScuttle/header.php';
header("Content-type: text/xml");
?>
-<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"\r
- xmlns:moz="http://www.mozilla.org/2006/browser/search/">\r
- <ShortName><?php echo $GLOBALS['sitename']?></ShortName>\r
- <LongName></LongName>\r
- <Description><?php echo $GLOBALS['welcomeMessage']?></Description>\r
- <InputEncoding>UTF-8</InputEncoding>\r
- <Contact><?php echo $GLOBALS['adminemail']?></Contact>\r
- <Developer>Jan Seifert "jan.seifert@uid.com"</Developer>\r
- <Tags>semanticscuttle bookmark web</Tags>\r
- <Image width="16" height="16">data:image/gif;base64,R0lGODlhEAAQAMZ9ANaPE9mREteTHtSXLdmXIdiXJtaYKdiYJ9iYKNeaLtKdP9CdRd2dLNWfQuWiFMqjX9+hNMykXt6jPOCkPM2oaM+paeCpQuGoR+OqOeKpR+GqS9+uWeSwU+ayS+uzOeWxVeWxWOSyWOu0POazXOS0YOm8Zee8cOy+WOm9a/jBLum+bPbCNurAbe7BYuvBc/LDV/LEV+zEdv/KKf/KLP/KLf/LLuzHe//MNP/NN/nMTv/OOf/OPP/OP/jNW//PPvnOVv/QQv7QRv/QRP/RR/HOhP/SSf/STPnRav/TT//TUPfScf/UUvzUXP/UVP/VV/bTfv/WWf/WW//WXP7XYf/XX//XYP/YZPPVmf/ZZv/ZZ/vYeP/aaf/aa//abP/abf/abvvaef/bb//bcfzbfP/ccv/cc//cdP/cdf/dd//deP/def3egP/ee//efP/efv/ffv/ggf/gg//ghP/ghfrfmv/hif/ii//ijP/jkfzjm//kkv7klv/lmP///////////yH5BAEKAH8ALAAAAAAQABAAAAergH+Cg38hhIeHIFcmiIgDLnt0Go2EE1pyd0QbjQMQDC9bZGprKBcjA4IfAQMrQUhOVFlhaGNPMRl/Aw4yMzc7QkZNUlZdZmASqAJKcW1WPDpARUtQUx0RgyR5fHpzUTU4PkMiqIMVNnh2c25lSTQpAIgqdXJvaWReXz0JiCxwbWhiuGCp8uMAohJszhw5AYMJlBwFEHFoYQHBAwUEMHgwgKjBA0QLKFAaKSgQADs=</Image>\r
- <Url type="text/html" template="<?php echo $GLOBALS['root']?>search.php/all/{searchTerms}"/>\r
- <moz:SearchForm><?php echo $GLOBALS['root']?></moz:SearchForm>\r
+<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"
+ xmlns:moz="http://www.mozilla.org/2006/browser/search/">
+ <ShortName><?php echo $GLOBALS['sitename']?></ShortName>
+ <LongName></LongName>
+ <Description><?php echo $GLOBALS['welcomeMessage']?></Description>
+ <InputEncoding>UTF-8</InputEncoding>
+ <Contact><?php echo $GLOBALS['adminemail']?></Contact>
+ <Developer>Jan Seifert "jan.seifert@uid.com"</Developer>
+ <Tags>semanticscuttle bookmark web</Tags>
+ <Image width="16" height="16">data:image/gif;base64,R0lGODlhEAAQAMZ9ANaPE9mREteTHtSXLdmXIdiXJtaYKdiYJ9iYKNeaLtKdP9CdRd2dLNWfQuWiFMqjX9+hNMykXt6jPOCkPM2oaM+paeCpQuGoR+OqOeKpR+GqS9+uWeSwU+ayS+uzOeWxVeWxWOSyWOu0POazXOS0YOm8Zee8cOy+WOm9a/jBLum+bPbCNurAbe7BYuvBc/LDV/LEV+zEdv/KKf/KLP/KLf/LLuzHe//MNP/NN/nMTv/OOf/OPP/OP/jNW//PPvnOVv/QQv7QRv/QRP/RR/HOhP/SSf/STPnRav/TT//TUPfScf/UUvzUXP/UVP/VV/bTfv/WWf/WW//WXP7XYf/XX//XYP/YZPPVmf/ZZv/ZZ/vYeP/aaf/aa//abP/abf/abvvaef/bb//bcfzbfP/ccv/cc//cdP/cdf/dd//deP/def3egP/ee//efP/efv/ffv/ggf/gg//ghP/ghfrfmv/hif/ii//ijP/jkfzjm//kkv7klv/lmP///////////yH5BAEKAH8ALAAAAAAQABAAAAergH+Cg38hhIeHIFcmiIgDLnt0Go2EE1pyd0QbjQMQDC9bZGprKBcjA4IfAQMrQUhOVFlhaGNPMRl/Aw4yMzc7QkZNUlZdZmASqAJKcW1WPDpARUtQUx0RgyR5fHpzUTU4PkMiqIMVNnh2c25lSTQpAIgqdXJvaWReXz0JiCxwbWhiuGCp8uMAohJszhw5AYMJlBwFEHFoYQHBAwUEMHgwgKjBA0QLKFAaKSgQADs=</Image>
+ <Url type="text/html" template="<?php echo $GLOBALS['root']?>search.php/all/{searchTerms}"/>
+ <moz:SearchForm><?php echo $GLOBALS['root']?></moz:SearchForm>
</OpenSearchDescription>
// Force HTTP authentication
require_once('httpauth.inc.php');
-require_once('../header.inc.php');
+require_once '../../src/SemanticScuttle/header.php';
/* Service creation: only useful services are created */
-$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
+$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark');
// Get all the bookmark's passed-in information
if (isset($_REQUEST['url']) && (trim($_REQUEST['url']) != ''))
// Force HTTP authentication first!
require_once('httpauth.inc.php');
-require_once('../header.inc.php');
+require_once '../../src/SemanticScuttle/header.php';
/* Service creation: only useful services are created */
-$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
+$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark');
// Check to see if a tag was specified.
// Force HTTP authentication first!
require_once('httpauth.inc.php');
-require_once('../header.inc.php');
+require_once '../../src/SemanticScuttle/header.php';
/* Service creation: only useful services are created */
-$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
+$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark');
// Check to see if a tag was specified.
// Force HTTP authentication first!
require_once('httpauth.inc.php');
-require_once('../header.inc.php');
+require_once '../../src/SemanticScuttle/header.php';
/* Service creation: only useful services are created */
-$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
+$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark');
// Note that del.icio.us only errors out if no URL was passed in; there's no error on attempting
// Force HTTP authentication first!
require_once('httpauth.inc.php');
-require_once('../header.inc.php');
+require_once '../../src/SemanticScuttle/header.php';
/* Service creation: only useful services are created */
-$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
+$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark');
// Check to see if a tag was specified.
// Force HTTP authentication first!
//require_once('httpauth.inc.php');
-require_once('../header.inc.php');
+require_once '../../src/SemanticScuttle/header.php';
/* Service creation: only useful services are created */
-$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
+$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark');
// Check to see if a tag was specified.
// Force HTTP authentication first!
require_once('httpauth.inc.php');
-require_once('../header.inc.php');
+require_once '../../src/SemanticScuttle/header.php';
/* Service creation: only useful services are created */
-$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
+$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark');
// Check to see if a tag was specified.
// Force HTTP authentication first!
require_once('httpauth.inc.php');
-require_once('../header.inc.php');
+require_once '../../src/SemanticScuttle/header.php';
/* Service creation: only useful services are created */
-$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
+$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark');
// Get the posts relevant to the passed-in variables.
// Force HTTP authentication first!
require_once('httpauth.inc.php');
-require_once('../header.inc.php');
+require_once '../../src/SemanticScuttle/header.php';
/* Service creation: only useful services are created */
-$b2tservice =& ServiceFactory::getServiceInstance('Bookmark2TagService');
+$b2tservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark2Tag');
// Get the tags relevant to the passed-in variables.
// Force HTTP authentication first!
require_once('httpauth.inc.php');
-require_once('../header.inc.php');
+require_once '../../src/SemanticScuttle/header.php';
/* Service creation: only useful services are created */
-$b2tservice =& ServiceFactory::getServiceInstance('Bookmark2TagService');
+$b2tservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark2Tag');
// Get the tag info.
if (isset($_REQUEST['old']) && (trim($_REQUEST['old']) != ''))
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***************************************************************************/
-require_once('header.inc.php');
+require_once '../src/SemanticScuttle/header.php';
/* Service creation: only useful services are created */
-$bookmarkservice = & ServiceFactory :: getServiceInstance('BookmarkService');
-$cdservice = & ServiceFactory :: getServiceInstance('CommonDescriptionService');
+$bookmarkservice = SemanticScuttle_Service_Factory :: getServiceInstance('Bookmark');
+$cdservice = SemanticScuttle_Service_Factory :: getServiceInstance('CommonDescription');
/* Managing all possible inputs */
isset($_POST['confirm']) ? define('POST_CONFIRM', $_POST['confirm']): define('POST_CONFIRM', '');
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***************************************************************************/
-require_once('header.inc.php');
+require_once '../src/SemanticScuttle/header.php';
/* Service creation: only useful services are created */
-$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
-$cacheservice =& ServiceFactory::getServiceInstance('CacheService');
+$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark');
+$cacheservice =SemanticScuttle_Service_Factory::getServiceInstance('Cache');
/* Managing all possible inputs */
isset($_GET['action']) ? define('GET_ACTION', $_GET['action']): define('GET_ACTION', '');
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***************************************************************************/
-require_once('header.inc.php');
+require_once '../src/SemanticScuttle/header.php';
/* Service creation: only useful services are created */
-$bookmarkservice = & ServiceFactory :: getServiceInstance('BookmarkService');
+$bookmarkservice = SemanticScuttle_Service_Factory :: getServiceInstance('Bookmark');
/* Managing all possible inputs */
isset($_POST['submitted']) ? define('POST_SUBMITTED', $_POST['submitted']): define('POST_SUBMITTED', '');
<?php
-require_once('../header.inc.php');
+require_once '../../src/SemanticScuttle/header.php';
if($GLOBALS['enableGoogleCustomSearch'] == false) {
echo "Google Custom Search disabled. You can enable it into the config.inc.php file.";
-<?php require_once('../header.inc.php');
+<?php require_once '../../src/SemanticScuttle/header.php';
if($GLOBALS['enableGoogleCustomSearch']==false) {
echo "Google Custom Search disabled. You can enable it into the config.inc.php file.";
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***************************************************************************/
-require_once('header.inc.php');
+require_once '../src/SemanticScuttle/header.php';
/* Service creation: only useful services are created */
-$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
-$cacheservice =& ServiceFactory::getServiceInstance('CacheService');
+$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark');
+$cacheservice =SemanticScuttle_Service_Factory::getServiceInstance('Cache');
/* Managing all possible inputs */
isset($_GET['page']) ? define('GET_PAGE', $_GET['page']): define('GET_PAGE', 0);
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***************************************************************************/
-require_once('header.inc.php');
+require_once '../src/SemanticScuttle/header.php';
/* Service creation: only useful services are created */
// No specific services
function startElement($parser, $name, $attrs) {
global $depth, $status, $tplVars, $userservice;
- $bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
+ $bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark');
if ($name == 'POST') {
while(list($attrTitle, $attrVal) = each($attrs)) {
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***************************************************************************/
-require_once('header.inc.php');
+require_once '../src/SemanticScuttle/header.php';
/* Service creation: only useful services are created */
-$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
+$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark');
/* Managing all possible inputs */
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***************************************************************************/
-require_once('header.inc.php');
+require_once '../src/SemanticScuttle/header.php';
/* Service creation: only useful services are created */
-$tag2tagservice =& ServiceFactory::getServiceInstance('Tag2TagService');
+$tag2tagservice =SemanticScuttle_Service_Factory::getServiceInstance('Tag2Tag');
/* Managing current logged user */
$currentUser = $userservice->getCurrentObjectUser();
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***************************************************************************/
-require_once('header.inc.php');
+require_once '../src/SemanticScuttle/header.php';
/* Service creation: only useful services are created */
-$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
-$cacheservice =& ServiceFactory::getServiceInstance('CacheService');
+$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark');
+$cacheservice =SemanticScuttle_Service_Factory::getServiceInstance('Cache');
/* Managing all possible inputs */
isset($_GET['action']) ? define('GET_ACTION', $_GET['action']): define('GET_ACTION', '');
<?php
header('Content-Type: text/javascript');
-require_once('header.inc.php');
+require_once '../src/SemanticScuttle/header.php';
require_once('functions.inc.php');
$player_root = ROOT .'includes/player/';
?>
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***************************************************************************/
-require_once('header.inc.php');
+require_once '../src/SemanticScuttle/header.php';
/* Service creation: only useful services are created */
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***************************************************************************/
-require_once('header.inc.php');
+require_once '../src/SemanticScuttle/header.php';
/* Service creation: only useful services are created */
// No specific services
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***************************************************************************/
-require_once('header.inc.php');
+require_once '../src/SemanticScuttle/header.php';
/* Service creation: only useful services are created */
-$b2tservice =& ServiceFactory::getServiceInstance('Bookmark2TagService');
-$cacheservice =& ServiceFactory::getServiceInstance('CacheService');
+$b2tservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark2Tag');
+$cacheservice =SemanticScuttle_Service_Factory::getServiceInstance('Cache');
@list($url, $user) = isset($_SERVER['PATH_INFO']) ? explode('/', $_SERVER['PATH_INFO']) : NULL;
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***************************************************************************/
-require_once('header.inc.php');
+require_once '../src/SemanticScuttle/header.php';
/* Service creation: only useful services are created */
// No specific services
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***************************************************************************/
-require_once('header.inc.php');
+require_once '../src/SemanticScuttle/header.php';
/* Service creation: only useful services are created */
// No specific services
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***************************************************************************/
-require_once('header.inc.php');
+require_once '../src/SemanticScuttle/header.php';
/* Service creation: only useful services are created */
-$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
-$cacheservice =& ServiceFactory::getServiceInstance('CacheService');
+$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark');
+$cacheservice =SemanticScuttle_Service_Factory::getServiceInstance('Cache');
header('Content-Type: application/xml');
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***************************************************************************/
-require_once('header.inc.php');
+require_once '../src/SemanticScuttle/header.php';
/* Managing all possible inputs */
isset($_POST['terms']) ? define('POST_TERMS', $_POST['terms']): define('POST_TERMS', '');
// GET
} else {
/* Service creation: only useful services are created */
- $bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
- $searchhistoryservice =& ServiceFactory::getServiceInstance('SearchHistoryService');
+ $bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark');
+ $searchhistoryservice =SemanticScuttle_Service_Factory::getServiceInstance('SearchHistory');
/* Managing current logged user */
$currentUserId = $userservice->getCurrentUserId();
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***************************************************************************/
-require_once('header.inc.php');
+require_once '../src/SemanticScuttle/header.php';
/* Service creation: only useful services are created */
-$tag2tagservice = & ServiceFactory :: getServiceInstance('Tag2TagService');
+$tag2tagservice = SemanticScuttle_Service_Factory :: getServiceInstance('Tag2Tag');
/* Managing all possible inputs */
isset($_POST['confirm']) ? define('POST_CONFIRM', $_POST['confirm']): define('POST_CONFIRM', '');
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***************************************************************************/
-require_once('header.inc.php');
+require_once '../src/SemanticScuttle/header.php';
/* Service creation: only useful services are created */
-$tag2tagservice = & ServiceFactory :: getServiceInstance('Tag2TagService');
+$tag2tagservice = SemanticScuttle_Service_Factory :: getServiceInstance('Tag2Tag');
/* Managing all possible inputs */
isset($_POST['confirm']) ? define('POST_CONFIRM', $_POST['confirm']): define('POST_CONFIRM', '');
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***************************************************************************/
-require_once('header.inc.php');
+require_once '../src/SemanticScuttle/header.php';
/* Service creation: only useful services are created */
-$tag2tagservice = & ServiceFactory :: getServiceInstance('Tag2TagService');
+$tag2tagservice = SemanticScuttle_Service_Factory :: getServiceInstance('Tag2Tag');
/* Managing all possible inputs */
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***************************************************************************/
-require_once('header.inc.php');
+require_once '../src/SemanticScuttle/header.php';
/* Service creation: only useful services are created */
-$b2tservice = & ServiceFactory :: getServiceInstance('Bookmark2TagService');
-$cdservice = & ServiceFactory :: getServiceInstance('CommonDescriptionService');
+$b2tservice = SemanticScuttle_Service_Factory :: getServiceInstance('Bookmark2Tag');
+$cdservice = SemanticScuttle_Service_Factory :: getServiceInstance('CommonDescription');
/* Managing all possible inputs */
isset($_POST['confirm']) ? define('POST_CONFIRM', $_POST['confirm']): define('POST_CONFIRM', '');
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***************************************************************************/
-require_once('header.inc.php');
+require_once '../src/SemanticScuttle/header.php';
/* Service creation: only useful services are created */
-$b2tservice = & ServiceFactory :: getServiceInstance('Bookmark2TagService');
+$b2tservice = SemanticScuttle_Service_Factory :: getServiceInstance('Bookmark2Tag');
/* Managing all possible inputs */
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***************************************************************************/
-require_once('header.inc.php');
+require_once '../src/SemanticScuttle/header.php';
/* Service creation: only useful services are created */
-$tagservice = & ServiceFactory :: getServiceInstance('TagService');
+$tagservice = SemanticScuttle_Service_Factory :: getServiceInstance('Tag');
/* Managing all possible inputs */
isset($_POST['confirm']) ? define('POST_CONFIRM', $_POST['confirm']): define('POST_CONFIRM', '');
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***************************************************************************/
-require_once('header.inc.php');
+require_once '../src/SemanticScuttle/header.php';
/* Service creation: only useful services are created */
-$b2tservice = & ServiceFactory :: getServiceInstance('Bookmark2TagService');
-$tagservice = & ServiceFactory :: getServiceInstance('TagService');
-$tag2tagservice = & ServiceFactory :: getServiceInstance('Tag2tagService');
+$b2tservice = SemanticScuttle_Service_Factory :: getServiceInstance('Bookmark2Tag');
+$tagservice = SemanticScuttle_Service_Factory :: getServiceInstance('Tag');
+$tag2tagservice = SemanticScuttle_Service_Factory :: getServiceInstance('Tag2Tag');
/* Managing all possible inputs */
isset($_POST['confirm']) ? define('POST_CONFIRM', $_POST['confirm']): define('POST_CONFIRM', '');
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***************************************************************************/
-require_once('header.inc.php');
+require_once '../src/SemanticScuttle/header.php';
/* Service creation: only useful services are created */
-$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
-$cacheservice =& ServiceFactory::getServiceInstance('CacheService');
+$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark');
+$cacheservice =SemanticScuttle_Service_Factory::getServiceInstance('Cache');
/* Managing all possible inputs */
isset($_GET['page']) ? define('GET_PAGE', $_GET['page']): define('GET_PAGE', 0);
/////////////////
// This part below will be executed once you comment the two lines above
/////////////////
-require_once('header.inc.php');
-$tagstatservice = & ServiceFactory :: getServiceInstance('TagStatService');
+require_once '../src/SemanticScuttle/header.php';
+$tagstatservice = SemanticScuttle_Service_Factory :: getServiceInstance('TagStat');
?>
<h1>Upgrade</h1>
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***************************************************************************/
-require_once('header.inc.php');
+require_once '../src/SemanticScuttle/header.php';
/* Service creation: only useful services are created */
-$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
-$cacheservice =& ServiceFactory::getServiceInstance('CacheService');
+$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark');
+$cacheservice =SemanticScuttle_Service_Factory::getServiceInstance('Cache');
/* Managing current logged user */
$currentUser = $userservice->getCurrentObjectUser();
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***************************************************************************/
-require_once('header.inc.php');
+require_once '../src/SemanticScuttle/header.php';
/* Service creation: only useful services are created */
//No specific services
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***************************************************************************/
-require_once('header.inc.php');
+require_once '../src/SemanticScuttle/header.php';
/* Service creation: only useful services are created */
-$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
-$cacheservice =& ServiceFactory::getServiceInstance('CacheService');
+$bookmarkservice =SemanticScuttle_Service_Factory::getServiceInstance('Bookmark');
+$cacheservice =SemanticScuttle_Service_Factory::getServiceInstance('Cache');
/* Managing all possible inputs */
isset($_GET['page']) ? define('GET_PAGE', $_GET['page']): define('GET_PAGE', 0);