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 "$query
\n";
+# print "
$query
\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') . " (" . $g->link('tinylink') . ")
\n";
+ print $row['creation_date'] . " - " . $b->link('link') . " (" . $g->link('tinylink') . ")
\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') . " (" . $g->link('tinylink') . ")
\n";
+ if (!empty ($b) AND !empty ($g)) {
+ print $row['hit_date'] . " - " . $b->link('link') . " (" . $g->link('tinylink') . ")
\n";
+ }
}
} else {
print "No bookmarks used";
@@ -179,7 +181,7 @@
$b = apb_bookmark($row);
$g = apb_group($row);
#print $row[hit_date] . " " . $row[hit_ip] . " " . $b->link('link') . "
(" . $g->link('tinylink') . ")
\n";
- print $row[hit_date] . " - " . $b->link('link') . " (" . $g->link('tinylink') . ")
- " . $row[hit_ip] . "
\n";
+ print $row['hit_date'] . " - " . $b->link('link') . " (" . $g->link('tinylink') . ")
- " . $row['hit_ip'] . "
\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 "$query
\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 "
Search Results
";
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 @@
Setup QuickAdd - Create a button in your browser that
Import Internet Explorer Favorites
- Import *.url bookmark files from a directory.
+ Import Netscape bookmark file - The bookmark file used by the Mozilla projekt (Firefox, Mozilla)
Additional APB Features
@@ -26,6 +27,7 @@
getting.
Check for Latest Version -
See if there is a newer version of APB.
+ Export APB to a Netscape bookmark file (FireFox/Mozilla)
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 @@
Edit Mode