最近老是看见有人问怎么把黄页做为全站首页,今天有时间看了看,找到办法了,很简单,复制黄页的模板替换掉首页模板,也就是把phpcms里面的lindex.html用yp里面的index.html替换:
- <?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;
- } //Vevb.com
- 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']));
- ?>
更新全站缓存,好了,自己试着改改看.
新闻热点
疑难解答