2007-12-12 17:29:16 +01:00
|
|
|
<?php
|
2008-12-05 08:25:04 +01:00
|
|
|
/* Service creation: only useful services are created */
|
2008-04-21 10:44:44 +02:00
|
|
|
$b2tservice =& ServiceFactory::getServiceInstance('Bookmark2TagService');
|
2008-12-05 08:25:04 +01:00
|
|
|
|
2007-12-12 17:29:16 +01:00
|
|
|
|
2008-11-27 08:27:36 +01:00
|
|
|
if(!isset($user)) $user="";
|
|
|
|
|
|
|
|
|
2007-12-12 17:29:16 +01:00
|
|
|
$logged_on_userid = $userservice->getCurrentUserId();
|
|
|
|
if ($logged_on_userid === false) {
|
|
|
|
$logged_on_userid = NULL;
|
|
|
|
}
|
2008-11-25 16:57:29 +01:00
|
|
|
|
|
|
|
if(!isset($userid)) {
|
|
|
|
$userid = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(isset($user) && strlen($user)==0) {
|
2008-03-12 10:17:13 +01:00
|
|
|
$cat_url = createURL('tags', '%2$s');
|
|
|
|
}
|
2007-12-12 17:29:16 +01:00
|
|
|
if ($currenttag) {
|
2008-04-21 10:44:44 +02:00
|
|
|
$relatedTags = $b2tservice->getRelatedTags($currenttag, $userid, $logged_on_userid);
|
2007-12-12 17:29:16 +01:00
|
|
|
if (sizeof($relatedTags) > 0) {
|
|
|
|
?>
|
|
|
|
|
|
|
|
<h2><?php echo T_('Related Tags'); ?></h2>
|
|
|
|
<div id="related">
|
|
|
|
<table>
|
|
|
|
<?php foreach($relatedTags as $row): ?>
|
2009-02-09 11:31:12 +01: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 17:29:16 +01:00
|
|
|
</tr>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
}
|
2008-03-12 10:17:13 +01:00
|
|
|
?>
|