<{php}> include_once XOOPS_ROOT_PATH . '/modules/publisher/include/common.php'; $publisher =& PublisherPublisher::getInstance(); $myts =& MyTextSanitizer::getInstance(); $itemsObj = $publisher->getHandler('item')->getItems($limit = 4, $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}>
prev next
 
    <{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}>
  • <{$title}>
     

    <{$title|truncate:15}>

      <{if $votes == 0}>
    •  
    •  
    •  
    •  
    •  
    • <{else}>
    •  
    •  
    •  
    •  
    •  
    • <{/if}>
    • <{$votes}> votes

    <{$body|truncate:250}>

     
  • <{php}> } <{/php}>