22时02分 03月15日 2010年

DedeCMS 5.3/5.5 动态首页的修改方法

Category: CSS, Author: Shenai Qiu, Popularity: 28%

  DedeCMS 升级至5.5后有很多不适应的地方,比如首页不再默认是动态,必须生成一个 HTML,最让人接受不了的就是首页域名后会带index.html的小尾巴。在 DedeCMS 官方论坛找到的解决方法。

  在将以下的代码替换 index.php 里原有的代码即可实现动态首页。

<?php
if(!file_exists(dirname(__FILE__).'/data/common.inc.php'))
{
    header('Location:install/index.php');
    exit();
}
require_once (dirname(__FILE__) . "/include/common.inc.php");
require_once DEDEINC."/arc.partview.class.php";
$GLOBALS['_arclistEnv'] = 'index';
$row = $dsql->GetOne("Select * From `#@__homepageset`");
$row['templet'] = MfTemplet($row['templet']);
$pv = new PartView();
$pv->SetTemplet($cfg_basedir . $cfg_templets_dir . "/" . $row['templet']);
$pv->Display();
?>

Tags:.
评论数量(0) | Add Comments
本文网址:http://www.shenaiqiu.com/archives/css/1033.html

There are No comments.

» You can leave a response or Trackback .

leave a reply