今天给各位分享phpcms标签路径的知识,其中也会对phpcms目录结构进行解释,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!
本文目录一览:
- 1、怎样把做好的网页传到phpcms里头
- 2、phpcms 调用出来的栏目,文章链接都是绝对路径,怎么修改为相对链接,谢谢!
- 3、phpcms文章描述标签什么?
- 4、phpcms 标签向导中的调用代码路径怎么才能去到我指定的路径?
- 5、phpcms静态路径 如何处理
1、怎样把做好的网页传到phpcms里头
1、前台模板目录在PHPCMS的 phpcms\templates\default\content里面,把新安装的PC前台模板备份一下(做参考用),然后删除,把做好的网页放到这里面。
2、把网页用到JS和图片还有css文件拷贝到 statics下面对应的文件夹里。
3、phpcms\templates\default\content 下面新建两个html页面分别为 header.html 和footer,html的分别代表着头部和尾部。
4、打开首页页面,把头部信息剪切到刚刚新建的header.html 里。
5、然后改css,js,图片的路径,JS路径:{JS_PATH}css路径:{CSS_PATH} 图片路径:{IMG_PATH}(可以参考原模板的header.html)
6、把index.html 的底部剪切到 footer.html 里面。
7、打开index.html 现在的index.html是去除头和尾的index.html ,在最顶部引入粘贴上:{template "content","header"},在底部粘贴上{template "content","footer"}。
8、这样做的其他的页面都要去除头和尾并依此引入头和尾,这样才实现了公共头和尾。
9、把在页面中用到图片的地方的图片路径都要改为 {IMG_PATH}XXX.jpg,JS和css也要改为{JS_PATH}XXX.js和{CSS_PATH}XXX.css。
10、 百度下载”PHPCMS V9用户手册.chm“看模板标签,调用内容就可以了。
注:第5步中,这些是常量 对应代表的是 网站根目录/statics/js/, /statics/css/,/statics/images/, 所以用变量肯定可以引用到你之前在static放的图片css和JS了
2、phpcms 调用出来的栏目,文章链接都是绝对路径,怎么修改为相对链接,谢谢!
\caches\configs\system.php
将所有绝对路径改为相对路径
'js_path' = '/statics/js/', //CDN JS
'css_path' = '/statics/css/', //CDN CSS
'img_path' = '/statics/images/', //CDN img
'app_path' = '/',//动态域名配置地址
3、phpcms文章描述标签什么?
phpcms常用标签
guml
php开发
顶级栏目名称:{$CATEGORYS[$top_parentid][catname]}
顶级栏目url:{$CATEGORYS[$top_parentid][url]}
顶级栏目id:{$CATEGORYS[$top_parentid][catid]}
其他字段只需要改动xxx:{$CATEGORYS[$top_parentid][xxx]}
父栏目名称:{$CATEGORYS[$CAT[parentid]][catname]}
父栏目url:{$CATEGORYS[$CAT[parentid]][url]}
父栏目id:{$CATEGORYS[$CAT[parentid]][catid]}
其他字段只需要改动xxx:{$CATEGORYS[$CAT[parentid]][xxx]}
**************************
内容页:
{$CAT[catid]}//调用上一级 栏目id
{$CAT[catname]}//调用上一级 栏目名称
{$CAT[url]}//调用上一级 栏目url
*****************************
{go($catid,$id)} 获取当前页面链接 {$url}在静态时不正常
{$CATEGORYS[$catid][url]} 显示当前栏目链接
{$CATEGORYS[$catid][catname]} 显示当前栏目名称
{$CATEGORYS[$r[catid]][catname]}循环内显示栏目
{if $r[thumb]}img src="{thumb($r[thumb],120,90)}"
alt="{$r[title]}" width="120" height="90" /{/if}有图显示图 没图不显示
截取:{str_cut($r[title],46,'')}
{str_cut(strip_tags($r[content]),400)} 列表页调取内容 过滤html标签 需要加moreinfo="1"
{date('Y-m-d H:i:s', $r['inputtime'])} 列表页调取发布时间
{date('Y-m-d',strtotime($inputtime))} 或者 {date('Y-m-d',time($inputtime))} 内容页调取发布时间
**********************************************************************
phpcms 调用当前栏目下的子栏目
category.html 写以下代码:
{loop subcat($catid) $r}
ul
lia href="{$r[url]}" title="{$r[catname]}"{$r[catname]}/a/li
/ul
{/loop}
list.html 写以下代码:
{loop subcat($catid) $r}
ul
lia href="{$CATEGORYS[$r[catid]][url]}"{$CATEGORYS[$r[catid]][catname]}/a/li
/ul
{/loop}
********************************************************************************
div class="pindaoright" {if $r[thumb]==""} style="width:100%;" {/if}
如果图片不存在 则执行某某
********************************
{if $r['catid']==$catid} class="newclass" {/if} 导航栏当前栏目增加class
*********************************************************
phpcms分页代码
style type="text/css"
.text-c {margin:10px 0;}
.text-c a {padding:5px;margin:0 8px;border:1px solid #ccc;background-color:#eee;}
/style
centerdiv id="pages" class="text-c"{$pages}/div/center
****************************************************************
phpcms v9列表页默认分页页码为10页,下面为分页页码条数的修改方法:
打开phpcms\libs\functions\global.func.php文件,
找到function pages函数(在672行左右)
修改下面代码中红色数字(10)为你想要显示的页码条数即可。
function pages($num, $curr_page, $perpage = 20, $urlrule = '', $array = array(),$setpages =?10)
---------------------
手机端图片自适应大小和居中 文章缩进
style type="text/css"
.part img {
width:100%!important;
height: auto!important;
display: table-cell!important;
}
.part p {
text-indent: 2em;
}
/style
-------------------------------------
第一个是图 剩下的是列表
{pc:content action="lists" catid="7" order="listorder DESC" thumb="1" num="1"}
{php $imgarr=array();$count=0;}
{loop $data $r}
{php array_push($imgarr,$r[id]);}
h4
a href="{$r[url]}" target="_blank" title="{$r[title]}"{str_cut($r[title],60,'')}/a
/h4
a href="{$r[url]}" target="_blank" title="{$r[title]}"
img src="{thumb($r[thumb],100,70)}" width="100" height="70" alt="{$r[title]}"
/a
p{str_cut($r[description],90)}/p
{/loop}
{/pc}
/div
ul
{pc:content action="lists" catid="7" order="listorder DESC" num="5"}
{loop $data $r}
{if $count4!in_array($r[id],$imgarr)}
{php $count++;}
lia href="{$r[url]}" target="_blank" title="{$r[title]}"{str_cut($r[title],57,'')}/a/li
{/if}
{/loop}
{/pc}
*********************************************
phpcms调用sql实例
{pc:get sql="select * from v9_news where catid=$catid and id!=$id order by updatetime desc" num="10"}
{loop $data $r}
li
a target="_blank" href="{$r[url]}" style="color:#333333;"{$r[title]}/a
span style="margin-left: 30px;color: #666;font-size: 14px;"{date('Y-m-d', $r[updatetime])}/span
/li
{/loop}
{/pc}
{pc:get sql="SELECT * FROM `v9_news` WHERE thumb!='$thumb' Order by id DESC " num="50"} 调用有图片的最新新闻
{loop $data $r}
织梦调用sql实例
{dede:sql sql="select * from dede_archives where typeid=5 and id!=~id~"}
li
a href="[field:id function=IDReturnURL(@me)/]" class="step-link"[field:title/]/a
/li
{/dede:sql}
4、phpcms 标签向导中的调用代码路径怎么才能去到我指定的路径?
使用PHPCMS的GET标签写查询数据库语句查询v9_form_表单名 的数据表中信息
然后使用loop输出
5、phpcms静态路径 如何处理
方法一:
一 打开 Apache 的配置文件 httpd.conf 。
二 将#LoadModule rewrite_module modules/mod_rewrite前面的#去掉
三 在 httpd.conf中添加:
IfModule mod_rewrite.c
RewriteEngine On
#RewriteCond %{ENV:SCRIPT_URL} (?:index|dispbbs)[-0-9]+\.html
RewriteRule ^(.*?(?:index|dispbbs))-([-0-9]+)\.html 1.php?__is_apache_rewrite=1__rewrite_arg=2
/IfModule
四 要实现asp帖子URL到php帖子的映射,在 第三步的IfModule mod_rewrite.c和/IfModule之间添加:
RewriteMap tolowercase int:tolower
RewriteCond %{QUERY_STRING} (?:boardid|page|id|replyid|star|skin)\=\d+ [NC]
RewriteRule ^(.*(?:index|dispbbs))\.asp 1.php?{tolowercase:%{QUERY_STRING}}__is_apache_rewrite=1
五 保存httpd.conf并重启Apache。
关于phpcms标签路径和phpcms目录结构的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站。