//初始化列表模板,并统计页面总数
$tempfile = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir']."/".$this->TypeLink->TypeInfos['templist'];
$tempfile = str_replace("{tid}", $this->TypeID, $tempfile);
$tempfile = str_replace("{cid}", $this->ChannelUnit->ChannelInfos['nid'], $tempfile);
if ( defined('DEDEMOB') )
{
$tempfile =str_replace('.htm','_m.htm',$tempfile);
}
if(!file_exists($tempfile))
{
$tempfile = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir']."/".$GLOBALS['cfg_df_style']."/list_default.htm";
if ( defined('DEDEMOB') )
{
$tempfile =str_replace('.htm','_m.htm',$tempfile);
}
}
if(!file_exists($tempfile)||!is_file($tempfile))
{
echo "模板文件不存在,无法解析文档!";
exit();
}
$this->dtp->LoadTemplate($tempfile);
$ctag = $this->dtp->GetTag("page");
if(!is_object($ctag))
{
$ctag = $this->dtp->GetTag("list");
}
if(!is_object($ctag))
{
$this->PageSize = 20;
}
else
{
if($ctag->GetAtt("flag")!="")
{
$this->Flag = 1;
$flags = explode(',', $ctag->GetAtt("flag"));
for($i=0; isset($flags[$i]); $i++) $this->addSql .= " AND FIND_IN_SET('{$flags[$i]}', arc.flag)>0 ";
}
if($ctag->GetAtt("pagesize")!="")
{
$this->PageSize = $ctag->GetAtt("pagesize");
}
else
{
$this->PageSize = 20;
}
}
|