程序员人生 网站导航

phpcms:实现黄页作为网站首页的方法

栏目:DedeCMS时间:2014-04-01 08:39:48

  1. 复制黄页的模板替换掉首页模板   也就是把  phpcms里面的lindex.html用yp里面的index.html  替换

  2.打开   index.php   改为一下代码

以下为引用的内容:
<?php
require dirname(__FILE__).'/yp/include/common.inc.php';
cache_page_start();
$template = 'index';
$C = subcat('yp', 0);
$lettercat = array('a'=>NULL,'b'=>NULL,'c'=>NULL,'d'=>NULL,'e'=>NULL,'f'=>NULL,'g'=>NULL,'h'=>NULL,'i'=>NULL,'j'=>NULL,'k'=>NULL,'l'=>NULL,
'm'=>NULL,'n'=>NULL,'o'=>NULL,'p'=>NULL,'q'=>NULL,'r'=>NULL,'s'=>NULL,'t'=>NULL,'u'=>NULL,'v'=>NULL,'w'=>NULL,'x'=>NULL,'y'=>NULL,'z'=>NULL,);
foreach($CATEGORY as $p)
{
if($p['letter'] && $p['module'] == 'yp')$lettercat[$p['letter']][] = $p;
}
ksort($lettercat);
$head['keywords'] = $M['name'].'_'.$M['seo_keywords'];
$head['title'] = $M['name'].'_'.$M['seo_title'].'_'.$PHPCMS['sitename'];
$head['description'] = $M['name'].'_'.$M['seo_description'].'_'.$PHPCMS['sitename'];
include template('phpcms', 'index');
cache_page(intval($M['cache_index']));
?>

  3.   更新全站缓存,好了,成功!!!

------分隔线----------------------------
------分隔线----------------------------

最新技术推荐