Main Page | Directories | File List | File Members

include/my/bookmarks.php

Go to the documentation of this file.
00001 <?php
00002 # This file is part of the Savane project
00003 # <http://gna.org/projects/savane/>
00004 #
00005 # $Id: bookmarks.php 4567 2005-06-30 17:19:37Z toddy $
00006 #
00007 #  Copyright 1999-2000 (c) The SourceForge Crew
00008 #  Copyright 2000-2001 (c) Free Software Foundation
00009 #
00010 #  Copyright 2004      (c) ...
00011 # 
00012 # The Savane project is free software; you can redistribute it and/or
00013 # modify it under the terms of the GNU General Public License
00014 # as published by the Free Software Foundation; either version 2
00015 # of the License, or (at your option) any later version.
00016 #
00017 # The Savane project is distributed in the hope that it will be useful,
00018 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00019 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020 # GNU General Public License for more details.
00021 #
00022 # You should have received a copy of the GNU General Public License
00023 # along with the Savane project; if not, write to the Free Software
00024 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00025 
00026 
00027 function bookmark_add ($bookmark_url, $bookmark_title="") 
00028 {
00029   if (!$bookmark_title) 
00030     { $bookmark_title = $bookmark_url; }
00031   
00032   $result = db_query("INSERT into user_bookmarks (user_id, bookmark_url, ".
00033                      "bookmark_title) values ('".user_getid()."', '".addslashes($bookmark_url)."', ".
00034                      "'".addslashes($bookmark_title)."');");
00035   if (!$result) 
00036     { print db_error(); }
00037 }
00038 
00039 function bookmark_edit ($bookmark_id, $bookmark_url, $bookmark_title) 
00040 {
00041   db_query("UPDATE user_bookmarks SET bookmark_url='".addslashes($bookmark_url)."', "
00042            ."bookmark_title='".addslashes($bookmark_title)."' where bookmark_id='".addslashes($bookmark_id)."' AND user_id='". user_getid() ."'");
00043 }
00044 
00045 function bookmark_delete ($bookmark_id) 
00046 {
00047   db_query("DELETE from user_bookmarks WHERE bookmark_id='".addslashes($bookmark_id)."'and user_id='".user_getid()."'");
00048 }
00049 
00050 ?>

Generated on Sun Feb 26 13:23:03 2006 for Savane PHP Frontend Developer Reference by  doxygen 1.4.4