
手机版
手机版太卡了
WeCenter 程序 • lxuanfeng 回复了问题 • 3 人关注 • 3 个回复 • 168 次浏览 • 3 天前
问个low的问题手机版logo和登录logo在那个路径
建站运营 • fanta 回复了问题 • 3 人关注 • 2 个回复 • 929 次浏览 • 2019-06-13 19:44
简单实现pc wap 微信 “三端”独立!
创意与设计 • 小疯子 发表了文章 • 3 个评论 • 2644 次浏览 • 2018-12-29 10:23
也就是手机浏览器访问的其实是pc端;
但又不想损失手机版前端的功能,特别是微信相关的如登录、分享接口等,所以微信端还是得保留跳转;
修改方法:
编辑/system/functions.inc.php
找到
function is_mobile($ignore_cookie = false)替换为
{
if (HTTP::get_cookie('_ignore_ua_check') == 'TRUE' AND !$ignore_cookie)
{
return false;
}
$user_agent = strtolower($_SERVER['HTTP_USER_AGENT']);
if (preg_match('/playstation/i', $user_agent) OR preg_match('/ipad/i', $user_agent) OR preg_match('/ucweb/i', $user_agent))
{
return false;
}
if (preg_match('/iemobile/i', $user_agent) OR preg_match('/mobile\ssafari/i', $user_agent) OR preg_match('/iphone\sos/i', $user_agent) OR preg_match('/android/i', $user_agent) OR preg_match('/symbian/i', $user_agent) OR preg_match('/series40/i', $user_agent))
{
return true;
}
return false;
}
function is_mobile($ignore_cookie = false) {搞定!
if(in_weixin()){
if (HTTP::get_cookie('_ignore_ua_check') == 'TRUE' AND !$ignore_cookie)
{
return false;
}
$user_agent = strtolower($_SERVER['HTTP_USER_AGENT']);
if (preg_match('/playstation/i', $user_agent) OR preg_match('/ipad/i', $user_agent) OR preg_match('/ucweb/i', $user_agent))
{
return false;
}
if (preg_match('/iemobile/i', $user_agent) OR preg_match('/mobile\ssafari/i', $user_agent) OR preg_match('/iphone\sos/i', $user_agent) OR preg_match('/android/i', $user_agent) OR preg_match('/symbian/i', $user_agent) OR preg_match('/series40/i', $user_agent))
{
return true;
}
return false;
}else{
return false;
}
}
就加了个in_weixin判断,在该行代码下方就能看到in_weixin这个函数,其实程序默认是有特别配置微信前端的,比如微信内访问是没有头部蓝条的。
手机版登录后无法退出
86077q 回复了问题 • 2 人关注 • 1 个回复 • 1066 次浏览 • 2017-05-16 13:14
[转载存档]WeCenter 三步实现手机版绑定二级域名移动m站
kenw2004 发表了文章 • 9 个评论 • 2926 次浏览 • 2017-03-24 13:35
WeCenter三步实现手机版绑定二级域名方法如下:
一、将m。你的域名。com解析到你的服务器(与www一样的解析方式)
二、修改index。php文件【将WeCenter换成你的域名】在include('system/system.php');后面添加如下代码大致10几行的样子
if ($_SERVER['HTTP_HOST'] == '你的m站网址') {
if (!is_mobile()) {
header('Location: http://你的PC站网址' . $_SERVER['REQUEST_URI']);exit;
}
} else if ($_SERVER['HTTP_HOST'] == '你的PC站网址') {
if (is_mobile()) {
header('Location: http://你的m站网址' . $_SERVER['REQUEST_URI']);
exit;
}
}
if (preg_match('#m\.(.*)#', $_SERVER['HTTP_HOST'])) {
$uri = $_SERVER['REQUEST_URI'];
if (!preg_match('#/account/#', $uri)) {
if (preg_match('#/?/m/#', $uri)) {
$uri = str_replace('/?/m/', '/', $uri);
}
if (preg_match('#^/\?/ajax/#', $uri)) {
$uri = str_replace('/?', '', $uri);
}
if (!preg_match('#/.+/ajax#', $uri)) {
if (is_mobile() && !preg_match('#^/m/#', $uri)) {
$_SERVER['REQUEST_URI'] = '/m' . $uri;
}
}
}
}
三、修改views/default/m目录下面的所有模板
只要模板是带有移动端m跳转的链接都要删除掉m(有点多,自行认真检查,以免部分未修改发生错误)
最好的方案就是将views/default/m先备份然后再修改,
形如
<ahref="m/login/"class="registerbtnbtn-default"><?php_e('登录');?></a>
改成这样
<ahref="/login/"class="registerbtnbtn-default"><?php_e('登录');?></a>
至此全部修改完成!
提醒:目前发现的问题就是在PC端的时候无法使用微信扫一扫登录,其他暂时没有发现。
微信中打开文章并分享到朋友圈以后,提示“文章不存在或已被删除”,查看链接后面多一个=
稻草人 回复了问题 • 15 人关注 • 6 个回复 • 2358 次浏览 • 2017-02-26 23:14

