/** * 专题主题调用标签 * * @version $Id: arclist.lib.php 2 8:29 2010年7月8日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 */ function ch_specialtopic($noteinfo, $arcTag, $refObj, $fname = '') { require_once DEDEINC . '/taglib/arclist.lib.php'; if ($noteinfo == '') { return ''; } $noteid = $arcTag->GetAtt('noteid'); $rvalue = ''; $tempStr = GetSysTemplets('channel_spec_note.htm'); $dtp = new DedeTagParse(); $dtp->LoadSource($noteinfo); if (is_array($dtp->CTags)) { foreach ($dtp->CTags as $k => $ctag) { $notename = $ctag->GetAtt('name'); //指定名称的专题节点 if ($noteid != '' && $ctag->GetAtt('noteid') != $noteid) { continue; } $isauto = $ctag->GetAtt('isauto'); $idlist = trim($ctag->GetAtt('idlist')); $rownum = trim($ctag->GetAtt('rownum')); $keywords = ''; $stypeid = 0; if (empty($rownum)) { $rownum = 40; } //通过关键字和栏目ID自动获取模式 if ($isauto == 1) { $idlist = ''; $keywords = trim($ctag->GetAtt('keywords')); $stypeid = $ctag->GetAtt('typeid'); } $listTemplet = trim($ctag->GetInnerText()) != '' ? $ctag->GetInnerText() : GetSysTemplets('spec_arclist.htm'); $idvalue = lib_arclistDone($refObj, $ctag, $stypeid, $rownum, $ctag->GetAtt('col'), $ctag->GetAtt('titlelen'), $ctag->GetAtt('infolen'), $ctag->GetAtt('imgwidth'), $ctag->GetAtt('imgheight'), 'all', 'default', $keywords, $listTemplet, 0, $idlist, $ctag->GetAtt('channel'), '', $ctag->GetAtt('att')); $notestr = str_replace('~notename~', $notename, $tempStr); $notestr = str_replace('~spec_arclist~', $idvalue, $notestr); $rvalue .= $notestr; if ($noteid != '' && $ctag->GetAtt('noteid') == $noteid) { break; } } } $dtp->Clear(); return $rvalue; }
function lib_arclist(&$ctag, &$refObj) { global $envs; $autopartid = 0; $tagid = ''; $tagname = $ctag->GetTagName(); $channelid = $ctag->GetAtt('channelid'); //增加对分页内容的处理 $pagesize = $ctag->GetAtt('pagesize'); if ($pagesize == '') { $multi = 0; } else { $tagid = $ctag->GetAtt('tagid'); } // arclist是否需要weight排序,默认为"N",如果需要排序则设置为"Y" $isweight = $ctag->GetAtt('isweight'); if ($tagname == 'imglist' || $tagname == 'imginfolist') { $listtype = 'image'; } else { if ($tagname == 'specart') { $channelid = -1; $listtype = ''; } else { if ($tagname == 'coolart') { $listtype = 'commend'; } else { if ($tagname == 'autolist') { $autopartid = $ctag->GetAtt('partsort'); } else { $listtype = $ctag->GetAtt('type'); } } } } //排序 if ($ctag->GetAtt('sort') != '') { $orderby = $ctag->GetAtt('sort'); } else { if ($tagname == 'hotart') { $orderby = 'click'; } else { $orderby = $ctag->GetAtt('orderby'); } } //对相应的标记使用不同的默认innertext if (trim($ctag->GetInnerText()) != '') { $innertext = $ctag->GetInnerText(); } else { if ($tagname == 'imglist') { $innertext = GetSysTemplets('part_imglist.htm'); } else { if ($tagname == 'imginfolist') { $innertext = GetSysTemplets('part_imginfolist.htm'); } else { $innertext = GetSysTemplets("part_arclist.htm"); } } } //兼容titlelength if ($ctag->GetAtt('titlelength') != '') { $titlelen = $ctag->GetAtt('titlelength'); } else { $titlelen = $ctag->GetAtt('titlelen'); } //兼容infolength if ($ctag->GetAtt('infolength') != '') { $infolen = $ctag->GetAtt('infolength'); } else { $infolen = $ctag->GetAtt('infolen'); } $typeid = trim($ctag->GetAtt('typeid')); if (empty($typeid)) { $typeid = isset($refObj->Fields['typeid']) ? $refObj->Fields['typeid'] : $envs['typeid']; } if ($listtype == 'autolist') { $typeid = lib_GetAutoChannelID($ctag->GetAtt('partsort'), $typeid); } if ($ctag->GetAtt('att') == '') { $flag = $ctag->GetAtt('flag'); } else { $flag = $ctag->GetAtt('att'); } return lib_arclistDone($refObj, $ctag, $typeid, $ctag->GetAtt('row'), $ctag->GetAtt('col'), $titlelen, $infolen, $ctag->GetAtt('imgwidth'), $ctag->GetAtt('imgheight'), $listtype, $orderby, $ctag->GetAtt('keyword'), $innertext, $envs['aid'], $ctag->GetAtt('idlist'), $channelid, $ctag->GetAtt('limit'), $flag, $ctag->GetAtt('orderway'), $ctag->GetAtt('subday'), $ctag->GetAtt('noflag'), $tagid, $pagesize, $isweight); }