当前位置: 首页>>代码示例>>PHP>>正文


PHP Members::list_connections_for_user方法代码示例

本文整理汇总了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)) {
开发者ID:rair,项目名称:yacs,代码行数:31,代码来源:select.php

示例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');
        }
开发者ID:rair,项目名称:yacs,代码行数:31,代码来源:element.php


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