phpcms 仿站小结
1.title
<title>{if isset($SEO['title']) && !empty($SEO['title'])}{$SEO['title']}{/if}{$SEO['site_title']}</title>
2 js
<script type="text/javascript" src="{JS_PATH}jquery.min.js"></script>
3.css
<link href="{CSS_PATH}reset.css" rel="stylesheet" type="text/css" />
CSS内的图片
background:url(../images/searchl.jpg) 0 0 no-repeat;
4.优化
<meta name="keywords" content="{$SEO['keyword']}">
<meta name="description" content="{$SEO['description']}">
5.连接文件
{template "content","header"}
6.图片
<img src="{IMG_PATH}v9/logo.jpg" />
护卫神 云查杀
7.首页导航
{pc:content action="category" catid="0" num="25" siteid="$siteid" order="listorder ASC"}
<ul class="nav-site">
<li><a href="{siteurl($siteid)}"><span>首页</span></a></li>
{loop $data $r}
<li class="line">|</li>
<li><a href="{$r[url]}"><span>{$r[catname]}</span></a></li>
{/loop}
</ul>
{/pc}
8.内容列表
{pc:content action="lists" catid="2" order="id DESC" num="4"}
{loop $data $key $val}
{$val['title']}
{/loop}
{/pc}
{pc:content action="lists" catid="$catid" num="25" order="id DESC" page="$page"}
{loop $data $r}
{$r[title]}
{/loop}
{/pc}
9.公告管理:
{pc:announce action="lists" siteid="$siteid"}
{loop $data $key $val}
{$val['content']}
{/loop}
{/pc
phpcms v9 频道页调用单网页内容
{pc:get sql=”SELECT * FROM phpcms_page where catid=19″ cache=”3600″ return=”data”}
{loop $data $r}
<h1 class=”h1_title”>{$r[title]}</h1>
<div class=”content”> {$r[content]} </div>
{/loop}
{/pc}
代码:{pc:get sql="SELECT `content` FROM v9_page where catid=所要调用的catid号"}
{loop $data $key $val}
{$val[content]}
{/loop}
{/pc}
10.列表页分页
{pc:content action="lists" catid="$catid" num="1" order="id DESC" page="$page"}
<ul class="list lh24 f14">
{loop $data $r}
<li><span class="rt">
{date('Y-m-d H:i:s',$r[inputtime])}</span>
·<a href="{$r[url]}" target="_blank"{title_style($r[style])}>{$r[title]}</a></li>
{if $n%5==0}<li class="bk20 hr"></li>{/if}
{/loop}
</ul>
<div id="pages" class="text-c"></div>{/pc}
11、格式化时间
{date('Y-m-d',$r['inputtime'])}
{str_cut($r['title'],30)}
12、 导引
<div class="crumbs"><a href="{siteurl($siteid)}">首页</a><span> > </span>{catpos($catid)} 正文</div>
13、内容详细
{$title}