I already read the sample include in this module but still cant understand the first 2 steps. I want to use with news and cbb module and all this plug in were already include in tag module.
Quote:
/*
To enable tag for a module ("mymodule"), following steps are need:
1 add tag input box to your item edit form (required)
2 add tag storage to your item submission page (required)
3 define functions to build info of tagged items (required)
4 add tag display API to your item display page and include tag template in your item template (optional)
5 add module tag view page and tag list page (optional)
6 add module tag blocks (optional)
*/
/* Step 1: add tag input box */
// File: edit.item.php
$itemid = $item_obj->isNew() ? 0 : $item_obj->getVar("itemid");
include_once XOOPS_ROOT_PATH."/modules/tag/include/formtag.php";
$form_item->addElement(new XoopsFormTag("item_tag", 60, 255, $itemid, $catid = 0));
/* Step 2: add tag storage after item storage */
// File: submit.item.php
$tag_handler = xoops_getmodulehandler('tag', 'tag');
$tag_handler->updateByItem($_POST["item_tag"], $itemid, $xoopsModule->getVar("dirname"), $catid =0);
/* Step 3: define functions to build info of tagged items */
// File: /modules/tag/plugin/mymodule.php OR /modules/mymodule/include/plugin.tag.php
/** Get item fields: title, content, time, link, uid, uname, tags **/