[dev] [cvs] commit: ansel/lib Tags.php
Chuck Hagenbuch
chuck at horde.org
Thu May 3 01:44:14 UTC 2007
Looking further in Tags.php, I don't understand the purpose of the
join in listTags(). If it's to only grab tags in use, it will ignore
tags that are set on galleries; if a tag is deleted completely we
should probably remove it from the ansel_tags table as well. At least
periodically.
Alternately we're probably going to want the list of tags plus how
many items are tagged with them, which _would_ require adding the
images (and galleries) relation tables but would give us some
additional nice information.
Also, you can have MDB2 do some of that array work for you:
$sql = 'SELECT DISTINCT ansel_tags.tag_name,
ansel_tags.tag_id FROM ansel_tags INNER JOIN ansel_images_tags ON
ansel_images_tags.tag_id = ansel_tags.tag_id';
return $GLOBALS['ansel_db']->queryAll($sql, null,
MDB2_FETCHMODE_DEFAULT, true);
-chuck
More information about the dev
mailing list