PHPCMS-V9 system to build WAP website and single page

Source: Internet
Author: User

If you need to bind the domain name as wap.domain.com, do as follows: First, bind the wap.domain.com domain name to your website host. Second, in the website backstage-module-the mobile phone portal domain name fill in "http://wap.domain.com/"third, in the revision of the route.php (in caches/configs directory), add a row to the filereturnArray ('default'=>array ('m'='content','C'='Index','a'='Init'),'wap.domain.com'=>array ('m'='WAP','C'='Index','a'='Init','Data'=>array ('GET'=>array ('SiteID'=1)) ,); The bindings have been successful here,
But why do you want to enter http://wap.domain.com/index.php can only access it? Enter HTTP directly://wap.domain.com/? The answer is yes.
Do the following:Iv. on the homepage or in header.html Add the following code:<script>Try{if(Self.location = ="http://wap.domain.com/") {Top.location.href="http://wap.domain.com/index.php"; }}Catch(e) {}</script>after the above 4 steps to complete the WAP mobile station building, example can see wap.domain.com wap template can be found in the Phpcms V9 Admin Center interface template style to find the changes!wap.domain.com have made some changes to the template, we can refer to. The current PHPCMS V9 mobile Site settings are a little weak, bound columns can not set the selection template, and can not tie the order page pages. However, you can customize the page to bind the order pages this feature:
  1, modify phpcms\modules\wap\index.php, add function page () functions://DIY single pagefunction page () {$WAP= $ This-WAP; $TYPE= $ This-types; $WAP _setting= String2array ($WAP ['setting']); $GLOBALS ['SiteID'] = MAX ($ This->siteid,1); Include Template ('WAP','page'); } can be added after function maps (). The general meaning of this section of function page () is to add a page model that can be index.php? m=wap&a=page to access the page template under the WAP template directory for your phone.
  2, the new page.html template file is added to the WAP template directory of mobile phone.
  3, in the mobile phone header.html template to add a custom link, although in the background settings do not see a single page of the column, but can actually call a single page of data, you can flexibly define a single page template page.html file, to achieve different CATID access to different content. Example: page.html template settings:
{PHP $catid= $_get['CATID'];} {PC:GetSql="SELECT * from Cmsyou_page WHERE catid= ' $catid '"Cache="0" return="Data"} {loop $data $val} {$val [content]}-{$catid} {/Loop} {/PC} This can be done by index.php? m=wap&a=page&catid=2, access to the background column ID 2 of the single page content

PHPCMS-V9 system to build WAP website and single page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.