1、找到inc/AspCms_MainClass.asp文件
2、找到inc/aspcms_CommonFun.asp文件
最底部加上:
约66行:修改为: '检测客户端,手机加上wap defaultTemplate=checkClient()&rs("defaultTemplate") |
2、找到inc/aspcms_CommonFun.asp文件
最底部加上:
'检测客户端 Function checkClient() dim HTTP_ACCEPT,HTTP_USER_AGENT,HTTP_X_WAP_PROFILE,HTTP_UA_OS,HTTP_VIA HTTP_ACCEPT=Request.ServerVariables("HTTP_ACCEPT") '获取浏览器信息 HTTP_USER_AGENT=LCase(Request.ServerVariables("HTTP_USER_AGENT")) '获取AGENT HTTP_X_WAP_PROFILE=Request.ServerVariables("HTTP_X_WAP_PROFILE") 'WAP特定信息 品牌机自带浏览器都会有 HTTP_UA_OS=Request.ServerVariables("HTTP_UA_OS") '手机系统 电脑为空 HTTP_VIA=LCase(Request.ServerVariables("HTTP_VIA")) '网关信息 Dim WapStr WAPstr=False If ubound(split(HTTP_ACCEPT,"vnd.wap"))>0 Then WAPstr=True If HTTP_USER_AGENT="" Then WAPstr=True If HTTP_X_WAP_PROFILE<>"" Then WAPstr=True If HTTP_UA_OS<>"" Then WAPstr=True IF ubound(split(HTTP_VIA,"wap"))>0 Then WAPstr=True IF ubound(split(HTTP_USER_AGENT,"netfront"))>0 Then WAPstr=True IF ubound(split(HTTP_USER_AGENT,"iphone"))>0 Then WAPstr=True IF ubound(split(HTTP_USER_AGENT,"opera mini"))>0 Then WAPstr=True IF ubound(split(HTTP_USER_AGENT,"ucweb"))>0 Then WAPstr=True IF ubound(split(HTTP_USER_AGENT,"windows ce"))>0 Then WAPstr=True IF ubound(split(HTTP_USER_AGENT,"symbianos"))>0 Then WAPstr=True IF ubound(split(HTTP_USER_AGENT,"java"))>0 Then WAPstr=True IF ubound(split(HTTP_USER_AGENT,"android"))>0 Then WAPstr=True If WAPstr=True Then checkClient="wap" else checkClient="" End if End Function |
3、在模板文件夹下,例如模版文件夹:abc,
那么复制一份,重命名为:wapabc
到此,使用手机访问ASPCMS站点,即可访问 wapabc 模板下的模板文件。
ASPCMS258下载
转载请注明:ASPcms» ASPCMS支持手机版[更新258支持],aspcms添加手机端
标签: