关于 fee主题免费版的qq快速获取信息功能的修复问题解决方法
通过qq快速昵称和邮箱功能有利于给用户提供评论的快捷方式,增强与用户的交流互动。
修复步骤:
1.打开以下主题 模板路径文件
content/templates /fee /static/js /mian.js
查找搜索关键字: //qq获取资料
将整个关于qq获取资料的代码全部替换为以下
//qq获取资料 wep.vipyshy.com
$("#qqhao").blur(function() {
$("#qqhao").attr("disabled", false);
$("#error1").html('<img src="' + pjaxtheme + 'static/img/loading.gif">');
$.ajax({
url: pjaxtheme + "inc/qq.php?qq=" + $("#qqhao").val(),
type: "GET",
dataType: "jsonp",
success: function(a) {
if (a.name) {
$("#error1").hide();
$("#author").val(a.name);
$("#email").val($("#qqhao").val() + "@qq.com");
$("#url").val("http://user.qzone.qq.com/" + $("#qqhao").val());
$("#qqhao").attr("disabled", true)
} else {
$("#error1").hide();
$(".comment-form-qq").removeAttr("disabled");
$("#error1").html('<img src="' + pjaxtheme + 'static/img/error.png"> qq账号错误').show().fadeOut(4E3)
}
},
error: function(a, b, c) {
$("#error1").hide();
$(".comment-form-qq").removeAttr("disabled");
$("#error1").html('<img src="' + pjaxtheme + 'static/img/error.png"> qq账号错误').show().fadeOut(4E3)
}
})
});
2.在路径 content / templates / fee / inc / 增加文件名为 qq.php的文件
<?php
header("Content-type: application/json; charset=utf-8");
$qq = $_GET['qq'];
$html = file_get_contents('http://r.qzone.qq.com/fcg-bin/cgi_get_portrait.fcg?uins='.$qq);
$nic = explode(',',$html);
$name = trim(mb_convert_encoding($nic[6], "UTF-8", "GBK"),'"');
$img = file_get_contents('http://ptlogin2.qq.com/getface?appid=1006102&uin='.$qq.'&imgtype=3');
preg_match('/pt.setHeader\((.*?)\);/',$img,$picc);
$pic = json_decode($picc[1]);
$json['name'] = $name;
$json['pic'] = $pic->$qq;
echo $_GET['callback'].'('.json_encode($json).')';
?>
3.清除下浏览器缓存,重新刷新即可使用qq快速获取信息功能了。
评论