function PageCompPageMainCode()
{
    global $iID;
    $sFriendList = getFriendList($iID);
    return $sFriendList;
}
Exemple #2
0
 public function blockfriend()
 {
     $map['f.uid'] = $this->uid;
     $map['f.apply_status'] = 3;
     $list = getFriendList($map, 15);
     $this->assign("list", $list);
     $data['html'] = $this->fetch();
     exit(json_encode($data));
 }
<?php

/*
 * file: fbobject.php
 * On the backend this code first runs and retrive latest albums, photos, information
 */
include_once "facebook.php";
include_once "helper.php";
$facebook = new Facebook($config['fb']['api_key'], $config['fb']['secret_key']);
$user = $facebook->user;
if (!$user) {
    header("Location: " . $config['base_url']);
    exit;
}
$friends = getFriendList($facebook);
//retrieving latest albums
$query1 = "SELECT cover_pid, name, aid, owner, created, link FROM album WHERE owner in ({$friends}) AND cover_pid != 0 AND size >= 4 ORDER BY modified_major desc limit 100";
$albums = $facebook->api_client->fql_query($query1);
$defaultAlbum = $albums[0];
$coverPids = '';
$flag = false;
foreach ($albums as $item) {
    if ($flag) {
        $coverPids .= ',';
    }
    $coverPids .= "'" . $item['cover_pid'] . "'";
    $flag = true;
}
$query2 = "SELECT pid, src_small FROM photo WHERE pid in ({$coverPids})";
$albumsThumb = $facebook->api_client->fql_query($query2);
//retrive photos for the first albums by album id