首页 > 运营 > 帮助中心 > 正文

PHPCMS如何把黄页作为全站首页的方法

2019-10-17 22:29:56
字体:
来源:转载
供稿:网友

 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.   更新全站缓存,好了,成功!!!

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表