高手: 头条新闻出版商

发表者: heyula 在 2014/9/27 14:23:41 7267次阅读
Resized Image


theme.html代码
<link href="<{xoImgUrl css/mansetx.css}>" type="text/css" rel="stylesheet" />  
<
script type="text/javascript" src="<{xoImgUrl js/mansetx.js}>">script>
<
script type="text/javascript" src="<{xoImgUrl js/jquery-1.11.1.js}>">script>


theme.html增加

<{includeq file="$theme_name/slidetpublisher.html"}>



slidetpublisher.html代码

<{php}>
include_once 
XOOPS_ROOT_PATH '/modules/publisher/include/common.php';
$publisher =& PublisherPublisher::getInstance();
$myts =& MyTextSanitizer::getInstance();
$itemsObj $publisher->getHandler('item')->getItems($limit 6$start 0, array(_PUBLISHER_STATUS_PUBLISHED), -1$sort 'datesub'$order='DESC'''true$criteria nulltrue);
$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="mansetx">
            <{
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}>
        <
div id="mansetx-img">
            <
a href="<{$xoops_url}>/modules/publisher/item.php?itemid=<{$itemid}>"><img width="720" height="315" src="<{$image}>">a>
        div>
         <{
php}>
        }
<{/
php}> 
        <
div id="mansetx-selector">
            <
ul>
            ul>
        div>
div>


演示

http://estetikameliyatmerkezi.com/xoopson/

病床