2007-12-12 17:29:16 +01:00
|
|
|
<?php
|
|
|
|
$userservice =& ServiceFactory::getServiceInstance('UserService');
|
|
|
|
$bookmarkservice =& ServiceFactory::getServiceInstance('BookmarkService');
|
2008-04-21 17:43:00 +02:00
|
|
|
$tagservice =& ServiceFactory::getServiceInstance('TagService');
|
2008-02-13 18:34:18 +01:00
|
|
|
$cdservice =& ServiceFactory::getServiceInstance('CommonDescriptionService');
|
2007-12-12 17:29:16 +01:00
|
|
|
|
|
|
|
$logged_on_userid = $userservice->getCurrentUserId();
|
2008-02-20 14:43:06 +01:00
|
|
|
$currentUser = $userservice->getCurrentUser();
|
|
|
|
$currentUsername = $currentUser[$userservice->getFieldName('username')];
|
2008-05-14 10:55:38 +02:00
|
|
|
$pageName = isset($pageName)?$pageName:"";
|
2008-02-20 14:43:06 +01:00
|
|
|
|
2007-12-12 17:29:16 +01:00
|
|
|
$this->includeTemplate($GLOBALS['top_include']);
|
|
|
|
|
|
|
|
include('search.inc.php');
|
|
|
|
?>
|
|
|
|
|
2008-05-14 10:55:38 +02:00
|
|
|
<?php if($pageName == PAGE_INDEX):?>
|
|
|
|
<p id="welcome"><?php echo $GLOBALS['welcomeMessage'];?></p>
|
|
|
|
<?php endif?>
|
|
|
|
|
|
|
|
|
2008-02-13 18:34:18 +01:00
|
|
|
<?php
|
|
|
|
if((isset($currenttag) && $GLOBALS['enableCommonTagDescription'])
|
|
|
|
|| (isset($hash) && $GLOBALS['enableCommonBookmarkDescription'])):?>
|
|
|
|
<p class="commondescription">
|
|
|
|
|
|
|
|
<?php
|
|
|
|
if(isset($currenttag) && $cdservice->getLastTagDescription($currenttag)) {
|
|
|
|
$description = $cdservice->getLastTagDescription($currenttag);
|
2008-02-19 15:19:49 +01:00
|
|
|
echo nl2br(filter($description['cdDescription']));
|
2008-02-13 18:34:18 +01:00
|
|
|
} elseif(isset($hash) && $cdservice->getLastBookmarkDescription($hash)) {
|
|
|
|
$description = $cdservice->getLastBookmarkDescription($hash);
|
2008-02-19 15:19:49 +01:00
|
|
|
echo nl2br(filter($description['cdTitle'])). "<br/>";
|
|
|
|
echo nl2br(filter($description['cdDescription'])). "<br/>";
|
2008-02-13 18:34:18 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if($logged_on_userid>0) {
|
|
|
|
if(isset($currenttag)) {
|
|
|
|
echo ' (<a href="'. createURL('tagcommondescriptionedit', $currenttag).'">';
|
|
|
|
echo T_('edit common description').'</a>)';
|
|
|
|
} elseif(isset($hash)) {
|
|
|
|
echo ' (<a href="'.createURL('bookmarkcommondescriptionedit', $hash).'">';
|
|
|
|
echo T_('edit common description').'</a>)';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</p>
|
|
|
|
<?php endif ?>
|
|
|
|
|
|
|
|
|
2008-04-21 17:43:00 +02:00
|
|
|
<?php
|
|
|
|
/* Private tag description */
|
2008-05-10 10:59:41 +02:00
|
|
|
if(isset($currenttag) && isset($user)) {
|
|
|
|
$userObject = $userservice->getUserByUsername($user);
|
|
|
|
if($tagservice->getDescription($currenttag, $userObject['uId'])) { ?>
|
|
|
|
|
2008-04-21 17:43:00 +02:00
|
|
|
<p class="commondescription">
|
|
|
|
<?php
|
|
|
|
$description = $tagservice->getDescription($currenttag, $userObject['uId']);
|
|
|
|
echo nl2br(filter($description['tDescription']));
|
|
|
|
?>
|
|
|
|
</p>
|
2008-05-10 10:59:41 +02:00
|
|
|
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
2008-04-21 17:43:00 +02:00
|
|
|
|
2008-02-13 18:34:18 +01:00
|
|
|
<?php if (count($bookmarks) > 0) { ?>
|
2007-12-12 17:29:16 +01:00
|
|
|
<script type="text/javascript">
|
|
|
|
window.onload = playerLoad;
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<p id="sort">
|
2008-03-12 18:05:03 +01:00
|
|
|
<?php echo $total.' '.T_("bookmark(s)"); ?> -
|
2007-12-12 17:29:16 +01:00
|
|
|
<?php echo T_("Sort by:"); ?>
|
2008-05-09 09:29:50 +02:00
|
|
|
<?php
|
|
|
|
$dateSort = (getSortOrder()=='date_desc')? 'date_asc':'date_desc';
|
|
|
|
$titleSort = (getSortOrder()=='title_asc')? 'title_desc':'title_asc';
|
|
|
|
$urlSort = (getSortOrder()=='url_asc')? 'url_desc':'url_asc';
|
|
|
|
?>
|
|
|
|
<a href="?sort=<?php echo $dateSort ?>"><?php echo T_("Date"); ?></a><span> / </span>
|
|
|
|
<a href="?sort=<?php echo $titleSort ?>"><?php echo T_("Title"); ?></a><span> / </span>
|
2007-12-12 17:29:16 +01:00
|
|
|
<?php
|
|
|
|
if (!isset($hash)) {
|
|
|
|
?>
|
2008-05-09 09:29:50 +02:00
|
|
|
<a href="?sort=<?php echo $urlSort ?>"><?php echo T_("URL"); ?></a>
|
2007-12-12 17:29:16 +01:00
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
2008-02-20 14:43:06 +01:00
|
|
|
|
|
|
|
<?php
|
|
|
|
if(isset($currenttag)) {
|
|
|
|
if(isset($user)) {
|
|
|
|
echo ' - ';
|
|
|
|
echo '<a href="'. createURL('tags', $currenttag) .'">';
|
2008-04-21 17:43:00 +02:00
|
|
|
echo T_('Bookmarks from other users for this tag').'</a>';
|
2008-02-20 14:43:06 +01:00
|
|
|
//echo T_(' for these tags');
|
|
|
|
} else if($logged_on_userid>0){
|
|
|
|
echo ' - ';
|
|
|
|
echo '<a href="'. createURL('bookmarks', $currentUsername.'/'.$currenttag) .'">';
|
2008-04-21 17:43:00 +02:00
|
|
|
echo T_('Only your bookmarks for this tag').'</a>';
|
2008-02-20 14:43:06 +01:00
|
|
|
//echo T_(' for these tags');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
2007-12-12 17:29:16 +01:00
|
|
|
</p>
|
|
|
|
|
2008-02-20 14:43:06 +01:00
|
|
|
|
|
|
|
|
2007-12-12 17:29:16 +01:00
|
|
|
<ol<?php echo ($start > 0 ? ' start="'. ++$start .'"' : ''); ?> id="bookmarks">
|
|
|
|
|
|
|
|
<?php
|
|
|
|
foreach(array_keys($bookmarks) as $key) {
|
|
|
|
$row =& $bookmarks[$key];
|
|
|
|
switch ($row['bStatus']) {
|
|
|
|
case 0:
|
|
|
|
$access = '';
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
$access = ' shared';
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
$access = ' private';
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
$cats = '';
|
2008-03-14 17:21:58 +01:00
|
|
|
$tagsForCopy = '';
|
2007-12-12 17:29:16 +01:00
|
|
|
$tags = $row['tags'];
|
|
|
|
foreach(array_keys($tags) as $key) {
|
2008-02-20 14:43:06 +01:00
|
|
|
|
2007-12-12 17:29:16 +01:00
|
|
|
$tag =& $tags[$key];
|
2008-02-20 14:43:06 +01:00
|
|
|
$cats .= '<a href="'. sprintf($cat_url, filter($row['username'], 'url'), filter($tag, 'url')) .'" rel="tag">'. filter($tag) .'</a>, ';
|
2008-03-14 17:21:58 +01:00
|
|
|
$tagsForCopy.= $tag.',';
|
2007-12-12 17:29:16 +01:00
|
|
|
}
|
|
|
|
$cats = substr($cats, 0, -2);
|
|
|
|
if ($cats != '') {
|
2008-09-10 18:14:38 +02:00
|
|
|
$cats = ' '.T_('in').' '. $cats;
|
2007-12-12 17:29:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// Edit and delete links
|
|
|
|
$edit = '';
|
|
|
|
if ($bookmarkservice->editAllowed($row['bId'])) {
|
|
|
|
$edit = ' - <a href="'. createURL('edit', $row['bId']) .'">'. T_('Edit') .'</a><script type="text/javascript">document.write(" - <a href=\"#\" onclick=\"deleteBookmark(this, '. $row['bId'] .'); return false;\">'. T_('Delete') .'<\/a>");</script>';
|
|
|
|
}
|
|
|
|
|
|
|
|
// User attribution
|
|
|
|
$copy = '';
|
|
|
|
if (!isset($user) || isset($watched)) {
|
|
|
|
$copy = ' '. T_('by') .' <a href="'. createURL('bookmarks', $row['username']) .'">'. $row['username'] .'</a>';
|
|
|
|
}
|
|
|
|
|
|
|
|
// Udders!
|
|
|
|
if (!isset($hash)) {
|
|
|
|
$others = $bookmarkservice->countOthers($row['bAddress']);
|
|
|
|
$ostart = '<a href="'. createURL('history', $row['bHash']) .'">';
|
|
|
|
$oend = '</a>';
|
|
|
|
switch ($others) {
|
|
|
|
case 0:
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
$copy .= sprintf(T_(' and %s1 other%s'), $ostart, $oend);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
$copy .= sprintf(T_(' and %2$s%1$s others%3$s'), $others, $ostart, $oend);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Copy link
|
2008-03-14 17:21:58 +01:00
|
|
|
if ($userservice->isLoggedOn() && ($logged_on_userid != $row['uId']) && !$bookmarkservice->bookmarkExists($row['bAddress'], $logged_on_userid)) {
|
2007-12-12 17:29:16 +01:00
|
|
|
// Get the username of the current user
|
|
|
|
$currentUser = $userservice->getCurrentUser();
|
|
|
|
$currentUsername = $currentUser[$userservice->getFieldName('username')];
|
2008-03-14 17:21:58 +01:00
|
|
|
$copy .= ' - <a href="'. createURL('bookmarks', $currentUsername .'?action=add&address='. urlencode($row['bAddress']) .'&title='. urlencode($row['bTitle'])). '&description='.urlencode($row['bDescription']). '&tags='.$tagsForCopy .'">'. T_('Copy') .'</a>';
|
2007-12-12 17:29:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// Nofollow option
|
|
|
|
$rel = '';
|
|
|
|
if ($GLOBALS['nofollow']) {
|
|
|
|
$rel = ' rel="nofollow"';
|
|
|
|
}
|
|
|
|
|
|
|
|
$address = filter($row['bAddress']);
|
|
|
|
|
|
|
|
// Redirection option
|
|
|
|
if ($GLOBALS['useredir']) {
|
|
|
|
$address = $GLOBALS['url_redir'] . $address;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Output
|
|
|
|
echo '<li class="xfolkentry'. $access .'">'."\n";
|
2008-03-11 13:36:23 +01:00
|
|
|
if ($GLOBALS['enableWebsiteThumbnails']) {
|
2008-11-13 15:38:04 +01:00
|
|
|
$thumbnailHash = md5($address.$GLOBALS['thumbnailsUserId'].$GLOBALS['thumbnailsKey']);
|
|
|
|
echo '<a href="'. $address .'"'. $rel .' ><img class="thumbnail" src="http://www.artviper.net/screenshots/screener.php?url='.$address.'&w=120&sdx=1280&userID='.$GLOBALS['thumbnailsUserId'].'&hash='.$thumbnailHash.'" /> ';
|
2008-03-11 13:36:23 +01:00
|
|
|
}
|
2008-03-11 14:50:23 +01:00
|
|
|
echo '<div>';
|
|
|
|
|
2007-12-12 17:29:16 +01:00
|
|
|
echo '<div class="link"><a href="'. $address .'"'. $rel .' class="taggedlink">'. filter($row['bTitle']) ."</a></div>\n";
|
2008-03-13 10:57:13 +01:00
|
|
|
if ($row['bDescription'] == '') {
|
|
|
|
$row['bDescription'] = '-';
|
2007-12-12 17:29:16 +01:00
|
|
|
}
|
2008-03-13 10:57:13 +01:00
|
|
|
echo '<div class="description">'. filter($row['bDescription']) ."</div>\n";
|
2008-02-13 18:41:47 +01:00
|
|
|
if(!isset($hash)) {
|
2008-04-18 12:29:09 +02:00
|
|
|
echo '<div class="address">'.shortenString($address).'</div>';
|
2008-02-13 18:41:47 +01:00
|
|
|
}
|
2008-03-11 13:36:23 +01:00
|
|
|
|
2007-12-12 17:29:16 +01:00
|
|
|
echo '<div class="meta">'. date($GLOBALS['shortdate'], strtotime($row['bDatetime'])) . $cats . $copy . $edit ."</div>\n";
|
2008-03-11 14:50:23 +01:00
|
|
|
|
|
|
|
echo '</div>';
|
|
|
|
|
2007-12-12 17:29:16 +01:00
|
|
|
echo "</li>\n";
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
|
|
|
|
</ol>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
// PAGINATION
|
|
|
|
|
|
|
|
// Ordering
|
|
|
|
$sortOrder = '';
|
|
|
|
if (isset($_GET['sort'])) {
|
|
|
|
$sortOrder = 'sort='. $_GET['sort'];
|
|
|
|
}
|
|
|
|
|
|
|
|
$sortAmp = (($sortOrder) ? '&'. $sortOrder : '');
|
|
|
|
$sortQue = (($sortOrder) ? '?'. $sortOrder : '');
|
|
|
|
|
|
|
|
// Previous
|
|
|
|
$perpage = getPerPageCount();
|
|
|
|
if (!$page || $page < 2) {
|
|
|
|
$page = 1;
|
|
|
|
$start = 0;
|
|
|
|
$bfirst = '<span class="disable">'. T_('First') .'</span>';
|
|
|
|
$bprev = '<span class="disable">'. T_('Previous') .'</span>';
|
|
|
|
} else {
|
|
|
|
$prev = $page - 1;
|
|
|
|
$prev = 'page='. $prev;
|
|
|
|
$start = ($page - 1) * $perpage;
|
|
|
|
$bfirst= '<a href="'. sprintf($nav_url, $user, $currenttag, '') . $sortQue .'">'. T_('First') .'</a>';
|
|
|
|
$bprev = '<a href="'. sprintf($nav_url, $user, $currenttag, '?') . $prev . $sortAmp .'">'. T_('Previous') .'</a>';
|
|
|
|
}
|
|
|
|
|
|
|
|
// Next
|
|
|
|
$next = $page + 1;
|
|
|
|
$totalpages = ceil($total / $perpage);
|
|
|
|
if (count($bookmarks) < $perpage || $perpage * $page == $total) {
|
|
|
|
$bnext = '<span class="disable">'. T_('Next') .'</span>';
|
2008-04-11 10:42:36 +02:00
|
|
|
$blast = '<span class="disable">'. T_('Last') ."</span>\n";
|
2007-12-12 17:29:16 +01:00
|
|
|
} else {
|
|
|
|
$bnext = '<a href="'. sprintf($nav_url, $user, $currenttag, '?page=') . $next . $sortAmp .'">'. T_('Next') .'</a>';
|
2008-04-11 10:42:36 +02:00
|
|
|
$blast = '<a href="'. sprintf($nav_url, $user, $currenttag, '?page=') . $totalpages . $sortAmp .'">'. T_('Last') ."</a>\n";
|
2007-12-12 17:29:16 +01:00
|
|
|
}
|
2008-04-24 10:48:57 +02:00
|
|
|
|
|
|
|
// RSS
|
|
|
|
$brss = '';
|
|
|
|
$size = count($rsschannels);
|
|
|
|
for ($i = 0; $i < $size; $i++) {
|
2008-11-20 18:03:28 +01:00
|
|
|
$brss = '<a style="background:#FFFFFF" href="'. $rsschannels[$i][1] .'" title="'. $rsschannels[$i][0] .'"><img src="'. $GLOBALS['root'] .'images/rss.gif" width="16" height="16" alt="'. $rsschannels[$i][0] .'" /></a>';
|
2008-04-24 10:48:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
echo '<p class="paging">'. $bfirst .'<span> / </span>'. $bprev .'<span> / </span>'. $bnext .'<span> / </span>'. $blast .'<span> / </span>'. sprintf(T_('Page %d of %d'), $page, $totalpages) ." ". $brss ." </p>\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-12-12 17:29:16 +01:00
|
|
|
} else {
|
2008-04-11 10:42:36 +02:00
|
|
|
echo '<p class="error">'.T_('No bookmarks available').'</p>';
|
2007-12-12 17:29:16 +01:00
|
|
|
}
|
|
|
|
$this->includeTemplate('sidebar.tpl');
|
|
|
|
$this->includeTemplate($GLOBALS['bottom_include']);
|
|
|
|
?>
|