遇到的问题及修改: 1.自动生成index.html的问题: 找到/phpcms/model/content_model.class.php 查找并注释掉以下代码,共2处:(可以进行查找) 大概在238,239行(解决发布内容时不自动生成) //在添加和修改内容处定义了 INDEX_HTML if(defined('INDEX_HTML')) $html->index(); if(defined('RELATION_HTML')) $html->create_relation_html($catid); 大概在341,342行(解决修改编辑时不自动生成) //在添加和修改内容处定义了 INDEX_HTML if(defined('INDEX_HTML')) $html->index(); if(defined('RELATION_HTML')) $html->create_relation_html($systeminfo['catid']); 这样就可以避免自动生成首页、栏目页、列表页,可以自行手动生成首页、栏目页、列表页。 2.伪静态时URL规则中{$categorydir}{$catdir}无效解决方法: 第一步:打开phpcms\modules\content\classes\url.class.php; 第二步:将122行 $url = str_replace(array('{$catid}', '{$page}'), array($catid, $page), $urlrule); 替换为 $category_dir = $this->get_categorydir($catid); $url = str_replace(array('{$catid}', '{$page}','{$catdir}','{$categorydir}'), array($catid, $page,$category['catdir'],$category_dir), $urlrule); 3.调用站点名称 打开:根目录/phpcms/libs/functions/global.func.php 找到$seo['keyword'] = !empty($keyword) ? $keyword : $site['keywords'];这句话, 在上面添加一段代码$seo['name']=$sites[$siteid]['name']; 保存即可。 然后在需要调用站点名称的地方调用{$SEO['name']},就可以获得站点名称了。
咨询电话
400-888-9999