本文转载自小草窝,以emlog大前端主题为示例
首先在module.php里面加以下代码
- <?php //获取QQ信息
- function getqqtx($qq){
- $url="https://q.qlogo.cn/headimg_dl?bs=qq&dst_uin=$qq&src_uin=qq.feixue.me&fid=blog&spec=100";
- return $url;}
- if(isset($_POST[’qq’])){
- if(empty($_POST[’qq’])){
- echo "@@({comname:’QQ账号错误’,commail:’QQ账号错误’,comurl:’QQ账号错误’,toux:’https://q.qlogo.cn/headimg_dl?bs=qq&dst_uin=34109680&src_uin=qq.feixue.me&fid=blog&spec=100’})@@";
- return ;
- }
- $spurl = "https://r.pengyou.com/fcg-bin/cgi_get_portrait.fcg?uins={$_POST[’qq’]}";
- $data = file_get_contents($spurl);
- $nc=explode(’"’,$data);
- $s=$nc[5];
- $bm=mb_convert_encoding($s,’UTF-8’,’UTF-8,GBK,GB2312,BIG5’);
- if(empty($bm)){echo "@@({comname:’QQ账号错误’,commail:’QQ账号错误’,comurl:’QQ账号错误’,toux:’https://q.qlogo.cn/headimg_dl?bs=qq&dst_uin=34109680&src_uin=qq.feixue.me&fid=blog&spec=100’})@@";}
- else{echo "@@({comname:’{$bm}’,commail:’{$_POST[’qq’]}@qq.com’,comurl:’https://user.qzone.qq.com/{$_POST[’qq’]}’,toux:’https://q.qlogo.cn/headimg_dl?bs=qq&dst_uin={$_POST[’qq’]}&src_uin=qq.feixue.me&fid=blog&spec=100’})@@";}}
- function getqqxx($qq,$role=’’){
- if(!empty($role)){
- return $role;
- }
- $ssud=explode("@",$qq,2);
- if($ssud[1]==’qq.com’){
- return getqqtx($ssud[0]);
- }else{
- return MyGravatar($qq,$role);
- }}
- ?>
直接加在module最后一行即可,然后在module.php 472行上面添加以下代码
- <div id="loging"> </div>
- <div class="form-group">
- <div class="comment-form-author form-group has-feedback"> <div class="input-group"> <div class="input-group-addon"><i class="fa fa-qq"></i></div> <input class="form-control" placeholder="QQ号码" id="qqnum" name="qqnum" type="text" size="30" value="" onblur="huoquqq()"> </div> </div>
- </div>
添加完后:
然后继续在module.php里面找到
myGravatar
这个替换成
getqqtx
有多少就替换多少吧
然后
getqqtx($email,$role=’’
修改替换成
myGravatar($email,$role=’’
接着
module.php搜索images/noAvator.jpg
加上id="toux"
最后
在main.js添加
- function huoquqq() {
- $(’#loging’).html(’<img src="https://www.wemcc.com/content/templates/vivid/img/loading.gif"><a style="font-size:12px;margin-left:5px;">u6b63u5728u83b7u53d6QQu4fe1u606f..</a>’);
- var urls = window.location.href;
- $.ajax({
- url: urls,
- type: "POST",
- data: {
- "qq": $(’#qqnum’).val()
- },
- dataType: "html",
- success: function(c) {
- var josn = eval("" + c.split(’@@’)[1].split(’@@’)[0] + "");
- $(’#loging’).html(" ");
- $(’#comname’).val(josn.comname);
- $(’#commail’).val(josn.commail);
- $(’#comurl’).val(josn.comurl);
- $(".none_user").html(josn.comname);
- $(’#toux’).attr("src", josn.toux);
- }
- });
- }
Warning: A non-numeric value encountered in /www/wwwroot/www.fxmiao.net/wp-content/themes/dux/modules/mo_comments_list.php on line 26
@油条:.。
Warning: A non-numeric value encountered in /www/wwwroot/www.fxmiao.net/wp-content/themes/dux/modules/mo_comments_list.php on line 26
[汗]
Warning: A non-numeric value encountered in /www/wwwroot/www.fxmiao.net/wp-content/themes/dux/modules/mo_comments_list.php on line 26
[调戏]不错
Warning: A non-numeric value encountered in /www/wwwroot/www.fxmiao.net/wp-content/themes/dux/modules/mo_comments_list.php on line 26
@渍渍渍:嘻嘻
Warning: A non-numeric value encountered in /www/wwwroot/www.fxmiao.net/wp-content/themes/dux/modules/mo_comments_list.php on line 26
[愤怒][愤怒]
Warning: A non-numeric value encountered in /www/wwwroot/www.fxmiao.net/wp-content/themes/dux/modules/mo_comments_list.php on line 26
知道怎么添加表情吗[微笑]
Warning: A non-numeric value encountered in /www/wwwroot/www.fxmiao.net/wp-content/themes/dux/modules/mo_comments_list.php on line 26
@心已成佛:可能失效了,新主题自带这个功能
Warning: A non-numeric value encountered in /www/wwwroot/www.fxmiao.net/wp-content/themes/dux/modules/mo_comments_list.php on line 26
为什么我的就是不成功?
Warning: A non-numeric value encountered in /www/wwwroot/www.fxmiao.net/wp-content/themes/dux/modules/mo_comments_list.php on line 26
大神
Warning: A non-numeric value encountered in /www/wwwroot/www.fxmiao.net/wp-content/themes/dux/modules/mo_comments_list.php on line 26
大神