phpcms V9手机门户模块实现单页功能的方法

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

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

<?php echo form::select_category('category_content_'.$siteid,$parentid,'name="info[cat]"',L('wap_type_bound'),0,0,0,$siteid);?>

修改为

<?php echo form::select_category('category_content_'.$siteid,$parentid,'name="info[cat]"',L('wap_type_bound'),0,-1,0,$siteid);?>
<?php echo form::select_category('category_content_'.$siteid,$parentid,'name="info[cat]"',L('wap_type_bound'),0,0,0,$siteid);?>

修改为

<?php echo form::select_category('category_content_'.$siteid,$parentid,'name="info[cat]"',L('wap_type_bound'),0,-1,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);
$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);
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模版中的标题使用标签{KaTeX parse error: Expected 'EOF', got '}' at position 5: time}̲,内容使用{content},与pc版相同。

第四步:调用URL

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值