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 Blocks
17: * @since 1.0
18: * @author trabis <lusopoemas@gmail.com>
19: * @author The SmartFactory <www.smartfactory.ca>
20: * @version $Id$
21: */
22:
23: include_once dirname(__DIR__) . '/include/common.php';
24:
25: function publisher_items_random_item_show($options)
26: {
27: $block = array();
28: $publisher = Publisher::getInstance();
29: // creating the ITEM object
30: $itemsObj = $publisher->getItemHandler()->getRandomItem('', array(_PUBLISHER_STATUS_PUBLISHED));
31:
32: if (!is_object($itemsObj)) return $block;
33:
34: $block['content'] = $itemsObj->getBlockSummary(300, true); //show complete summary but truncate to 300 if only body available
35: $block['id'] = $itemsObj->getVar('itemid');
36: $block['url'] = $itemsObj->getItemUrl();
37: $block['lang_fullitem'] = _MB_PUBLISHER_FULLITEM;
38:
39: return $block;
40: }
41: