调用最新或推荐信息:
e:loop={'select * from (
select id,classid,titleurl,filename,title,newstime,titlepic from ec_ecms_photo where newstime union
select id,classid,titleurl,filename,title,newstime,titlepic from ec_ecms_flash where newstime union
select id,classid,titleurl,filename,title,newstime,titlepic from ec_ecms_movie where newstime) a order by newstime desc limit 10',10,24,1}]
//调用推荐信息newstime改为isgood
<?php
//读取栏目id,栏目名称,发表时间(并格式化)
$cid=$bqr['classid'];
$clsname=$class_r[$cid]['classname'];
$ttl=$bqr['title'];
$ntm=date('y-m-d',$bqr['newstime']);
//标题截取指定长度(减去栏目名称的长度)
$tlen=56-strlen($clsname);
$ttl2=substr($ttl, 0,$tlen);
if ( strlen( mb_substr($ttl2, -1,1,"gbk") ) == strlen( substr($ttl2, -1,1) ) ){
$ttl2=substr($ttl, 0,$tlen -1);
}
?>
<li>[<a href="/List-<?=$cid?>-0.html" target="_blank" ><?=$clsname?></a>] - <a href="<?=$bqsr['titleurl']?>" target="_blank" title="<?=$ttl?>"><?=$ttl2?></a><span aligh=right><?=$ntm?></span></li>
[/e:loop]
调用热门信息:
[e:loop={'select * from (
select id,classid,titleurl,title,onclick from ec_ecms_photo where onclick union
select id,classid,titleurl,title,onclick from ec_ecms_flash where onclick union
select id,classid,titleurl,title,onclick from ec_ecms_movie where onclick) a order by onclick desc limit 10',10,24,0}]
<?php
$i++;
$ttl=$bqr['title'];
$tlen=49;
$ttl2=substr($ttl, 0,$tlen);
if ( strlen( mb_substr($ttl2, -1,1,"gbk") ) == strlen( substr($ttl2, -1,1) ) ){
$ttl2=substr($ttl, 0,$tlen -1);
}
?>
<li class="no<?=$i?>"><a href="<?=$bqsr['titleurl']?>" target="_blank" title="<?=$ttl?>"><?=$ttl2?></a></li>
[/e:loop]
|