本文整理匯總了PHP中Relation::get_external_relations方法的典型用法代碼示例。如果您正苦於以下問題:PHP Relation::get_external_relations方法的具體用法?PHP Relation::get_external_relations怎麽用?PHP Relation::get_external_relations使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Relation
的用法示例。
在下文中一共展示了Relation::get_external_relations方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: loadRelations
public function loadRelations()
{
// load all this users relations
$this->user->{'local_relations'} = Relation::get_all_relations($this->user->user_id);
$this->user->{'external_relations'} = Relation::get_external_relations($this->user->user_id);
}
示例2: FriendList
function FriendList($content)
{
global $uid, $service;
// get relations for this user
// so we can see if these friends are already added or not
$external_relations = Relation::get_external_relations($uid);
// put into more accessible form
$existing_relations = array();
foreach ($external_relations as $k => $rel) {
$existing_relations[$rel['network'] . ':' . $rel['network_uid']] = true;
}
echo '<ul class="friendlist">';
foreach ($content as $k => $friend) {
echo '<li class="vcard" id="' . $friend->friendid . '">';
echo '<a class="fn url" rel="friend" href="' . $friend->pageUrl . '" target="_blank">';
echo '<img class="photo" src="' . $friend->icon . '">';
echo '<br />';
echo $friend->name;
echo '</a>';
echo '<div class="friendconfig buttonbar"><ul><li>';
if (isset($existing_relations[$service . ':' . $friend->friendid])) {
echo '<a href="javascript://" onclick="removerelation(this);">';
echo 'remove from Widget';
echo '</a>';
} else {
echo '<a href="javascript://" onclick="addrelation(this);">';
echo 'add to Widget';
echo '</a>';
}
echo '</li></ul></div>';
echo '</li>';
}
echo '</ul>';
echo '<p class="header"> </p>';
}