PHPCMS作为普通企业展示站还是非常不错的,静态化做的也是非常好,速度也挻快的。标签调用也是一学就懂。接触过几款cms, php语言类型的话,wordpress做博客最好,国内外主题资源多,网上相关教程也多,运行速度和效率有待加强,静态化只能借住插件;dede是目前国内最多人使用的,中小城市里很多公司的网站都是用dede做的,论坛活跃,很多问题都能得到解决,个人感觉后台不够人性化美观度有待加强,效率一般在数据量多的时候速度就不行了;phpcms是让人又爱又恨的,v9开始后台届面美观体验度较好,相比 wordpress 和dede 数据处理能力是最快最强的,站群功能也是一大亮点,但是目前对于phpcms的文档资源还是太少,官方论坛基本都快成鬼区了,有很多问题得不到解决。如果有需要二开的地方太多还是建议用dede,基本上有问题随便一发网上成堆的资源。
文件路径调用
{CSS_PATH}CSS文件路径,对应http://您的域名/statics/css/
{JS_PATH}JS文件路径,对应http://您的域名/statics/js/
{IMG_PATH}图片文件路径,对应http://您的域名/statics/images/
模版调用
{template “模版目录名”," 模版 文件名"}
{template “content”,“footer”}调用content目录下footer模版
常用字段(其它字段可查看模型的所有字段)
catid="$catid" 当前栏目ID
action=“category” 主要栏目名称调用等
action=“lists” 主要用于列表调用等
action=“hits” 调用排行等
action=“position” 主要用于推荐位列表等
posid=“9” 推荐位ID=“9”
num=“10” 数据调用数量=“10”
page="KaTeX parse error: Expected '}', got 'EOF' at end of input: …" 缓存="3600″毫秒 {r[title]}文章标题可增加截取
{KaTeX parse error: Expected 'EOF', got '}' at position 7: r[url]}̲链接 {r[description]}摘要
{thumb($r[thumb],200,200)}略缩图200px*200px
{$v[inputtime])}日期
{date(‘Y-m-d H:i:s’,KaTeX parse error: Expected 'EOF', got '}' at position 14: v[inputtime])}̲ 时间格式化调用 年-月-日…v[inputtime])} 时间格式化调用 月/日,其它组合类推
{str_cut($v[字段名],30,…)} 超出30字符后用…代替,注意一个汉字等于3字符
自定义字段{$v[自定义字段]} 主表字段加上 moreinfo=“1”
{if $n%3 ==0}需要出现的内容{/if} 判断语句,文章、列表分组或每3篇文章出现一次
文件或栏目排序方式
order=“listorder ASC” 默认排序正序排序(栏目一般用这种,后台可以设置手动排序,比如1,2,3文章,可以手动调用为2,3,1/3,1,2/2,1,3顺序等等,以下简称手动)
order=“listorder DESC” 默认排序逆序排序 (文章一般用这种,后台可以设置手动排序)
order=“id ASC” 按ID正序排序 (设置后,后台手动排序不能生效)
order=“id DESC” 按ID逆序排序 (设置后,后台手动排序不能生效)
order="inputtime ASC"按发布时间正序排序
order="inputtime DESC"按发布时间逆序排序
order="weekviews DESC"按点周击量逆序排序
网页头部部分
{if isset(KaTeX parse error: Expected 'EOF', got '&' at position 15: SEO['title']) &̲& !empty(SEO[‘title’])}{KaTeX parse error: Expected 'EOF', got '}' at position 13: SEO['title']}̲{/if}{SEO[‘site_title’]} 网页标题
首页导航代码(附带选中栏目高亮完美解决方法,添加active类,样式部分自行定义)
{pc:content action=“category” catid=“0” num=“25” siteid="$siteid" order=“listorder ASC”}
首页导航代码(栏目包函子栏目一起调用,
r位置不能变)
{pc:content action=“category” catid=“0” num=“25” siteid="$siteid" order=“listorder ASC”}
- 首页 {loop $data $k $r}
- {$r[catname]} {pc:content action="category" catid="$k" num="25" siteid="$siteid" order="listorder ASC"}
-
{loop $data $v}
- {$v[catname]} {/loop}
{/loop}
频道页、列表页、内容页当前父栏目所有子栏目名称调用(附选中栏目高亮完美解决方法)
{pc:content action=“category” catid=“
siteid” order=“listorder ASC”}
{loop $data $r}
网站公告模块
{pc:announce action=“lists” siteid="$siteid" num=“5”}
{loop $data KaTeX parse error: Expected 'EOF', got '}' at position 2: r}̲ <a href="{APP_…r[‘aid’]}">{$r[‘title’]}
{/loop}
{/pc}
推荐位调用(posid="“填推荐位序号,后台可以查看)
{pc:content action=“position” posid=”" order=“listorder DESC " num=“1” cache=“3600”}
{loop $data KaTeX parse error: Expected 'EOF', got '}' at position 2: r}̲ <a href="{r[url]}”>{$r[title]}
{/loop}
{/pc}
基本文章调用(如需分页请加上 page=“KaTeX parse error: Expected '}', got 'EOF' at end of input: …"lists" catid="catid” siteid="$siteid" num=“25” order=“listorder DESC”}
{loop $data KaTeX parse error: Expected 'EOF', got '}' at position 2: r}̲ <a href="{r[url]}">{$r[title]}
{/loop}
{/pc}
友情链接调用
{pc:link action=“type_list” siteid="$siteid" linktype=“1” order=“listorder DESC” num=“24” return=“pic_link”}
{loop $pic_link KaTeX parse error: Expected 'EOF', got '}' at position 2: v}̲ <a href="{v[url]}" target="_blank">{$v[name]}
{/loop}
{/pc}
频道或列表文章排行
(首页调用需指定栏目ID要不然会空白,order="weekviews DESC"星期点击排行,order="views DESC"总点击排行,order="monthviews"月排行用 ,order=“daythviews” 日排行,年排行排行用单词类推)
{pc:content action=“hits” catid=“
siteid” order=“weekviews DESC” num=“10”}
{loop $data KaTeX parse error: Expected 'EOF', got '}' at position 2: r}̲ {n}-{$r[title]}
{/loop}
{/pc}
调用 news 模型下最新文章(其实也就是按ID逆顺)
{pc:get sql=“SELECT * FROM v9_news
Order by id DESC " num=“10”}
{loop $data KaTeX parse error: Expected 'EOF', got '}' at position 2: r}̲ <a href="{r[url]}”>{$r[title]}
{/loop}
{/pc}
文章浏览和评论量调用(首页)
{pc:content action=“lists” catid=“1” siteid="$siteid" num=“25” order=“listorder DESC”}
{php KaTeX parse error: Expected group after '_' at position 39: …ategory_content_̲'.siteid,‘commons’);}
{loop $data $v}
{php $category =
v[catid]];}
{php $modelid = $category[‘modelid’];}
{php $db = pc_base::load_model(‘hits_model’); $_r =
modelid.’-’.$v[id])); $views = $_r[views]; }
{php $comment_tag = pc_base::load_app_class(“comment_tag”, “comment”); $comment_total = KaTeX parse error: Expected group after '_' at position 47: …ntid'=>'content_̲'.v[catid].’-’.
siteid));}
{KaTeX parse error: Expected 'EOF', got '}' at position 9: v[title]}̲ - 点击量:{views}- 评论量:{if KaTeX parse error: Expected 'EOF', got '}' at position 14: comment_total}̲{comment_total}{else}0{/if}
{/loop}
{/pc}
文章浏览量和评论量调用(频道页和列表页调用)
{pc:content action=“lists” catid=“
siteid” num=“25” order=“listorder DESC”}
{loop $data $v}
{php $db = pc_base::load_model(‘hits_model’); $_r =
modelid.’-’.$v[id])); $views = $_r[views]; }
{php $comment_tag = pc_base::load_app_class(“comment_tag”, “comment”); $comment_total = KaTeX parse error: Expected group after '_' at position 47: …ntid'=>'content_̲'.v[catid].’-’.
modelid));}
{KaTeX parse error: Expected 'EOF', got '}' at position 9: v[title]}̲ - 点击量:{views}- 评论量:{if KaTeX parse error: Expected 'EOF', got '}' at position 14: comment_total}̲{comment_total}{else}0{/if}
{/loop}
{/pc}
文章浏览量(内容页调用,需引用jq库,提供要用原生JS的方法,api返回值是用JQ选中ID为hits然后写入数值)
点击量:
文章浏览量 (不引用JQ库)
{php $db = pc_base::load_model(‘hits_model’); $_r = modelid.’-’.$id)); $views = $_r[views]; }
点击量: {$views}
文章标题前面调用文章所在栏目名称
{
v[catid]][catname]} 频道页调用(KaTeX parse error: Expected '}', got 'EOF' at end of input: …用文章时你使用的循环标签) {CATEGORYS[KaTeX parse error: Expected 'EOF', got '}' at position 16: catid][catname]}̲ 列表页调用(如所有文章都在本…catid,不全在用频道页的)
{$CATEGORYS[22][catname]} 调用栏目为22的栏目名称
关键字调用(关键字格式化explode(’ ',
v[keywords]);关键字用逗号间隔;
{php KaTeX parse error: Double superscript at position 22: …ds = explode(' '̲,v[keywords]);}
关键字:
{loop $keywords KaTeX parse error: Expected 'EOF', got '}' at position 8: keyword}̲ {keyword}
{/loop}
单页调用/内容页相关调用
{KaTeX parse error: Expected 'EOF', got '}' at position 6: title}̲标题 {inputtime}发布时间
{KaTeX parse error: Expected 'EOF', got '}' at position 11: updatetime}̲更新时间 {catpos(catid)} 当前位置
{KaTeX parse error: Expected 'EOF', got '}' at position 6: pages}̲内容分页 {CAT[catname]}当前栏目
{$content}文章内容
内容页组图调用
{loop $pictureurls $pic_k KaTeX parse error: Expected 'EOF', got '}' at position 2: r}̲ <img src="{thu…r[url]}"/>
{/loop}
调用评论
{if $allow_comment && module_exists(‘comment’)}
{/if}
相关文章
{pc:content action=“relation” relation=“
id” catid=“
rs[keywords]”}
{if $data}
{loop $data KaTeX parse error: Expected 'EOF', got '}' at position 2: r}̲ <a href="{r[url]}" target="_blank">{KaTeX parse error: Expected 'EOF', got '}' at position 9: r[title]}̲</a>{date('Y-m-…r[inputtime])}
{/loop}
{/if}
{/pc}