首页 > 代码库 > phpcms替换来源

phpcms替换来源

   //替换来源:pc标签里面必须加moreinfo="1"不加会调不出来源

 

 

{pc:content action="lists" catid="12" order="id ASC" num="4" moreinfo="1"}
        {loop $data $key $val}
        {php list($val[copyfrom]) = explode(‘|‘, $val[‘copyfrom‘])}<!--将来源进行拆分,来源就是作者-->
   <div class="row">
 
     <div class="col-sm-4">
         <a href="http://www.mamicode.com/{$val[‘url‘]}"><img src="http://www.mamicode.com/{$val[‘thumb‘]}" class="img-responsive xm_pic" /> </a>
        </div>
        <div class="col-sm-8">
         <div class="ry_info">
             <h4><span class="ry_sp">新闻名称:</span>{$val[‘title‘]}</h4>//标题
            </div>
            <div class="ry_info">
             <span class="ry_sp">新闻简介:</span>{$val[‘description‘]}//摘要
            </div>
            <div class="ry_info">
             <span class="ry_sp">作者:</span>{$val[copyfrom]}//来源
 
            </div>
            <div class="ry_info">
             <span class="ry_sp">时间:</span>{date(‘Y-m-d‘,$val[inputtime])}//替换时间
            </div>
            </div>
       </div>     
    <hr />
    {/loop}
        {/pc}
       

phpcms替换来源