27
Quote:
function.xoMemberInfo.php
Not working in new Publisher module
function smarty_function_publisher_latest($params, &$smarty)
{
defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined");
include_once XOOPS_ROOT_PATH . '/modules/publisher/include/common.php';
$publisher =& PublisherPublisher::getInstance();
$myts =& MyTextSanitizer::getInstance();
$itemsObj = $publisher->getHandler('item')->getItems($limit = 1, $start = 0, '', -1, $sort = 'datesub', $order='DESC', '', true, $criteria = null, true);
$totalItems = count($itemsObj);
for ( $i = 0; $i < $totalItems; $i++ ) {
$title = $itemsObj[$i]->title();
$images = $itemsObj[$i]->getImages();
if (is_object($images['main'])) {
$image = XOOPS_URL . '/uploads/' . $images['main']->getVar('image_name');
}
switch ($params['ret']) {
case 'image':
echo $image;
break;
case 'title':
echo $title;
break;
default:
echo $image;
break;
}
}
}
?>
I think there is a problem because of the following codes defined("XOOPS_ROOT_PATH") or die("XOOPS root path not defined");
include_once XOOPS_ROOT_PATH . '/modules/publisher/include/common.php';
$publisher =& PublisherPublisher::getInstance();
$myts =& MyTextSanitizer::getInstance();
$itemsObj = $publisher->getHandler('item')->getItems($limit = 1, $start = 0, '', -1, $sort = 'datesub', $order='DESC', '', true, $criteria = null, true);