一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

phpcms V9手机门户模块实现单页功能的例子

时间:2016-06-13 编辑:简简单单 来源:一聚教程网

第一步:实现分类管理可以绑定单页的修改办法

需要修改的文件所在目录:\phpcms\modules\wap\templates ,目录下文件type_manage.tpl.php为手机门户分类管理的模版,其中,第9行


select_category('category_content_'.$siteid,$parentid,'name="info[cat]"',L('wap_type_bound'),0,0,0,$siteid);?>
修改为

另,\phpcms\modules\wap目录下,wap_admin.php文件的

修改type_manage方法的111行左右:


$r['select_cat'] = form::select_category('',$r[cat],'name="cat['.$r['typeid'].']"',L('wap_type_bound'),0,0,0,$siteid);
改为
$r['select_cat'] = form::select_category('',$r[cat],'name="cat['.$r['typeid'].']"',L('wap_type_bound'),0,-1,0,$siteid);
 

修改public_show_cat_ajx方法,


echo form::select_category('',0,'name="addcat['.$parentid.'][]"',L('wap_type_bound'),0,0,0,$siteid);
修改为
echo form::select_category('',0,'name="addcat['.$parentid.'][]"',L('wap_type_bound'),0,-1,0,$siteid);

然后再试试能否绑定单页。

第二步:实现page页面的调用方法

\phpcms\modules\wap目录下,index.php文件增加方法:


//单页 by ZRT 2016.6
 function page() {
  $WAP = $this->wap;
  $TYPE = $this->types;
  $WAP_SETTING = string2array($WAP['setting']); 
  $GLOBALS['siteid'] = max($this->siteid,1); 
  $typeid = intval($_GET['typeid']);  
  if(!$typeid) exit(L('parameter_error'));     
  $catid = $this->types[$typeid]['cat'];
  
  
  $tablename = $this->db->table_name = $this->db->db_tablepre."page";
  $data = $this->db->get_one(array('catid'=>$catid));
  if(!$data) showmessage(L('info_does_not_exists'),'blank');
  extract($data);
  include template('wap', 'page');
 }

第三步:wap模版目录下增加page.html模版

page.html模版中的标题使用标签{$time},内容使用{$content},与pc版相同。

第四步:调用URL

http://m.111com.net /index.php?&a=page&typeid=12

热门栏目