[Feat. Req.] Tagging System

eNoyx
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 24 Jun 2008, 11:58

[Feat. Req.] Tagging System

Post by eNoyx »

Hi!

I needed a gallery for my new site, and -after testing every gallery available for J!1.5- I decided to use Phoca Gallery. It's wonderfully built, and the user experience while browsing is so nice. I love it!
It would be perfect, though, if it had a tagging system.

I'll try to explain. Let's imagine a gallery about a series, where the characters will appear in different groups, alone, in pairs... If a visitor wanted to see the photos about only one character, he'd try to browse through the categories we've set previously (for example, 'group photos' and 'character X photos'). This is a good approach, but maybe, the character we're looking for doesn't appear in every group photo. And if we choosea different category system (wallpapers, avatars, signatures...) this gets even harder for the visitor to find his favourite character photos.

This is when the tagging system becomes so useful. We could tag every photo where the character appears (alone or in a group, doesn't matter) with the tag 'character X'. That way, our visitor would have all the photos in one results page, without having to browse all the categories.

Furthermore, tags aren't only useful for this problem. Tagging types of landscapes (cloudy, dawns, rainy...) or whatever you may imagine.

So, that's my feature request. I don't know if this would have to be coded from scratch, or if it's any 3rd party plugin which could be integrated (thinking about Jootags).

I'm not a coder, but I think I could try to implement it on my own. The problem would be that my skills don't allow me to share the 'hack' with the community in an easy way, not to mention the poor quality the code would have. That's why I think is better that this gets developed by the original authors, who will know how to do it properly.

Thanks in advance, and excuse my English ^^'

PS: Is the forum bridged/wrapped, or is it only a template modification to include the top menu?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48416
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: [Feat. Req.] Tagging System

Post by Jan »

Re PS: this site is not running on Joomla!

Tagging, ... maybe you can use the description for the tags, maybe you can combine it with search plugin ??

I add this feature into the feature request list, but openly I don't know when I find time for doing this feature .... :(

Jan
If you find Phoca extensions useful, please support the project
eNoyx
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 24 Jun 2008, 11:58

Re: [Feat. Req.] Tagging System

Post by eNoyx »

Thanks for the quick response!

I'll try using the description field. I think it could be possible that way.
I'll let you know if it works.

Bye!
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48416
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: [Feat. Req.] Tagging System

Post by Jan »

great
If you find Phoca extensions useful, please support the project
eNoyx
Phoca Newbie
Phoca Newbie
Posts: 3
Joined: 24 Jun 2008, 11:58

Re: [Feat. Req.] Tagging System

Post by eNoyx »

Quick update on this.
I've been testing a lot of tags extensions for J!1.5, and found JooTags might be what I'm looking for. It allows per-item (photo) tagging, using the description field. However, it needs a plugin to be written in order to work. It does list the different tags, but you can't browse them. The developer said a while ago he was writing a dev guide about these plugins, so we'll have to wait until then... And support forums are offline >.<

Anyway, I'll keep you up-to-date.
Bye!
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48416
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: [Feat. Req.] Tagging System

Post by Jan »

ok
If you find Phoca extensions useful, please support the project
teddyfresco
Phoca Member
Phoca Member
Posts: 16
Joined: 30 Jun 2008, 17:59

Re: [Feat. Req.] Tagging System

Post by teddyfresco »

jootags seems not to be working with Joomla 156, did you try Jtags, which is even better?
http://extensions.joomla.org/component/ ... Itemid,35/
emagus
Phoca Member
Phoca Member
Posts: 15
Joined: 30 Sep 2008, 23:27
Location: Germany
Contact:

Re: [Feat. Req.] Tagging System

Post by emagus »

Hey guys,

unfortunatley I wasn't able to get Jtags to work with Phoca, cause I couldn't figure out what event is thrown when saving a new/edited category. It's "onAfterContentSave" for regular Joomla content.
I'd really preferred it to work with Jtags, cause it'd be a global solution. But as I said, I didn't get it to work.

So here's what I did:

I kind of misused the comment-feature, which I don't need for the project I'm working on. The tags are saved comma-seperated in the comment-title. Then I hacked the JTags module to understand the Phoca-SQL-querys and changed a couple of minor things in the phoca categories-view, so it was able to filter categories by tags and voila, i have tagged categories (which is just what I needed).

So if anyone is interested in that, let me know.

If someone has a better solution, let me know all the more.

And Jan, if you want to integrate this solution into the phoca core, let me know, too. You would just have to add a table, similar to the comments-table (just with less fields) and change a couple of things in my hack, so it could work alongside the comment-feature.

But as i said, getting Jtags to work, would be the best solution of all.

Greetings from Germany!
emagus - web. design. communication.
www.emagus.eu
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48416
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: [Feat. Req.] Tagging System

Post by Jan »

Hi, I don't know JTags, but maybe it will be good to write some FAQ about it... Now I am not able to implement such solution because of my time, but please send me your solution, your ideas (info at phoca dot cz) so I can prepare it for possible future feature...

Thank you, Jan
If you find Phoca extensions useful, please support the project
emagus
Phoca Member
Phoca Member
Posts: 15
Joined: 30 Sep 2008, 23:27
Location: Germany
Contact:

Re: [Feat. Req.] Tagging System

Post by emagus »

Hey Jan,
sorry it's been a while.
So here's my solution:

in components/com_phocagallery/models/categories.php
i did the following changes:

around line 148 right before the $query definition:

add the following code:

$tags=JRequest::getVar( 'tags', '', 'get', '', JREQUEST_NOTRIM );

if ($tags) {
$tags_array=explode(',',$tags);
$leftjoin_comments = ' LEFT JOIN #__phocagallery_comments AS co ON co.catid = cc.id ' ;
$where_comments = ' AND ( ';
$i=0;
foreach ($tags_array as $tag) {
if ($i!=0) $where_comments .= ' OR ';
$where_comments .= ' co.title LIKE "%'.$tag.'%" ';
$i++;
}
$where_comments .= ' ) ';
//echo "TAGS!";
}

and then add these to your query:

. $leftjoin_comments
. $where_comments

This is a quick and dirty solution. But if you wanted to implement this into the core, you'd simply have to add a table "tags" and use that instead of the comments-table.

At last I modified the JTags-Tag-Cloud Module to work with this. And I have what I wanted.

To put a tag on one of the categories, I just add a comment in the backend and put comma-seperated tags into the comment-title.


It'd really prefer to solve this with Jacek Zielinski's JTags. But as I mentioned in my other post, I had problems with the events. Maybe Jacek will write a tutorial on how to write an extension for his component.

Anyhow, maybe somebody had a similar problem like i had and can use my solution. if you want the tag-cloud-module just let me know.

Bye,
Simon
emagus - web. design. communication.
www.emagus.eu
Post Reply