1.软文推荐

2.软文推荐

3.软文推荐

杰奇cms2.4这个伪静态设置教程,相对于二次开发那些,这个确实是算简单的了。只需要根据网上的js自己补充而已,但是相对于每个模板都配置一条跳转规则,我还是有个简单的办法,不过还是得配合已经设置好的伪静态。在这篇教程里,小编就简单说明一下杰奇CMS电脑和手机端两边的配置。

比较重要的页面主要是首页,书库,分类,小说信息,充值,目录,小说阅读,但是一般来说目录和小说阅读的头部是放置在单个文件中,不和其它页面共用。

假如:

电脑端网址为:pc.xx.com

手机端网址为:wap.xx.com

教程开始:

1、首先是PC端的修改

1.在PC端的/themes/目录中找到当前设置的模板,进入后找到theme.html,在它的head标签对中加入如下代码:

<script?type="text/javascript">??????
function?browserRedirect()?{
??var?sUserAgent?=?navigator.userAgent.toLowerCase();
??var?bIsIpad?=?sUserAgent.match(/ipad/i)?==?"ipad";
??var?bIsIphoneOs?=?sUserAgent.match(/iphone?os/i)?==?"iphone?os";
??var?bIsMidp?=?sUserAgent.match(/midp/i)?==?"midp";
??var?bIsUc7?=?sUserAgent.match(/rv:1.2.3.4/i)?==?"rv:1.2.3.4";
??var?bIsUc?=?sUserAgent.match(/ucweb/i)?==?"ucweb";
??var?bIsAndroid?=?sUserAgent.match(/android/i)?==?"android";
??var?bIsCE?=?sUserAgent.match(/windows?ce/i)?==?"windows?ce";
??var?bIsWM?=?sUserAgent.match(/windows?mobile/i)?==?"windows?mobile";
??if(bIsIphoneOs?||?bIsMidp?||?bIsUc7?||?bIsUc?||?bIsAndroid?||?bIsCE?||?bIsWM){
??{?if?$jieqi_thisfile|basename?==?'articlefilter.php'?}
??window.location.href?=?"http://wap.xx.com/modules/article/articlefilter.php";
??{?else?if?$jieqi_thisfile|basename?==?'articlelist.php'?}
??window.location.href?=?"http://wap.xx.com/sort/{?$sortid?}/1.html";
??{?else?if?$jieqi_thisfile|basename?==?'buyegold.php'?}
??window.location.href?=?"http://wap.xx.com/modules/pay/buyegold.php";
??{?else?if?$jieqi_thisfile|basename?==?'articleinfo.php'?}
??window.location.href?=?"http://wap.xx.com/book/{?$articleid?}";
??{?else?}
??window.location.href?=?"http://wap.xx.com/";
??{?/if?}
??}
}
browserRedirect();
</script>

2.目录页和章节页头部可能在themer.html,也可能是/modules/article/templates/里面的style.html和index.html,同样是在head标签对加入如下代码。

<script?type="text/javascript">??????
function?browserRedirect()?{
??var?sUserAgent?=?navigator.userAgent.toLowerCase();
??var?bIsIpad?=?sUserAgent.match(/ipad/i)?==?"ipad";
??var?bIsIphoneOs?=?sUserAgent.match(/iphone?os/i)?==?"iphone?os";
??var?bIsMidp?=?sUserAgent.match(/midp/i)?==?"midp";
??var?bIsUc7?=?sUserAgent.match(/rv:1.2.3.4/i)?==?"rv:1.2.3.4";
??var?bIsUc?=?sUserAgent.match(/ucweb/i)?==?"ucweb";
??var?bIsAndroid?=?sUserAgent.match(/android/i)?==?"android";
??var?bIsCE?=?sUserAgent.match(/windows?ce/i)?==?"windows?ce";
??var?bIsWM?=?sUserAgent.match(/windows?mobile/i)?==?"windows?mobile";
??if(bIsIphoneOs?||?bIsMidp?||?bIsUc7?||?bIsUc?||?bIsAndroid?||?bIsCE?||?bIsWM){
??{?if?$jieqi_thisfile|basename?==?'reader.php'?}
??window.location.href?=?"http://wap.xx.com/index/{?$articleid?}/1/asc";
??{?else?if?$chapterid?!=?''?}
??window.location.href?=?"http://wap.xx.com/book/{?$articleid?}/{?$chapterid?}.html";
??{?else?}
??window.location.href?=?"http://wap.xx.com/";
??{?/if?}
??}
}
browserRedirect();
</script>

2、然后是WAP端的修改:

1.在WAP端的/themes/目录中找到当前设置的模板,进入后找到theme.html,在它的head标签对中加入如下代码:

