예제 #1
0
 public function evaluate($id)
 {
     list($flid, $uid) = explode(':', $id);
     $lists = friend_list_get_lists($uid);
     if (isset($lists[$flid])) {
         return $lists[$flid]['name'];
     }
 }
예제 #2
0
 /**
  * Helper function that gets all row ids that match the
  * given $uid and $flid parameters and populates them into
  * the $result array, passed by reference.
  *
  * @param  $uid    id of user to get friend lists for
  * @param  $flid   if specified, only gets friend list id
  *                 matching this id
  * @param  $result array passed by reference that will be populated
  *                 by the resulting ids, where row id => 1
  */
 private function get_all_lists($uid, $flid, &$result)
 {
     $lists = friend_list_get_lists($uid);
     if ($flid) {
         if (isset($lists[$flid])) {
             $result["{$flid}:{$uid}"] = 1;
         }
     } else {
         foreach ($lists as $flid => $list) {
             $result["{$flid}:{$uid}"] = 1;
         }
     }
 }
예제 #3
0
 public function friends_getLists()
 {
     $array_lists = friend_list_get_lists($this->user_id);
     $object_lists = array();
     foreach ($array_lists as $flid => $list) {
         $object_lists[] = new api10_friendlist(array('flid' => $flid, 'name' => $list['name']));
     }
     return $object_lists;
 }
예제 #4
0
/**
 * Checks to see if the given $uid is the owner of the
 * friend list identified by $flid.
 *
 * @param  $flid  id of friend list
 * @param  $uid   id of user to check ownership
 * @return boolean, true if $uid is owner of friend list
 */
function friend_list_is_owner($flid, $uid)
{
    $lists = friend_list_get_lists($uid);
    return isset($lists[$flid]);
}