From: <wis...@us...> - 2017-05-23 05:41:46
|
Revision: 13244 http://sourceforge.net/p/xoops/svn/13244 Author: wishcraft Date: 2017-05-23 05:41:44 +0000 (Tue, 23 May 2017) Log Message: ----------- Tag Module 2.41 (Still in Development - Alpha-1! Modified Paths: -------------- XoopsModules/tag/trunk/README.md Modified: XoopsModules/tag/trunk/README.md =================================================================== --- XoopsModules/tag/trunk/README.md 2017-05-23 05:39:24 UTC (rev 13243) +++ XoopsModules/tag/trunk/README.md 2017-05-23 05:41:44 UTC (rev 13244) @@ -1,6 +1,6 @@ -#Tag Module for XOOPS 2.5 +# Tag Module for XOOPS 2.5 -##Version 2.xx (Still in Development) +## Version 2.xx (Still in Development) ### Author: Simon Roberts <simon@snails.email> @@ -8,7 +8,7 @@ Check http://en.wikipedia.org/wiki/Tags for more info about "tag" -#Usage of the Tag Module in your XOOPS Module +# Usage of the Tag Module in your XOOPS Module To enable tag for a module ("mymodule"), following steps are need: * add tag input box to your item edit form (required) @@ -18,7 +18,7 @@ * add module tag view page and tag list page (optional) * add module tag blocks (optional) -##Step 1: add tag input box +## Step 1: add tag input box This is how you would set up an inclusion of the tag module in an itemised edit form in your module, this is not explicit example and could have variegates for the module you are writing or editing. @@ -27,7 +27,7 @@ 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 +## Step 2: add tag storage after item storage This is how you would set up an inclusion of the tag module in an itemised submition form in your module, this is not explicit example and could have variegates for the module you are writing or editing. @@ -35,12 +35,12 @@ $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 of module +## Step 3: define functions to build info of tagged items of module This is the plugin for the tag module to enable the taging in both the tag module and the module you are writing/editing! Editing File Example: /modules/tag/plugin/mymodule.php -###Get item fields: title, content, time, link, uid, uname, tags +### Get item fields: title, content, time, link, uid, uname, tags function mymodule_tag_iteminfo(&$items) { @@ -72,7 +72,7 @@ unset($items_obj); } -###Remove orphan tag-item links +### Remove orphan tag-item links function mymodule_tag_synchronization($mid) { @@ -79,9 +79,9 @@ // Optional } -###Get's category catid data for module +### Get's category catid data for module -###Get item fields: catid, parentid, term +### Get item fields: catid, parentid, term function mymodule_tag_category($catid) { @@ -88,48 +88,48 @@ return array('catid'->0, 'parentid' =>0, 'term' =>0); } -##Step 4: Display tags on our tiem page +## Step 4: Display tags on our tiem page These files are not explicit as filenames they could be different this is how to display the tag in the item of the module you are editing/writing. -###File: view.item.php +### File: view.item.php include_once XOOPS_ROOT_PATH."/modules/tag/include/tagbar.php"; $xoopsTpl->assign('tagbar', tagBar($itemid, $catid = 0)); -###File: mymodule_item_template.html +### File: mymodule_item_template.html <{include file="db:tag_bar.html"}> -##Step 5: create tag list page and tag view page and for categories as well +## Step 5: create tag list page and tag view page and for categories as well This is the files that belong in /modules/mymodule/xxxx.xxx.php for redirecting or displaying within your module the tag lists and views as well as categories -###File: list.tag.php +### File: list.tag.php include "header.php"; include XOOPS_ROOT_PATH . "/modules/tag/list.tag.php"; -###File: view.tag.php +### File: view.tag.php include "header.php"; include XOOPS_ROOT_PATH . "/modules/tag/view.tag.php"; -###File: list.cat.php +### File: list.cat.php include "header.php"; include XOOPS_ROOT_PATH . "/modules/tag/list.cat.php"; -###File: view.cat.php +### File: view.cat.php include "header.php"; include XOOPS_ROOT_PATH . "/modules/tag/view.cat.php"; -##Step 6: create tag blocks +## Step 6: create tag blocks This is where you create the blocks you will have to edit and create files for this within your module -###File: xoops_version.php +### File: xoops_version.php /* * $options: @@ -177,7 +177,7 @@ "template" => "mymodule_tag_block_cumulus.html", ); -###File: mymodule_block_tag.php +### File: mymodule_block_tag.php This file belongs in /modules/mymodule/blocks and is adjustable in function names and filename in the xoops_version.php as seen in the example above. @@ -202,7 +202,7 @@ return tag_block_top_edit($options); } -###File: mymodule_block_cumulus.php +### File: mymodule_block_cumulus.php This file belongs in /modules/mymodule/blocks and is adjustable in function names and filename in the xoops_version.php as seen in the example above. @@ -217,19 +217,19 @@ return tag_block_cumulus_edit($options); } -###File: mymodule_tag_block_cloud.html +### File: mymodule_tag_block_cloud.html This file belongs in /modules/mymodule/templates/blocks and is adjustable in function names and filename in the xoops_version.php as seen in the example above. <{include file="db:tag_block_cloud.html"}> -###File: mymodule_tag_block_top.html +### File: mymodule_tag_block_top.html This file belongs in /modules/mymodule/templates/blocks and is adjustable in function names and filename in the xoops_version.php as seen in the example above. <{include file="db:tag_block_top.html"}> -###File: mymodule_tag_block_cumulus.html +### File: mymodule_tag_block_cumulus.html This file belongs in /modules/mymodule/templates/blocks and is adjustable in function names and filename in the xoops_version.php as seen in the example above. |