}
if(!$userservice->isLoggedOn()) {
-
/* Maybe we have caught authentication data in $_SERVER['REMOTE_USER']
( Inspired by http://www.yetanothercommunitysystem.com/article-321-regle-comment-utiliser-l-authentification-http-en-php-chez-ovh ) */
if((!isset($_SERVER['PHP_AUTH_USER']) || !isset($_SERVER['PHP_AUTH_PW']))
$tplVars['start'] = $start;
$tplVars['bookmarkCount'] = $start + 1;
- $bookmarks =& $bookmarkservice->getBookmarks($start, $perpage, $userid, $cat, $terms, getSortOrder());
+ $bookmarks =& $bookmarkservice->getBookmarks($start, $perpage, $userid, $cat, null, getSortOrder());
$tplVars['total'] = $bookmarks['total'];
$tplVars['bookmarks'] =& $bookmarks['bookmarks'];
$tplVars['cat_url'] = createURL('bookmarks', '%s/%s');
$tplVars['nav_url'] = createURL('bookmarks', '%s/%s%s');
- if ($user == $currentUsername) {
+ if ($userservice->isLoggedOn() && $user == $currentUsername) {
$title = T_('My Bookmarks') . filter($catTitle);
} else {
$title = filter($pagetitle);
ini_set('mysql.trace_mode', '0');
error_reporting(E_ALL ^ E_NOTICE);
+//error_reporting(E_ALL);
define('DEBUG', true);
session_start();
}
$root = 'http://'. $_SERVER['HTTP_HOST'] . $root;
}
+
?>
// PHP 5.1.1 does not read more than 8192 bytes in one fread()
// the discussions at PHP Bugs suggest it's the intended behaviour
+ $data = '';
while ($bytes > 0) {
$chunk = fread($this->_fd, $bytes);
$data .= $chunk;
}
-?>
\ No newline at end of file
+?>
$tplVars = array();
+$keeppass = isset($_POST['keeppass'])&&($_POST['keeppass']=='yes')?true:false;
+
$login = false;
if (isset($_POST['submitted']) && isset($_POST['username']) && isset($_POST['password'])) {
$posteduser = trim(utf8_strtolower($_POST['username']));
- $login = $userservice->login($posteduser, $_POST['password'], ($_POST['keeppass'] == "yes"));
+ $login = $userservice->login($posteduser, $_POST['password'], $keeppass);
if ($login) {
if ($_POST['query'])
header('Location: '. createURL('bookmarks', $posteduser .'?'. $_POST['query']));
$tplVars = array();
// IF SUBMITTED
-if ($_POST['submitted']) {
+if (isset($_POST['submitted'])) {
// NO USERNAME
if (!$_POST['username']) {
$userid = NULL;
}
-$tags = $b2tservice->getPopularTags($userid, 150, $logged_on_userid);
+$tags = $b2tservice->getPopularTags($userid, 150);
$tplVars['tags'] =& $b2tservice->tagCloud($tags, 5, 90, 225, getSortOrder('alphabet_asc'));
$tplVars['user'] = $user;
$tplVars = array();
-if ($_POST['submitted']) {
+if (isset($_POST['submitted'])) {
$posteduser = trim(utf8_strtolower($_POST['username']));
// Check if form is incomplete
+<?php
+/* Manage input */
+$select_watchlist = isset($select_watchlist)?$select_watchlist:'';
+$select_all = isset($select_all)?$select_all:'';
+?>
+
+
<form id="search" action="<?php echo createURL('search'); ?>" method="post">
<table>
<tr>
<?php
if (!in_array($range, array($currentUsername, 'all', 'watchlist'))) {
?>
- <option value="<?php echo $user ?>"<?php echo $selectUser; ?>><?php echo T_("this user's bookmarks"); ?></option>
+ <option value="<?php echo $user ?>"<?php //echo $selectUser; ?>><?php echo T_("this user's bookmarks"); ?></option>
<?php
}
if ($logged_on) {
?>
- <option value="<?php echo $currentUsername; ?>"<?php echo $selectMy; ?>><?php echo T_('my bookmarks'); ?></option>
+ <option value="<?php echo $currentUsername; ?>"<?php //echo $selectMy; ?>><?php echo T_('my bookmarks'); ?></option>
<option value="watchlist"<?php echo $select_watchlist; ?>><?php echo T_('my watchlist'); ?></option>
<?php
}
<?php
}
?>
- <td><input type="text" name="terms" size="30" value="<?php echo filter($terms); ?>" /></td>
+ <td><input type="text" name="terms" size="30" value="<?php $terms=!isset($terms)?'':$terms; echo filter($terms); ?>" /></td>
<td><input type="submit" value="<?php echo T_('Search' /* Submit button */); ?>" /></td>
</tr>
</table>
message_die(GENERAL_ERROR, 'Could not get related tags', '', __LINE__, __FILE__, $query, $this->db);
return false;
}
- return $this->db->sql_fetchrowset($dbresult);
+ $output = $this->db->sql_fetchrowset($dbresult);
+ return $output;
}
// Returns the most popular tags used for a particular bookmark hash
return false;
}
- return $this->db->sql_fetchrowset($dbresult);
+ $output = $this->db->sql_fetchrowset($dbresult);
+ return $output;
}
function hasTag($bookmarkid, $tag) {
function &tagCloud($tags = NULL, $steps = 5, $sizemin = 90, $sizemax = 225, $sortOrder = NULL) {
if (is_null($tags) || count($tags) < 1) {
- return false;
+ $output = false;
+ return $output;
}
$min = $tags[count($tags) - 1]['bCount'];
$query_3 .= ' AND ('. $query_3_1 .') AND B.bStatus IN (0, 1)';
}
+ $query_5 = '';
if($hash == null) {
$query_5.= ' GROUP BY B.bHash';
}
$row['tags'] = $b2tservice->getTagsForBookmark(intval($row['bId']));
$bookmarks[] = $row;
}
- return array ('bookmarks' => $bookmarks, 'total' => $total);
+
+ $output = array ('bookmarks' => $bookmarks, 'total' => $total);
+ return $output;
}
function deleteBookmark($bookmarkid) {
$query.= " AND uId = '".$uId."'";
}
//die($query);
- if (! ($dbresult =& $this->db->sql_query_limit($query, $limit)) ){
+ if (! ($dbresult =& $this->db->sql_query($query)) ){
message_die(GENERAL_ERROR, 'Could not get related tags', '', __LINE__, __FILE__, $query, $this->db);
return false;
}
if ($id = $this->getCurrentUserId())
$currentuser = $this->getUser($id);
else
- return;
+ return null;
}
return $currentuser;
}
$templateservice = & ServiceFactory :: getServiceInstance('TemplateService');
$userservice = & ServiceFactory :: getServiceInstance('UserService');
+
+
$logged_on_user = $userservice->getCurrentUser();
//permissions
-if($logged_on_user == null) {
+if($logged_on_user == null) {
$tplVars['error'] = T_('Permission denied.');
$templateservice->loadTemplate('error.500.tpl', $tplVars);
exit();
<?php
-$userObject = $userservice->getUserByUsername($user);
/* Private tag description */
-if(isset($currenttag) && strlen($user)>0 && $tagservice->getDescription($currenttag, $userObject['uId'])):?>
+if(isset($currenttag) && isset($user)) {
+ $userObject = $userservice->getUserByUsername($user);
+ if($tagservice->getDescription($currenttag, $userObject['uId'])) { ?>
+
<p class="commondescription">
<?php
-
$description = $tagservice->getDescription($currenttag, $userObject['uId']);
echo nl2br(filter($description['tDescription']));
?>
</p>
-<?php endif ?>
+
+<?php
+ }
+}
+?>
<?php if (count($bookmarks) > 0) { ?>
<script type="text/javascript">
require_once('sidebar.linkedtags.inc.php');
+/* Manage input */
+$user = isset($user)?$user:'';
+$userid = isset($userid)?$userid:0;
+$currenttag = isset($currenttag)?$currenttag:'';
+$summarizeLinkedTags = isset($summarizeLinkedTags)?$summarizeLinkedTags:false;
+
+
$logged_on_userid = $userservice->getCurrentUserId();
if ($logged_on_userid === false) {
$logged_on_userid = NULL;
}
$explodedTags = array();
-if ($currenttag) {
+if (strlen($currenttag)>0) {
$explodedTags = explode('+', $currenttag);
} else {
if($summarizeLinkedTags == true) {
require_once('sidebar.linkedtags.inc.php');
+/* Manage input */
+$userid = isset($userid)?$userid:0;
+$user = isset($user)?$user:null;
+
+
$logged_on_userid = $userservice->getCurrentUserId();
if ($logged_on_userid === false) {
$logged_on_userid = NULL;
$editingMode = false;
}
-if(strlen($user)==0) {
+if(!isset($user)) {
$cat_url = createURL('tags', '%2$s');
}
$b2tservice =& ServiceFactory::getServiceInstance('Bookmark2TagService');
$userservice =& ServiceFactory::getServiceInstance('UserService');
+/* Manage input */
+$userid = isset($userid)?$userid:0;
+
$logged_on_userid = $userservice->getCurrentUserId();
if ($logged_on_userid === false) {
$logged_on_userid = NULL;
} else {
$link = '> ';
}
+ } else {
+ $link = '';
}
$output = '';
$displayLinkedTags = displayLinkedTags($linkedTag, $linkType, $uId, $cat_url, $user, $editingMode, $precedentTag, $level + 1, $stopList);
$output.= $displayLinkedTags['output'];
}
- if(is_array($displayLinkedTags['stopList'])) {
+ if(isset($displayLinkedTags) && is_array($displayLinkedTags['stopList'])) {
$stopList = array_merge($stopList, $displayLinkedTags['stopList']);
$stopList = array_unique($stopList);
}
?>
<ul id="navigation">
- <li><a href="<?php echo createURL('populartags', $cUsername); ?>"><?php echo T_('Popular Tags'); ?></a></li>
+ <li><a href="<?php echo createURL('populartags'); ?>"><?php echo T_('Popular Tags'); ?></a></li>
<li><a href="<?php echo createURL('about'); ?>"><?php echo T_('About'); ?></a></li>
<li class="access"><a href="<?php echo createURL('login'); ?>"><?php echo T_('Log In'); ?></a></li>
<li class="access"><a href="<?php echo createURL('register'); ?>"><?php echo T_('Register'); ?></a></li>
<link rel="icon" type="image/png" href="<?php echo $GLOBALS['root']; ?>icon.png" />
<link rel="stylesheet" type="text/css" href="<?php echo $GLOBALS['root']; ?>scuttle.css" />
<?php
- $size = count($rsschannels);
- for ($i = 0; $i < $size; $i++) {
- echo '<link rel="alternate" type="application/rss+xml" title="'. $rsschannels[$i][0] .'" href="'. $rsschannels[$i][1] .'" />';
+ if(isset($rsschannels)) {
+ $size = count($rsschannels);
+ for ($i = 0; $i < $size; $i++) {
+ echo '<link rel="alternate" type="application/rss+xml" title="'. $rsschannels[$i][0] .'" href="'. $rsschannels[$i][1] .'" />';
+ }
}
- if ($loadjs) {
+ if (isset($loadjs)) {
echo '<script type="text/javascript" src="'. $GLOBALS['root'] .'jsScuttle.php"></script>';
}
?>