1
Working on older versions of the publisher
<{php}>
include_once XOOPS_ROOT_PATH . '/modules/publisher/include/common.php';
$publisher =& PublisherPublisher::getInstance();
$myts =& MyTextSanitizer::getInstance();
$itemsObj = $publisher->getHandler('item')->getItems($limit = 10, $start = 0, array(_PUBLISHER_STATUS_PUBLISHED), -1, $sort = 'datesub', $order='DESC', '', true, $criteria = null, true);
$totalItems = count($itemsObj);
global $items;
$items = array();
if ($itemsObj) {
for ( $i = 0; $i < $totalItems; $i++ ) {
$newItems['itemid'] = $itemsObj[$i]->itemid();
$newItems['title'] = $itemsObj[$i]->title();
$newItems['body'] = $itemsObj[$i]->body();
$newItems['votes'] = $itemsObj[$i]->votes();
$newItems['image'] = XOOPS_URL . '/uploads/blank.gif';
$images = $itemsObj[$i]->getImages();
if (is_object($images['main'])) {
$newItems['image'] = XOOPS_URL . '/uploads/' . $images['main']->getVar('image_name');
}
$items[] = $newItems;
}
}
<{/php}>
<div id="slider">
<a href="#" id="prev" class="notext">a>
<a href="#" id="next" class="notext">a>
<div id="slider-content">
<ul>
<{php}>
foreach ( $GLOBALS['items'] as $myrow )
{
$GLOBALS['xoopsTpl']->assign('itemid', $myrow['itemid']);
$GLOBALS['xoopsTpl']->assign('title', $myrow['title']);
$GLOBALS['xoopsTpl']->assign('body', $myrow['body']);
$GLOBALS['xoopsTpl']->assign('votes', $myrow['votes']);
$GLOBALS['xoopsTpl']->assign('image', $myrow['image']);
<{/php}>
<li>
<div class="left-side">
<a href="<{$xoops_url}>/modules/publisher/item.php?itemid=<{$itemid}>"><img src="<{$image}>" alt="<{$title}>" width="400px" height="200px"/>a>
div>
<div class="right-side" >
<h1><a href="<{$xoops_url}>/modules/publisher/item.php?itemid=<{$itemid}>" title="<{$title}>"><{$title}>h1>
<p><{$body|truncate:220}>p>
<p class="readmore"><a style="color:#ff0000" href="<{$xoops_url}>/modules/publisher/item.php?itemid=<{$itemid}>">ÊÊãÉ »a>p>
div>
<div class="cl"> div>
li>
<{php}>
}
<{/php}>
ul>
div>
div>
Can we run this code for the current publisher