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';
}
$cats = '';
+ $tagsForCopy = '';
$tags = $row['tags'];
foreach(array_keys($tags) as $key) {
$tag =& $tags[$key];
$cats .= '<a href="'. sprintf($cat_url, filter($row['username'], 'url'), filter($tag, 'url')) .'" rel="tag">'. filter($tag) .'</a>, ';
+ $tagsForCopy.= $tag.',';
}
$cats = substr($cats, 0, -2);
if ($cats != '') {
}
// 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 .= ' - <a href="'. createURL('bookmarks', $currentUsername .'?action=add&address='. urlencode($row['bAddress']) .'&title='. urlencode($row['bTitle'])) .'">'. T_('Copy') .'</a>';
+ $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>';
}
// Nofollow option