本帖最后由 jaysoh 于 2009-11-12 21:34 编辑
1、修改network.php
- $acs = array('space', 'doing', 'blog', 'album', 'mtag', 'thread', 'share');
复制代码 改成:- $acs = array('space', 'doing', 'blog', 'album', 'mtag', 'thread', 'share', 'tag', 'invitefriend');
复制代码 接着- if($gvalue) $nexturl .= '&'.$gkey.'='.rawurlencode(stripslashes($gvalue));
复制代码 改为:- if($gvalue) $nexturl .= '&'.$gkey.'='.rawurlencode($gvalue);
复制代码 2、CP_FRIEND.PHP 按顺序一路下来
2.1在、- if(submitcheck('findsubmit')) {
-
- $wheresql = "username='$_POST[username]'";
- $parstr = 'username='.stripslashes($_POST['username']);
- if($_SCONFIG['realname']) {
- $wheresql .= " OR name='$_POST[username]'";
- $parstr = 'name='.stripslashes($_POST['username']);
- }
复制代码 下面添加:- $wheresql.="isinvite='0'";///把邀请的和好友分开
复制代码- //批量忽略
- $query = $_SGLOBAL['db']->query("SELECT uid FROM ".tname('friend')." WHERE fuid='$space[uid]' AND status='0' LIMIT 0,1");
复制代码 改为- //批量忽略
- $query = $_SGLOBAL['db']->query("SELECT uid FROM ".tname('friend')." WHERE fuid='$space[uid]' AND status='0' and isinvite='1' LIMIT 0,1");
复制代码
- $_SGLOBAL['db']->query("DELETE FROM ".tname('friend')." WHERE (uid='$uid' AND fuid='$fuid') OR (uid='$fuid' AND fuid='$uid')");
- //从用户中心删除
复制代码 改为:- $_SGLOBAL['db']->query("DELETE FROM ".tname('friend')." WHERE (uid='$uid' AND fuid='$fuid') OR (uid='$fuid' and isinvite='1' AND fuid='$uid')");
- //从用户中心删除
复制代码- //批量审核
- $query = $_SGLOBAL['db']->query("SELECT uid FROM ".tname('friend')." WHERE fuid='$space[uid]' AND status='0' LIMIT 0,1");
复制代码 改为:- //批量审核
- $query = $_SGLOBAL['db']->query("SELECT uid FROM ".tname('friend')." WHERE fuid='$space[uid]' AND status='0' and isinvite='0' LIMIT 0,1");
复制代码- //查找当前好友
- if($havas) {
- $query = $_SGLOBAL['db']->query("SELECT uid FROM ".tname('friend')." WHERE fuid='$_SGLOBAL[supe_uid]'");
复制代码 改为:- //查找当前好友
- if($havas) {
- $query = $_SGLOBAL['db']->query("SELECT uid FROM ".tname('friend')." WHERE fuid='$_SGLOBAL[supe_uid]' and isinvite='1'");
复制代码- //好友的好友
- $friendlist = array();
- if($space['feedfriend']) {
- $query = $_SGLOBAL['db']->query("SELECT fuid AS uid, fusername AS username FROM ".tname('friend')."
- WHERE uid IN (".$space['feedfriend'].") AND fuid NOT IN ($nouids) LIMIT 0,$maxnum");
复制代码 改为:- //好友的好友
- $friendlist = array();
- if($space['feedfriend']) {
- $query = $_SGLOBAL['db']->query("SELECT fuid AS uid, fusername AS username FROM ".tname('friend')."
- WHERE uid IN (".$space['feedfriend'].") AND fuid NOT IN ($nouids) and isinvite='0' LIMIT 0,$maxnum");
复制代码- //获得当前用户group
- $query = $_SGLOBAL['db']->query("SELECT * FROM ".tname('friend')." WHERE uid='$_SGLOBAL[supe_uid]' AND fuid='$uid'");
复制代码 改为:- //获得当前用户group
- $query = $_SGLOBAL['db']->query("SELECT * FROM ".tname('friend')." WHERE uid='$_SGLOBAL[supe_uid]' AND fuid='$uid' and isinvite='0'");
复制代码- if(submitcheck('groupsubmin')) {
- if(empty($_POST['fuids'])) {
- showmessage('please_correct_choice_groups_friend');
- }
- $ids = simplode($_POST['fuids']);
- $groupid = intval($_POST['group']);
- updatetable('friend', array('gid'=>$groupid), "uid='$_SGLOBAL[supe_uid]' AND fuid IN ($ids) AND status='1'");
复制代码 改为:- if(submitcheck('groupsubmin')) {
- if(empty($_POST['fuids'])) {
- showmessage('please_correct_choice_groups_friend');
- }
- $ids = simplode($_POST['fuids']);
- $groupid = intval($_POST['group']);
- updatetable('friend', array('gid'=>$groupid), "uid='$_SGLOBAL[supe_uid]' AND fuid IN ($ids) AND status='1' and isinvite='0'");
复制代码- $query = $_SGLOBAL['db']->query("SELECT main.fuid AS uid,main.fusername AS username, main.gid FROM ".tname('friend')." main
- LEFT JOIN ".tname('spacefield')." f ON f.uid=main.fuid
- WHERE main.uid='$space[uid]' AND main.status='1' $wheresql
复制代码 改为:- $query = $_SGLOBAL['db']->query("SELECT main.fuid AS uid,main.fusername AS username, main.gid FROM ".tname('friend')." main
- LEFT JOIN ".tname('spacefield')." f ON f.uid=main.fuid
- WHERE main.uid='$space[uid]' AND main.status='1' and isinvite='0' $wheresql
复制代码- $query = $_SGLOBAL['db']->query("SELECT s.*, sf.friend, f.* FROM ".tname('friend')." f
- LEFT JOIN ".tname('space')." s ON s.uid=f.uid
- LEFT JOIN ".tname('spacefield')." sf ON sf.uid=f.uid
- WHERE f.fuid='$space[uid]' AND f.status='0'
复制代码 改为:- $query = $_SGLOBAL['db']->query("SELECT s.*, sf.friend, f.* FROM ".tname('friend')." f
- LEFT JOIN ".tname('space')." s ON s.uid=f.uid
- LEFT JOIN ".tname('spacefield')." sf ON sf.uid=f.uid
- WHERE f.fuid='$space[uid]' and isinvite='0' AND f.status='0'
复制代码 3、SPACE_FRIEND.PHP
3.1=====- //好友分组
- $wheresql = '';
- if($space['self']) {
复制代码 改为:- //好友分组
- $wheresql = "and main.isinvite='0'";
- if($space['self']) {
复制代码- //搜索实名
- $uids = array();
- $query = $_SGLOBAL['db']->query("SELECT s.uid FROM ".tname('space')." s, ".tname('friend')." f
- WHERE s.name LIKE '%$get_key%' AND s.uid=f.fuid AND f.uid='$_SGLOBAL[supe_uid]' AND f.status='1'");
- while ($value = $_SGLOBAL['db']->fetch_array($query)) {
复制代码 改为:- //搜索实名
- $uids = array();
- $query = $_SGLOBAL['db']->query("SELECT s.uid FROM ".tname('space')." s, ".tname('friend')." f
- WHERE f.isinvite='0' and s.name LIKE '%$get_key%' AND s.uid=f.fuid AND f.uid='$_SGLOBAL[supe_uid]' AND f.status='1'");
- while ($value = $_SGLOBAL['db']->fetch_array($query)) {
复制代码- //取100好友用户名
- $query = $_SGLOBAL['db']->query("SELECT f.fusername, s.name, s.namestatus, s.groupid FROM ".tname('friend')." f
- LEFT JOIN ".tname('space')." s ON s.uid=f.fuid
- WHERE f.uid=$_SGLOBAL[supe_uid] AND f.status='1' ORDER BY f.num DESC, f.dateline DESC LIMIT 0,100");
- while ($value = $_SGLOBAL['db']->fetch_array($query)) {
复制代码 改为:- //取100好友用户名
- $query = $_SGLOBAL['db']->query("SELECT f.fusername, s.name, s.namestatus, s.groupid FROM ".tname('friend')." f
- LEFT JOIN ".tname('space')." s ON s.uid=f.fuid
- WHERE f.isinvite='0' and f.uid=$_SGLOBAL[supe_uid] AND f.status='1' ORDER BY f.num DESC, f.dateline DESC LIMIT 0,100");
- while ($value = $_SGLOBAL['db']->fetch_array($query)) {
复制代码 4、network_header.htm
任意位置添加- <li$actives[invitefriend]><a href="network.php?ac=invitefriend"><span>邀请的好友</span></a></li>
复制代码 SQL:- ALTER TABLE `uchome_space` ADD `invitefriends` INT( 100 ) DEFAULT '0' NOT NULL;
- ALTER TABLE `uchome_space` ADD `invitefriend` TEXT NOT NULL AFTER `invitefriends` ;
- ALTER TABLE `uchome_friend` ADD `isinvite` INT( 10 ) DEFAULT '0' NOT NULL ;
复制代码 |