phpcms教程

1、首先下载phpcms v9的集成安装包并安装论坛里很显眼的位置,是个正常人都应该能找得到!

2、安装好打开v9的根目录“phproot→phpcms→templates”文件夹把“default”文件夹复制一份起名“redu”

3、登陆v9后台登录地址:http://localhost/admin.php

用户名:phpcms

密码:phpcms

4、打开界面→模板风格→风格标识redu下的详细列表下的content文件夹

标签解说:

{template “content”,”header”}   ———-  调用根目录下phpcms\template\content\header文件

{CHARSET}  ————————————-字符集 (gbk或者utf-8)

{if isset($SEO['title']) && !empty($SEO['title'])}

{$SEO['title']}{/if}

{$SEO['site_title']}

{$SEO['keyword']}

{$SEO['description']}上面4条不用我解释了吧,都是标题和标题seo优化

{CSS_PATH}  ———————————–地址替换为根目录下tatics\css

{JS_PATH}————————————–地址替换为根目录下tatics\js

{pc:content  action=”position” posid=”9″ order=”id” num=”10″ cache=”3600″}

pc标签{pc:content 参数名=“参数值” 参数名=“参数值” 参数名=“参数值”}

{loop $data $k $v}

·  {$v[title]}

{/loop}

显示pc标签值

action=”position”————-对话框的类型=“内容推荐位列表”

posid=”9″——————–推荐位ID=“9”

order=”id”——————–排序类型=“id”

num=”10″ ——————-数据调用数量=“10”

cache=”3600″—————-缓存=”3600″毫秒

{APP_PATH}—————–项目地址

{get_siteid()}—————-

{IMG_PATH}—————–

action=”hits” 排行,热点等

action=”lists” 主要用于列表等。

 

catid=”$catid” 当前栏目ID   指定数字,即为指定的栏目

num=”"  调用文章的数量

order=”id DESC” 按ID降序排列

order=”id ASC”  按ID升序排列

order=”views DESC”

sort=”"

thumb=”1″ 缩略图

return=”"

page=”$page” 需要分页

每当列表几行的时候出现一次这个{if $num%2==0}   {/if}

循环标签{loop $data $r}  {/loop}    {loop $info $r}  {/loop}

日期      {date(‘Y-m-d H:i:s’,$r[inputtime])}

文章链接  {$r}

文章标题  {$r[title]}

标题截取  {str_cut($r[title],40,’…’)}

缩略图    loop是info的时候用  {thumb($r[thumb],110,0)}     loop是data的时候用{thumb($v[thumb],90,0)}

分页标签{$pages}

文章页标签

标题      {$title}

内容      {$content}

日期      {$inputtime}

来源      {$copyfrom}

点击数      

网站首页  {siteurl($siteid)}

当前位置  {catpos($catid)}

————————————————————————

1、首先修改首页模板index.html

修改前向大家介绍下v9的工作模式,v9和他的前身phpcms 2008是一样的都是“标签调用头部 +首页部分+ 标签调用底部”

所以按照从头开始的顺序

第一步打开heard.html

现在我们开始分析header.html的构造

上面是W3C网页标准 {CHARSET}” =字符集 (gbk或者utf-8) 判断语句 翻译:如果设置了标题并且标题不为空,则显示标题,否则显示网站名称上面2行是外部css的调用{CSS_PATH} 上面3行是网页的js调用

{pc:content action=”position” posid=”9″ order=”id” num=”10″ cache=”3600″}

{loop $data $k $v}

{/loop}

{/pc}

rss

[/url]

下面是搜索部分

