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


PHP Network::get_user_networks方法代码示例

本文整理汇总了PHP中Network::get_user_networks方法的典型用法代码示例。如果您正苦于以下问题:PHP Network::get_user_networks方法的具体用法?PHP Network::get_user_networks怎么用?PHP Network::get_user_networks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Network的用法示例。


在下文中一共展示了Network::get_user_networks方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: render_networks

    function render_networks() {
	$page = 1;
	$network_state =& $this->state['networks'];

	$showing = $this->make_showing_link($network_state, "networks", "");

	$facewall = "";
	foreach (Network::get_user_networks($this->user->user_id, FALSE, $this->friends_per_page, $page) as $net) {
	    $facewall .= '<div id="network_'.$net->network_id.'">'.$this->render_network_image($net).'</div>';
	}

	return <<<ENS
<p>$showing</p>

<div>
$facewall
<div style="clear: both"></div>
</div>

ENS;
    }
开发者ID:Cyberspace-Networks,项目名称:PeopleAggregator,代码行数:21,代码来源:badge_create.php

示例2: delete_users

/**
 * @author   Z.Hron
 * @name     delete_users
 * @brief    This function delete array of users
 * @return   array of error messages
 *
 *
 */
function delete_users($params, $true_delete = FALSE)
{
    $message_array = array();
    $user_id_array = $params['user_id_array'];
    foreach ($user_id_array as $user_id) {
        if (PA::$network_info->type == MOTHER_NETWORK_TYPE) {
            if (!Network::member_exists(PA::$network_info->network_id, (int) $user_id)) {
                $message_array[] = "UserID {$user_id} does not exists.";
                continue;
            }
            //deleting user data from mothership
            try {
                User::delete_user($user_id);
                Activities::delete_for_user($user_id);
            } catch (CNException $e) {
                $message_array[] = $e->message;
            }
            $user_networks = Network::get_user_networks($user_id);
            if (count($user_networks)) {
                foreach ($user_networks as $network) {
                    if ($network->user_type != NETWORK_OWNER) {
                        $network_prefix = $network->address;
                        try {
                            User::delete_user($user_id);
                            Activities::delete_for_user($user_id);
                            Network::leave($network->network_id, $user_id);
                            //leave
                        } catch (CNException $e) {
                            $message_array[] = $e->message;
                        }
                    } else {
                        try {
                            Network::delete($network->network_id);
                        } catch (CNException $e) {
                            $message_array[] = $e->message;
                        }
                    }
                }
            }
            //deleting user
            try {
                User::delete($user_id, $true_delete);
            } catch (CNException $e) {
                Logger::log('User has been already deleted');
            }
        } else {
            //user delete for network owner
            if (!Network::member_exists(PA::$network_info->network_id, (int) $user_id)) {
                $message_array[] = "UserID {$user_id} does not exists.";
                continue;
            }
            $network_prefix = PA::$network_info->address;
            try {
                User::delete_user($user_id);
                Activities::delete_for_user($user_id);
                Network::leave(PA::$network_info->network_id, $user_id);
                //network leave
            } catch (CNException $e) {
                $message_array[] = $e->message;
            }
        }
    }
    return $message_array;
}
开发者ID:Cyberspace-Networks,项目名称:CoreSystem,代码行数:72,代码来源:cnfunctions.php

示例3: array

    if (!($user_id = $_GET['uid'])) {
        $location .= '?msg=7005';
    }
}
if ($user_id && $permission) {
    $message_array = array();
    if ($network_info->type == MOTHER_NETWORK_TYPE) {
        //user delete for SU
        //deleting user data from mothership
        try {
            User::delete_user($user_id);
            Activities::delete_for_user($user_id);
        } catch (PAException $e) {
            $message_array[] = $e->message;
        }
        $user_networks = Network::get_user_networks($user_id);
        if (count($user_networks)) {
            foreach ($user_networks as $network) {
                if ($network->user_type != NETWORK_OWNER) {
                    $network_prefix = $network->address;
                    try {
                        User::delete_user($user_id);
                        Network::leave($network->network_id, $user_id);
                        //leave
                    } catch (PAException $e) {
                        $message_array[] = $e->message;
                    }
                } else {
                    try {
                        Network::delete($network->network_id);
                    } catch (PAException $e) {
开发者ID:CivicCommons,项目名称:oldBellCaPA,代码行数:31,代码来源:delete_user.php

示例4: uihelper_resize_mk_img

                $grp->load((int) $grp_id);
                $img = uihelper_resize_mk_img("files/" . $grp->picture, 75, 75, DEFAULT_USER_PHOTO_REL);
                $group_name_enc = htmlspecialchars($grp->title);
                $h = <<<EOS
<div class="badge_person">
<a href="{$group_url_enc}" target="_blank"><div class="person_image">{$img}</div><div class="person_name">{$group_name_enc}</div></a>
</div>
EOS;
                $items_html[] = array("item", $h);
            }
            $html .= badge_render_section($items_html);
        }
        $networks =& $badge['networks'];
        if (@$networks['enabled']) {
            $html .= "<h4>My networks</h4>";
            $nets = Network::get_user_networks($user->user_id, FALSE, 1000, 1);
            $net_ids = array();
            $net_lookup = array();
            foreach ($nets as $n) {
                $net_ids[] = $n->network_id;
                $net_lookup[$n->network_id] = $n;
            }
            $net_incl = @$networks['included'];
            $max_networks = 8;
            // need to make this configurable
            $net_show = select_random_subset($net_incl, $networks['show'], $net_ids, 'ids', $max_networks);
            $items_html = array();
            foreach ($net_show as $net_id) {
                $net = $net_lookup[$net_id];
                $network_url_enc = 'http://' . $net->address . '.' . PA::$domain_suffix . BASE_URL_REL;
                $extra = unserialize($net->extra);
开发者ID:CivicCommons,项目名称:oldBellCaPA,代码行数:31,代码来源:badge.php


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