2007-12-12 16:29:16 +00:00
|
|
|
<?php
|
2008-12-05 07:25:04 +00:00
|
|
|
/* Service creation: only useful services are created */
|
2008-04-21 08:44:44 +00:00
|
|
|
$b2tservice =& ServiceFactory::getServiceInstance('Bookmark2TagService');
|
2008-12-05 07:25:04 +00:00
|
|
|
|
2007-12-12 16:29:16 +00:00
|
|
|
|
2008-11-27 07:27:36 +00:00
|
|
|
if(!isset($user)) $user="";
|
|
|
|
|
|
|
|
|
2007-12-12 16:29:16 +00:00
|
|
|
$logged_on_userid = $userservice->getCurrentUserId();
|
|
|
|
if ($logged_on_userid === false) {
|
|
|
|
$logged_on_userid = NULL;
|
|
|
|
}
|
2008-11-25 15:57:29 +00:00
|
|
|
|
|
|
|
if(!isset($userid)) {
|
|
|
|
$userid = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(isset($user) && strlen($user)==0) {
|
2008-03-12 09:17:13 +00:00
|
|
|
$cat_url = createURL('tags', '%2$s');
|
|
|
|
}
|
2007-12-12 16:29:16 +00:00
|
|
|
if ($currenttag) {
|
2008-04-21 08:44:44 +00:00
|
|
|
$relatedTags = $b2tservice->getRelatedTags($currenttag, $userid, $logged_on_userid);
|
2007-12-12 16:29:16 +00:00
|
|
|
if (sizeof($relatedTags) > 0) {
|
|
|
|
?>
|
|
|
|
|
|
|
|
<h2><?php echo T_('Related Tags'); ?></h2>
|
|
|
|
<div id="related">
|
|
|
|
<table>
|
|
|
|
<?php foreach($relatedTags as $row): ?>
|
2009-02-09 10:31:12 +00:00
|
|
|
<tr>
|
|
|
|
<td><a href="<?php echo sprintf($cat_url, filter($user, 'url'), filter($row['tag'], 'url')); ?>" rel="tag"><?php echo filter($row['tag']); ?></a> <b><a href="<?php echo sprintf($cat_url, filter($user, 'url'), filter($currenttag, 'url') .'+'. filter($row['tag'], 'url')); ?>" title="<?php echo T_('Add this tag to the query') ?>">+</a></b></td>
|
2007-12-12 16:29:16 +00:00
|
|
|
</tr>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
}
|
2008-03-12 09:17:13 +00:00
|
|
|
?>
|