當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Group::member_exists方法代碼示例

本文整理匯總了PHP中Group::member_exists方法的典型用法代碼示例。如果您正苦於以下問題:PHP Group::member_exists方法的具體用法?PHP Group::member_exists怎麽用?PHP Group::member_exists使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Group的用法示例。


在下文中一共展示了Group::member_exists方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: get_links

 public function get_links()
 {
     $this->Paging["count"] = Group::get_user_groups((int) $this->uid, TRUE);
     $ids = array();
     if ($this->usergroups) {
         foreach ($this->usergroups as $groups) {
             $ids[] = array('gid' => $groups['gid'], 'access' => $groups['access']);
         }
     }
     $group_details = array();
     for ($gr = 0; $gr < count($ids); $gr++) {
         $group = ContentCollection::load_collection((int) $ids[$gr]['gid'], PA::$login_uid);
         $group_tags = Tag::load_tags_for_content_collection($ids[$gr]['gid']);
         $member_exist = Group::member_exists($ids[$gr]['gid'], PA::$login_uid);
         $picture = $group->picture;
         $cnt = Group::get_member_count($group->collection_id);
         $group_details[$gr]['id'] = $group->collection_id;
         $group_details[$gr]['title'] = stripslashes($group->title);
         $desc = stripslashes($group->description);
         $desc = substr($desc, 0, 100);
         $group_details[$gr]['desc'] = $desc;
         $group_details[$gr]['picture'] = $picture;
         $group_details[$gr]['members'] = $cnt;
         $group_details[$gr]['access'] = $ids[$gr]['access'];
     }
     return $group_details;
 }
開發者ID:Cyberspace-Networks,項目名稱:PeopleAggregator,代碼行數:27,代碼來源:MyGroupsModule.php

示例2: get_links

 public function get_links()
 {
     $this->Paging["count"] = Group::get_user_groups((int) $this->uid, TRUE);
     if ($this->block_type == 'usergroups') {
         $pub = 'public';
         $usergroups = Group::get_user_groups((int) $this->uid, FALSE, 5, 1, 'created', 'DESC', $pub);
     } else {
         $usergroups = Group::get_user_groups((int) $this->uid, FALSE, 5, 1);
     }
     global $base_url, $current_theme_path;
     $ids = array();
     if ($usergroups) {
         foreach ($usergroups as $groups) {
             $ids[] = array('gid' => $groups['gid'], 'access' => $groups['access']);
         }
     }
     $group_details = array();
     for ($gr = 0; $gr < count($ids); $gr++) {
         $group = ContentCollection::load_collection((int) $ids[$gr]['gid'], $_SESSION['user']['id']);
         $group_tags = Tag::load_tags_for_content_collection($ids[$gr]['gid']);
         $member_exist = Group::member_exists($ids[$gr]['gid'], $_SESSION['user']['id']);
         $picture = $group->picture;
         $cnt = Group::get_member_count($group->collection_id);
         $group_details[$gr]['id'] = $group->collection_id;
         $group_details[$gr]['title'] = stripslashes($group->title);
         $desc = stripslashes($group->description);
         $desc = substr($desc, 0, 100);
         $group_details[$gr]['desc'] = $desc;
         $group_details[$gr]['picture'] = $picture;
         $group_details[$gr]['members'] = $cnt;
         $group_details[$gr]['access'] = $ids[$gr]['access'];
     }
     $links = $group_details;
     return $links;
 }
開發者ID:CivicCommons,項目名稱:oldBellCaPA,代碼行數:35,代碼來源:MyGroupsModule.php

示例3: get_families

 private function get_families()
 {
     $userfamilies = TypedGroupEntityRelation::get_relation_for_user($this->uid, 'family');
     $family_details = array();
     foreach ($userfamilies as $i => $fam) {
         $group = ContentCollection::load_collection((int) $fam->object_id, PA::$login_uid);
         $member_exist = Group::member_exists((int) $fam->object_id, $this->uid);
         $picture = $group->picture;
         $cnt = Group::get_member_count($group->collection_id);
         $family_details[$i]['id'] = $group->collection_id;
         $family_details[$i]['title'] = stripslashes($group->title);
         $desc = stripslashes($group->description);
         $desc = substr($desc, 0, 100);
         $family_details[$i]['desc'] = $desc;
         $family_details[$i]['picture'] = $picture;
         $family_details[$i]['members'] = $cnt;
         $family_details[$i]['access'] = $group->access_type;
     }
     return $family_details;
 }
開發者ID:Cyberspace-Networks,項目名稱:CoreSystem,代碼行數:20,代碼來源:CNMyFamiliesModule.php

示例4: set_group_id

 /**
   Purpose : this function is core funtion of this Navigation class. It is used to make links level_1,level_2,level_3
   Some links need extra parameters
   append them here but first set them in their methods
   e.g.
     public function set_group_id($group_id){
       $this->group_id = $group_id;
     }
     public function get_group_id() {
       return $this->group_id();
     }
   Scope : public
   @param - it needs no direct input
   @return - it sets class variables level_1,level_2,level_3 which can be used further.
   **/
 function make_links()
 {
     global $_PA;
     ////These are level 1 links shown in top navigation bar
     $level_1 = array('home_network' => array('caption' => __('Return to home network'), 'url' => $this->mothership_info['url']));
     // Display network directory, if network operation is enabled.
     if (PA::$network_capable) {
         $level_1['networks_directory'] = array('caption' => __('Network directory'), 'url' => $this->base_url . '/' . FILE_NETWORKS_HOME);
     }
     $owner = Network::is_admin($this->network_info->network_id, @$_SESSION['user']['id']);
     //is_member will be true when user is registered member of the nework.
     $is_member = Network::member_exists($this->network_info->network_id, $this->get_uid());
     if (!$this->is_anonymous && $this->network_info && !$is_member && $this->network_info->type != MOTHER_NETWORK_TYPE) {
         $level_1['join_network'] = array('caption' => 'JOIN Network', 'url' => $this->base_url . '/' . FILE_NETWORK_ACTION . '?action=join&amp;nid=' . $this->network_info->network_id . '&amp;cid=' . $this->network_info->category_id);
     } else {
         if (!$this->is_anonymous && $is_member && !$owner && $this->network_info->type != MOTHER_NETWORK_TYPE) {
             $level_1['unjoin_network'] = array('caption' => 'Unjoin Network', 'url' => $this->base_url . '/' . FILE_NETWORK_ACTION . '?action=leave&amp;nid=' . $this->network_info->network_id . '&amp;cid=' . $this->network_info->category_id);
         } else {
             if (Network::is_admin($this->network_info->network_id, (int) @$_SESSION['user']['id'])) {
                 $level_1['configure_network'] = array('caption' => __('Configure'), 'url' => $this->base_url . '/' . FILE_NETWORK_STATS);
             }
         }
     }
     if ($this->network_info->type == MOTHER_NETWORK_TYPE) {
         unset($level_1['home_network']);
     }
     if ($_PA->enable_network_spawning) {
         $level_1['create_network'] = array('caption' => __('Create a network'), 'url' => $this->mothership_info['extra']['links']['create_network']);
     }
     ////END OF These are level 1 links shown in top navigation bar
     ////These are level 2 links shown in second navigation bar
     $level_2 = array('home' => array('caption' => __('Home'), 'url' => $this->base_url . '/' . FILE_HOMEPAGE), 'user' => array('caption' => __('Me'), 'url' => $this->base_url . '/' . FILE_USER), 'people' => array('caption' => __('People'), 'url' => $this->base_url . '/' . FILE_PEOPLES), 'groups' => array('caption' => __('Groups'), 'url' => $this->base_url . '/' . FILE_GROUPS_HOME), 'search' => array('caption' => __('Search'), 'url' => $this->base_url . '/' . FILE_SEARCH_HOME . '?btn_searchContent=Search+Content'));
     ////END OF These are level 2 links shown in second navigation bar
     /// children of user 2nd level link
     $uid = $this->get_uid();
     //we need uid for some links
     $user_children = array('user_private' => array('caption' => __('My Page'), 'url' => $this->base_url . '/' . FILE_USER), 'user_widgets' => array('caption' => __('My Widgets'), 'url' => $this->base_url . '/' . FILE_WIDGET), 'messages' => array('caption' => __('My Messages'), 'url' => $this->base_url . '/' . FILE_MYMESSAGE), 'my_gallery' => array('caption' => __('My Gallery'), 'url' => $this->base_url . '/' . FILE_MEDIA_GALLERY), 'my_events' => array('caption' => __('My Events'), 'url' => $this->base_url . '/' . FILE_USER_CALENDAR), 'settings' => array('caption' => __('Edit My Account'), 'url' => $this->base_url . '/' . FILE_EDIT_PROFILE), 'customize_ui' => array('caption' => __('Themes'), 'url' => $this->base_url . '/' . FILE_CUSTOMIZE_UI));
     if ($this->is_anonymous) {
         //these links are not for anonymous
         unset($user_children);
     }
     ///END OF children of user 2nd level link
     /// children of people 2nd level link
     //required friend id in some places
     $friend_id = $this->get_friend_uid();
     $people_children = array('find_people' => array('caption' => 'Find people', 'url' => $this->base_url . '/' . FILE_PEOPLES), 'my_friends' => array('caption' => 'My friends', 'url' => $this->base_url . '/' . FILE_VIEW_ALL_MEMBERS . '?view_type=relations&amp;uid=' . $uid), 'people_who_call_me_friend' => array('caption' => 'People who call me friend', 'url' => $this->base_url . '/' . FILE_VIEW_ALL_MEMBERS . '?view_type=in_relations&amp;uid=' . $uid), 'friends_gallery' => array('caption' => 'Friends gallery', 'url' => $this->base_url . '/' . FILE_MEDIA_GALLERY . '?view=friends&amp;uid=' . $friend_id));
     if ($this->is_anonymous) {
         //these links are not for anonymous
         unset($people_children);
     }
     ///EOF children of people 2nd level link
     /// group general children
     //    $users_first_group_id = $this->get_users_first_group_id();
     $groups_general = array('find_groups' => array('caption' => 'Find groups', 'url' => $this->base_url . '/' . FILE_GROUPS_HOME), 'create_group' => array('caption' => 'Create', 'url' => $this->base_url . '/' . FILE_ADDGROUP), 'invite' => array('caption' => 'Invite', 'url' => $this->base_url . '/' . FILE_GROUP_INVITATION));
     /*    if ($users_first_group_id) {
     	$groups_general['group_media_gallery'] = array(
     	    'caption'=>'Groups gallery',
     	    'url'=>$this->base_url.'/'.FILE_GROUP_MEDIA_GALLERY.'?view=groups_media&amp;gid='.$users_first_group_id
     	    );
         }*/
     if ($this->is_anonymous) {
         //these links are not for anonymous
         unset($groups_general['create_group']);
         unset($groups_general['invite']);
         unset($groups_general['group_media_gallery']);
     }
     /// EOF group general children
     ///group specific menu children
     $group_id = $this->get_group_id();
     $group_specific = array('group_home' => array('caption' => 'Group Home', 'url' => $this->base_url . '/' . FILE_GROUP . '?gid=' . $group_id), 'group_forum' => array('caption' => 'Forum', 'url' => $this->base_url . '/' . FILE_FORUM_HOME . '?gid=' . $group_id), 'group_members' => array('caption' => 'Members', 'url' => $this->base_url . '/' . FILE_VIEW_ALL_MEMBERS . '?gid=' . $group_id), 'group_gallery' => array('caption' => 'Group gallery', 'url' => $this->base_url . '/' . FILE_GROUP_MEDIA_GALLERY . '?view=groups_media&amp;gid=' . $group_id), 'group_events' => array('caption' => 'Group Events', 'url' => $this->base_url . '/' . FILE_GROUP_CALENDAR . '?gid=' . $group_id), 'join' => array('caption' => 'Join', 'url' => $this->base_url . '/' . FILE_GROUP . '?gid=' . $group_id . '&amp;action=join'), 'unjoin' => array('caption' => 'Unjoin', 'url' => $this->base_url . '/' . FILE_GROUP . '?gid=' . $group_id . '&amp;action=leave'), 'delete_group' => array('caption' => 'Delete', 'url' => $this->base_url . '/' . FILE_GROUP . '?action=delete&amp;gid=' . $group_id, 'extra' => ' onclick ="return delete_confirmation_msg(\'Are you sure you want to delete this group?\') "'), 'group_customize_ui' => array('caption' => 'Themes', 'url' => $this->base_url . '/' . FILE_CUSTOMIZE_GROUP . '?gid=' . $group_id));
     /// group links are having some more complicated logic
     // following links are not visible to anonymous
     if ($this->is_anonymous) {
         unset($group_specific['create_group']);
         unset($group_specific['join']);
         unset($group_specific['unjoin']);
         unset($group_specific['edit_group']);
         unset($group_specific['invite']);
         unset($group_specific['delete_group']);
         unset($group_specific['moderate_group']);
         unset($group_specific['group_customize_ui']);
     } else {
         if (!empty($group_id) && !Group::is_admin($group_id, $_SESSION['user']['id'])) {
             unset($group_specific['edit_group']);
             unset($group_specific['delete_group']);
//.........這裏部分代碼省略.........
開發者ID:CivicCommons,項目名稱:oldBellCaPA,代碼行數:101,代碼來源:Navigation.php

示例5: count

    $group_details['is_admin'] = $is_admin;
    //////////////////get details of group EOF
    if (is_array($members)) {
        $count = count($members);
        foreach ($members as $member) {
            $count_relations = Relation::get_relations($member['user_id'], APPROVED, PA::$network_info->network_id);
            $user = new User();
            $user->load((int) $member['user_id']);
            $login_name = $user->login_name;
            $user_picture = $user->picture;
            $users_data[] = array('user_id' => $member['user_id'], 'picture' => $user_picture, 'login_name' => $login_name, 'no_of_relations' => count($count_relations));
        }
        $final_array = array('users_data' => $users_data, 'total_users' => $count);
    }
    $users = $final_array;
    if (isset($_SESSION['user']['id']) && Group::member_exists((int) $group->collection_id, (int) $_SESSION['user']['id'])) {
        $is_member = TRUE;
    }
    $group_details['is_member'] = $is_member;
    //..get details of group ends
}
//..ccid
if (!empty($_GET['btn_searchContent'])) {
    array_unshift($setting_data['middle'], 'SearchContentModule');
}
if ($_REQUEST['ccid']) {
    array_unshift($setting_data['left'], 'GroupAccessModule', 'MembersFacewallModule');
    array_unshift($setting_data['right'], 'GroupStatsModule', 'RecentPostModule');
}
function setup_module($column, $moduleName, $obj)
{
開發者ID:Cyberspace-Networks,項目名稱:CoreSystem,代碼行數:31,代碼來源:cnshowcontent.php

示例6: delete_user_groups

 /**
  * function used to delete a group or groups.
  * @param $user_id and $group_id
  */
 public function delete_user_groups($user_id, $group_id = NULL)
 {
     $network_owner_id = (int) PA::$network_info->owner_id;
     //getting user groups
     $all_user_groups = Group::get_user_groups($user_id);
     if (count($all_user_groups) > 0) {
         foreach ($all_user_groups as $group) {
             $this->collection_id = $group['gid'];
             if ($group['access'] == OWNER) {
                 // assign new Battalion/UGCGroup owner
                 Group::set_user_type($user_id, (int) $group['gid'], MEMBER);
                 // only MEMBER can leave a group!
                 $this->leave($user_id);
                 if (Group::member_exists((int) $group['gid'], $network_owner_id)) {
                     // network owner is already member of group
                     Group::set_user_type($network_owner_id, (int) $group['gid'], OWNER);
                     // transfer ownership to network owner
                 } else {
                     Group::set_group_owner($network_owner_id, (int) $group['gid']);
                     // insert new group owner
                 }
                 $role_id = GROUP_ADMIN_ROLE;
                 $role_extra = array('user' => false, 'network' => false, 'groups' => array((int) $group['gid']));
                 $role = array('role_id' => $role_id, 'extra' => serialize($role_extra));
                 $net_owner = new User();
                 $net_owner->load($network_owner_id);
                 $net_owner->set_user_role(array($role));
             } else {
                 if ($group['access'] == MEMBER || $group['access'] == MODERATOR) {
                     if ($group['access'] == MODERATOR) {
                         Group::set_user_type($user_id, (int) $group['gid'], MEMBER);
                         // only MEMBER can leave a group!
                     }
                     //voiding user membership
                     $this->leave($user_id);
                 }
             }
         }
     }
 }
開發者ID:paragjagdale,項目名稱:people-aggregator,代碼行數:44,代碼來源:Group.php

示例7: array

if ($user->picture) {
    $img_path = $base_url . "/files/" . $user->picture;
} else {
    $img_path = $base_url . "/images/default.jpg";
}
$is_member = FALSE;
$is_admin = FALSE;
$is_invite = FALSE;
if ($_GET['gid']) {
    $group = ContentCollection::load_collection((int) $_GET['gid'], $_SESSION['user']['id']);
    $pending = array();
    $accepted = array();
    if (Group::member_exists((int) $group->collection_id, (int) $_SESSION['user']['id'])) {
        $is_member = TRUE;
    }
    if ($group->reg_type == $group->REG_INVITE and Group::member_exists((int) $group->collection_id, (int) $_SESSION['user']['id'])) {
        $is_invite = TRUE;
    }
    if (Group::is_admin((int) $group->collection_id, (int) $_SESSION['user']['id'])) {
        $is_admin = TRUE;
        if ($group->is_moderated || $group->reg_type == $group->REG_MODERATED) {
            $total_in_mod_queue = count($group->get_moderation_queue('content')) + count($group->get_moderation_queue('user'));
        }
        $invs = Invitation::get_all((int) $_SESSION['user']['id'], $group->collection_id);
        foreach ($invs as $i) {
            if ($i['status'] == 0) {
                $pending[] = $i['id'];
            } elseif ($i['status'] == 1) {
                $accepted[] = $i['id'];
            }
        }
開發者ID:CivicCommons,項目名稱:oldBellCaPA,代碼行數:31,代碼來源:groupinvite.php

示例8: pageLoadGroup

function pageLoadGroup($group)
{
    $access = $group->access_type;
    $skip_group_modules = FALSE;
    $is_admin = FALSE;
    if ($group->access_type == $group->ACCESS_PRIVATE) {
        if (PA::$login_uid) {
            //if private group
            if (GROUP::member_exists($group->collection_id, PA::$login_uid)) {
                $skip_group_modules = FALSE;
            } else {
                // haha no way for non member of group
                $skip_group_modules = TRUE;
            }
        } else {
            //haha no way for anonymous user
            $skip_group_modules = TRUE;
        }
        $access_type = 'Private';
    } else {
        $access_type = 'Public';
    }
    if ($group->reg_type == $group->REG_OPEN) {
        $access_type .= ' Open';
    } else {
        $access_type .= ' Moderated';
    }
    if (Group::is_admin((int) $group->collection_id, (int) PA::$login_uid)) {
        $is_admin = TRUE;
    }
    $members = $group->get_members($cnt = FALSE, 5, 1, 'created', 'DESC', FALSE);
    $group_details = array();
    $group_details['collection_id'] = $group->collection_id;
    $group_details['type'] = $group->type;
    $group_details['author_id'] = $group->author_id;
    $user = new User();
    $user->load((int) $group->author_id);
    $login_name = $user->login_name;
    $first_name = $user->first_name;
    $last_name = $user->last_name;
    $group_details['author_name'] = $login_name;
    $group_details['author_picture'] = $user->picture;
    $group_details['title'] = $group->title;
    $group_details['description'] = $group->description;
    $group_details['is_active'] = $group->is_active;
    $group_details['picture'] = $group->picture;
    $group_details['desktop_picture'] = @$group->desktop_picture;
    $group_details['created'] = PA::datetime($group->created, 'long', 'short');
    // date("F d, Y h:i A", $group->created);
    $group_details['changed'] = $group->changed;
    $group_details['category_id'] = $group->category_id;
    $cat_obj = new Category();
    $cat_obj->set_category_id($group->category_id);
    $cat_obj->load();
    $cat_name = stripslashes($cat_obj->name);
    $cat_description = stripslashes($cat_obj->description);
    $group_details['category_name'] = $cat_name;
    $group_details['category_description'] = $cat_description;
    $group_details['members'] = Group::get_member_count($group->collection_id);
    $group_details['access_type'] = $access_type;
    $group_details['is_admin'] = $is_admin;
    //////////////////get details of group EOF
    if (is_array($members)) {
        $count = count($members);
        foreach ($members as $member) {
            $count_relations = Relation::get_relations($member['user_id'], APPROVED, PA::$network_info->network_id);
            $user = new User();
            $user->load((int) $member['user_id']);
            $login_name = $user->login_name;
            $user_picture = $user->picture;
            $users_data[] = array('user_id' => $member['user_id'], 'picture' => $user_picture, 'login_name' => $login_name, 'no_of_relations' => count($count_relations));
        }
        $final_array = array('users_data' => $users_data, 'total_users' => $count);
    }
    $users = $final_array;
    $is_member = Group::member_exists((int) $group->collection_id, (int) PA::$login_uid) ? TRUE : FALSE;
    $group_details['is_member'] = $is_member;
    $group_details['skip_group_modules'] = $skip_group_modules;
    $group_details['users'] = $users;
    return $group_details;
}
開發者ID:Cyberspace-Networks,項目名稱:PeopleAggregator,代碼行數:81,代碼來源:content.php

示例9: handleGET_leave

 private function handleGET_leave($request_data)
 {
     global $error_msg;
     if (PA::$login_uid && !empty($this->shared_data['group_info'])) {
         $group = $this->shared_data['group_info'];
         $user = PA::$login_user;
         $user_type = Group::get_user_type(PA::$login_uid, (int) $request_data['gid']);
         if (Group::is_admin((int) $request_data['gid'], (int) PA::$login_uid) && $user_type == OWNER) {
             // admin can leave a group but owner can't
             $error_msg = __("You can't leave your own group.");
         } else {
             if (Group::member_exists((int) $request_data['gid'], (int) PA::$login_uid)) {
                 try {
                     $x = $group->leave((int) PA::$login_uid);
                 } catch (PAException $e) {
                     $error_msg = "Operation failed (" . $e->message . "). Please try again";
                 }
             } else {
                 $error_msg = sprintf(__("You are not member of \"%s\"."), stripslashes($group->title));
             }
         }
         if (@$x) {
             $error_msg = sprintf(__("You have left \"%s\" successfully."), stripslashes($group->title));
             // also delete Family relation
             require_once 'api/Entity/TypedGroupEntityRelation.php';
             TypedGroupEntityRelation::delete_relation(PA::$login_uid, $request_data['gid'], PA::$network_info->network_id);
         }
     }
 }
開發者ID:Cyberspace-Networks,項目名稱:PeopleAggregator,代碼行數:29,代碼來源:FamilyModule.php

示例10: setup_module

function setup_module($column, $moduleName, $obj)
{
    global $request_info, $title, $body, $name, $email, $paging, $msg;
    global $group_details, $users, $param;
    switch ($moduleName) {
        case 'GroupAccessModule':
        case 'GroupStatsModule':
            $obj->group_details = $group_details;
            break;
        case 'MembersFacewallModule':
            $obj->group_details = $group_details;
            $obj->mode = PRI;
            $obj->block_type = HOMEPAGE;
            $obj->links = $users;
            $obj->gid = $_REQUEST['ccid'];
            break;
        case 'RecentPostModule':
            $obj->block_type = HOMEPAGE;
            $obj->type = 'group';
            $obj->mode = PRI;
            $obj->gid = $_REQUEST['ccid'];
            $obj->group_details = $group_details;
            break;
        case 'GroupForumPermalinkModule':
            global $group_top_mesg;
            $gid = $_REQUEST['ccid'];
            $group = ContentCollection::load_collection((int) $gid, $_SESSION['user']['id']);
            $is_member = Group::member_exists((int) $gid, $_SESSION['user']['id']);
            $is_admin = Group::is_admin((int) $gid, $_SESSION['user']['id']);
            if ($group->reg_type == REG_INVITE && !$is_member && !$is_admin && !user_can($param)) {
                $msg = 9005;
                return "skip";
            }
            $obj->parent_id = $request_info['parent_id'];
            $obj->parent_name_hidden = $request_info['parent_name_hidden'];
            $obj->parent_type = $request_info['parent_type'];
            $obj->header_title = $request_info['header_title'];
            $obj->title_form = $title;
            $obj->body = $body;
            $obj->name = $name;
            $obj->email = $email;
            $obj->Paging["page"] = $paging["page"];
            $obj->Paging["show"] = 5;
            //five records
            if ($error) {
                $obj->msg = $msg;
            }
            break;
    }
}
開發者ID:CivicCommons,項目名稱:oldBellCaPA,代碼行數:50,代碼來源:forum_messages.php

示例11: render

 function render()
 {
     $login_uid = @PA::$login_user->user_id;
     $this->gid = @$this->params['blog_id'];
     $this->blog_name = @$this->params['blog_name'];
     $this->note = '';
     if ($this->blog_name) {
         $this->find_or_create_blog();
     }
     if ($this->gid) {
         $this->type == 'group';
         $group = new Group();
         $group->collection_id = $this->gid;
         $group->load($this->gid);
         $this->group_member = Group::member_exists($group->collection_id, $login_uid) ? TRUE : FALSE;
         switch ($this->view) {
             case "recent_post":
                 // load content
                 $this->contents = $group->get_contents_for_collection($type = 'all', $cnt = FALSE, 1, 1, 'created', 'DESC');
                 $this->inner_template = 'recent_post.tpl';
                 break;
             case 'user':
                 // load content
                 if (@$this->params['cid']) {
                     // permalink, load only this one
                     $bp = new BlogPost();
                     try {
                         $bp->load((int) $this->params['cid']);
                         $this->count = 1;
                         $content = array();
                         foreach ($bp as $k => $v) {
                             $content[$k] = $v;
                         }
                         $this->contents[] = $content;
                     } catch (PAException $e) {
                         $this->err = __("Couldn't load BlogPost. ") . $e->getMessage();
                     }
                 } else {
                     $this->count = $group->get_contents_for_collection($type = 'all', $cnt = TRUE, 'all', 0, $sort_by = 'created', $direction = 'DESC');
                     $this->contents = $group->get_contents_for_collection($type = 'all', $cnt = FALSE, $this->show, $this->page, 'created', 'DESC');
                 }
                 break;
             case "admin":
                 $this->title = "Managing authors for " . $this->blog_name;
                 $this->inner_template = 'manageauthors.tpl';
                 // find members
                 $this->members = $group->get_members();
                 $this->member_count = count($this->members);
                 break;
         }
         // load Items for all BlogPosts -> for Comments to work
         foreach ($this->contents as $i => $post) {
             $item_params = array("type" => 'blogpost', "id" => $post['content_id'], "name" => $post['content_id'], "thumbnail" => "", "thumbnail_w" => "0", "thumbnail_h" => "0", "genres" => "blog", "url" => $this->blog_url . "?b_cid=" . $post['content_id']);
             Item::sync($item_params);
             // create or update row in 'items' database table
             $item = Item::find_by_subject('blogpost', $post['content_id']);
             $this->contents[$i]['comment_count'] = $item->comment_count;
         }
     } else {
         $this->err = __("No Blog found.");
     }
     $tmp_file = dirname(__FILE__) . "/" . $this->skin . "_" . $this->inner_template;
     $inner_html_gen =& new Template($tmp_file, $this);
     $this->inner_HTML = $inner_html_gen->fetch();
     $content = parent::render();
     return $content;
 }
開發者ID:CivicCommons,項目名稱:oldBellCaPA,代碼行數:67,代碼來源:BlogWidgetModule.php

示例12: catch

            $x = $group->join((int) $_SESSION['user']['id']);
        } catch (PAException $e) {
            $error_msg = "Operation failed (" . $e->message . "). Please try again";
        }
    } else {
        $error_msg = "You are already member of \"" . stripslashes($group->title) . "\" group.";
    }
    if ($x) {
        if ($group->reg_type == $group->REG_MODERATED) {
            $error_msg = "Your joining request has been submitted to the owner of \"" . stripslashes($group->title) . "\" group.";
        } else {
            $error_msg = "You have joined the \"" . stripslashes($group->title) . "\" group successfully.";
        }
    }
} elseif ($_GET['action'] == 'leave') {
    if (Group::member_exists((int) $_GET['gid'], (int) $_SESSION['user']['id'])) {
        try {
            $x = $group->leave((int) $_SESSION['user']['id']);
        } catch (PAException $e) {
            $error_msg = "Operation failed (" . $e->message . "). Please try again";
        }
    } else {
        $error_msg = "You are not member of " . stripslashes($group->title) . " group.";
    }
    if ($x) {
        $error_msg = "You have left the \"" . stripslashes($group->title) . "\" group successfully.";
    }
}
$header =& new Template(CURRENT_THEME_FSPATH . "/header.tpl");
$header->set('user_name', $user->first_name . ' ' . $user->last_name);
if ($network_info) {
開發者ID:CivicCommons,項目名稱:oldBellCaPA,代碼行數:31,代碼來源:groupmembers.php

示例13: leaveFamily

 private function leaveFamily($family, $uid)
 {
     $msg = null;
     $res = false;
     if (Group::member_exists((int) $family->collection_id, (int) $uid)) {
         try {
             $x = $family->leave((int) $uid);
             $res = true;
         } catch (PAException $e) {
             $msg = "Operation failed (" . $e->message . "). Please try again";
             $res = false;
         }
     }
     if (@$x) {
         $msg = sprintf(__("You have left \"%s\" successfully."), stripslashes($family->title));
         // also delete Family relation
         require_once 'api/Entity/TypedGroupEntityRelation.php';
         TypedGroupEntityRelation::delete_relation((int) $uid, (int) $family->collection_id, PA::$network_info->network_id);
     }
     return array($res, $msg);
 }
開發者ID:Cyberspace-Networks,項目名稱:PeopleAggregator,代碼行數:21,代碼來源:FamilyModerationModule.php

示例14: render

 function render()
 {
     global $login_uid;
     if ($this->type == 'group') {
         $this->outer_template = 'outer_show_content_group_module.tpl';
         $group = new Group();
         $group->collection_id = $this->gid;
         if ($this->content_type == NULL) {
             $this->content_type = 'all';
         }
         //$type = 'all',$cnt=FALSE, $show='ALL', $page=0, $sort_by='created', $direction='DESC'
         if (!empty($this->content_type)) {
             $this->Paging["count"] = $this->links = $group->get_contents_for_collection($this->content_type, TRUE, 10, 1, 'created', 'DESC', TRUE);
             $this->contents = $group->get_contents_for_collection($this->content_type, FALSE, $this->Paging["show"], $this->Paging["page"], 'created', 'DESC', TRUE);
         } else {
             $this->Paging["count"] = $this->links = $group->get_contents_for_collection($type = 'all', $cnt = TRUE, 'all', 0, $sort_by = 'created', $direction = 'DESC');
             $this->contents = $group->get_contents_for_collection($type = 'all', $cnt = FALSE, $this->Paging["show"], $this->Paging["page"], 'created', 'DESC');
         }
         $this->group_owner = FALSE;
         if (Group::is_admin($group->collection_id, $login_uid)) {
             $this->group_owner = TRUE;
         }
         $this->group_member = FALSE;
         if (Group::member_exists($group->collection_id, $login_uid)) {
             $this->group_member = TRUE;
         }
         /*
               if($this->html_block_id_flag == 1) {
                 $this->Paging["count"] = $this->links =  $group->get_contents_for_collection($type = 'all',$cnt=TRUE,'all' , 0, $sort_by='created', $direction='DESC');
                 $this->contents = $group->get_contents_for_collection($type = 'all', $cnt=FALSE, $this->Paging["show"], $this->Paging["page"],'created','DESC');
               } else {
                 $this->contents =  $group->get_contents_for_collection($this->content_type,FALSE, 10, 1, 'created', 'DESC',TRUE);
                 
         
               }*/
         $this->title = $this->group_details['title'] . '\'s Group Blog';
     } else {
         if ($this->type == "tag") {
             $this->Paging["count"] = Tag::get_associated_content_ids((int) $this->tag_id, $cnt = TRUE);
             $this->contents = Tag::get_associated_content_ids((int) $this->tag_id, $cnt = FALSE, $this->Paging["show"], $this->Paging["page"]);
         } else {
             if ($this->type == "search") {
                 $this->Paging["count"] = Content::content_search($this->search_string_array, $cnt = TRUE);
                 $this->contents = Content::content_search($this->search_string_array, $cnt = FALSE, $this->Paging["show"], $this->Paging["page"]);
             } else {
                 //print $this->content_type; exit;
                 $this->Paging["count"] = Content::load_content_id_array($this->uid, $this->content_type, $cnt = TRUE);
                 $contents = Content::load_content_id_array($this->uid, $this->content_type, $cnt = FALSE, $this->Paging["show"], $this->Paging["page"]);
                 $this->contents = $contents;
             }
         }
     }
     $this->orientation = LEFT;
     if ($this->type == 'user') {
         $this->block_type = 'ShowContentUserBlock';
         $this->do_pagination = TRUE;
     } else {
         if ($this->type == 'group') {
             if ($this->html_block_id_flag == 1) {
                 $this->block_type = 'ShowAllContent';
                 $this->do_pagination = TRUE;
             } else {
                 $this->block_type = 'ShowContentGroupBlock';
             }
         } else {
             if ($this->type == "tag") {
                 $this->block_type = 'ShowAllContent';
                 $this->do_pagination = TRUE;
             } else {
                 if ($this->type == "search") {
                     $this->block_type = 'ShowAllContent';
                     $this->do_pagination = TRUE;
                 } else {
                     if ($this->show_all == 1) {
                         $this->block_type = 'ShowAllContent';
                         $this->do_pagination = TRUE;
                     } else {
                         $this->block_type = 'ShowContentBlock';
                         $this->do_pagination = TRUE;
                     }
                 }
             }
         }
     }
     $this->inner_HTML = $this->generate_inner_html($this->contents, $this->type);
     $Pagination = new Pagination();
     $Pagination->setPaging($this->Paging);
     $this->page_first = $Pagination->getFirstPage();
     $this->page_last = $Pagination->getLastPage();
     $this->page_links = $Pagination->getPageLinks();
     $content = parent::render();
     return $content;
 }
開發者ID:CivicCommons,項目名稱:oldBellCaPA,代碼行數:93,代碼來源:ShowContentModule.php

示例15: js_includes

include "includes/page.php";
include_once "{$path_prefix}/ext/Group/Group.php";
require_once "{$path_prefix}/api/MessageBoard/MessageBoard.php";
/*including Js files */
$parameter .= js_includes('common.js');
// for query count
global $query_count_on_page, $login_uid;
$query_count_on_page = 0;
$user = new User();
$user->load($login_uid);
$login_name = $user->login_name;
$email = $user->email;
$request_info = load_info();
$parent_id = $request_info['parent_id'];
$parent_type = $request_info['parent_type'];
$is_member = Group::member_exists($parent_id, $login_uid);
if ($is_member == FALSE) {
    $error = TRUE;
    $msg[] = 'Please Join this group to perform any activity';
}
$gid = (int) $_GET['gid'];
function setup_module($column, $module, $obj)
{
    global $group_data, $gid;
    $obj->gid = $gid;
    switch ($module) {
        case 'MembersFacewallModule':
            $group = new Group();
            $group->collection_id = $gid;
            $group->is_active = 1;
            $members = $group->get_members($cnt = FALSE, 5, 1, 'created', 'DESC', FALSE);
開發者ID:CivicCommons,項目名稱:oldBellCaPA,代碼行數:31,代碼來源:create_forum_topic.php


注:本文中的Group::member_exists方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。