<script>
??if(?navigator.userAgent.match(/Android/i)
?????||?navigator.userAgent.match(/webOS/i)
?????||?navigator.userAgent.match(/iPhone/i)
?????||?navigator.userAgent.match(/iPad/i)
?????||?navigator.userAgent.match(/iPod/i)
?????||?navigator.userAgent.match(/BlackBerry/i)
?????||?navigator.userAgent.match(/Windows?Phone/i)
????){
??}else{
??{?if?$jieqi_thisfile|basename?==?'articlefilter.php'?}
??window.location.href?=?"http://pc.xx.com/modules/article/articlefilter.php";
??{?else?if?$jieqi_thisfile|basename?==?'articlelist.php'?}
??window.location.href?=?"http://pc.xx.com/sort/{?$sortid?}/1.html";
??{?else?if?$jieqi_thisfile|basename?==?'buyegold.php'?}
??window.location.href?=?"http://pc.xx.com/modules/pay/buyegold.php";
??{?else?if?$jieqi_thisfile|basename?==?'articleinfo.php'?}
??window.location.href?=?"http://pc.xx.com/book/{?$articleid?}";
??{?else?}
??window.location.href?=?"http://pc.xx.com/";
??{?/if?}
??}
</script>

2.目录页和章节页和pc差不多相同,一样的逻辑,就是目录页面的细节不一样。

<script>
??if(?navigator.userAgent.match(/Android/i)
?????||?navigator.userAgent.match(/webOS/i)
?????||?navigator.userAgent.match(/iPhone/i)
?????||?navigator.userAgent.match(/iPad/i)
?????||?navigator.userAgent.match(/iPod/i)
?????||?navigator.userAgent.match(/BlackBerry/i)
?????||?navigator.userAgent.match(/Windows?Phone/i)
????){
??}else{
??{?if?$jieqi_thisfile|basename?==?'reader.php'?}
??window.location.href?=?"http://pc.xx.com/index/{?$articleid?}";
??{?else?if?$chapterid?!=?''?}
??window.location.href?=?"http://pc.xx.com/book/{?$articleid?}/{?$chapterid?}.html";
??{?else?}
??window.location.href?=?"http://pc.xx.com/";
??{?/if?}
??}
</script>

3、杰奇后台伪静态的设置

没写的自己按照格式写伪静态规则,或者不填。

小说信息页面伪静态规则:/book/<{$id}>

小说分类页面伪静态规则:/sort/<{$sortid}>/<{$page}>.html

排行榜页面伪静态规则:/top/<{$order}>/<{$page}>.html

书库伪静态规则:/book_<{$order}>_<{$rgroup}>_<{$sortid}>_<{$typeid}>_<{$words}>_<{$update}>_<{$initial}>_<{$isfull}>_<{$isvip}>_<{$page}>.html

小说目录页伪静态规则:/index/<{$aid}>

小说章节页伪静态规则:/book/<{$aid}>/<{$cid}>.html

搜索结果页伪静态规则:/search/<{$searchtype}>/<{$searchkey}>/<{$page}>.html

搜索结果页伪静态规则:/reviews/<{$aid}>/<{$page}>.html

标签列表页伪静态规则:/taglist/<{$sort}>/<{$page}>.html

apache伪静态,在根目录创建.htaccess

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ^templates/(.*).html$ /404.php

RewriteRule ^themes/(.*)/(.*).html$ /404.php

RewriteRule ^modules/(.*)/templates/$ /404.php

RewriteRule ^modules/(.*)/templates/(.*).html$ /404.php

RewriteRule ^book/([0-9]+)$ /modules/article/articleinfo.php?id=$1

本文来源:yuntue.com/post/11935.html,若侵权,请联系删除。

相关文章 8

1

详解C++中const使用方法 2分钟前

const 是 constant 的缩写,本意是不变的,不易改变的意思。在 C++ 中是用来修饰内置类型变量,自定义对象,成员函数,返回值,函数参数。...

2

同一营业执照可以申请办理2个不同的域名网站吗?(同一营业执照可以有两个地址吗) 3分钟前

本文转载,原地址:http://www.heyou51.com/zhishi/index.php?q-13967.html,原作者保留一切权利,若侵权请联系删除。...

3

珠海香洲外贸网站制作(珠海香洲官网) 4分钟前

广州合优网络科技有限公司 让您的网站走在互联网的前端!以最佳的用户体验,让客户随时随地找到您!所谓响应式网页建设,是指可以自...

4

使用Bash编写扫雷游戏 7分钟前

我在编程教学方面不是专家,但当我想更好掌握某一样东西时,会试着找出让自己乐在其中的方法。比方说,当我想在 shell 编程方面更进一...

5

Linux系统RPM详细使用教程 8分钟前

RPM是Linux系统非常重要的一个工具,除了核心模块不能通过RPM进行安装,其他模块均可通过RPM进行安装,下面良许教程网为大家分享一下Li...

6

app与小程序的区别(小程序和app区别) 10分钟前

小程序是一款基于微信的轻应用,面向10亿+的微信用户群体,具有四个特点:无需安装、无须卸载、触手可及、用完即走。因为它轻量、简...

7

简介Python3 面向对象 12分钟前

面向对象主要有三个特征:封装,继承,多态度,Python从设计之初就已经是一门面向对象的语言,正因为如此,在Python中创建一个类和对象是...

8

深受喜爱的5款Linux服务器发行版 14分钟前

当谈到不同版本的操作系统时,Linux在市场上的地位是不言而喻的。其实,在服务器市场,Linux同样占有不容忽视的地位。由于其稳定性,安...