群组邀请好友BUG修正 for Discuz_X2_RC之前版本

Discuz!X群组邀请好友BUG,当我们任意选择一个非“全部好友”的好友分组后,接着再选择“全部好友”的好友分组,

这时就可以看到问题了,好友框中好友不显示了。

好友去哪了?让我们把好友找回来吧。

先贴上一张群组邀请页面浏览器显示的源代码:

在这一张图中,不难看出有用户分组ID与全部好友分组ID重复,所以导致不能正常显示全部好友。

接下来,请使用以下的修改方法:

1.打开invite.htm文件,             /template/default/common


(如使用“Discuz_X2_Beta_SC_GBK”或之前的版本,请进行下面的修改。)

查找:

<option value="0">{lang invite_all_friend}</option>

改为:

<option value="-1">{lang invite_all_friend}</option>

2.打开spacecp_friend.php文件,        /source/include/spacecp/

(如使用“Discuz! X1.5 Release 20101228”或之前的版本,请进行下面的修改。)

查找:

$page = empty($_G['gp_page'])?0:intval($_G['gp_page']);
if($page<1) $page = 1;
$start = ($page-1) * $perpage;
$json = array();
$wheresql = '';
if($_G['gp_gid']) {
$gid = intval($_G['gp_gid']);
$wheresql = " AND gid='$gid'";
}
$singlenum = 0;
$count = DB::result(DB::query("SELECT COUNT(*) FROM ".DB::table('home_friend')." WHERE uid='$_G[uid]' $wheresql"), 0);

改为:

$page = empty($_G['gp_page'])?0:intval($_G['gp_page']);
$gid = isset($_G['gp_gid']) ? intval($_G['gp_gid']) : -1;
if($page<1) $page = 1;
$start = ($page-1) * $perpage;
$json = array();
$wheresql = '';
if($gid > -1) {
$wheresql = " AND gid='$gid'";
}
$singlenum = 0;
$count = DB::result_first("SELECT COUNT(*) FROM ".DB::table('home_friend')." WHERE uid='$_G[uid]' $wheresql");

相关文章:

1、DISCUZ!X 2.5上传图片后缩略图无水印
https://www.onexin.net/discuz-x-2-5-upload-picture-thumbnail-no-watermark/

2、Discuz!X站内开启视频播放代码
https://www.onexin.net/discuz-x-stations-open-video-player-code/

3、Discuz!X 2.5升级前与升级后(笔记)
https://www.onexin.net/discuz-x-2-5-upgrade-before-and-after-the-upgrade-notes/

4、升级Discuz!X X2后我们可以设置的优化(网站加速)
https://www.onexin.net/upgrade-discuz-x-x2-later-we-can-set-the-optimization-website-acceleration/

5、[原创]Discuz!X多国语言实现方法,欢迎点评
https://www.onexin.net/original-discuz-x-multi-language-implementations-please-comment/

转载请注明出处:https://www.onexin.net/bug-invite-friends-group-before-correction-for-discuz_x2_rc-version/

Leave a Reply

Your email address will not be published. Required fields are marked *