帝国模板使用记录

2024-01-19
 <title>[!--pagetitle--]</title>
 <meta name="description" content="[!--pagedes--]" />
 <meta name="keywords" content="[!--pagekey--]" />

公众模板头部和尾部:

[!--temp.header--] 
[!--temp.footer--]

调用某个栏目下文章

[e:loop={1,10,0,0,'','newstime DESC'}]
<h2><a href="<?=$bqsr['titleurl']?>"><?=$bqr['title']?></a></h2>
<img src="<?=$bqr['titlepic']?>">
<?=date('Y-m-d',$bqr[newstime])?>
<p><?=esub($bqr['smalltext'],32,'...')?><a href="<?=$bqsr['titleurl']?>">【详情】</a></p
[/e:loop]

更多例子:

[e:loop={"select *  from phome_ecms_news where id  between 1 and 100 order by id desc limit 100",0,24,0}]
<a href="<?=$bqsr['titleurl']?>" target="_blank"><?=$bqr['title']?></a> <br>
[/e:loop]

[e:loop={"SELECT * FROM phome_ecms_news where classid in (2,3,4,5,6,7,8,9) and titlepic<>'' ORDER BY onclick desc limit 2",6,24,0}]
      <a href="<?=$bqsr['titleurl']?>" target="_blank" class="item">
        <div class="img"><img src="<?=$bqr['titlepic']?>"></div>
        <p><?=$bqr['title']?></p>
        <p><?=$bqr['smalltext']?></p>
        </a> 
[/e:loop] 


[e:loop={7,1,12,1,"limit 0,1","onclick DESC"}]
模板代码内容
[/e:loop]

调用某个栏目的信息

<?php
$cr=$empire->fetch1("select intro,classimg,classpath from phome_enewsclass where classid=9");
echo '<span><img src="'.$cr[classimg].'"></span>';
echo '<p><a href="'.$cr[classpath].'">'.$cr[intro].'</a></p>';
?>

使用loop
[e:loop={"select intro,classimg,classurl from phome_enewsclass where classid=9",1,24,0}]
<span><img src="<?=$bqr[classimg]?>"></span>
<em><?=$bqr['classname']?></em>
<p><a href="<?=$bqsr[classurl]?>"><?=esub($bqr[intro],100,'...') ?></a></p>
[/e:loop]

调用多个栏目的名称和链接

[e:loop={"select * from phome_enewsclass where classid in (5,6,12,11,13,24,29) order by myorder asc",0,24,0}]
<li><a href="<?=$bqsr[classurl]?>"><?=$bqr[classname]?></a></li>
[/e:loop]
文章页
[!--title--]
[!--newstime--]
[!--newstext--]
相关内容
最新

坚持的力量

wordpress建站,视频剪辑拍摄,动画制作