oushanzhe 回答了问题 • 2014-05-30 13:11 • 22 个回复 不感兴趣
再次升级模版!新增文章图文展示,简化问题列表,增强话题列表...测试站:ceshi.atyidu.com猛戳!
赞同来自:
微信中打开文章并分享到朋友圈以后,提示“文章不存在或已被删除”,查看链接后面多一个=
回复稻草人 回复了问题 • 15 人关注 • 6 个回复 • 2358 次浏览 • 2017-02-26 23:14
简单实现pc wap 微信 “三端”独立!
创意与设计 • 小疯子 发表了文章 • 3 个评论 • 2644 次浏览 • 2018-12-29 10:23
也就是手机浏览器访问的其实是pc端;
但又不想损失手机版前端的功能,特别是微信相关的如登录、分享接口等,所以微信端还是得保留跳转;
修改方法:
编辑/system/functions.inc.php
找到
function is_mobile($ignore_cookie = false)替换为
{
if (HTTP::get_cookie('_ignore_ua_check') == 'TRUE' AND !$ignore_cookie)
{
return false;
}
$user_agent = strtolower($_SERVER['HTTP_USER_AGENT']);
if (preg_match('/playstation/i', $user_agent) OR preg_match('/ipad/i', $user_agent) OR preg_match('/ucweb/i', $user_agent))
{
return false;
}
if (preg_match('/iemobile/i', $user_agent) OR preg_match('/mobile\ssafari/i', $user_agent) OR preg_match('/iphone\sos/i', $user_agent) OR preg_match('/android/i', $user_agent) OR preg_match('/symbian/i', $user_agent) OR preg_match('/series40/i', $user_agent))
{
return true;
}
return false;
}
function is_mobile($ignore_cookie = false) {搞定!
if(in_weixin()){
if (HTTP::get_cookie('_ignore_ua_check') == 'TRUE' AND !$ignore_cookie)
{
return false;
}
$user_agent = strtolower($_SERVER['HTTP_USER_AGENT']);
if (preg_match('/playstation/i', $user_agent) OR preg_match('/ipad/i', $user_agent) OR preg_match('/ucweb/i', $user_agent))
{
return false;
}
if (preg_match('/iemobile/i', $user_agent) OR preg_match('/mobile\ssafari/i', $user_agent) OR preg_match('/iphone\sos/i', $user_agent) OR preg_match('/android/i', $user_agent) OR preg_match('/symbian/i', $user_agent) OR preg_match('/series40/i', $user_agent))
{
return true;
}
return false;
}else{
return false;
}
}
就加了个in_weixin判断,在该行代码下方就能看到in_weixin这个函数,其实程序默认是有特别配置微信前端的,比如微信内访问是没有头部蓝条的。
[转载存档]WeCenter 三步实现手机版绑定二级域名移动m站
kenw2004 发表了文章 • 9 个评论 • 2926 次浏览 • 2017-03-24 13:35
WeCenter三步实现手机版绑定二级域名方法如下:
一、将m。你的域名。com解析到你的服务器(与www一样的解析方式)
二、修改index。php文件【将WeCenter换成你的域名】在include('system/system.php');后面添加如下代码大致10几行的样子
if ($_SERVER['HTTP_HOST'] == '你的m站网址') {
if (!is_mobile()) {
header('Location: http://你的PC站网址' . $_SERVER['REQUEST_URI']);exit;
}
} else if ($_SERVER['HTTP_HOST'] == '你的PC站网址') {
if (is_mobile()) {
header('Location: http://你的m站网址' . $_SERVER['REQUEST_URI']);
exit;
}
}
if (preg_match('#m\.(.*)#', $_SERVER['HTTP_HOST'])) {
$uri = $_SERVER['REQUEST_URI'];
if (!preg_match('#/account/#', $uri)) {
if (preg_match('#/?/m/#', $uri)) {
$uri = str_replace('/?/m/', '/', $uri);
}
if (preg_match('#^/\?/ajax/#', $uri)) {
$uri = str_replace('/?', '', $uri);
}
if (!preg_match('#/.+/ajax#', $uri)) {
if (is_mobile() && !preg_match('#^/m/#', $uri)) {
$_SERVER['REQUEST_URI'] = '/m' . $uri;
}
}
}
}
三、修改views/default/m目录下面的所有模板
只要模板是带有移动端m跳转的链接都要删除掉m(有点多,自行认真检查,以免部分未修改发生错误)
最好的方案就是将views/default/m先备份然后再修改,
形如
<ahref="m/login/"class="registerbtnbtn-default"><?php_e('登录');?></a>
改成这样
<ahref="/login/"class="registerbtnbtn-default"><?php_e('登录');?></a>
至此全部修改完成!
提醒:目前发现的问题就是在PC端的时候无法使用微信扫一扫登录,其他暂时没有发现。