summaryrefslogtreecommitdiffstats
path: root/lib/class/flag.class.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2009-03-08 13:28:43 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2009-03-08 13:28:43 +0000
commit37a348127fc68a8e3e8858873bc4df47d40a1760 (patch)
tree0cea9f357efdb076d3b1714424e485959177392e /lib/class/flag.class.php
parented15ee4a9c06ab2a3c706f4f6225820fae730cc1 (diff)
downloadampache-37a348127fc68a8e3e8858873bc4df47d40a1760.tar.gz
ampache-37a348127fc68a8e3e8858873bc4df47d40a1760.tar.bz2
ampache-37a348127fc68a8e3e8858873bc4df47d40a1760.zip
fixed catalog functions and corrected negative value caching
Diffstat (limited to 'lib/class/flag.class.php')
-rw-r--r--lib/class/flag.class.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/class/flag.class.php b/lib/class/flag.class.php
index 148d5aa8..501f6415 100644
--- a/lib/class/flag.class.php
+++ b/lib/class/flag.class.php
@@ -90,11 +90,16 @@ class Flag extends database_object {
$sql = "SELECT * FROM `flagged` " .
"WHERE `flagged`.`object_type`='$type' AND `flagged`.`object_id` IN $idlist";
$db_results = Dba::read($sql);
-
+
while ($row = Dba::fetch_assoc($db_results)) {
- parent::add_to_cache('flagged_' . $type,$row['object_id'],$row);
+ $results[$row['object_id']] = $row;
}
-
+
+ // Itterate through the passed ids as we need to cache 'nulls'
+ foreach ($ids as $id) {
+ parent::add_to_cache('flagged_' . $type,$id,$results[$id]);
+ }
+
return true;
} // build_map_cache
@@ -109,7 +114,7 @@ class Flag extends database_object {
$data = parent::get_from_cache('flagged_' . $type,$id);
return $data['date'];
}
-
+
// Ok we have to query this
$type = Dba::escape($type);