Forums / Cotonti / Support / Using Tags in Plugins

urlkiller
#1 2010-03-23 07:26
Hellow again,

is there a way that i can add Tags as Category "files" instead of forum or page?
i mean i tried NOT to make my own tag system and i wanted to use the onboard version.
so how did i add/edit/delete show tags i was working in my plugins with.

any tut i missed?
URL shortener: <a href="http://bbm.li/!7AD5C7">http://bbm.li/!7AD5C7</a>
tensh
#2 2010-03-23 16:18
Trustmaster said once that here:
http://www.cotonti.com/docs/en/developer/code_reference

we can find Tags API. So we can reuse specific functions for adding tags, etc.
Trustmaster
#3 2010-03-23 17:57
Yes, see sed_tag* functions in the reference manual. As for example of use, the tags plugin is a good implementation for 'pages' and 'forums'. You can use tags.forums.* to see how you could use these functions for 'files' or anything else as well, because the API works the same way for any module or plugin.
May the Source be with you!
urlkiller
#4 2010-03-25 03:09
ok this far it works well.

the question is i want to use the index.tags and the search and both only looks for tags with pages and forum as cat?!

if i add a tag with the cat "files" it just wont show up in the regular serch...

Added 44 seconds later:

or do i have to change some array somewhere ? tags.php maybe?
URL shortener: <a href="http://bbm.li/!7AD5C7">http://bbm.li/!7AD5C7</a>
Trustmaster
#5 2010-03-25 04:44
You are also damn right about arrays :) There an array $tag_areas, you can extend it with your own search this way:
hook into 'tags.first':
$tag_areas[] = 'files';
function sed_tag_search_files($query)
{
    // Perform the search
}
See examples of such functions in tags/inc/functions.php
May the Source be with you!
urlkiller
#6 2010-03-25 07:23
got it to work! thx dude!
URL shortener: <a href="http://bbm.li/!7AD5C7">http://bbm.li/!7AD5C7</a>