}
tologin();
if ($action == 'follow') {
    $follow = $_POST['follow'];
    $follownew = array();
    for ($i = 0; $i < count($follow); $i++) {
        $isfriend = isfriend($follow[$i], $my[user_id]);
        if ($isfriend == 0 && $follow[$i] != $my[user_id]) {
            $follownew[] = $follow[$i];
        }
    }
    if ($follownew) {
        for ($j = 0; $j < count($follownew); $j++) {
            $db->query("INSERT INTO et_friend  (fid_jieshou,fid_fasong) VALUES ('{$follownew[$j]}','{$my['user_id']}')");
            frinum($my[user_id]);
            frinum($follownew[$j]);
        }
    }
    header("location: {$webaddr}/op/setting");
    exit;
}
$query = $db->query("SELECT * FROM et_users WHERE user_id=1 || (followme_num>0 && lastconttime>0) ORDER BY followme_num DESC LIMIT 10");
while ($data = $db->fetch_array($query)) {
    $uhead = $data['user_head'] ? "{$webaddr}/attachments/head/" . $data['user_head'] : "{$webaddr}/images/noavatar.jpg";
    $follows[] = array('user_id' => $data['user_id'], 'user_name' => $data['user_name'], 'nickname' => $data['nickname'], 'user_head' => $uhead, 'lastcontent' => ubb($data['lastcontent']), 'lastconttime' => timeop($data['lastconttime']), 'followme_num' => $data['followme_num'], 'msg_num' => $data['msg_num']);
}
//模板和Foot
$web_name3 = "新来乍到";
$sqlnum = $db->querynum;
$mtime = explode(' ', microtime());
$loadtime = $mtime[1] + $mtime[0] - $starttime;
    $uname = idtoname($uid);
    if (!$uname) {
        echo "<div class='showmag'><p>该用户不存在或者已经被管理员删除!</p><p><a href='index.php?op=friends'>返回我的关注</a></p></div>";
        wapfooter();
        exit;
    }
    $isfriend = isfriend($uid, $user_id);
    if ($isfriend['fri'] == 0) {
        echo "<div class='showmag'><p>您没有关注此用户!</p><p><a href='index.php?op=friends'>返回我的关注</a></p></div>";
        wapfooter();
        exit;
    }
    if ($isfriend['fri'] == 1) {
        $db->query("DELETE FROM et_friend WHERE fid_fasong='{$user_id}' && fid_jieshou='{$uid}'");
        frinum($user_id);
        frinum($uid);
        echo "<div class='showmag'><p>解除关注成功!</p><p><a href='index.php?op=friends'>返回我的关注</a></p></div>";
        wapfooter();
        exit;
    }
}
//导航
if ($fop == "fri") {
    echo "<h2>我关注 | <a href='index.php?op=friends&fop=fol'>关注我</a> | <a href='index.php?op=friends&fop=all'>好友</a></h2>";
} else {
    if ($fop == "fol") {
        echo "<h2><a href='index.php?op=friends&fop=fri'>我关注</a> | 关注我 | <a href='index.php?op=friends&fop=all'>好友</a></h2>";
    } else {
        if ($fop == "all") {
            echo "<h2><a href='index.php?op=friends&fop=fri'>我关注</a> | <a href='index.php?op=friends&fop=fol'>关注我</a> | 好友</h2>";
        }
Example #3
0
//删除好友 friends
if ($act == "frienddel") {
    tologin();
    if (!idtoname($user[user_id])) {
        echo "该用户不存在或者已经被管理员删除!";
        exit;
    }
    $isfriend = isfriend($user[user_id], $my[user_id]);
    if ($isfriend['fri'] == 0) {
        echo "您没有关注此用户!";
        exit;
    }
    if ($isfriend['fri'] == 1) {
        $db->query("DELETE FROM et_friend WHERE fid_fasong='{$my['user_id']}' && fid_jieshou='{$user['user_id']}'");
        frinum($my[user_id]);
        frinum($user[user_id]);
        fsock($user[user_id], "【小T提醒】 " . $my[user_name] . "解除了对你的关注,你去看看TA吧,TA的地址:" . $webaddr . "/home/u." . $my[user_id]);
        echo "success";
        exit;
    }
}
//以下是 发送 代码
if ($action == "msgsend") {
    tologin();
    $content = daddslashes(trim($_POST["content"]));
    $toid = $_POST["toid"];
    $status_id = $_POST["status_id"];
    $status_type = $_POST["status_type"];
    $topid = $_POST["topid"] ? $_POST["topid"] : 0;
    $toname = idtoname($toid);
    if (!empty($content)) {