{php $j=0} {php $search_model = getcache(‘search_model_’.$siteid, ‘search’);} {loop $search_model $k=>$v} {php $j++;} [url=http://jycms.com.ru/%E2%80%9Djavascript:;%E2%80%9D]{$v['name']}{if $j != count($search_model)} | {/if} {/loop} {php unset($j);}

 

窗体顶端

 

窗体底端

 

搜索部分结束

{pc:content action=”category” catid=”0″ num=”25″ siteid=”$siteid” order=”listorder ASC”}

{loop $data $r}

{/loop}

{/pc}

{if $top_parentid}

{pc:content action=”category” catid=”$top_parentid” num=”15″ siteid=”$siteid” order=”listorder ASC”} {loop $data $r} {$r[catname]} | {/loop} {/pc} {if $modelid}搜索{/if}

{/if}

搜索引擎优化(seo)中,对代码的优化也是一个很关键的步骤。为了更加符合SEO的规范,下面是目前流行的CSS+DIV的命名规则:

DIV ID命名

页头:header

登录条:loginBar

标志:logo

侧栏:sideBar

广告:banner

导航:nav

子导航:subNav

菜单:menu

子菜单:subMenu

搜索:search

滚动:scroll

页面主体:main

内容:content

标签页:tab

文章列表:list

提示信息:msg

小技巧:tips

栏目标题:title

友情链接:friendLink

页脚:footer

加入:joinus

指南:guild

服务:service

热点:hot

新闻:news

下载:download

注册:regsiter

状态:status

按钮:btn

投票:vote

合作伙伴:partner

版权:copyRight

CSS ID的命名

外套:wrap

主导航:mainNav(globalNav)

子导航:subNav

页脚:footer

整个页面:content

页眉:header

页脚:footer

商标:label

标题:title

顶导航:topNav

边导航:sideBar

左导航:leftsideBar

右导航:rightsideBar

标识:logo

标语:banner

菜单1内容:menu1Content

菜单1容量:menu1Container

子菜单:submenu

边导航图标:sidebarIcon

注释:note

面包屑:breadCrumb(即页面所处位置导航提示)

容器:container

内容:content

搜索:search

登陆:login

功能区:shop(如购物车,收银台)

当前的current

样式文件命名

全站标签默认样式:general.css或global.css

布局版式设计样式:layout.css或container.css

通用样式(如文字、表单等):style.css

专栏/频道样式:columns.css

打印输出样式:print.css

主题模板样式:themes.css

 

       

{CHARSET}

字符集

$SEO['title']

页面标题

$SEO['site_title']

网站标题

$SEO['keyword']

keyword

{$SEO['description']

description

{CSS_PATH}

css路径

{JS_PATH}

js路径

{IMG_PATH}

img路径

{APP_PATH}

app路径

{get_siteid()}

站点ID

{$siteid}

分站URL

{siteurl($siteid)}

站点URL

{$catid}

 

栏目ID

{$pages}

 

分页

     

{date('Y-m-d H:i:s',$r[inputtime])}

 

更新时间

{str_cut($v[description],116,'..')}

 

截字符串

{thumb($v[thumb],70,60)}

 

截缩略图

{$CATEGORYS[$cid][catname]}

 

频道名

{$CATEGORYS[$cid][url]}

 

频道URL

{template  "content","footer"}

 

模板调用

{pc:block pos="index_block_1"}

 

争议(块调用)

action:lists列表、position推荐位、category子栏目、relation相关文章、hits排行榜

 

action

posid:

 

推荐位

1首页焦点图推荐

 

posid

2首页头条推荐

   

5推荐下载

   

8图片频道首页焦点图

   

9网站顶部推荐

   

10栏目首页推荐

   

12首页图片推荐

   

13栏目页焦点图

   

thumb:0所有文章、1包含缩略图

 

thumb

order:listorder  DESC排序降序、listorder ASC排序升序、id DESC添加时间降序、updatetime DESC更新时间降序

order

     

{pc:content
action="position"  posid="2" order="listorder DESC" num="4"}

 

news-hot

{pc:content
action="position"  posid="1"
order="listorder DESC" thumb="1"  num="5"}

 

FocusPic

{pc:content
action="position"  posid="12" thumb="1" order="id DESC"  num="10"}

 

图片新闻

{pc:content  action="lists" catid="$r[catid]" num="1"  thumb="1" order="id DESC" return="info"}

   

{pc:content  action="lists" catid="$r[catid]" num="5"  order="id DESC" return="info"}

   

{pc:announce
action="lists"  siteid="$siteid" num="2"}

 

公告

{pc:special
action="lists"  siteid="$siteid" elite="1" listorder="3"  num="2"}

 

专题

{pc:content action="hits"  catid="35" num="10" order="views DESC"}

 

digg点击

{pc:comment action="bang"  num="10" cache="3600"}

 

评论

{pc:content action="hits"  catid="35" num="10" order="views DESC"}

   

{pc:link
action="type_list"  siteid="$siteid" linktype="1" order="listorder  DESC" num="8" return="pic_link"}

友情链接

{pc:content action="lists"  catid="$catid" num="25" order="id DESC"  page="$page"}

 

列表

{pc:content action="hits"  catid="$catid" num="10" order="views DESC"  cache="3600"}

 

总排行

{pc:content action="hits"  catid="$catid" num="8" order="monthviews DESC"  cache="3600"}

 

月排行

{pc:content
action="position"  posid="5" order="listorder DESC" num="4"}

 

推荐下载

     

{catpos($catid)}

 

栏目定位

{loop subcat(0,0,0,$siteid) $r}

   

{title_style($r[style])}

 

标题样式

{$inputtime}

 
     
 
posted @ 2013-09-27 17:11  蓝魔  阅读(309)  评论(0编辑  收藏  举报