<?php   if(!defined('DEDEINC')) exit('Request Error!');
/**
 * 連載圖書最新內容調用
 *
 * @version        $Id: bookcontentlist.lib.php 1 9:29 2010年7月6日Z tianya $
 * @package        DedeCMS.Taglib
 * @copyright      Copyright (c) 2007 - 2010, DesDev, Inc.
 * @license        http://help.dedecms.com/usersguide/license.html
 * @link           http://www.dedecms.com
 */
 
/*>>dede>>
<name>連載內容</name>
<type>全局標記</type>
<for>V55,V56,V57</for>
<description>連載圖書最新內容調用</description>
<demo>
{dede:bookcontentlist row='12' booktype='-1' orderby='lastpost' author='' keyword=''}
<table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr>
<td width='40%'>
[[field:cataloglink/]] [field:booklink/]</td>
<td width='40%'>[field:contentlink/]</td>
<td width='20%'>[field:lastpost function="GetDateMk(@me)"/]</td>
</tr>
</table>
{/dede:bookcontentlist} 
</demo>
<attributes>
    <iterm>row:調用記錄條數</iterm> 
    <iterm>booktype:圖書類型，0 圖書、1 漫畫，默認全部</iterm>
    <iterm>orderby:排序類型，當按排序類型為 commend 表示推薦圖書</iterm>
    <iterm>author:作者</iterm>
    <iterm>keyword:關鍵字</iterm>
</attributes> 
>>dede>>*/
 
require_once(DEDEINC.'/taglib/booklist.lib.php');

function lib_bookcontentlist(&$ctag, &$refObj)
{
    global $dsql, $envs, $cfg_dbprefix, $cfg_cmsurl;

    $attlist="row|12,booktype|-1,titlelen|30,orderby|lastpost,author|,keyword|";
    FillAttsDefault($ctag->CAttribute->Items,$attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);

    if( !$dsql->IsTable("{$cfg_dbprefix}story_books") ) return '沒安裝連載模塊';
    
    return lib_booklist($ctag, $refObj, 1);
    
}