本文整理汇总了PHP中Members::list_connections_for_user方法的典型用法代码示例。如果您正苦于以下问题:PHP Members::list_connections_for_user方法的具体用法?PHP Members::list_connections_for_user怎么用?PHP Members::list_connections_for_user使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Members
的用法示例。
在下文中一共展示了Members::list_connections_for_user方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
if (isset($user['full_name']) && $user['full_name']) {
$label = $user['full_name'] . ' (' . $user['nick_name'] . ')';
} else {
$label = $user['nick_name'];
}
// surfer cannot be deselected
if ($anchor->is_owned($id, FALSE)) {
$suffix .= ' - <span class="details">' . i18n::s('owner') . '</span>';
}
// format the item
$new_users[$url] = array($prefix, $label, $suffix, $type, $icon);
}
// display attached users with unlink buttons
$context['text'] .= Skin::build_list($new_users, 'compact') . '</div>';
// the current list of linked users
} elseif (!strncmp($anchor->get_reference(), 'user:', 5) && ($users =& Members::list_connections_for_user($anchor->get_reference(), 0, 5 * USERS_LIST_SIZE, 'raw')) && count($users)) {
// splash message
$context['text'] .= '<div style="margin-top: 2em;">' . sprintf(i18n::s('Persons followed by %s'), $anchor->get_title());
// browse the list
foreach ($users as $id => $user) {
// make an url
$url = Users::get_permalink($user);
// gather information on this user
$prefix = $suffix = $type = $icon = '';
if (isset($user['full_name']) && $user['full_name']) {
$label = $user['full_name'] . ' (' . $user['nick_name'] . ')';
} else {
$label = $user['nick_name'];
}
// surfer cannot be deselected
if ($anchor->is_owned($id, FALSE)) {
示例2: elseif
} elseif ($action == 'watch') {
render_raw();
// we return some HTML
$output = '';
// horizontal menu
$menu = array();
// manage command
if (Surfer::is_associate() || Surfer::get_id() == $item['id']) {
Skin::define_img('USERS_WATCH_IMG', 'users/watch.gif');
$menu[] = Skin::build_link(Users::get_url('user:' . $item['id'], 'select'), USERS_WATCH_IMG . i18n::s('Manage followers'), 'span');
}
// build the menu
$output .= Skin::finalize_list($menu, 'menu_bar');
// list watched users by posts
$watched = '';
if ($items =& Members::list_connections_for_user('user:' . $item['id'], 0, 200, 'watch')) {
if (is_array($items)) {
$items = Skin::build_list($items, 'decorated');
}
$watched .= $items;
} elseif (Surfer::get_id() == $item['id']) {
$watched .= '<p>' . i18n::s('Click on the link above to follow someone.') . '</p>';
} else {
$watched .= '<p>' . sprintf(i18n::s('%s is not yet following other persons.'), $item['full_name']) . '</p>';
}
// the list of followers
$followers = '';
if ($items = Members::list_watchers_by_name_for_anchor('user:' . $item['id'], 0, 1000, 'compact')) {
if (is_array($items)) {
$items = Skin::build_list($items, 'compact');
}