<?php

/**
* $Id: items_random_item.php,v 1.9 2006/01/05 19:39:27 malanciault Exp $
* Module: SmartSection
* Author: The SmartFactory <www.smartfactory.ca>
* Licence: GNU
*/
if (!defined("XOOPS_ROOT_PATH")) {
die("XOOPS root path not defined");
}

function smartsection_items_random_item_show($options)
{
	include_once(XOOPS_ROOT_PATH."/modules/smartsection/include/common.php");
    
    $block = array();
	$smartsection_item_handler =& smartsection_gethandler('item');
    // creating the ITEM object
    $itemsObj = $smartsection_item_handler->getRandomItem('summary', array(_SSECTION_STATUS_PUBLISHED));
    
    If ($itemsObj) {
       	$block['content'] = $itemsObj->summary();
       	$block['id'] = $itemsObj->itemid();
       	$block['url'] = $itemsObj->getItemUrl();
       	$block['lang_fullitem'] = _MB_SSECTION_FULLITEM;
    } 
    
    return $block;
} 

?>