3 * Bookmarks functions library.
5 * Copyright 1999-2001 (c) VA Linux Systems
6 * http://fusionforge.org
8 * This file is part of FusionForge. FusionForge is free software;
9 * you can redistribute it and/or modify it under the terms of the
10 * GNU General Public License as published by the Free Software
11 * Foundation; either version 2 of the Licence, or (at your option)
14 * FusionForge is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License along
20 * with FusionForge; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25 * bookmark_add() - Add a new bookmark
27 * @param string The bookmark's URL
28 * @param string The bookmark's title
30 function bookmark_add ($bookmark_url, $bookmark_title="") {
31 if (!$bookmark_title) {
32 $bookmark_title = $bookmark_url;
34 $result = db_query_params ('INSERT into user_bookmarks (user_id, bookmark_url, bookmark_title) values ($1, $2, $3)',
36 htmlentities($bookmark_url),
37 htmlspecialchars($bookmark_title)));
44 * bookmark_edit() - Edit an existing bookmark
46 * @param int The bookmark's ID
47 * @param string The new or existing bookmark URL
48 * @param string The new or existing bookmark title
50 function bookmark_edit ($bookmark_id, $bookmark_url, $bookmark_title) {
51 $result = db_query_params ('UPDATE user_bookmarks SET bookmark_url=$1, bookmark_title=$2 WHERE bookmark_id=$3 AND user_id=$4',
52 array (htmlentities($bookmark_url),
53 htmlspecialchars($bookmark_title),
65 * bookmark_deleted() - Delete an existing bookmark
67 * @param int The bookmark's ID
69 function bookmark_delete ($bookmark_id) {
70 db_query_params ('DELETE from user_bookmarks WHERE bookmark_id=$1 AND user_id=$2',