[dev] [cvs] commit: ansel/lib Tags.php

Michael Rubinsky mike at theupstairsroom.com
Thu May 3 16:02:52 UTC 2007


Quoting Chuck Hagenbuch <chuck at horde.org>:

Thanks for the feedback, Chuck...

> 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;

Indeed, the purpose is to grab only tags in use, and was one of the  
first routines I wrote for the tag stuff, before I started adding the  
tags to galleries as well...forgot to add it to listTags() though.


if a tag is deleted completely we
> should probably remove it from the ansel_tags table as well. At least
> periodically.

That was my thought as well, but was unsure of how to go about this.   
For efficiency, writeTags() simply deletes all the resource's tags,  
then replaces them with the new (or even empty) tag list.  I didn't  
think it would be worth the queries needed to keep track of which tags  
were being deleted, then check for any other use.  I thought this  
might be better handled as either some sort of maintenance task, or  
even a cron script.  But, as usual, I could be completely wrong ;)


> 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.

Yep, that was the plan, just haven't gotten to getting the tagged  
items count figured in there yet...got a little side tracked with the  
gallery display stuff :)


While were on the display topic, I'd like to start bouncing some of UI  
ideas off   of you and the rest of the devs.  I'll start by describing  
what I've started to do on my installation and where I'm heading -

So far, all I have actually implemented UI wise is when an image is  
displayed, a list of the image's tags is displayed in a small div that  
is positioned all the way to the right of the image (similar to the My  
Calendars in Kronolith).  I also plan on a list of 'related' tags  
under the image's tags.  When a tag is clicked on, a display of  
images/galleries matching that tag is displayed.

What I'd like to do from there is again provide a list of related tags  
that would effectively work as an 'AND' search, further narrowing down  
the matching resources.  This is similar in concept to the approach  
described at  
http://blog.thinkphp.de/archives/124-An-alternative-Approach-to-Tagging.html  
but without the drop down menu driven navigation (which, IMO would be  
somewhat clunky inside Ansel).  Alternatively we could provide the  
option to make the next selection a single tag search (similar to  
other tag-savvy websites), or an AND search.

I also would like to see a dedicated search page that would again  
provide a list of tags - maybe a tag cloud (although I'm not a huge  
fan of clouds) - as well as a plain text search.  Results would be  
displayed as above.

I am definitely open to other thoughts/suggestions/'what the heck are  
you thinking' etc...


>
> 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);
>

Cool, thanks for that, Chuck - I did not know that.

Thanks,
mike

--
The Horde Project (www.horde.org)
mrubinsk at horde.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-keys
Size: 2013 bytes
Desc: PGP Public Key
Url : http://lists.horde.org/archives/dev/attachments/20070503/7c4e066c/attachment.bin 


More information about the dev mailing list