• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP getFriends函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中getFriends函数的典型用法代码示例。如果您正苦于以下问题:PHP getFriends函数的具体用法?PHP getFriends怎么用?PHP getFriends使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了getFriends函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: getOnlineUsersInfo

function getOnlineUsersInfo($sUserId, $bInit)
{
    global $aXmlTemplates;
    $aSaved = getSavedUsers();
    $aActive = getActiveUsers($sUserId);
    $aFriends = getFriends($sUserId);
    saveUsers($aActive);
    $sContents = "";
    if ($bInit) {
        $aFullUsers = array_unique(array_merge($aActive['online'], $aFriends));
    } else {
        $aFullUsers = array_diff($aActive['online'], $aSaved['online'], $aFriends);
        $aNewOfflineUsers = array_intersect($aSaved['online'], $aActive['offline']);
        $aNewOnlineUsers = array_intersect($aSaved['offline'], $aActive['online'], $aFriends);
        for ($i = 0; $i < count($aNewOfflineUsers); $i++) {
            $sContents .= parseXml($aXmlTemplates['user'], $aNewOfflineUsers[$i], FALSE_VAL);
        }
        for ($i = 0; $i < count($aNewOnlineUsers); $i++) {
            $sContents .= parseXml($aXmlTemplates['user'], $aNewOnlineUsers[$i], TRUE_VAL);
        }
    }
    $rResult = getUsersMedia($aFullUsers);
    if ($rResult != null) {
        for ($i = 0; $i < mysql_num_rows($rResult); $i++) {
            $aUser = mysql_fetch_assoc($rResult);
            $aUserInfo = getUserInfo($aUser['ID']);
            $sOnline = in_array($aUser['ID'], $aActive['online']) ? TRUE_VAL : FALSE_VAL;
            $sFriend = in_array($aUser['ID'], $aFriends) ? TRUE_VAL : FALSE_VAL;
            $sMusic = $aUser['CountMusic'] > 0 ? TRUE_VAL : FALSE_VAL;
            $sVideo = $aUser['CountVideo'] > 0 ? TRUE_VAL : FALSE_VAL;
            $sContents .= parseXml($aXmlTemplates['user'], $aUser['ID'], $aUserInfo['nick'], $aUserInfo['sex'], $aUserInfo['age'], $aUserInfo['photo'], $aUserInfo['profile'], $sOnline, $sFriend, $sMusic, $sVideo);
        }
    }
    return makeGroup($sContents, "users");
}
开发者ID:dalinhuang,项目名称:shopexts,代码行数:35,代码来源:functions.inc.php


示例2: getGames

function getGames($db, $max_game, $max_player, $mode, $fid = false, $facebook = false)
{
    $modes = array('joinable' => 0, 'started' => 1, 'ended' => 2, 'all' => -1, 'friends' => -2, 'friends_all' => -3);
    $m = $modes[$mode];
    if ($m == -2) {
        $friends = filterFriends($db, getFriends($db, $fid, $facebook));
        $sql = "SELECT games.gid,games.state,games.numplayers " . "FROM games,plays " . "WHERE plays.gameid=games.gid AND games.state=0 AND games.numplayers<=?";
        $s = sizeof($friends);
        if (is_array($friends)) {
            if ($s == 0) {
                return array();
            }
            if ($s == 1) {
                $sql_mid = " AND plays.playerid=?";
            } else {
                $s--;
                $sql_mid = " AND (";
                for ($i = 0; $i < $s; $i++) {
                    $sql_mid .= "plays.playerid=? OR ";
                }
                $sql_mid .= 'plays.playerid=?)';
                $sql .= $sql_mid;
            }
        } else {
            return array();
        }
        $sql .= "ORDER BY gid DESC LIMIT ?";
        $ids = array($max_player);
        foreach ($friends as $friend) {
            $ids[] = $friend['fid'];
        }
        $ids[] = $max_game;
        $query = $db->query($sql, $ids);
        return $query;
    } else {
        if ($m != -1) {
            $sql = "SELECT `gid`,`state`,`numplayers` FROM `games` WHERE `state`=? AND `numplayers`<= ? ORDER BY gid DESC LIMIT ?";
            $query = $db->query($sql, array($m, $max_game, $max_player));
        } else {
            $sql = "SELECT `gid`,`state`,`numplayers` FROM `games` ORDER BY gid DESC LIMIT ?";
            $query = $db->query($sql, array($max_game));
        }
    }
    return $query;
}
开发者ID:BGCX067,项目名称:facebook-slt-svn-to-git,代码行数:45,代码来源:sql_game_helper.php


