1: <?php
 2: /*
 3:  You may not change or alter any portion of this comment or credits
 4:  of supporting developers from this source code or any supporting source code
 5:  which is considered copyrighted (c) material of the original comment or credit authors.
 6: 
 7:  This program is distributed in the hope that it will be useful,
 8:  but WITHOUT ANY WARRANTY; without even the implied warranty of
 9:  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10:  */
11: 
12: /**
13:  * @copyright       The XUUPS Project http://sourceforge.net/projects/xuups/
14:  * @license         GNU GPL V2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
15:  * @package         Publisher
16:  * @subpackage      Include
17:  * @since           1.0
18:  * @author          trabis <lusopoemas@gmail.com>
19:  * @author          The SmartFactory <www.smartfactory.ca>
20:  * @version         $Id$
21:  */
22: 
23: /** Get item fields: title, content, time, link, uid, uname, tags **/
24: function publisher_tag_iteminfo(&$items)
25: {
26:     $publisher = Publisher::getInstance();
27: 
28:     $items_id = array();
29:     foreach (array_keys($items) as $cat_id) {
30:         // Some handling here to build the link upon catid
31:         // if catid is not used, just skip it
32:         foreach (array_keys($items[$cat_id]) as $item_id) {
33:             // In article, the item_id is "art_id"
34:             $items_id[] = (int)($item_id);
35:         }
36:     }
37:     $item_handler = $publisher->getItemHandler();
38:     $criteria = new Criteria("itemid", "(" . implode(", ", $items_id) . ")", "IN");
39:     $items_obj = $item_handler->getItemObjects($criteria, 'itemid');
40: 
41:     /* @var $item_obj PublisherItem */
42:     foreach (array_keys($items) as $cat_id) {
43:         foreach (array_keys($items[$cat_id]) as $item_id) {
44:             $item_obj = $items_obj[$item_id];
45:             $items[$cat_id][$item_id] = array(
46:                 "title" => $item_obj->getVar("title"),
47:                 "uid" => $item_obj->getVar("uid"),
48:                 "link" => "item.php?itemid={$item_id}",
49:                 "time" => $item_obj->getVar("datesub"),
50:                 "tags" => tag_parse_tag($item_obj->getVar("item_tag", "n")), // optional
51:                 "content" => "",
52:             );
53:         }
54:     }
55:     unset($items_obj);
56: }
57: 
58: /** Remove orphan tag-item links **/
59: function publisher_tag_synchronization($mid)
60: {
61:     // Optional
62: }
63: