1.index.php控制器中添加lists_all()方法:
- /**
- * 此方法为自行添加,主要用来控制显示全站文章内容
- */
- public function lists_all() {
- $page = intval($_GET['page']);
- include template('content','list_all');
- }
2.list_all.html模板文件:查询v9_news内容表中所有文章,每页显示15篇文章:
- <div class="wenzhangliebiaoye">
- {pc:get sql="select * from v9_news order by id desc" num="15" page="$page"}
- {loop $data $r $val}
- <a href="{$val[url]}">
- <dl class="wenzhangliebiao">
- {if $val[thumb] != "" }
- <dt><img src="{thumb($val[thumb],132,97)}" width="132" height="97" alt="{$val[title]}"></dt>
- {else} //开源软件:Vevb.com
- <dt><img src="http://www.hebei800.cn/statics/images/common_images/logo1.jpg" width="132" height="97" alt="{$val[title]}"></dt>
- {/if}
- <dd>
- <h3>{$val[title]}</h3>
- <p>{str_cut($val[description],220,'...')} </p>
- <div><span>{date('Y年m月d日 H:i:s',$val[inputtime])}</span> <span>{date('H:i',$val[updatetime])}更新</span></div>
- </dd>
- </dl>
- </a>
- {/loop}
- {/pc}
- </div>
- <div class="clear30"></div>
- <div class="wenzhangfanye">
- <p>
- {$pages}
- </p>
- </div>
新闻热点
疑难解答