示例3: readUsers

    }
    ?>
		</div>
	<?php 
}
?>
	
	<div id="friends">
	<h3>Current Users:</h3>
	<?php 
$users = readUsers();
foreach ($users as $u) {
    if (!isPendingUser($u->username)) {
        $uname = $u->username;
        $picture = $u->pic;
        if (!in_array($u->username, getFriends($_SESSION['username']))) {
            ?>
		<div class="user">
			<?php 
            echo '<a href="profile.php?uname=' . $uname . '"><img class="thumbnails" src="' . $picture . '" alt="user1" /></a>';
            ?>
			<?php 
            echo $uname;
            ?>
		</div>
	<?php 
        }
    }
}
?>
	</div>
开发者ID:HKMOpen,项目名称:project3_webdev,代码行数:31,代码来源:userList.php


示例4: substrs

     $objectDescrip = substrs($activeArray['content'], 30);
     $activeId = $activeArray['id'];
     $emailContent = getLangInfo('email', 'email_groupactive_invite_content');
 } else {
     $id = $cyid;
     $type = 'group';
     $invite_url = $db_bbsurl . '/u.php?a=invite&type=group&id=' . $cyid . '&uid=' . $winduid . '&hash=' . appkey($winduid, $type);
     $objectName = $colony['cname'];
     $objectDescrip = substrs($colony['descrip'], 30);
     $emailContent = getLangInfo('email', 'email_group_invite_content');
 }
 if (empty($_POST['step'])) {
     S::gp("id", null, 2);
     //* @include_once pwCache::getPath(D_P.'data/bbscache/o_config.php');
     pwCache::getData(D_P . 'data/bbscache/o_config.php');
     $friend = getFriends($winduid) ? getFriends($winduid) : array();
     foreach ($friend as $key => $value) {
         $frienddb[$value['ftid']][] = $value;
     }
     $query = $db->query("SELECT * FROM pw_friendtype WHERE uid=" . S::sqlEscape($winduid) . " ORDER BY ftid");
     $friendtype = array();
     while ($rt = $db->fetch_array($query)) {
         $friendtype[$rt['ftid']] = $rt;
     }
     $no_group_name = getLangInfo('other', 'no_group_name');
     $friendtype[0] = array('ftid' => 0, 'uid' => $winduid, 'name' => $no_group_name);
     require_once PrintEot('thread_member');
     footer();
 } elseif ($_POST['step'] == 1) {
     // 发送email邀请
     S::gp(array('emails', 'customdes'), 'P');
开发者ID:jechiy,项目名称:PHPWind,代码行数:31,代码来源:thread_member.php


示例5: getFriends

$savant->assign('list_of_my_apps', $applications_obj->listMyApplications(true));
$savant->display('social/tiny_applications.tmpl.php');
//			echo '<div class="gadget_wrapper">';
//			echo '<div class="gadget_title_bar">Applications</div>';
//			echo '<div class="gadget_container">TODO: GADGETS/Applications</div>';
//			echo '</div>';
?>
	</div>

	<div class="my-contacts">
		<?php 
//if friends array is not empty.
if (!empty($friends)) {
    $savant->assign('friends', $friends);
} else {
    $savant->assign('friends', getFriends($_SESSION['member_id'], SOCIAL_FRIEND_HOMEPAGE_MAX));
}
$savant->assign('group_invitations', getGroupInvitations());
$savant->assign('group_requests', getGroupRequests());
$savant->assign('pending_requests', getPendingRequests());
$savant->display('social/friend_list.tmpl.php');
?>
		
	</div>
		
	<?php 
$people_you_may_know = getPeopleYouMayKnow();
if (!empty($people_you_may_know)) {
    ?>
	<!-- people you may know -->
	<div class="people-you-may-know">
开发者ID:vicentborja,项目名称:ATutor,代码行数:31,代码来源:index.php


示例6: getFriendsActivities

 /**
  * Retrieve friends' recent activities
  *
  * @param	int		user id
  * @param	boolean	set TRUE to display all entry		
  * @return	The array of description of all the activities of the given user's friends.
  */
 function getFriendsActivities($id, $displayAll = false)
 {
     $activities = array();
     $friends = getFriends($id);
     if ($friends > 0) {
         $friends_ids = implode(', ', array_keys($friends));
         if ($friends_ids != '') {
             $sql = 'SELECT * FROM %ssocial_activities WHERE member_id IN (%s) ORDER BY created_date DESC';
             if (!$displayAll) {
                 $sql .= ' LIMIT ' . SOCIAL_FRIEND_ACTIVITIES_MAX;
             }
             $rows_activities = queryDB($sql, array(TABLE_PREFIX, $friends_ids));
             if (count($rows_activities) > 0) {
                 foreach ($rows_activities as $row) {
                     $activities[$row['id']]['member_id'] = $row['member_id'];
                     $activities[$row['id']]['title'] = $row['title'];
                     $activities[$row['id']]['created_date'] = $row['created_date'];
                 }
             }
             return $activities;
         } else {
             return false;
         }
     }
 }
开发者ID:genaromendezl,项目名称:ATutor,代码行数:32,代码来源:Activity.class.php


示例7: ajax_friends

 public function ajax_friends()
 {
     $friends = filterFriends($this->db, getFriends($this->db, $this->fid, $this->facebook));
     $this->load->view('/player/friends', array('friends' => $friends));
 }
开发者ID:BGCX067,项目名称:facebook-slt-svn-to-git,代码行数:5,代码来源:player.php


示例8: InitGP

InitGP(array('u', 'hash', 'app'));
$u = (int) $u;
!$u && Showmsg('undefined_action');
$thisbase = $basename . "q=invite&";
if ($winduid) {
    if (getOneFriend($u)) {
        Showmsg('mode_o_is_friend');
    }
}
$friend = $db->get_one("SELECT m.uid,m.username,m.icon as face,m.honor,md.f_num,md.postnum,od.diarynum,od.photonum,od.owritenum,od.sharenum,od.groupnum FROM pw_members m LEFT JOIN pw_memberdata md ON m.uid=md.uid LEFT JOIN pw_ouserdata od ON m.uid=od.uid WHERE m.uid=" . pwEscape($u));
!$friend && Showmsg('undefined_action');
if ($hash != appkey($u, $app)) {
    Showmsg('mode_o_invite_hash_error');
} elseif ($winduid) {
    $o_u = $u;
    if (is_numeric($o_u) && strlen($hash) == 18) {
        require_once R_P . 'require/o_invite.php';
    }
    refreshto("u.php?uid={$u}", 'add_friend_success');
} else {
    Cookie('o_invite', "{$u}\t{$hash}\t{$app}");
}
require_once R_P . 'require/showimg.php';
list($friend['face']) = showfacedesign($friend['face'], 1, 'm');
if ($friend['f_num']) {
    $friends = getFriends($u, 0, 6, '', 1);
}
$forward = rawurlencode("u.php?uid={$u}");
require_once M_P . 'require/header.php';
require_once PrintEot('m_invite');
footer();
开发者ID:adi00,项目名称:wumaproject,代码行数:31,代码来源:m_invite.php


示例9: TagontoNET

//Init Tagontonet
require_once 'Tagontonet.php';
$tnet = new TagontoNET();
//Analyze request
$Request = $_GET['r'];
$TagLabel = $_GET['tag'];
$Plugin = $_GET['pl'];
$URI = $_GET['uri'];
$tag = new TAG($TagLabel);
//Getting the document on the right mood
header("Content-Type: application/xml");
switch ($Request) {
    case 'GetFriends':
        //Check if a specific plugin has been requested
        $Plugin = $_GET['pl'];
        getFriends($tnet, $tag, $Plugin);
        break;
    case 'GetResources':
        //Check if a specific plugin has been requested
        tagRes($tnet, $tag, $Plugin);
        break;
    case 'ListPlugins':
        listPlugins($tnet);
        break;
    case 'ExtractTags':
        extractTags($tnet, $URI);
        break;
    default:
        break;
        //TODO return an "unknown command" message
}
开发者ID:paradoxengine,项目名称:tagonto,代码行数:31,代码来源:TagontoNETREST.php


示例10: getUserInfo

         $aUserInfo = getUserInfo($sFriendId);
         $sOnline = in_array($iFriendId, $aOnlineFriends) ? TRUE_VAL : FALSE_VAL;
         $sContents .= parseXml($aXmlTemplates['user'], $sFriendId, $aUserInfo['nick'], $aUserInfo['sex'], $aUserInfo['age'], $sOnline, $aUserInfo['photo'], $aUserInfo['profile']);
     }
     $sContents = makeGroup($sContents, "users");
     break;
     /**
      * Update friend's information.
      * @param id - user's ID, whose friends' info need to be updated.
      */
 /**
  * Update friend's information.
  * @param id - user's ID, whose friends' info need to be updated.
  */
 case "updateFriends":
     $aFriendIds = getFriends($sId);
     if (count($aFriendIds) == 0) {
         $sContents = "";
     } else {
         $aOnlineFriends = getOnline($aFriendIds);
         for ($i = 0; $i < count($aOnlineFriends); $i++) {
             $sContents .= parseXml($aXmlTemplates['user'], $aOnlineFriends[$i]);
         }
     }
     $sContents = makeGroup($sContents, "users");
     break;
     /**
      * Gets online user's information
      */
 /**
  * Gets online user's information
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:31,代码来源:actions.inc.php


示例11: removeFriend

     $results = removeFriend($db, $_SESSION['id'], $_POST['deletefriendid'], $_SESSION['token']);
     switch ($results[SP::ERROR]) {
         case ERR::OK:
             echo "<p>Friend removed! <a href='friendslist.php'>See friends</a></p>";
             break;
         case ERR::TOKEN_EXPIRED:
         case ERR::TOKEN_FAIL:
         case ERR::USER_NO_TOKEN:
             header("Location: logout.php?error=" . $results[SP::ERROR]);
             break;
         default:
             echo "<p>Could not remove friend. Error: " . $ERRORS[$results[SP::ERROR]] . "</p>";
             break;
     }
 } else {
     $results = getFriends($db, $_SESSION['id'], $_SESSION['token']);
     $errorCode = $results[SP::ERROR];
     unset($results[SP::ERROR]);
     switch ($errorCode) {
         case ERR::OK:
             if (count($results) == 0) {
                 echo "<p>You have no friends ;_;</p>";
             }
             foreach ($results as $num => $friend) {
                 $friendInfo = getPublicUserDetails($db, $friend[FRIEND::FRIEND_ID]);
                 echo <<<EOT
t\t<div class="friendbox">
t\t\t<a href="profile.php?profileid={$friend[FRIEND::FRIEND_ID]}">
t\t\t\t<img class="avatar" src="avatar/{$friend[FRIEND::FRIEND_ID]}.jpg" />
t\t\t{$friendInfo[USER::DISP_NAME]}</a>
t\t\t<form method="GET" action="makemessage.php">
开发者ID:Blackdeathhh,项目名称:WDAAss2,代码行数:31,代码来源:friendslist.php


示例12: getFriendsActivities

 /**
  * Retrieve friends' recent activities
  *
  * @param	int		user id
  * @param	boolean	set TRUE to display all entry		
  * @return	The array of description of all the activities of the given user's friends.
  */
 function getFriendsActivities($id, $displayAll = false)
 {
     global $db;
     $activities = array();
     $friends = getFriends($id);
     $friends_ids = implode(', ', array_keys($friends));
     $sql = 'SELECT * FROM ' . TABLE_PREFIX . 'social_activities WHERE member_id IN (' . $friends_ids . ') ORDER BY created_date DESC';
     if (!$displayAll) {
         $sql .= ' LIMIT ' . SOCIAL_FRIEND_ACTIVITIES_MAX;
     }
     $result = mysql_query($sql, $db);
     if ($result) {
         while ($row = mysql_fetch_assoc($result)) {
             $activities[$row['id']]['member_id'] = $row['member_id'];
             $activities[$row['id']]['title'] = $row['title'];
             $activities[$row['id']]['created_date'] = $row['created_date'];
         }
     }
     return $activities;
 }
开发者ID:vicentborja,项目名称:ATutor,代码行数:27,代码来源:Activity.class.php


示例13: connectDatabase

?>
">
		<input type="text" id="search_tbox" name="search_tbox" placeholder="Search for new Friends.. "/>
		<input type="submit" name="search_button" id="search_button" value="Search"/>
	
	<div class="friends_table">
		<table>
			<tr><td> Your Friends </td> <td> Online</td></tr>
			 
			<?php 
include 'conn/db_conn.php';
include 'func/quer.php';
include 'func/otherFunctions.php';
$link = connectDatabase();
$user = $_COOKIE['logged_in_user'];
$friends = getFriends($user, $link);
displayFriends($friends, $link);
if (isset($_POST['search_button'])) {
    if (isset($_POST['search_tbox'])) {
        $text = $_POST['search_tbox'];
        $searchedFriends = searchFriend($text, $link);
        if (FALSE == $searchedFriends) {
            echo "<script type='text/javascript'>alert('No username found with such name');</script>";
        } else {
            $temp = mysqli_fetch_assoc($searchedFriends);
            $_SESSION["username"] = $temp;
            header('Location: add_friend.php');
        }
    } else {
        echo "<script type='text/javascript'>alert('Search fields are empty.');</script>";
    }
开发者ID:Chetan21,项目名称:Chat-Application,代码行数:31,代码来源:friends.php


示例14: pwEscape

    if (!$db_groups_open) {
        $addwhere .= " AND f.type!='colony' AND f.type!='colony_post' AND f.type!='colony_photo'";
    }
    $query = $db->query("SELECT f.*,m.username,m.groupid,m.icon FROM pw_feed f LEFT JOIN pw_members m ON f.uid=m.uid WHERE f.uid= " . pwEscape($u) . " {$addwhere} ORDER BY f.timestamp DESC LIMIT 30");
    while ($rt = $db->fetch_array($query)) {
        $rt['descrip'] = parseFeed($rt['descrip']);
        if ($rt['groupid'] == 6 && $db_shield && $groupid != 3) {
            $rt['descrip'] = appShield('ban_feed');
        }
        $key = get_date($rt['timestamp'], 'y-m-d');
        list($rt['faceurl']) = showfacedesign($rt['icon'], '1', 's');
        $rt['appicon'] = getAppIcon($rt['type']);
        $feeds[$key][] = $rt;
    }
}
$friends = getFriends($u, 0, 18, '', 1);
//$sendfriends = getFriends($winduid,0,0,false,1);
//留言板
if ($privacy['msgboard']) {
    $boards = array();
    require_once R_P . 'require/bbscode.php';
    $wordsfb = L::loadClass('FilterUtil');
    $query = $db->query("SELECT o.*,m.icon as face,m.groupid FROM pw_oboard o LEFT JOIN pw_members m ON o.uid=m.uid WHERE o.touid=" . pwEscape($u) . " ORDER BY o.id DESC " . pwLimit(0, 15));
    while ($rt = $db->fetch_array($query)) {
        $rt['postdate'] = get_date($rt['postdate']);
        list($rt['face']) = showfacedesign($rt['face'], 1, 'm');
        if ($rt['groupid'] == 6 && $db_shield && $groupid != 3) {
            $rt['title'] = appShield('ban_feed');
        } elseif (!$wordsfb->equal($rt['ifwordsfb'])) {
            $rt['title'] = $wordsfb->convert($rt['title'], array('id' => $rt['id'], 'type' => 'oboard', 'code' => $rt['ifwordsfb']));
        }
开发者ID:adi00,项目名称:wumaproject,代码行数:31,代码来源:m_user.php


示例15: getFriends

<div class="row">



<div class="card">
<div class="titleOnCard">Upcoming Birthdays</div>

<div class="friends">
<?php 
$friends = getFriends();
while ($friend = array_shift($friends)) {
    ?>
	<a href="choose.php?friendID=<?php 
    echo $friend->id;
    ?>
"><div class="friend clearFix">
		<div class="profile-picture floater">
				<img src="<?php 
    echo $friend->picture;
    ?>
" class="friendPic"/>
		</div>
        
        <div class="floater bdayInfo">
		<div class="name"><?php 
    echo $friend->name;
    ?>
</div> 
		<div class="birthday"><?php 
    echo getBirthday($friend);
开发者ID:skin,项目名称:planty,代码行数:30,代码来源:index.php


示例16: Showmsg

    if ($groupid == 3 || $isU == 2 || $isU != 2 && $privacy['index']) {
        $SpaceShow = 1;
    }
    if (!$SpaceShow) {
        Showmsg('mode_o_index_right');
    }
}
include_once D_P . 'data/bbscache/forum_cache.php';
$fids = trim(getSpecialFid() . ",'0'", ',');
$shortcutforum = pwGetShortcut();
$force = $where = '';
$article = array();
$ordertype = 'postdate';
if ($a == 'friend') {
    $thisbase = $basename . 'a=friend&';
    if ($friends = getFriends($winduid)) {
        $uids = array_keys($friends);
        !empty($fids) && ($where .= "fid NOT IN({$fids}) AND ");
        $where .= "authorid IN(" . pwImplode($uids) . ") AND ifcheck=1 AND ifhide=0 AND anonymous=0";
        $where .= " AND postdate>" . pwEscape($timglimit);
    } else {
        //require_once(M_P.'require/header.php');
        //require_once PrintEot('m_article');
        //footer();
        list($isheader, $isfooter, $tplname, $isleft) = array(true, true, "m_article", true);
    }
    $username = $windid;
} elseif ($a == 'pc') {
    InitGP(array('pcid'), GP, 2);
    InitGP(array('see'));
    $pcid = (int) $pcid;
开发者ID:adi00,项目名称:wumaproject,代码行数:31,代码来源:index.php


示例17: exit

<?php

!defined('P_W') && exit('Forbidden');
S::gp(array('u'), 'P', 2);
if (!$u) {
    Showmsg('undefined_action');
}
if ($u != $winduid) {
    Showmsg('undefined_action');
}
$friends = getFriends($winduid, 0, 8, false, 1, 's');
$str = '';
if ($friends) {
    $friend_online = array();
    foreach ($friends as $key => $value) {
        if ($value['uid'] == $winduid) {
            continue;
        }
        if ($value['thisvisit'] + $db_onlinetime * 1.5 > $timestamp) {
            $friend_online[] = array('uid' => $value['uid'], 'face' => $value['face'], 'username' => $value['username']);
        }
    }
    if ($friend_online) {
        $str = pwJsonEncode($friend_online);
    }
}
echo "success\t{$str}";
ajax_footer();
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:28,代码来源:pwb_friend.php


示例18: list

        list($pages, $limit) = pwLimitPages($count, $page, "{$thisbase}{$addurl}");
    } else {
        InitGP('ftid', '', 2);
        if (isset($_GET['ftid'])) {
            $ftype = (int) GetGP('ftid');
        }
        $username = $windid;
        $query = $db->query("SELECT * FROM pw_friendtype WHERE uid=" . pwEscape($winduid) . " ORDER BY ftid");
        $friendtype = array();
        while ($rt = $db->fetch_array($query)) {
            $friendtype[$rt['ftid']] = $rt;
        }
        $count = $winddb['f_num'];
        list($pages, $limit) = pwLimitPages($count, $page, "{$thisbase}");
    }
    $friends = getFriends($u, $start, $db_perpage, $ftype, 1);
    if ($friends) {
        foreach ($friends as $key => $value) {
            $value['isfriend'] = isFriend($winduid, $value['uid']);
            $friends[$key] = $value;
        }
    }
}
require_once M_P . 'require/header.php';
if ($space == 1) {
    require_once R_P . 'require/credit.php';
    list($userdb, $ismyfriend, $friendcheck, $usericon, $usercredit, $totalcredit, $appcount, $p_list) = getAppleftinfo($u);
    require_once PrintEot('user_friend');
} else {
    require_once PrintEot('m_friend');
}
开发者ID:adi00,项目名称:wumaproject,代码行数:31,代码来源:m_friend.php


示例19: markFriends

/**
 * Given an array list of friends, this function will add an attribute 'added' into the array if this person is already connected to the user.
 * @param	int		the user id
 * @param	array	the given array of friends
 * @return	marked array
 */
 function markFriends($id, $connections){
	//get all friends
	$my_friends = getFriends($id);
	$pending_requests = getPendingRequests(true);

	foreach($my_friends as $friends){
		//if it is in the connection, set the attribute
		if($connections[$friends] != null){
			$connections[$friends]['added'] = 1;
		} 
	}

	foreach ($pending_requests as $friends=>$garbage){
		//if it is already added, set pending =1
		if ($connections[$friends] != null){
			$connections[$friends]['pending'] = 1;
		}
	}
	return $connections;
 }
开发者ID:radiocontrolled,项目名称:ATutor,代码行数:26,代码来源:friends.inc.php


示例20: getUser

<?php

require_once "conf.php";
require_once "Utils.php";
require_once "header.html";
$user = getUser($facebook, APPURL);
$friends = getFriends($facebook, $user);
//print_r($friends);
require_once "run.html";
开发者ID:rampr,项目名称:Sample-facebook-app,代码行数:9,代码来源:run.php



注:本文中的getFriends函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getFromClient函数代码示例发布时间:2022-05-15
下一篇:
PHP getFriendlyURL函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap