Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[展示] 分享一个“推广之星” For UC2.0

[复制链接]
jaysoh 发表于 2009-11-12 21:54:02 | 显示全部楼层 |阅读模式
本帖最后由 jaysoh 于 2009-11-12 21:34 编辑

1、修改network.php

  1. $acs = array('space', 'doing', 'blog', 'album', 'mtag', 'thread', 'share');
复制代码
改成:
  1. $acs = array('space', 'doing', 'blog', 'album', 'mtag', 'thread', 'share', 'tag', 'invitefriend');
复制代码
接着
  1. if($gvalue) $nexturl .= '&'.$gkey.'='.rawurlencode(stripslashes($gvalue));
复制代码
改为:
  1. if($gvalue) $nexturl .= '&'.$gkey.'='.rawurlencode($gvalue);
复制代码
2、CP_FRIEND.PHP  按顺序一路下来
2.1在、
  1. if(submitcheck('findsubmit')) {
  2.        
  3.         $wheresql = "username='$_POST[username]'";
  4.         $parstr = 'username='.stripslashes($_POST['username']);
  5.         if($_SCONFIG['realname']) {
  6.                 $wheresql .= " OR name='$_POST[username]'";
  7.                 $parstr = 'name='.stripslashes($_POST['username']);
  8.         }
复制代码
下面添加:
  1. $wheresql.="isinvite='0'";///把邀请的和好友分开
复制代码
  1. //批量忽略
  2.                         $query = $_SGLOBAL['db']->query("SELECT uid FROM ".tname('friend')." WHERE fuid='$space[uid]' AND status='0' LIMIT 0,1");
复制代码
改为
  1. //批量忽略
  2.                         $query = $_SGLOBAL['db']->query("SELECT uid FROM ".tname('friend')." WHERE fuid='$space[uid]' AND status='0' and          isinvite='1'  LIMIT 0,1");
复制代码

  1. $_SGLOBAL['db']->query("DELETE FROM ".tname('friend')." WHERE (uid='$uid' AND fuid='$fuid') OR (uid='$fuid' AND fuid='$uid')");
  2.                                 //从用户中心删除
复制代码
改为:
  1. $_SGLOBAL['db']->query("DELETE FROM ".tname('friend')." WHERE (uid='$uid' AND fuid='$fuid') OR (uid='$fuid' and         isinvite='1' AND fuid='$uid')");
  2.                                 //从用户中心删除

复制代码
  1. //批量审核
  2.                 $query = $_SGLOBAL['db']->query("SELECT uid FROM ".tname('friend')." WHERE fuid='$space[uid]' AND status='0' LIMIT 0,1");
复制代码
改为:
  1. //批量审核
  2.                 $query = $_SGLOBAL['db']->query("SELECT uid FROM ".tname('friend')." WHERE fuid='$space[uid]' AND status='0' and isinvite='0' LIMIT 0,1");

复制代码
  1. //查找当前好友
  2.         if($havas) {
  3.                 $query = $_SGLOBAL['db']->query("SELECT uid FROM ".tname('friend')." WHERE fuid='$_SGLOBAL[supe_uid]'");
复制代码
改为:
  1. //查找当前好友
  2.         if($havas) {
  3.                 $query = $_SGLOBAL['db']->query("SELECT uid FROM ".tname('friend')." WHERE fuid='$_SGLOBAL[supe_uid]' and         isinvite='1'");
复制代码
  1. //好友的好友
  2.         $friendlist = array();
  3.         if($space['feedfriend']) {
  4.                 $query = $_SGLOBAL['db']->query("SELECT fuid AS uid, fusername AS username FROM ".tname('friend')."
  5.                         WHERE uid IN (".$space['feedfriend'].") AND fuid NOT IN ($nouids) LIMIT 0,$maxnum");
复制代码
改为:
  1. //好友的好友
  2.         $friendlist = array();
  3.         if($space['feedfriend']) {
  4.                 $query = $_SGLOBAL['db']->query("SELECT fuid AS uid, fusername AS username FROM ".tname('friend')."
  5.                         WHERE uid IN (".$space['feedfriend'].") AND fuid NOT IN ($nouids) and isinvite='0' LIMIT 0,$maxnum");
复制代码
  1. //获得当前用户group
  2.         $query = $_SGLOBAL['db']->query("SELECT * FROM ".tname('friend')." WHERE uid='$_SGLOBAL[supe_uid]' AND fuid='$uid'");
复制代码
改为:
  1. //获得当前用户group
  2.         $query = $_SGLOBAL['db']->query("SELECT * FROM ".tname('friend')." WHERE uid='$_SGLOBAL[supe_uid]' AND fuid='$uid' and isinvite='0'");
复制代码
  1. if(submitcheck('groupsubmin')) {
  2.                 if(empty($_POST['fuids'])) {
  3.                         showmessage('please_correct_choice_groups_friend');
  4.                 }
  5.                 $ids = simplode($_POST['fuids']);
  6.                 $groupid = intval($_POST['group']);
  7.                 updatetable('friend', array('gid'=>$groupid), "uid='$_SGLOBAL[supe_uid]' AND fuid IN ($ids) AND status='1'");
复制代码
改为:
  1. if(submitcheck('groupsubmin')) {
  2.                 if(empty($_POST['fuids'])) {
  3.                         showmessage('please_correct_choice_groups_friend');
  4.                 }
  5.                 $ids = simplode($_POST['fuids']);
  6.                 $groupid = intval($_POST['group']);
  7.                 updatetable('friend', array('gid'=>$groupid), "uid='$_SGLOBAL[supe_uid]' AND fuid IN ($ids) AND status='1'  and isinvite='0'");
复制代码
  1. $query = $_SGLOBAL['db']->query("SELECT main.fuid AS uid,main.fusername AS username, main.gid FROM ".tname('friend')." main
  2.                         LEFT JOIN ".tname('spacefield')." f ON f.uid=main.fuid
  3.                         WHERE main.uid='$space[uid]' AND main.status='1' $wheresql
复制代码
改为:
  1. $query = $_SGLOBAL['db']->query("SELECT main.fuid AS uid,main.fusername AS username, main.gid FROM ".tname('friend')." main
  2.                         LEFT JOIN ".tname('spacefield')." f ON f.uid=main.fuid
  3.                         WHERE main.uid='$space[uid]' AND main.status='1'  and isinvite='0' $wheresql
复制代码
  1. $query = $_SGLOBAL['db']->query("SELECT s.*, sf.friend, f.* FROM ".tname('friend')." f
  2.                 LEFT JOIN ".tname('space')." s ON s.uid=f.uid
  3.                 LEFT JOIN ".tname('spacefield')." sf ON sf.uid=f.uid
  4.                 WHERE f.fuid='$space[uid]' AND f.status='0'
复制代码
改为:
  1. $query = $_SGLOBAL['db']->query("SELECT s.*, sf.friend, f.* FROM ".tname('friend')." f
  2.                 LEFT JOIN ".tname('space')." s ON s.uid=f.uid
  3.                 LEFT JOIN ".tname('spacefield')." sf ON sf.uid=f.uid
  4.                 WHERE f.fuid='$space[uid]' and  isinvite='0' AND f.status='0'
复制代码
3、SPACE_FRIEND.PHP
3.1=====
  1. //好友分组
  2.         $wheresql = '';
  3.         if($space['self']) {
复制代码
改为:
  1. //好友分组
  2.         $wheresql = "and main.isinvite='0'";
  3.         if($space['self']) {
复制代码
  1. //搜索实名
  2.                                 $uids = array();
  3.                                 $query = $_SGLOBAL['db']->query("SELECT s.uid FROM ".tname('space')." s, ".tname('friend')." f
  4.                                         WHERE s.name LIKE '%$get_key%' AND s.uid=f.fuid AND f.uid='$_SGLOBAL[supe_uid]' AND f.status='1'");
  5.                                 while ($value = $_SGLOBAL['db']->fetch_array($query)) {
复制代码
改为:
  1. //搜索实名
  2.                                 $uids = array();
  3.                                 $query = $_SGLOBAL['db']->query("SELECT s.uid FROM ".tname('space')." s, ".tname('friend')." f
  4.                                         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'");
  5.                                 while ($value = $_SGLOBAL['db']->fetch_array($query)) {
复制代码
  1. //取100好友用户名
  2.                 $query = $_SGLOBAL['db']->query("SELECT f.fusername, s.name, s.namestatus, s.groupid FROM ".tname('friend')." f
  3.                         LEFT JOIN ".tname('space')." s ON s.uid=f.fuid
  4.                         WHERE f.uid=$_SGLOBAL[supe_uid] AND f.status='1' ORDER BY f.num DESC, f.dateline DESC LIMIT 0,100");
  5.                 while ($value = $_SGLOBAL['db']->fetch_array($query)) {
复制代码
改为:
  1. //取100好友用户名
  2.                 $query = $_SGLOBAL['db']->query("SELECT f.fusername, s.name, s.namestatus, s.groupid FROM ".tname('friend')." f
  3.                         LEFT JOIN ".tname('space')." s ON s.uid=f.fuid
  4.                         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");
  5.                 while ($value = $_SGLOBAL['db']->fetch_array($query)) {
复制代码
4、network_header.htm
任意位置添加
  1. <li$actives[invitefriend]><a href="network.php?ac=invitefriend"><span>邀请的好友</span></a></li>
复制代码
SQL:
  1. ALTER TABLE `uchome_space` ADD `invitefriends` INT( 100 ) DEFAULT '0' NOT NULL;
  2. ALTER TABLE `uchome_space` ADD `invitefriend` TEXT NOT NULL AFTER `invitefriends` ;
  3. ALTER TABLE `uchome_friend` ADD `isinvite` INT( 10 ) DEFAULT '0' NOT NULL ;
复制代码

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
落寞纷繁 发表于 2009-11-12 22:12:22 | 显示全部楼层
是2.0的吗?????
回复

使用道具 举报

杰克王伦 发表于 2009-11-12 22:20:51 | 显示全部楼层
这是个什么东西,作用?
回复

使用道具 举报

 楼主| jaysoh 发表于 2009-11-12 23:05:20 | 显示全部楼层
是2.0的吗?????
落寞纷繁 发表于 2009-11-12 08:42 PM

对是2.0的
回复

使用道具 举报

dansui1314 发表于 2009-11-13 04:34:19 | 显示全部楼层
有没有演示啊
回复

使用道具 举报

abcnic18 发表于 2009-11-13 08:42:20 | 显示全部楼层
好东西!!!
回复

使用道具 举报

bigdreamer 发表于 2009-11-13 09:29:52 | 显示全部楼层
不错,看看先
回复

使用道具 举报

careerhome 发表于 2009-11-13 09:35:39 | 显示全部楼层
听着可以。。。。。。。。。。
回复

使用道具 举报

wade8 发表于 2009-11-13 15:18:16 | 显示全部楼层
楼主给个演示啊
不然不知道改过之后的效果啊
回复

使用道具 举报

Imabird 发表于 2009-11-13 16:34:51 | 显示全部楼层
.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-11-15 07:47 , Processed in 0.032092 second(s), 3 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表