diff --git a/bookmarks.php b/bookmarks.php
index 4c0a2a9..ff1d65b 100644
--- a/bookmarks.php
+++ b/bookmarks.php
@@ -131,9 +131,9 @@ if ($loggedon && isset($_POST['submitted'])) {
if (isset($_GET['action']) && ($_GET['action'] == "add")) {
// If the bookmark exists already, edit the original
if ($bookmarkservice->bookmarkExists(stripslashes($_GET['address']), $currentUserID)) {
- $bookmark =& $bookmarkservice->getBookmarkByAddress(stripslashes($_GET['address']));
- $popup = (isset($_GET['popup'])) ? '?popup=1' : '';
- header('Location: '. createURL('edit', $bookmark['bId'] . $popup));
+ $bookmark =& $bookmarkservice->getBookmarks(0, NULL, $currentUserID, NULL, NULL, NULL, NULL, NULL, NULL, md5(stripslashes($_GET['address'])));
+ $popup = (isset($_GET['popup'])) ? '?popup=1' : '';
+ header('Location: '. createURL('edit', $bookmark['bookmarks'][0]['bId'] . $popup));
exit();
}
$templatename = 'editbookmark.tpl';
diff --git a/templates/bookmarks.tpl.php b/templates/bookmarks.tpl.php
index 84a67fe..d48aa1b 100644
--- a/templates/bookmarks.tpl.php
+++ b/templates/bookmarks.tpl.php
@@ -96,11 +96,13 @@ window.onload = playerLoad;
}
$cats = '';
+ $tagsForCopy = '';
$tags = $row['tags'];
foreach(array_keys($tags) as $key) {
$tag =& $tags[$key];
$cats .= ''. filter($tag) .', ';
+ $tagsForCopy.= $tag.',';
}
$cats = substr($cats, 0, -2);
if ($cats != '') {
@@ -136,11 +138,11 @@ window.onload = playerLoad;
}
// Copy link
- if ($userservice->isLoggedOn() && ($logged_on_userid != $row['uId'])) {
+ if ($userservice->isLoggedOn() && ($logged_on_userid != $row['uId']) && !$bookmarkservice->bookmarkExists($row['bAddress'], $logged_on_userid)) {
// Get the username of the current user
$currentUser = $userservice->getCurrentUser();
$currentUsername = $currentUser[$userservice->getFieldName('username')];
- $copy .= ' - '. T_('Copy') .'';
+ $copy .= ' - '. T_('Copy') .'';
}
// Nofollow option