(1)打开phpcmsmoduleswapindex.php,第283行以后增加控制器函数
- //单页面
- function page() {
- $WAP = $this->wap;
- $TYPE = $this->types;
- $WAP_SETTING = string2array($WAP['setting']);
- $GLOBALS['siteid'] = max($this->siteid,1);
- $catid = intval($_GET['catid']);
- if(!$catid) exit(L('parameter_error'));
- $this->page_db = pc_base::load_model('page_model');
- $data = $this->page_db->get_one(array('catid'=>$catid));
- if(!$data) showmessage(L('info_does_not_exists'),'blank');
- extract($data);
- include template('wap', 'page');
- }
(2)在手机模板文件夹里边(phpcmstemplatesdefaultwap)新增page.html,就行pc站调用内容一样,直接使用pc站的代码调用,比如:{$title}、{$content}等
(3)导航处调用该栏目的链接为:{WAP_SITEURL}&a=page&catid=3 (catid=3 此处直接填写pc站该栏目对应的catid即可)
- <h1>{$title}</h1>
- <div class="reaf_info">作者:{$username} 日期:{date('m-d',strtotime($inputtime))}</div>
- <div class="read_content">{$content}</div>
完成!这样手机站可以直接调用内容了!
希望以上内容对你有所帮助!如果还有其他问题,请随时提问。 各类知识收集 拥有多年CMS企业建站经验,对 iCMS, Fastadmin, ClassCMS, LeCMS, PbootCMS, PHPCMS, 易优CMS, YzmCMS, 讯睿CMS, 极致CMS, Wordpress, HkCMS, YznCMS, WellCMS, ThinkCMF, 等各类cms的相互转化,程序开发,网站制作,bug修复,程序杀毒,插件定制都可以提供最佳解决方案。