예제 #1
1
function GamePage()
{
    global $base_uri;
    $uid = params('user');
    if (!isset($_SESSION['uid'])) {
        return 0;
    } else {
        createToken($_SESSION['uid']);
    }
    $reg = 0;
    $shit = 0;
    if (!isset($uid) || $uid == "") {
        $uid = $_SESSION['uid'];
    } else {
        if (!check_registration($uid)) {
            $reg = 1;
        }
        $shit = 1;
    }
    $user = getUserInfo($_SESSION['access_token'], $uid, 'photo_max');
    if ($reg) {
        register($uid, $user['first_name'], $user['last_name']);
    }
    echo $user['first_name'] . " " . $user['last_name'];
    echo "<img src=\"" . $user['photo_max'] . "\" /><br><br>";
    if ($shit) {
        echo "<a href=\"/shit/" . $_SESSION['uid'] . "/" . $uid . "/" . getToken($_SESSION['uid']) . "\">shit</a><br>";
    }
    $friends = getUserFriends($_SESSION['access_token'], $uid);
    foreach ($friends as $friend) {
        echo $friend["first_name"] . " " . $friend["last_name"] . "<br>";
        echo "<a href=\"{$base_uri}/game/" . $friend['uid'] . "\"><img src=\"" . $friend["photo_50"] . "\" /></a><hr>";
    }
}
예제 #2
0
 public function feed()
 {
     //好友动态
     $friendArray = getUserFriends($this->mid);
     $friends = implode(',', $friendArray);
     $map = "userId in (" . $friends . ")";
     $friendFeed = D('UserFeed')->findAll($map, '*', 'cTime desc', '50');
     $this->assign('friendFeed', $friendFeed);
     $this->display();
 }
예제 #3
0
 public function getFriends()
 {
     $response['friends'] = array();
     $response['signed'] = false;
     if (isset($_SESSION["user_id"]) && strlen(trim($_SESSION["user_id"])) > 0) {
         $response['signed'] = true;
         $response['user_id'] = $_SESSION["user_id"];
         $response['friends'] = getUserFriends($_SESSION["user_id"]);
     }
     echo json_encode($response);
 }
예제 #4
0
 function friends()
 {
     $friends = getUserFriends($this->mid);
     $friends = implode(',', $friends);
     $map = "userId in (" . $friends . ")";
     $dao = D('UserShare');
     $count = $dao->count($map);
     $rows = 10;
     $p = new Page($count, $rows);
     $voList = $dao->findAll($map, '*', 'cTime desc', $p->firstRow . ',' . $p->listRows);
     $page = $p->show();
     $this->assign('list', $voList);
     $this->assign('count', $count);
     $this->assign("page", $page);
     $this->display();
 }
예제 #5
0
 public function friends()
 {
     $friendArray = getUserFriends($this->mid);
     array_push($friendArray, $this->mid);
     $friends = implode(",", $friendArray);
     $map = "userId in (" . $friends . ")";
     $dao = D('Mini');
     $count = $dao->count($map);
     $rows = 20;
     $p = new Page($count, $rows);
     $list = $dao->findAll($map, '*', 'cTime desc', $p->firstRow . ',' . $p->listRows);
     $page = $p->show();
     $this->assign('count', $count);
     $this->assign('mini', $list);
     $this->assign('page', $page);
     $this->display();
 }
예제 #6
0
 function friends()
 {
     $friendArray = getUserFriends($this->mid);
     //加入我的ID
     array_push($friendArray, $this->mid);
     $friends = implode(",", $friendArray);
     $map = "userId in (" . $friends . ")";
     $dao = D("Album");
     $count = $dao->count($map, 'id');
     $rows = 10;
     $p = new Page($count, $rows);
     $list = $dao->findAll($map, '*', 'cTime desc', $p->firstRow . ',' . $p->listRows);
     $page = $p->show();
     $this->assign('albumCount', $count);
     $this->assign('userId', $userId);
     $this->assign('list', $list);
     $this->assign('page', $page);
     $this->display();
 }