這表標(biāo)簽有自帶的col參數(shù)可以分為兩列或者幾列但是調(diào)用起來及其不方便標(biāo)簽自帶的是tr的方式但是無法靈活運用到自己的模板中我想用limit方式調(diào)用但是試了試居然不支持那只好自己來修改一下標(biāo)簽了谐宙!
網(wǎng)站根目錄下include\taglib找到likearticle.lib.php找到$attlist="row|12,titlelen|28,infolen|150,col|1,tablewidth|100,mytypeid|0,byabs|0,imgwidth|120,imgheight|90";替換成
$attlist="row|12,titlelen|28,infolen|150,col|1,tablewidth|100,mytypeid|0,byabs|0,imgwidth|120,imgheight|90,limit|0";
在$colWidth = $colWidth."%";行下增加
if($limit!=0){
$limits='limit '.$limit;
}else{
$limits='limit 0';
}
接下來就是要修改sql語句找到
$query變量
$query = "SELECT arc.*,tp.typedir,tp.typename,tp.corank,tp.isdefault,tp.defaultname,tp.namerule,
tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath
FROM `#@__archives` arc LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id
where arc.arcrank>-1 AND ($keyword)$typeid $orderquery limit 0, $row";
修改為
$query = "SELECT arc.*,tp.typedir,tp.typename,tp.corank,tp.isdefault,tp.defaultname,tp.namerule,
tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath
FROM `#@__archives` arc LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id
where arc.arcrank>-1 AND ($keyword)$typeid $orderquery $limits, $row";
找到
$query = "SELECT arc.*,tp.typedir,tp.typename,tp.corank,tp.isdefault,tp.defaultname,tp.namerule,
tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath
FROM `#@__archives` arc LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id
WHERE arc.arcrank>-1 AND$typeid $orderquery limit 0, $row";
修改為
$query = "SELECT arc.*,tp.typedir,tp.typename,tp.corank,tp.isdefault,tp.defaultname,tp.namerule,
tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath
FROM `#@__archives` arc LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id
WHERE arc.arcrank>-1 AND$typeid $orderquery $limits, $row";
點擊保存然后清除dede緩存
前臺內(nèi)容頁調(diào)用標(biāo)簽為
{dede:likearticle row='5' col='1' }
[field:title/][field:pubdate function="MyDate('m.d',@me)"/]
{/dede:likearticle}
{dede:likearticle row='5' col='1' limit='5'}
[field:title/][field:pubdate function="MyDate('m.d',@me)"/]
{/dede:likearticle}
好了大功告成!