您现在的位置是:首页 > cms教程 > phpcms教程phpcms教程

phpcms无法读取index.html的解决方法

穆漂徽2025-06-08 17:37:00phpcms教程已有9人查阅

导读代码如下:phpcms\modules\content\classes\html.class.php然后重新就OK了。当然你也可以修改成"index,shtml"。现在假如我要改成一行3个,那么新的代码就是:

代码如下:
phpcms\modules\content\classes\html.class.php
查找
代码如下:
/**
* 更新首页
*/
public function index() {
if($this->siteid==1) {
$file = PHPCMS_PATH.'index.html';
//添加到发布点队列
$this->queue->add_queue('edit','/index.html',$this->siteid);
} else {
$site_dir = $this->sitelist[$this->siteid]['dirname'];
$file = $this->html_root.'/'.$site_dir.'/index.html';
//添加到发布点队列
$this->queue->add_queue('edit',$file,$this->siteid);
$file = PHPCMS_PATH.$file;
}
修改成
代码如下:
/**
* 更新首页
*/
public function index() {
if($this->siteid==1) {
$file = PHPCMS_PATH.'index.htm';
//添加到发布点队列
$this->queue->add_queue('edit','/index.htm',$this->siteid);
} else {
$site_dir = $this->sitelist[$this->siteid]['dirname'];
$file = $this->html_root.'/'.$site_dir.'/index.html';
//添加到发布点队列
$this->queue->add_queue('edit',$file,$this->siteid);
$file = PHPCMS_PATH.$file;
}
然后重新就OK了。当然你也可以修改成"index,shtml"。
代码如下:
php $j=1;}
{loop subcat($catid) $v}
{php if($v['type']!=0) continue;}
<div class="box cat-area" {if $j%2==1}style="margin-right:10px"{/if}>
.....
{if $j%2==0}<div class="bk10"></div>{/if}
{$j++}
{/loop}
现在假如我要改成一行3个,那么新的代码就是:
复制代码
代码如下:
{php $j=1;}
{loop subcat($catid) $v}
{php if($v['type']!=0) continue;}
<div class="box cat-area" {if $j%3==1}style="margin-right:10px"{/if}{if $j%3==2}style="margin-right:10px"{/if}>
.......
{if $j%3==0}<div class="bk10"></div>{/if}
{$j++}
{/loop}
下面做出解释:
①第4行代码:“$j%3==1”代表每行3个box(每个栏目的边框css样式)的第一个,“$j%3==2”就是3个box中间的一个,这两个box都使用了style样式 margin-right:10px的样式,即右外边距10px;
②第6行代码:这个是每行与每行的边距代码;
③修改default_blue.css样式表里的box、cat-area,修改边框的宽度及颜色等自定义样式。

本文标签:

很赞哦! (0)

暂无内容
暂无内容
暂无内容
暂无内容
留言与评论 (共有 0 条评论)
昵称:
匿名发表 登录账号
         
验证码: