diff -u bookmarks2/account_setup.php bookmarks/account_setup.php
--- bookmarks2/account_setup.php	Tue Jan 18 16:33:27 2005
+++ bookmarks/account_setup.php	Tue Jan 18 16:44:50 2005
@@ -9,7 +9,7 @@
     $password_verify = $_POST['password_verify'];
 }
 
-if ($username && $password && ($password == $password_verify)) {
+if (!empty ($username) && !empty ($password) && ($password == $password_verify)) {
     $crypted_password = crypt($password, '27');
     debug("Username: $username", 2);
     debug("Password: $password -> $crypted_password", 2);
@@ -36,7 +36,7 @@
 <?php
 
 // Display password verify error.
-if ($password && $password != $password_verify) { echo "<p><div class='warning'>Your passwords didn't match, try again.</div>"; }
+if (!empty ($password) && $password != $password_verify) { echo "<p><div class='warning'>Your passwords didn't match, try again.</div>"; }
 
 ?>
 
@@ -44,7 +44,7 @@
 <table cellpadding="0" cellspacing="5" border="0">
 <tr>
   <td>Username:</td>
-  <td><input type="text" name="username" value="<?php echo $username ?>"></td>
+  <td><input type="text" name="username" value="<?php echo (!empty ($username) ? $username : '') ?>"></td>
 </tr>
 <tr>
   <td>Password:</td>
diff -u bookmarks2/add_bookmark.php bookmarks/add_bookmark.php
--- bookmarks2/add_bookmark.php	Tue Jan 18 16:33:27 2005
+++ bookmarks/add_bookmark.php	Tue Jan 18 17:20:48 2005
@@ -29,40 +29,42 @@
 if ($APB_SETTINGS['auth_user_id']) {
 
     // We have an authenticated user.
-
+    $id = null;
     if (isset($_GET['id']))
     {
-        $id = $_GET['id'];
+        $id = addslashes ($_GET['id']);
     }
 
 // Javascript quickadd uses get to add bookmarks, so let's
 // try to accommodate that
     if (isset($_GET['form_title']))
     {
-        $form_title = $_GET['form_title'];
+        $form_title = addslashes ($_GET['form_title']);
     }
     if (isset($_GET['form_url']))
     {
-        $form_url = $_GET['form_url'];
+        $form_url = addslashes ($_GET['form_url']);
     }
     print "<div class='editbox'>";
     print "<div class='editboxheader'>" . (($id) ? 'Edit' : 'Add') . " Bookmark</div><br>\n";
 
     $action = '';
+    $form_private = null;
+    $form_description = null;
     if (isset($_GET['action']))
     {
-        $action = $_GET['action'];
+        $action = addslashes ($_GET['action']);
     }
     if (isset($_POST['form_url']))
     {
-        $form_url = $_POST['form_url'];
+        $form_url = addslashes ($_POST['form_url']);
     }
 
     // If we're going to insert, we need to have a URL. [LBS 20020211]
-    if ($action == 'insert_bookmark' && $form_url) {
+    if ($action == 'insert_bookmark' && !empty ($form_url)) {
 
         $form_group_type = $_POST['form_group_type'];
-        if ('' != $_POST['form_group_title'])
+        if (!empty ($_POST['form_group_title']))
         {
             $form_group_title = $_POST['form_group_title'];
         }
@@ -116,7 +118,7 @@
             $form_id = $_POST['form_id'];
         }
 
-        if ($form_id) {
+        if (!empty ($form_id)) {
 
 
 // Hacked this line, because I'm not sure it's needed... plus it helps
@@ -125,15 +127,15 @@
             if (1) {
                 if (isset($_GET['form_title']))
                 {
-                    $form_title = $_GET['form_title'];
+                    $form_title = addslashes ($_GET['form_title']);
                 }
                 if (isset($_POST['form_title']))
                 {
-                    $form_title = $_POST['form_title'];
+                    $form_title = addslashes ($_POST['form_title']);
                 }
-                $form_description = $_POST['form_description'];
-                $form_private = $_POST['form_private'];
-                $back_url = $_POST['back_url'];
+                $form_description = addslashes ($_POST['form_description']);
+                $form_private = addslashes ($_POST['form_private']);
+                $back_url = addslashes ($_POST['back_url']);
                 $query = "
                     UPDATE apb_bookmarks
                        SET group_id = '$form_group_id',
@@ -171,9 +173,9 @@
             }
 
         } else {
-            $form_title = $_POST['form_title'];
-            $form_description = $_POST['form_description'];
-            $form_private = $_POST['form_private'];
+            $form_title = addslashes ($_POST['form_title']);
+            $form_description = addslashes ($_POST['form_description']);
+            $form_private = addslashes ($_POST['form_private']);
             $query = "
                 INSERT INTO apb_bookmarks
                     (group_id, bookmark_title, bookmark_url, bookmark_description,
@@ -249,7 +251,7 @@
             $form_title = $b->title();
             $form_url = $b->url();
             $form_description = $b->description();
-            $form_private = $b->private();
+            $form_private = $b->apb_private();
             $id_owner_user_id = $b->user_id();
         }
 
@@ -272,7 +274,7 @@
                             <div class="editfieldlabel"><input type="radio" class="radio" name="form_group_type" value="existing" checked>
                             Existing Group:
                             </div>
-                            <div class='editmenu'><?php groups_dropdown('form_group_id', $form_group_id) ?>
+                            <div class='editmenu'><?php groups_dropdown('form_group_id', (!empty ($form_group_id) ? $form_group_id : null)) ?>
                             </div>
                             </div>
                            <div style="clear:both"><br><hr></div>
@@ -281,7 +283,7 @@
                             New Group:
                             </div>
                             <div>
-                            <input class='text' name="form_group_title" value="<?php echo $form_group_title ?>">
+                            <input class='text' name="form_group_title" value="<?php echo (!empty ($form_group_title) ? $form_group_title : '') ?>">
                             </div>
                             <div class="editfieldlabel">Parent Group:
                             </div>
@@ -295,7 +297,8 @@
                 // If there are not any groups yet, show the simple group editor. [LBS 20020211]
                 else
                 {
-                    if (!$form_group_title) { $form_group_title = "My First Group"; }
+                    $form_group_title = null;
+                    if (!empty ($form_group_title)) { $form_group_title = "My First Group"; }
 
                     ?>
                     <input type="hidden" name="form_group_type" value="new">
@@ -316,7 +319,7 @@
         $form_title = $_GET['form_title'];
     }
 ?>
-                        <div><input class="text" name="form_title" value="<?php echo stripslashes($form_title) ?>">
+                        <div><input class="text" name="form_title" value="<?php echo (!empty ($form_title) ? stripslashes($form_title) : '') ?>">
                         </div>
                         </div>
 
@@ -329,14 +332,14 @@
         $form_url = $_GET['form_url'];
     }
 ?>
-                        <div><input class="text" name="form_url" value="<?php echo $form_url ?>">
+                        <div><input class="text" name="form_url" value="<?php echo (!empty ($form_url) ? $form_url : null) ?>">
                         </div>
                         </div>
 
                         <div class='editboxfields'>
                         <div class="editfieldlabel">Description:
                         </div>
-                        <div><input class="text" name="form_description" value="<?php echo stripslashes($form_description) ?>">
+                        <div><input class="text" name="form_description" value="<?php echo (!empty ($form_description) ? stripslashes($form_description) : '') ?>">
                         </div>
                         </div>
 
diff -u bookmarks2/apb_bookmark_class.php bookmarks/apb_bookmark_class.php
--- bookmarks2/apb_bookmark_class.php	Tue Jan 18 16:33:27 2005
+++ bookmarks/apb_bookmark_class.php	Tue Jan 18 16:41:05 2005
@@ -101,7 +101,7 @@
         return $this->creation_date;
     }
 
-    function private () {
+    function apb_private () {
         if (! $this->private) {
             #debug("No private, loading vars");
             $this->load_vars($this->id);
@@ -126,7 +126,7 @@
         $this->title() || $this->load_vars($this->id);
 
         // If we're in "edit mode" go to a different link than the normal one.
-        if ($APB_SETTINGS['auth_user_id'] AND $APB_SETTINGS['edit_mode']) {
+        if ($APB_SETTINGS['auth_user_id'] AND !empty ($APB_SETTINGS['edit_mode'])) {
             $url = $APB_SETTINGS['apb_url']."add_bookmark.php?id=";
             // Show an icon to let you know if something is private.
             if ($this->private) { $private_icon = " <img src='images/private.gif' alt='Private' title='Private'>"; }
@@ -146,7 +146,7 @@
             ">".
             $this->title.
             "</a>".
-            $private_icon;
+            ((!empty ($private_icon)) ? $private_icon : '');
 
         return $link;
     }
@@ -183,4 +183,4 @@
 
 }
 
-?>
\ No newline at end of file
+?>
diff -u bookmarks2/apb_common.php bookmarks/apb_common.php
--- bookmarks2/apb_common.php	Tue Jan 18 16:33:27 2005
+++ bookmarks/apb_common.php	Tue Jan 18 17:13:44 2005
@@ -54,7 +54,7 @@
 
 /*  Database Connection */
 //  All database queries should use mysql_db_query($APB_SETTINGS['apb_database'], $query);
-mysql_pconnect ($APB_SETTINGS['apb_host'], $APB_SETTINGS['apb_username'], $APB_SETTINGS['apb_password']);
+mysql_pconnect ($APB_SETTINGS['apb_host'], $APB_SETTINGS['apb_username'], $APB_SETTINGS['apb_password']) or die ('Error db connect:' . mysql_error ());
 //echo "[[[".$APB_SETTINGS['apb_username']."]]]";
 
 /* class files */
@@ -78,17 +78,18 @@
 
 // By default we allow the login button to be displayed. [LBS 20020211]
 $APB_SETTINGS["allow_login"] = 1;
+$APB_SETTINGS['auth_user_id'] = false;
 
 debug("About to do authentication...");
 
 /* Authentication */
 if ($APB_SETTINGS['auth_type'] == 'cookie') {
-    $cookie_username = $_COOKIE['cookie_username'];
-    $cookie_password = $_COOKIE['cookie_password'];
+    $cookie_username = (!empty ($_COOKIE['cookie_username']) ? $_COOKIE['cookie_username'] : false);
+    $cookie_password = (!empty ($_COOKIE['cookie_password']) ? $_COOKIE['cookie_password'] : false);
     debug("Auth type is cookie", 4);
     $query = "SELECT * FROM apb_users WHERE username = '$cookie_username'";
     debug($query, 5);
-    $result = mysql_db_query($APB_SETTINGS['apb_database'], $query);
+    $result = mysql_db_query($APB_SETTINGS['apb_database'], $query) or die ('Error with query: ' . mysql_error ());
     if (mysql_num_rows($result) > 0) {
         debug("Username $cookie_username found", 4);
         $row = mysql_fetch_assoc($result);
@@ -157,13 +158,18 @@
     $APB_SETTINGS['log_start'] = "apb_bookmark()";
 
     if (is_array($constructor)) {
-        $bookmark_id = $constructor['bookmark_id'];
-        if (!$apb_bookmarks[$bookmark_id]) {
+        if (!empty ($constructor['bookmark_id'])) {
+            $bookmark_id = $constructor['bookmark_id'];
+        }
+        else {
+            return (false);
+        }
+        if (empty ($apb_bookmarks[$bookmark_id])) {
             $apb_bookmarks[$bookmark_id] = new Bookmark($bookmark_id);
         }
     } else {
         $bookmark_id = $constructor;
-        if (!$apb_bookmarks[$bookmark_id]) {
+        if (empty ($apb_bookmarks[$bookmark_id])) {
             $apb_bookmarks[$bookmark_id] = new Bookmark($bookmark_id);
         }
     }
@@ -188,12 +194,12 @@
 
     if (is_array($constructor)) {
         $group_id = $constructor['group_id'];
-        if (!$apb_groups[$group_id]) {
+        if (empty ($apb_groups[$group_id])) {
             $apb_groups[$group_id] = new Group($group_id);
         }
     } else {
         $group_id = $constructor;
-        if (!$apb_groups[$group_id]) {
+        if (empty ($apb_groups[$group_id])) {
             $apb_groups[$group_id] = new Group($group_id);
         }
     }
@@ -310,7 +316,7 @@
             "<option value='" . $row['group_id'] . "'" .
             (($selected_id == $row['group_id']) ? ' SELECTED' : '') .
             "> " . $row['group_title']. "\n";
-		do_group_dropdown_children($row[group_id], 3, $selected_id, $dont_show);
+		do_group_dropdown_children($row['group_id'], 3, $selected_id, $dont_show);
 	}
 
 	print "</select>\n\n";
@@ -344,12 +350,12 @@
 		$string .= "- $row[group_title]";
 
 		print
-            "<option value='" . $row[group_id] . "'" .
+            "<option value='" . $row['group_id'] . "'" .
             (($selected_id == $row['group_id']) ? ' SELECTED' : '') .
             ">" . $string . "\n";
 
 		$count += 3;
-        do_group_dropdown_children($row[group_id], $count, $selected_id, $dont_show);
+        do_group_dropdown_children($row['group_id'], $count, $selected_id, $dont_show);
 		$count -= 3;
     }
 }
@@ -415,6 +421,7 @@
 //    $top_level_group_list = array_slice($top_level_group_list, 0, $group_count);
 
     $c = 0;
+	$count = 0;
     while (list ($gid, $hits) = each ($top_level_group_list)) {
         if ($count == $group_count) {
             break;
@@ -567,15 +574,15 @@
 function error ($string) {
     global $APB_SETTINGS;
 
-    $error_string = "ERROR: ";
-    if ($APB_SETTINGS['log_start']) {
+    $error_string = 'ERROR: ';
+    if (!empty ($APB_SETTINGS['log_start'])) {
         $error_string .= $APB_SETTINGS['log_start'] . ": ";
     }
     $error_string .= "$string\n";
 
     print $error_string;
 
-    if ($ABP_SETTINGS['log_path']) {
+    if (!empty ($ABP_SETTINGS['log_path'])) {
         $fp = fopen($ABP_SETTINGS['log_path'], 'a');
         fwrite($fp, $error_string);
         fclose($fp);
diff -u bookmarks2/apb_group_class.php bookmarks/apb_group_class.php
--- bookmarks2/apb_group_class.php	Tue Jan 18 16:33:27 2005
+++ bookmarks/apb_group_class.php	Tue Jan 18 16:41:05 2005
@@ -82,7 +82,7 @@
         return $this->creation_date;
     }
 
-    function private () {
+    function apb_private () {
         if (! $this->private) {
             $this->load_vars($this->id);
         }
@@ -108,7 +108,7 @@
         $link = "<a class=\"$linkclass\" href='";
 
         // If we're in "edit mode" display a different link than the normal one.
-        if ($APB_SETTINGS['auth_user_id'] AND $APB_SETTINGS['edit_mode']) {
+        if ($APB_SETTINGS['auth_user_id'] AND !empty ($APB_SETTINGS['edit_mode'])) {
             $link .= $APB_SETTINGS['apb_url']."edit_group.php?id=".$this->id;
         } else {
             $link .= $APB_SETTINGS['view_group_path'] . "?id=" . $this->id;
@@ -245,7 +245,7 @@
 
     function number_of_child_groups () {
 
-        if (! $this->number_of_child_groups) {
+        if (empty ($this->number_of_child_groups)) {
 
             global $APB_SETTINGS;
 
@@ -305,7 +305,7 @@
               FROM apb_bookmarks b
              WHERE b.group_id = " . $this->id() . "
                AND b.user_id = " . $APB_SETTINGS['user_id'] . "
-               " . $private_sql . "
+               " . ((!empty ($private_sql)) ? $private_sql : false) . "
                AND b.bookmark_deleted != 1
           ORDER BY b.bookmark_title
         ";
@@ -327,7 +327,7 @@
     function return_child_groups () {
         global $APB_SETTINGS;
 
-        if (! $this->child_groups_loop) {
+        if (empty ($this->child_groups_loop)) {
             $this->group_list = array();
             array_push($this->group_list, $this->id);
             $this->child_groups_loop($this->id);
diff -u bookmarks2/apb_view_class.php bookmarks/apb_view_class.php
--- bookmarks2/apb_view_class.php	Tue Jan 18 16:33:27 2005
+++ bookmarks/apb_view_class.php	Tue Jan 18 16:41:05 2005
@@ -43,7 +43,7 @@
 
         $this->set_template_files();
         $this->construct_inner();
-        $inner = $this->inner_string_output;
+        $inner = ((!empty ($this->inner_string_output)) ? $this->inner_string_output : '');
         #debug("INNER:".$inner);
         include($APB_SETTINGS['template_path'] . $this->outer_file);
     }
@@ -84,8 +84,10 @@
         $where_sql       = "WHERE b.user_id = $this->user_id";
         $and_sql         = $this->get_and_sql();
         $and_private_sql = "AND $this->private_sql";
+        $and_since_sql   = '';
+        $and_group_sql   = '';
 
-        if ($this->on_date) {
+        if (!empty ($this->on_date)) {
             if ( preg_match("/^h\./", $this->group_by) ) {
                 $and_on_date_sql .= "AND DATE_FORMAT(h.hit_date, '$this->on_date_format') = '$this->on_date'";
             }
@@ -96,7 +98,7 @@
             }
         }
 
-        if ($this->since_n_interval) {
+        if (!empty ($this->since_n_interval)) {
             if ( preg_match("/^h\./", $this->group_by) ) {
                 $and_since_sql .= "AND h.hit_date > DATE_SUB(NOW(), INTERVAL $this->since_n_interval $this->interval)";
             }
@@ -138,20 +140,20 @@
             $select_sql
             $from_sql
             $join_hits_sql
-            $join_groups_sql
+            ". ((!empty ($join_groups_sql)) ? $join_groups_sql : '' ). "
             $where_sql
             $and_private_sql
             $and_group_sql
             $and_sql
-            $and_since_sql
-            $and_on_date_sql
+            ". ((!empty ($and_since_sql)) ? $and_since_sql : ''). "
+            ". ((!empty ($and_on_date_sql)) ? $and_on_date_sql : ''). "
             AND b.bookmark_deleted != '1'
             $group_by_sql
             $order_by_sql
             $limit_sql
         ";
 
-        #print "<p><pre>$query</pre><p>\n";
+#        print "<p><pre>$query</pre><p>\n";
 
         return $query;
     }
@@ -260,6 +262,7 @@
         
         $this->order_by = "total DESC, h.hit_date";
 
+        $string = '';
         $string .=  "
             AND b.group_id = $this->group_id
             AND h.user_id = ".$APB_SETTINGS['user_id']."
@@ -276,6 +279,7 @@
         
         $this->order_by = "total DESC, h.hit_date";
 
+        $string = '';
         $string .=  "
             AND b.group_id IN (". $this->group_list . ")
             AND h.user_id = ".$APB_SETTINGS['user_id']."
diff -u bookmarks2/cookie_auth.php bookmarks/cookie_auth.php
--- bookmarks2/cookie_auth.php	Tue Jan 18 16:33:27 2005
+++ bookmarks/cookie_auth.php	Tue Jan 18 16:41:05 2005
@@ -59,7 +59,7 @@
     {
         $form_username = $_POST['form_username'];
         $form_password = $_POST['form_password'];
-        $login_type = $_POST['login_type']; 
+        $login_type = (!empty ($_POST['login_type']) ? $_POST['login_type'] : false); 
         $expiration_date = time()+(60*60*24*365*10); // Expire in 10 years.
         if ($login_type != "permanent") { $expiration_date = 0; } // Expire when browser is closed.
 
diff -u bookmarks2/daily_browser.php bookmarks/daily_browser.php
--- bookmarks2/daily_browser.php	Tue Jan 18 16:33:27 2005
+++ bookmarks/daily_browser.php	Tue Jan 18 16:41:05 2005
@@ -104,7 +104,7 @@
 	$query = "
 		SELECT b.*, g.*, DATE_FORMAT(b.bookmark_creation_date, '%H:%i:%s') as creation_date
 		  FROM apb_bookmarks b
-		       NATURAL JOIN apb_groups g
+			   NATURAL JOIN apb_groups g
 		 WHERE DATE_FORMAT(b.bookmark_creation_date, '%Y-%m-%d') = '$now'
            AND b.user_id = $APB_SETTINGS[user_id]
            AND b.bookmark_deleted = 0
@@ -118,7 +118,7 @@
         while ($row = mysql_fetch_assoc($result)) {
             $b = apb_bookmark($row);
             $g = apb_group($row);
-            print $row[creation_date] . " - " . $b->link('link') . " <span>(" . $g->link('tinylink') . ")</span><br>\n";
+            print $row['creation_date'] . " - " . $b->link('link') . " <span>(" . $g->link('tinylink') . ")</span><br>\n";
         }
     } else {
         print "No sites bookmarked";
@@ -148,7 +148,9 @@
         while ($row = mysql_fetch_assoc($result)) {
             $b = apb_bookmark($row);
             $g = apb_group($row);
-            print $row[hit_date] . " - " . $b->link('link') . " <span>(" . $g->link('tinylink') . ")</span><br>\n";
+            if (!empty ($b) AND !empty ($g)) {
+            print $row['hit_date'] . " - " . $b->link('link') . " <span>(" . $g->link('tinylink') . ")</span><br>\n";
+            }
         }
     } else {
         print "No bookmarks used";
@@ -179,7 +181,7 @@
             $b = apb_bookmark($row);
             $g = apb_group($row);
             #print $row[hit_date] . " &nbsp;&nbsp; " . $row[hit_ip] . " &nbsp;&nbsp; " . $b->link('link') . " <div>(" . $g->link('tinylink') . ")</div><br>\n";
-            print $row[hit_date] . " - " . $b->link('link') . " <div>(" . $g->link('tinylink') . ")</div> - " . $row[hit_ip] . "<br>\n";
+            print $row['hit_date'] . " - " . $b->link('link') . " <div>(" . $g->link('tinylink') . ")</div> - " . $row['hit_ip'] . "<br>\n";
         }
     } else {
         print "No bookmarks used";
diff -u bookmarks2/edit_group.php bookmarks/edit_group.php
--- bookmarks2/edit_group.php	Tue Jan 18 16:33:27 2005
+++ bookmarks/edit_group.php	Tue Jan 18 17:08:04 2005
@@ -32,17 +32,17 @@
     }
     if (isset($_POST['id']))
     {
-        $id = $_POST['id'];
+        $id = addslashes ($_POST['id']);
     }
     if (isset($_POST['form_title']))
     {
-        $form_title = $_POST['form_title'];
+        $form_title = addslashes ($_POST['form_title']);
     }
 
     // We're actually editing the group.
     if ($action == "edit_group" && $id && $form_title)
     {
-        $form_group_parent_id = $_POST['form_group_parent_id'];
+        $form_group_parent_id = addslashes ($_POST['form_group_parent_id']);
         $back_url = $_POST['back_url'];
         $query = "
             UPDATE apb_groups
@@ -90,7 +90,7 @@
             $form_group_id = $g->id();
             $form_title = $g->title();
             $form_description = $g->description();
-            $form_private = $g->private();
+            $form_private = $g->apb_private();
             $id_owner_user_id = $g->user_id();
             $parent_id = $g->parent_id();
         }
Common subdirectories: bookmarks2/images and bookmarks/images
Only in bookmarks/: netscape_export.php
Only in bookmarks/: netscape_import.php
diff -u bookmarks2/redirect.php bookmarks/redirect.php
--- bookmarks2/redirect.php	Tue Jan 18 16:33:27 2005
+++ bookmarks/redirect.php	Tue Jan 18 16:41:05 2005
@@ -30,7 +30,7 @@
     header ("Location: ".$APB_SETTINGS['apb_url']);
 }
 
-elseif ($bm->private() AND ! ($APB_SETTINGS['auth_user_id'] == $bm->user_id())) {
+elseif ($bm->apb_private() AND ! ($APB_SETTINGS['auth_user_id'] == $bm->user_id())) {
     debug("Not a valid id: $id");
     header ("Location: ".$APB_SETTINGS['apb_url']);
 }
diff -u bookmarks2/search.php bookmarks/search.php
--- bookmarks2/search.php	Tue Jan 18 16:33:27 2005
+++ bookmarks/search.php	Tue Jan 18 16:41:05 2005
@@ -15,6 +15,7 @@
 apb_head();
 
 $APB_SETTINGS['allow_edit_mode'] = 1;
+$keywords = false;
 
 // Clean up the data that's been passed to us [LBS 20020211].
 if (isset($_GET['edit_mode']))
@@ -66,12 +67,18 @@
         #print "<p><pre>$query</pre><p>\n\n";
 
         $result = mysql_db_query($APB_SETTINGS['apb_database'], $query);
+        $results = array ();
         $total_rows = mysql_num_rows($result);
+        $keyword = false;
+        $group_results = array ();
 
         while ($row = mysql_fetch_assoc($result)) {
             $mod = 1;
             #$group_results[$row[group_id]] += (( 2 * ( 100 - (($total_rows/$total_groups) * 100) ) ) / $mod);
-            $group_results[$row[group_id]]++;
+            if (empty ($group_results[$row['group_id']])) {
+                $group_results[$row['group_id']] = 0;
+            }
+            $group_results[$row['group_id']]++;
         }
     }
 
@@ -100,12 +107,14 @@
             } else {
                 $mod = 1;
             }
-            $results[$row[bookmark_id]] += (( 2 * ( 100 - (($total_rows/$total_bookmarks) * 100) ) ) / $mod);
+            if (empty ($results[$row['bookmark_id']])) {
+                $results[$row['bookmark_id']] = 0;
+            }
+            $results[$row['bookmark_id']] += (( 2 * ( 100 - (($total_rows/$total_bookmarks) * 100) ) ) / $mod);
         }
     }
 }
 
-$keyword = htmlspecialchars(stripslashes($keyword));
 $number_of_results = count($results) + count($group_results);
 
 print "<h2>Search Results</h2>";
diff -u bookmarks2/setup.php bookmarks/setup.php
--- bookmarks2/setup.php	Tue Jan 18 16:33:27 2005
+++ bookmarks/setup.php	Tue Jan 18 17:24:37 2005
@@ -17,6 +17,7 @@
     <li><a href="quickadd.php">Setup QuickAdd</a> - Create a button in your browser that
     <li><a href="import.php">Import Internet Explorer Favorites</a> 
     - Import *.url bookmark files from a directory.
+    <li><a href="netscape_import.php">Import Netscape bookmark file</a> - The bookmark file used by the Mozilla projekt (Firefox, Mozilla)
   </ul>
 
   <h3>Additional APB Features</h3>
@@ -26,6 +27,7 @@
     getting.
     <li><a href="http://lbstone.com/apb/version_check.php?version=<?php echo $APB_SETTINGS['version'] ?>">Check for Latest Version</a> -
     See if there is a newer version of APB.
+    <li><a href="netscape_export.php">Export APB to a Netscape bookmark file (FireFox/Mozilla)</a>
   </ul>
 
   </td>
Common subdirectories: bookmarks2/templates and bookmarks/templates
diff -u apb-1.2.05/templates/foot.php bookmarks/templates/foot.php
--- apb-1.2.05/templates/foot.php	Wed Feb 18 02:57:32 2004
+++ bookmarks/templates/foot.php	Tue Jan 18 17:42:26 2005
@@ -14,9 +14,9 @@
 // Security check.
 //////////////////////////////////////////////////////////////////////
 
-if ($_COOKIE["APB_SETTINGS"]["template_path"] ||
-    $_POST["APB_SETTINGS"]["template_path"] ||
-    $_GET["APB_SETTINGS"]["template_path"])
+if (!empty ($_COOKIE["APB_SETTINGS"]["template_path"]) ||
+    !empty ($_POST["APB_SETTINGS"]["template_path"]) ||
+    !empty ($_GET["APB_SETTINGS"]["template_path"]))
 { exit(); }
 
 ?>
@@ -45,7 +45,7 @@
 
 <?php if ($edit_mode) { echo "<div class='warning'>Edit Mode</div>"; } ?>
 
-<?php if ($APB_SETTINGS['allow_search_box']) { ?>
+<?php if (!empty ($APB_SETTINGS['allow_search_box'])) { ?>
                                                                                 
     <form method='get' action='search.php'>
     <input name='keywords' value='' size='25'>
@@ -67,7 +67,7 @@
   <!-- EDIT MODE -->
   <?php if ($APB_SETTINGS['auth_user_id'] && $APB_SETTINGS['allow_edit_mode']) { ?>
     <?php
-        if ($APB_SETTINGS['edit_mode']) {
+        if (!empty ($APB_SETTINGS['edit_mode'])) {
             print "<td><div class='option'><a href='".$_SERVER['SCRIPT_NAME']."?";
             if ($date) { echo "date=".$date."&"; }
             if ($id) { echo "id=".$id."&"; }
diff -u apb-1.2.05/templates/head.php bookmarks/templates/head.php
--- apb-1.2.05/templates/head.php	Wed Feb 18 02:32:54 2004
+++ bookmarks/templates/head.php	Tue Jan 18 17:40:06 2005
@@ -14,9 +14,9 @@
 // Security check.
 //////////////////////////////////////////////////////////////////////
 
-if ($_COOKIE["APB_SETTINGS"]["template_path"] ||
-    $_POST["APB_SETTINGS"]["template_path"] ||
-    $_GET["APB_SETTINGS"]["template_path"])
+if (!empty ($_COOKIE["APB_SETTINGS"]["template_path"]) ||
+    !empty ($_POST["APB_SETTINGS"]["template_path"]) ||
+    !empty ($_GET["APB_SETTINGS"]["template_path"]))
 { exit(); }
 
 //////////////////////////////////////////////////////////////////////

