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;
 }
 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;
 }
 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;
 }
Esempio n. 4
0
 /**
   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']);
             unset($group_specific['moderate_group']);
             if (Group::member_exists($group_id, $_SESSION['user']['id']) == TRUE) {
                 unset($group_specific['join']);
             } else {
                 if (Group::member_exists($group_id, $_SESSION['user']['id']) == FALSE) {
                     unset($group_specific['unjoin']);
                 }
             }
             unset($group_specific['group_customize_ui']);
         } else {
             if (!empty($group_id) && Group::is_admin($group_id, $_SESSION['user']['id'])) {
                 unset($group_specific['join']);
                 unset($group_specific['unjoin']);
             }
         }
     }
     ///EOF group specific menu children
     /// children of group
     $groups_children = array('groups_general' => $groups_general, 'group_specific' => $group_specific);
     ///EOF children of group
     //for network option at 3 level
     $network = array('configure_network' => array('caption' => 'Configure', 'url' => $this->base_url . '/' . FILE_NETWORK_STATS), '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'));
     //     'home' => array('caption'=>'Home',
     //                                   'url'=>$this->base_url.'/'.FILE_HOMEPAGE
     //                                   ),
     //                       'statistics' => array('caption'=>'Setting',
     //                                   'url'=>$this->base_url.'/'.FILE_NETWORK_STATS
     //                                   ),
     //                       'manage_user' => array('caption'=>'Manage',
     //                                   'url'=>$this->base_url.'/'.FILE_NETWORK_MANAGE_USER
     //                                   ),
     //                        'user_defaults' => array('caption'=>'Defaults',
     //                                   'url'=>$this->base_url.'/'.FILE_NEW_USER_BY_ADMIN
     //                                   ),
     //                        'email_notification' => array('caption'=>'Notify',
     //                                   'url'=>$this->base_url.'/'.FILE_EMAIL_NOTIFICATION
     //                                   ),
     //                       'meta_network' => array('caption'=>'Meta Network',
     //                                   'url'=>$this->base_url.'/'.FILE_NETWORK_FEATURE
     //                                   ),
     //                       'module_selector' => array('caption'=>'Module Selector',
     //                                                  'url'=>$this->base_url.'/'
     //                                                  .FILE_MODULE_SELECTOR.
     //                                                  '?page_id=home_page_id'
     //                                                  ),
     // 			     );
     $network_notify = array('email_notification' => array('caption' => 'Email Notification', 'url' => $this->base_url . '/' . FILE_EMAIL_NOTIFICATION), 'network_bulletins' => array('caption' => 'Bulletins', 'url' => $this->base_url . '/' . FILE_NETWORK_BULLETINS));
     $network_setting = array('network_feature' => array('caption' => 'Set Feature Network', 'url' => $this->base_url . '/' . FILE_NETWORK_FEATURE), 'manage_emblem' => array('caption' => 'Manage Emblem', 'url' => $this->base_url . '/' . FILE_MANAGE_EMBLEM), 'manage_taketour' => array('caption' => 'Personalized Video', 'url' => $this->base_url . '/' . FILE_MANAGE_TAKETOUR), 'splash_page' => array('caption' => 'Configure Splash Page', 'url' => $this->base_url . '/' . FILE_CONFIGURE_SPLASH_PAGE), 'top_bar' => array('caption' => 'Top Bar Enable/Disable', 'url' => '#'));
     $network_default = array('new_user_by_admin' => array('caption' => 'Create User', 'url' => $this->base_url . '/' . FILE_NEW_USER_BY_ADMIN), 'user_defaults' => array('caption' => 'User Defaults', 'url' => $this->base_url . '/' . FILE_NETWORK_USER_DEFAULTS), 'relationship_settings' => array('caption' => 'Relationships', 'url' => $this->base_url . '/' . FILE_RELATIONSHIP_SETTINGS));
     $manage_network = array('manage_user' => array('caption' => 'Manage Users', 'url' => $this->base_url . '/' . FILE_NETWORK_MANAGE_USER), 'manage_content' => array('caption' => 'Manage Contents', 'url' => $this->base_url . '/' . FILE_NETWORK_MANAGE_CONTENT), 'manage_links' => array('caption' => 'Manage Links', 'url' => $this->base_url . '/' . FILE_NETWORK_LINKS));
     $network_stats = array('statistics' => array('caption' => 'General', 'url' => $this->base_url . '/' . FILE_NETWORK_STATS), 'customize_ui' => array('caption' => 'Customize Ui', 'url' => $this->base_url . '/' . FILE_NETWORK_CUSTOMIZE_UI_PAGE));
     $network_module_selector = array('home_page_id' => array('caption' => 'Home Page', 'url' => $this->base_url . '/' . FILE_MODULE_SELECTOR . '?page_id=home_page_id'), 'user_default_page_id' => array('caption' => 'User Default Page', 'url' => $this->base_url . '/' . FILE_MODULE_SELECTOR . '?page_id=user_default_page_id'), 'group_directory_page_id' => array('caption' => 'Group Directory Page', 'url' => $this->base_url . '/' . FILE_MODULE_SELECTOR . '?page_id=group_directory_page_id'), 'network_directory_page_id' => array('caption' => 'Network Directory Page', 'url' => $this->base_url . '/' . FILE_MODULE_SELECTOR . '?page_id=network_directory_page_id'));
     if ($this->network_info->type != MOTHER_NETWORK_TYPE) {
         unset($network['meta_network']);
     }
     if ($this->network_info->type != MOTHER_NETWORK_TYPE) {
         unset($network['manage_taketour']);
         unset($network['manage_emblem']);
     }
     //end
     /// second level menu for network
     $level_3 = array('user' => @$user_children, 'people' => @$people_children, 'groups' => $groups_children, 'network' => $network, 'network_notify' => $network_notify, 'network_module_selector' => $network_module_selector, 'network_setting' => $network_setting, 'network_default' => $network_default, 'manage_network' => $manage_network, 'network_stats' => $network_stats);
     ///EOF second level menu children
     ///set level menu items
     $this->level_1 = $level_1;
     $this->level_2 = $level_2;
     $this->level_3 = $level_3;
 }
    $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)
{
Esempio n. 6
0
 /**
  * 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);
                 }
             }
         }
     }
 }
Esempio n. 7
0
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'];
            }
        }
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;
}
 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);
         }
     }
 }
Esempio n. 10
0
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;
    }
}
 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;
 }
Esempio n. 12
0
            $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) {
 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);
 }
 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;
 }
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);
 /**
  * get pending invitations for specified email address + uid
  * @access public
  * @param varchar @email
  */
 public static function get_pending_invitations_for_user_by_email($email_id, $uid)
 {
     Logger::log("Enter: Invitation::get_pending_invitations_for_email_id() | Args: \$email_id = {$email_id}");
     $res = Dal::query("SELECT I.inv_id, I.inv_user_email, I.inv_collection_id, CC.title,U.user_id, U.first_name, U.last_name FROM {invitations} as I LEFT JOIN {contentcollections} as CC ON I.inv_collection_id = CC.collection_id INNER JOIN {users} as U on CC.author_id = U.user_id WHERE I.inv_collection_id <> -1 AND I.inv_user_email = ? AND I.inv_status = ?", array($email_id, INVITATION_PENDING));
     $invites = array();
     $i = 0;
     while ($row = $res->fetchRow(DB_FETCHMODE_OBJECT)) {
         if (Group::member_exists((int) $row->inv_collection_id, (int) $uid)) {
             continue;
         }
         $invites[$i]['inv_id'] = $row->inv_id;
         $invites[$i]['inv_user_email'] = $row->inv_user_email;
         $invites[$i]['collection_id'] = $row->inv_collection_id;
         $invites[$i]['collection_name'] = $row->title;
         $invites[$i]['author_first_name'] = $row->first_name;
         $invites[$i]['author_last_name'] = $row->last_name;
         $i++;
     }
     Logger::log("Exit: Invitation::get_pending_invitations_for_email_id()");
     return $invites;
 }
function peopleaggregator_leaveGroup($args)
{
    $user = User::from_auth_token($args['authToken']);
    $ccid = api_parse_group_id($args['id']);
    // not a member?
    if (!Group::member_exists($ccid, $user->user_id)) {
        throw new PAException(OPERATION_NOT_PERMITTED, "User {$user->login_name} is not a member of that group");
    }
    // trying to leave own group?
    if (Group::is_admin($ccid, $user->user_id)) {
        throw new PAException(OPERATION_NOT_PERMITTED, "Group leader cannot leave the group");
    }
    // find group
    $g = ContentCollection::load_collection($ccid, $user->user_id);
    // remove user from group
    if (!$g->leave($user->user_id)) {
        throw new PAException(OPERATION_NOT_PERMITTED, "Unable to leave group");
    }
    return array('success' => TRUE);
}
function uihelper_generate_center_content_permalink($cid, $show = 0)
{
    global $app;
    $image_media_gallery = FALSE;
    $back_page = PA::$url . $app->current_route;
    $content = CNContent::load_content((int) $cid, (int) PA::$login_uid);
    // filter content fields for output
    $content->title = _out($content->title);
    $content->body = _out($content->body);
    if (strstr($back_page, PA_ROUTE_CONTENT) || strstr($back_page, PA_ROUTE_PERMALINK)) {
        if ($content->parent_collection_id > 0) {
            $collection = ContentCollection::load_collection((int) $content->parent_collection_id, PA::$login_uid);
            if ($collection->type == GROUP_COLLECTION_TYPE) {
                $back_page = PA::$url . PA_ROUTE_GROUP . "/gid=" . $content->parent_collection_id;
            } else {
                $back_page = PA::$url . PA_ROUTE_MEDIA_GALLEY_IMAGES . "/uid=" . $content->author_id;
            }
            // IF permalink content is a group content redirect to group homepage
        } else {
            //if coming from permalink page then redirect to user page
            $back_page = PA::$url . PA_ROUTE_USER_PRIVATE;
        }
    }
    $moderateduser = Group::is_admin((int) $content->parent_collection_id, (int) PA::$login_uid) ? 1 : 0;
    $back_page = urlencode($back_page);
    if (!$content->is_html) {
        $content->body = nl2br($content->body);
    }
    $media_gallery_content = NULL;
    $media_gallery_content = in_array(trim($content->type), array('Image', 'Audio', 'Video'));
    $editable = PA::$login_uid == $content->author_id || $moderateduser;
    $comments = Comment::get_comment_for_content($cid, '', 'ASC');
    $number_of_comments = count($comments);
    $content->no_of_comments = $number_of_comments;
    $trackback = CNContent::get_trackbacks_for_content($cid);
    $number_of_trackbacks = count($trackback);
    $content->no_of_trackbacks = $number_of_trackbacks;
    $content->trackback_url = PA::$url . "/pa_trackback.php?cid=" . $cid;
    $content_user = new User();
    $content_user->load((int) $content->author_id);
    $content->create_time = PA::date($content->changed, 'long');
    // date("l, F d, Y", $content->changed);
    $tags = Tag::load_tags_for_content($cid);
    if ($tags) {
        $t = array();
        for ($i = 0; $i < count($tags); $i++) {
            $name = _out($tags[$i]['name']);
            $uid = PA::$login_uid;
            $url = PA::$url . '/' . FILE_TAG_SEARCH . '?name_string=content_tag&keyword=' . $tags[$i]["name"];
            $t[] = "<a href={$url}>" . $name . "</a>";
        }
        $tag_string = "<b>Tags : </b>" . implode(", ", $t);
    } else {
        $tag_string = "";
    }
    $content->tag_entry = $tag_string;
    if (property_exists($content, 'sbname')) {
        if (substr($content->sbname, 0, 5) == 'event') {
            $content->type = 'SBEvent';
        } elseif (substr($content->sbname, 0, 6) == 'review') {
            $content->type = 'Review';
        } elseif (substr($content->sbname, 0, 11) == 'media/audio') {
            $content->type = 'Audio';
        } elseif (substr($content->sbname, 0, 11) == 'media/video') {
            $content->type = 'Video';
        } elseif (substr($content->sbname, 0, 11) == 'media/image') {
            $content->type = 'Image';
        } elseif (substr($content->sbname, 0, 14) == 'showcase/group') {
            $content->type = 'GroupShowCase';
        } elseif (substr($content->sbname, 0, 15) == 'showcase/person') {
            $content->type = 'PersonShowCase';
        }
    }
    // replace magic strings
    $content->replace_percent_strings(PA::$url);
    $type = $content->type;
    $type = $type . 'Permalink';
    // comments
    $comments_list_tpl = new Template(CURRENT_THEME_FSPATH . "/cncontent_comments.php");
    $comments_list_tpl->set('current_theme_path', PA::$theme_url);
    $comments_list_tpl->set('comments', $comments);
    $comments_list_tpl->set('author_id', $content->author_id);
    // Setting the variable for the abuse form ...
    $comments_list = $comments_list_tpl->fetch();
    //comment form
    $cnform_comment_tpl = new Template(CURRENT_THEME_FSPATH . "/cnform_comment.php");
    $cnform_comment_tpl->set('current_theme_path', PA::$theme_url);
    if (isset(PA::$login_uid)) {
        $user = new User();
        $user->load((int) PA::$login_uid);
        $login_name = $user->login_name;
        $cnform_comment_tpl->set('name', $login_name);
        $cnform_comment_tpl->set('login_name', $user->login_name);
    }
    $cnform_comment_tpl->set('cid', $cid);
    if ($content->parent_collection_id > 0) {
        $cnform_comment_tpl->set('ccid', $content->parent_collection_id);
    }
    // abuse form
    $cnform_abuse_tpl = new Template(CURRENT_THEME_FSPATH . "/cnform_abuse.php");
    /* Permalink and edit links for content */
    if ($content->parent_collection_id != -1) {
        $perma_link = PA::$url . PA_ROUTE_PERMALINK . "/cid=" . $content->content_id . '&ccid=' . $content->parent_collection_id;
    } else {
        $perma_link = PA::$url . PA_ROUTE_PERMALINK . "/cid=" . $content->content_id;
    }
    $params = array('permissions' => 'edit_content', 'uid' => PA::$login_uid, 'cid' => $content->content_id);
    if (PermissionsHandler::can_user(PA::$login_uid, $params)) {
        if ($media_gallery_content) {
            $edit_link = PA::$url . '/edit_media.php?cid=' . $content->content_id;
        } else {
            $edit_link = PA::$url . "/cncontent_blog.php?cid=" . $content->content_id;
        }
        $delete_link = PA::$url . PA_ROUTE_CONTENT . "?action=deleteContent&cid=" . $content->content_id . '&amp;back_page=' . $back_page;
        // handle Event separately
        if ($type == "EventPermalink") {
            $edit_link = PA::$url . '/calendar.php?cid=' . $content->content_id;
            $delete_link = $edit_link . "&delete=1" . '&amp;back_page=' . $back_page;
        }
    } else {
        $edit_link = $delete_link = NULL;
    }
    $user_link = PA::$url . PA_ROUTE_USER_PUBLIC . '/' . $content->author_id;
    /* Code for Approval and Denial links for a content */
    if ($moderateduser && $content->is_active == 2) {
        $approval_link = PA::$url . PA_ROUTE_PERMALINK . '/cid=' . $content->content_id . '&ccid=' . $content->parent_collection_id . '&apv=1';
        $denial_link = PA::$url . PA_ROUTE_PERMALINK . '/cid=' . $content->content_id . '&ccid=' . $content->parent_collection_id . '&dny=1';
    } else {
        $approval_link = $denial_link = NULL;
    }
    // Show comments form to logged in users, only if comments enabled.
    global $comments_disabled;
    // fix by Z.Hron; if group content - only members of group can comment it
    $can_user_comment = true;
    if (isset($_GET['gid']) && isset(PA::$login_uid)) {
        $can_user_comment = Group::member_exists((int) $_GET['gid'], PA::$login_uid);
    }
    if (!$comments_disabled && !empty(PA::$login_uid) && $can_user_comment) {
        $cnform_comment = $cnform_comment_tpl->fetch();
        $cnform_abuse = $cnform_abuse_tpl->fetch();
    } else {
        $cnform_comment = $cnform_abuse = NULL;
    }
    if (getShadowedPath(CURRENT_THEME_FSPATH . "/{$type}.php")) {
        $middle_content = new Template(getShadowedPath(CURRENT_THEME_FSPATH . "/{$type}.php"));
        $middle_content->set_object('contents', $content);
        $middle_content->set('editable', $editable);
        $middle_content->set('picture_name', $content_user->picture);
        //  to set picture name for diplaying in contets
        $middle_content->set('user_id', $content_user->user_id);
        $middle_content->set('user_name', $content_user->first_name . ' ' . $content_user->last_name);
        $middle_content->set('current_theme_path', PA::$theme_url);
        $middle_content->set('back_page', $back_page);
        $middle_content->set('comments', $comments_list);
        $middle_content->set('cnform_comment', $cnform_comment);
        $middle_content->set('cnform_abuse', $cnform_abuse);
        $middle_content->set('media_gallery_content', $media_gallery_content);
        if ($show == 1) {
            $middle_content->set('show', $show);
        }
        $middle_content->set('permalink', $perma_link);
        $middle_content->set('edit_link', $edit_link);
        $middle_content->set('approval_link', $approval_link);
        $middle_content->set('denial_link', $denial_link);
        $middle_content->set('delete_link', $delete_link);
        $middle_content->set('user_link', $user_link);
        $return_content = $middle_content->fetch();
    } else {
        $return_content = '<p>Content does not have a display template.</p><p>Create a ' . $type . '.php file to display this content type.</p>';
    }
    return $return_content;
}
 private function checkUser($request_data)
 {
     $this->login_user = PA::$login_user;
     if (PA::$login_uid && is_object($this->board)) {
         $member = null;
         $members = PaForumsUsers::listPaForumsUsers("user_id = " . PA::$login_uid . " AND board_id = " . $this->board->get_id());
         if (isset($members[0])) {
             $member = $members[0];
         }
         if ($member) {
             // check is user a member
             $this->forum_user = $member;
             $user_status = $this->forum_user->get_user_status();
             $this->shared_data['board_member'] = $this->forum_user;
         } else {
             // logged user but not member of this board!
             $is_member = false;
             switch ($this->board_type) {
                 case PaForumBoard::network_board:
                     $is_member = Network::member_exists($this->shared_data['network_id'], PA::$login_uid);
                     break;
                 case PaForumBoard::group_board:
                     $is_member = Group::member_exists($this->gid, PA::$login_uid);
                     break;
                 case PaForumBoard::personal_board:
                     $is_member = false;
                     break;
                 default:
                     $is_member = false;
             }
             if ($is_member) {
                 $user_status = PaForumsUsers::_allowed;
                 try {
                     $params = array("user_id" => PA::$login_uid, "board_id" => $this->board->get_id(), "user_status" => $user_status, "is_active" => 1, "date_join" => date("Y-m-d H:i:s"));
                     PaForumsUsers::insertPaForumsUsers($params);
                     $members = PaForumsUsers::listPaForumsUsers("user_id = " . PA::$login_uid . " AND board_id = " . $this->board->get_id());
                     if (isset($members[0])) {
                         $this->forum_user = $members[0];
                     }
                 } catch (Exception $e) {
                     $error_msg = "Exception in ForumModule, function checkUser();<br />Message: " . $e->getMessage();
                 }
             } else {
                 $user_status = PaForumsUsers::_notmember | PaForumsUsers::_anonymous;
                 $this->forum_user = null;
             }
         }
         $params = array('permissions' => 'manage_forum', 'board' => $this->board, 'gid' => !empty($this->gid) ? $this->gid : null);
         if (PermissionsHandler::can_user(PA::$login_uid, $params)) {
             $user_status = $user_status | PaForumsUsers::_admin;
         }
         if ($user_status & PaForumsUsers::_banned) {
             $board = $this->getDefaultBoard($request_data, false);
             $this->setupBoard($board);
             $user = new User();
             $user->load((int) $this->forum_user->get_user_id());
             $this->title = __('Banned User');
             $this->set_inner_template('cnmodule_content_banned_user.php');
             $this->inner_HTML = $this->generate_inner_html(array('page_id' => $this->page_id, 'forum_user' => $user, 'user_status' => $user_status, 'board_settings' => $this->board_settings));
             return false;
         }
     } else {
         $this->forum_user = null;
         $user_status = PaForumsUsers::_anonymous;
     }
     return $user_status;
 }
Esempio n. 20
0
 /**
  * Join a group
  * @access public
  * @param int $user_id
  */
 public function join($user_id, $email = NULL, $GInvID = NULL)
 {
     Logger::log("Enter: Group::join() | Args: \$user_id = {$user_id}");
     $this->created = time();
     if (!$this->is_active) {
         throw new PAException(OPERATION_NOT_PERMITTED, "Trying to join a deleted group");
     }
     if (Group::member_exists($this->collection_id, $user_id)) {
         throw new PAException(OPERATION_NOT_PERMITTED, "Already a member of this group.");
     }
     switch ($this->reg_type) {
         case $this->REG_MODERATED:
             // moderated group - send moderation request
             $this->moderate_user($user_id);
             break;
         case $this->REG_INVITE:
             // Check whether the user has the invitation to join the group or not.
             if (!Invitation::check_invitation($GInvID, $this->collection_id)) {
                 // uninvited!
                 throw new PAException(GROUP_NOT_INVITED, "You need to have invitation link to join this group.");
             }
             // fall through to default behaviour if we do have an invitation
         // fall through to default behaviour if we do have an invitation
         default:
             // either it's an open group, or an invite-only one and the
             // user has an invitation, so add the user to the group.
             $res = Dal::query("INSERT INTO {groups_users} (group_id, user_id, user_type, created) VALUES (?, ?, ?, ?)", array($this->collection_id, $user_id, MEMBER, $this->created));
             break;
     }
     Logger::log("Exit: Group::join()");
     return TRUE;
 }
Esempio n. 21
0
        $heading = "All Groups";
        if (!$allgroups) {
            $error_msg = "No groups published yet.";
        }
    }
    if ($allgroups) {
        foreach ($allgroups as $groups) {
            $ids[] = $groups['group_id'];
        }
    }
}
$group_details = array();
for ($gr = 0; $gr < count($ids); $gr++) {
    $group = ContentCollection::load_collection((int) $ids[$gr], $_SESSION['user']['id']);
    $group_tags = Tag::load_tags_for_content_collection($ids[$gr]);
    $member_exist = Group::member_exists($ids[$gr], $_SESSION['user']['id']);
    if ($group_tags) {
        $t = array();
        for ($i = 0; $i < count($group_tags); $i++) {
            $name = $group_tags[$i]['name'];
            $t[] = '<a href="showgroup.php?tag=' . $group_tags[$i]['name'] . '">' . $group_tags[$i]['name'] . '</a>';
        }
        $tag_string = "<b>Tags:</b> " . implode(", ", $t);
    } else {
        $tag_string = "";
    }
    if ($group->picture) {
        $picture = "<img src=\"" . $group->picture . "\" height='50px' width='50px'/>";
    } else {
        $picture = "<img src='" . $current_theme_path . "/images/default.jpg' height='50px' width='50px'/>";
    }
* @package PeopleAggregator
*/
//anonymous user can not view this page;
$login_required = FALSE;
$use_theme = 'Beta';
//TODO : Remove this when new UI is completely implemented.
//including necessary files
include_once "web/includes/page.php";
include_once "api/ModuleSetting/ModuleSetting.php";
include_once "api/Group/Group.php";
global $login_uid;
$msg = '';
if (!empty($_GET['gid'])) {
    $gid = (int) $_GET['gid'];
    $group_data = ContentCollection::load_collection($gid, $login_uid);
    $is_member = Group::member_exists($gid, $login_uid);
    $is_admin = Group::is_admin($gid, $login_uid);
    if ($group_data->reg_type == REG_INVITE && !$is_member && !$is_admin) {
        $msg = 9005;
    }
}
function setup_module($column, $module, $obj)
{
    global $is_member, $is_admin, $group_data, $gid;
    $obj->gid = $gid;
    switch ($module) {
        case 'MembersFacewallModule':
            $group = new Group();
            $group->collection_id = $gid;
            $group->is_active = ACTIVE;
            $members = $group->get_members($cnt = FALSE, 5, 1, 'created', 'DESC', FALSE);
Esempio n. 23
0
        header("Location: {$base_url}/generic_error.php?msg={$redirect_msg}&back_to_page={$back_to_page}");
        exit;
    }
} elseif ($group_id) {
    $obj_group = new Group();
    try {
        $obj_group->load($group_id);
        $parent_name = stripslashes($obj_group->title);
        //$parent_description = stripslashes($obj_group->description);
    } catch (PAException $e) {
        $msg = "Error occured in retreiving group information\n";
        $msg .= "<br><center><font color=\"red\">" . $e->message . "</font></center>";
        $error_code = $e->code;
        $load_error = TRUE;
    }
    if (!Group::member_exists((int) $obj_group->collection_id, (int) $_SESSION['user']['id'])) {
        $load_error = TRUE;
    }
    if ($load_error) {
        $redirect_msg = "Group does not exist.";
        $back_to_page = $base_url . '/forums.php';
        header("Location: {$base_url}/generic_error.php?msg={$redirect_msg}&back_to_page={$back_to_page}");
        exit;
    }
}
if (isset($_POST['submit'])) {
    $txt_title = trim($_POST['txt_title']);
    $textarea_contents = trim($_POST['textarea_contents']);
    if ($txt_title == '') {
        $post_error = TRUE;
        $msg .= "<font color=\"red\">Please specify title</font><br>";
 /**
   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()
 {
     $user_id = isset($_SESSION['user']['id']) ? $_SESSION['user']['id'] : 0;
     ////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, $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) $user_id)) {
                 $level_1['configure_network'] = array('caption' => __('Configure'), 'url' => $this->base_url . PA_ROUTE_CONFIGURE_NETWORK);
             }
         }
     }
     if ($this->network_info->type == MOTHER_NETWORK_TYPE) {
         unset($level_1['home_network']);
     }
     if (PA::$config->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 . PA_ROUTE_HOME_PAGE), 'user' => array('caption' => __(PA::$mypage_noun), 'url' => $this->base_url . PA_ROUTE_USER_PRIVATE), 'people' => array('caption' => __(PA::$people_noun), 'url' => $this->base_url . PA_ROUTE_PEOPLES_PAGE), 'groups' => array('caption' => __(PA::$group_noun_plural), 'url' => $this->base_url . PA_ROUTE_GROUPS));
     if (!empty(PA::$config->useTypedGroups)) {
         $level_2 = $level_2 + array('directory' => array('caption' => __('Orgs'), 'url' => $this->base_url . PA_ROUTE_TYPED_DIRECTORY));
         if (!empty(PA::$config->simple['use_families'])) {
             $level_2 = $level_2 + array('families' => array('caption' => __('Neighbors'), 'url' => $this->base_url . PA_ROUTE_FAMILY_DIRECTORY));
         }
     }
     $level_2 = $level_2 + array('forum' => array('caption' => __('Forum'), 'url' => $this->base_url . PA_ROUTE_FORUMS . "/network_id=" . $this->network_info->network_id), 'search' => array('caption' => __('Search'), 'url' => $this->base_url . PA_ROUTE_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_children = $user_children + array('user_private' => array('caption' => __('My Page'), 'url' => $this->base_url . PA_ROUTE_USER_PRIVATE));
     $user_children = $user_children + array('user_widgets' => array('caption' => __('My Widgets'), 'url' => $this->base_url . '/' . FILE_WIDGET));
     $user_children = $user_children + array('messages' => array('caption' => __('My Messages'), 'url' => $this->base_url . PA_ROUTE_MYMESSAGE));
     $user_children = $user_children + array('my_gallery' => array('caption' => __('My Gallery'), 'url' => $this->base_url . PA_ROUTE_MEDIA_GALLEY_IMAGES . "/uid={$uid}"));
     $user_children = $user_children + array('my_events' => array('caption' => __('My Events'), 'url' => $this->base_url . '/' . FILE_USER_CALENDAR), 'my_friends' => array('caption' => __('My Friends'), 'url' => $this->base_url . "/view_all_members.php?view_type=in_relations&amp;uid={$uid}"));
     $user_children = $user_children + array('my_forum' => array('caption' => __('My Forum'), 'url' => $this->base_url . PA_ROUTE_FORUMS . "/network_id=" . $this->network_info->network_id . '&user_id=' . $uid));
     $user_children = $user_children + array('my_points' => array('caption' => __('My Points'), 'url' => $this->base_url . PA_ROUTE_POINTS_DIRECTORY . "?uid={$uid}"));
     if (!empty(PA::$config->simple['use_families'])) {
         // get this users Family or Families
         require_once "api/Entity/TypedGroupEntityRelation.php";
         $userfamilyRelations = TypedGroupEntityRelation::get_relation_for_user($uid, 'family');
         if (count($userfamilyRelations) == 1) {
             $user_children = $user_children + array('my_family' => array('caption' => __('My Family'), 'url' => $this->base_url . PA_ROUTE_FAMILY . "?gid=" . $userfamilyRelations[0]->object_id));
         } else {
             $html = "<ul>";
             foreach ($userfamilyRelations as $i => $relation) {
                 $group = ContentCollection::load_collection((int) $relation->object_id, PA::$login_uid);
                 $html .= "<li>";
                 $html .= "<a href=\"" . $this->base_url . PA_ROUTE_FAMILY . "?gid=" . $relation->object_id . "\">" . $group->title . "</a>";
                 $html .= "</li>";
             }
             $html .= "</ul>";
             $user_children = $user_children + array('my_family' => array('caption' => __('My Families'), 'html' => $html));
         }
     }
     // end of !empty(PA::$config->simple['use_families'])
     $user_children = $user_children + array('settings' => array('caption' => __('Edit My Account'), 'url' => $this->base_url . PA_ROUTE_EDIT_PROFILE));
     $user_children = $user_children + array('customize_ui' => array('caption' => __('Themes'), 'url' => $this->base_url . PA_ROUTE_CUSTOMIZE_USER_GUI . "/theme/uid={$uid}"));
     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' => sprintf(__('Find %s'), __(PA::$people_noun)), 'url' => $this->base_url . PA_ROUTE_PEOPLES_PAGE), 'my_friends' => array('caption' => __('My friends'), 'url' => $this->base_url . '/' . FILE_VIEW_ALL_MEMBERS . '?view_type=relations&amp;uid=' . $uid), 'friends_gallery' => array('caption' => __('Friends gallery'), 'url' => $this->base_url . PA_ROUTE_MEDIA_GALLEY_IMAGES . "/uid={$friend_id}&view=friends"));
     if ($this->is_anonymous) {
         //these links are not for anonymous
         unset($people_children);
     }
     ///EOF children of people 2nd level link
     $family_children = array('neighbors' => array('caption' => __("Neighbors"), 'url' => $this->base_url . PA_ROUTE_FAMILY_DIRECTORY), 'family_home' => array('caption' => __("Family Homepage"), 'url' => $this->base_url . PA_ROUTE_FAMILY . "/gid=" . $this->group_id), 'family_members' => array('caption' => __("Family Members"), 'url' => $this->base_url . PA_ROUTE_FAMILY_MEMBERS . "/gid=" . $this->group_id));
     /// group general children
     //    $users_first_group_id = $this->get_users_first_group_id();
     $groups_general = array('find_groups' => array('caption' => sprintf(__('Find %s'), __(PA::$group_noun_plural)), 'url' => $this->base_url . PA_ROUTE_GROUPS), 'create_group' => array('caption' => __('Create'), 'url' => $this->base_url . '/' . FILE_ADDGROUP), 'invite' => array('caption' => __('Invite'), 'url' => $this->base_url . '/' . FILE_GROUP_INVITATION));
     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
     $gid = $group_id = $this->get_group_id();
     $group_specific = array('group_home' => array('caption' => sprintf(__('%s Home'), __(PA::$group_noun)), 'url' => $this->base_url . PA_ROUTE_GROUP . '/gid=' . $group_id), 'group_forum' => array('caption' => sprintf(__('%s Forum'), __(PA::$group_noun)), 'url' => $this->base_url . PA_ROUTE_FORUMS . "/network_id=" . $this->network_info->network_id . '&gid=' . $group_id), 'group_members' => array('caption' => sprintf(__('%s Members'), __(PA::$group_noun)), 'url' => $this->base_url . '/' . FILE_VIEW_ALL_MEMBERS . '?gid=' . $group_id), 'group_gallery' => array('caption' => sprintf(__('%s Gallery'), __(PA::$group_noun)), 'url' => $this->base_url . PA_ROUTE_MEDIA_GALLEY_IMAGES . '/view=groups_media&amp;gid=' . $group_id), 'group_events' => array('caption' => sprintf(__('%s Events'), __(PA::$group_noun)), 'url' => $this->base_url . '/' . FILE_GROUP_CALENDAR . '?gid=' . $group_id));
     $group_member = FALSE;
     $group_may_post = FALSE;
     $group_may_invite = FALSE;
     $group_moderator = FALSE;
     $group_manange_ads = FALSE;
     $group_owner = FALSE;
     if (PA::$login_uid) {
         if (Group::member_exists($gid, PA::$login_uid)) {
             $group_member = TRUE;
             // TODO: split this out to it's own perm check
             $group_may_post = TRUE;
             $group_may_invite = TRUE;
         }
         if (PermissionsHandler::can_group_user(PA::$login_uid, $gid, array('permissions' => 'manage_groups, manage_roles')) || Group::is_admin($gid, PA::$login_uid)) {
             $group_owner = TRUE;
             $group_moderator = TRUE;
         } else {
             if (PermissionsHandler::can_group_user(PA::$login_uid, $gid, array('permissions' => 'manage_groups'))) {
                 $group_moderator = TRUE;
             }
         }
         // network level ad manager?
         $group_manange_ads = PermissionsHandler::can_user(PA::$login_uid, array('permissions' => 'manage_ads'));
         // check for manageads of group permissions
         if (!$group_manange_ads) {
             // we do this check only if the user is not already permitted to manage ads
             $group_manange_ads = PermissionsHandler::can_group_user(PA::$login_uid, $gid, array('permissions' => 'manage_ads'));
         }
         if ($group_may_invite) {
             $group_specific = array('invite' => array('caption' => __("Invite a Friend"), 'url' => PA::$url . PA_ROUTE_GROUP_INVITE . '/gid=' . $gid)) + $group_specific;
         }
         if ($group_may_post) {
             // member get's a 'Create Post' link on top
             $group_specific = array('create_post' => array('caption' => __("Create post"), 'url' => PA::$url . '/post_content.php?ccid=' . $gid)) + $group_specific;
         }
         // admin / owner
         if ($group_owner) {
             $group_specific = $group_specific + array('settings' => array('caption' => __("Group Settings"), 'url' => PA::$url . '/addgroup.php?gid=' . $gid), 'group_poll_select' => array('caption' => sprintf(__('%s Poll Select'), __(PA::$group_noun)), 'url' => $this->base_url . '/group_poll.php?gid=' . $group_id . '&type=select'), 'group_poll_create' => array('caption' => sprintf(__('%s Poll Create'), __(PA::$group_noun)), 'url' => $this->base_url . '/group_poll.php?gid=' . $group_id . '&type=create'));
         }
         // admin / moderator
         if ($group_moderator) {
             $group_specific = $group_specific + array('bulletin' => array('caption' => __("Group Bulletin"), 'url' => PA::$url . PA_ROUTE_GROUP_BULLETINS . '?gid=' . $gid), 'moderate' => array('caption' => __("Moderate"), 'url' => PA::$url . PA_ROUTE_GROUP_MODERATION . '/view=members&amp;gid=' . $gid), 'manage_members' => array('caption' => __("Manage Content"), 'url' => PA::$url . '/manage_group_content.php?gid=' . $gid), 'group_customize_ui' => array('caption' => __('Group Appearance'), 'url' => $this->base_url . PA_ROUTE_CUSTOMIZE_GROUP_GUI . '/theme/gid=' . $group_id));
         }
         // ads
         if ($group_manange_ads) {
             $group_specific = $group_specific + array('ads' => array('caption' => __("Manage Ads"), 'url' => PA::$url . PA_ROUTE_GROUP_AD_CENTER . '?gid=' . $gid));
         }
         // the join/unjoin/delete go last
         if ($group_owner) {
             // only the owner can delete
             $group_specific = $group_specific + array('delete_group' => array('caption' => __('Delete'), 'url' => $this->base_url . PA_ROUTE_GROUP . '/action=delete&amp;gid=' . $group_id, 'extra' => ' onclick ="return delete_confirmation_msg(\'' . __('Are you sure you want to delete this group') . '?\') "'));
         } else {
             // anyone else
             if ($group_member) {
                 $group_specific = $group_specific + array('unjoin' => array('caption' => __('Unjoin'), 'url' => $this->base_url . PA_ROUTE_GROUP . '/gid=' . $group_id . '&amp;action=leave'));
             } else {
                 $group_specific = $group_specific + array('join' => array('caption' => __('Join'), 'url' => $this->base_url . PA_ROUTE_GROUP . '/gid=' . $group_id . '&amp;action=join'));
             }
         }
     }
     ///EOF group specific menu children
     /// children of group
     $groups_children = array('groups_general' => $groups_general, 'group_specific' => $group_specific);
     ///EOF children of group
     //for network option at 3 level
     $network = array('configure_network' => array('caption' => __('Configure'), 'url' => $this->base_url . PA_ROUTE_CONFIGURE_NETWORK)) + $level_2;
     $network_notify = array('email_notification' => array('caption' => __('Email Notification'), 'url' => $this->base_url . '/' . FILE_EMAIL_NOTIFICATION), 'network_bulletins' => array('caption' => __('Bulletins'), 'url' => $this->base_url . '/' . FILE_NETWORK_BULLETINS));
     $network_setting = array('network_feature' => array('caption' => __('Set Feature Network'), 'url' => $this->base_url . '/' . FILE_NETWORK_FEATURE), 'manage_emblem' => array('caption' => __('Manage Emblem'), 'url' => $this->base_url . '/' . FILE_MANAGE_EMBLEM), 'manage_taketour' => array('caption' => __('Personalized Video'), 'url' => $this->base_url . '/' . FILE_MANAGE_TAKETOUR), 'splash_page' => array('caption' => __('Configure Splash Page'), 'url' => $this->base_url . '/' . FILE_CONFIGURE_SPLASH_PAGE), 'top_bar' => array('caption' => __('Top Bar Enable/Disable'), 'url' => '#'));
     $network_default = array('new_user_by_admin' => array('caption' => __('Create User'), 'url' => $this->base_url . '/' . FILE_NEW_USER_BY_ADMIN), 'user_defaults' => array('caption' => __('User Defaults'), 'url' => $this->base_url . '/' . FILE_NETWORK_USER_DEFAULTS), 'relationship_settings' => array('caption' => __('Relationships'), 'url' => $this->base_url . '/' . FILE_RELATIONSHIP_SETTINGS));
     $manage_network = array('manage_user' => array('caption' => __('Manage Users'), 'url' => $this->base_url . '/' . FILE_NETWORK_MANAGE_USER), 'manage_content' => array('caption' => __('Manage Contents'), 'url' => $this->base_url . '/' . FILE_NETWORK_MANAGE_CONTENT), 'manage_links' => array('caption' => __('Manage Links'), 'url' => $this->base_url . '/' . FILE_NETWORK_LINKS));
     $network_stats = array('statistics' => array('caption' => __('General'), 'url' => $this->base_url . PA_ROUTE_CONFIGURE_NETWORK), 'customize_ui' => array('caption' => __('Customize UI'), 'url' => $this->base_url . '/' . FILE_NETWORK_CUSTOMIZE_UI_PAGE));
     $network_module_selector = array('home_page_id' => array('caption' => __('Home Page'), 'url' => $this->base_url . '/' . FILE_MODULE_SELECTOR . '?page_id=home_page_id'), 'user_default_page_id' => array('caption' => __('User Default Page'), 'url' => $this->base_url . '/' . FILE_MODULE_SELECTOR . '?page_id=user_default_page_id'), 'group_directory_page_id' => array('caption' => __('Group Directory Page'), 'url' => $this->base_url . '/' . FILE_MODULE_SELECTOR . '?page_id=group_directory_page_id'), 'network_directory_page_id' => array('caption' => __('Network Directory Page'), 'url' => $this->base_url . '/' . FILE_MODULE_SELECTOR . '?page_id=network_directory_page_id'));
     if ($this->network_info->type != MOTHER_NETWORK_TYPE) {
         unset($network['meta_network']);
     }
     if ($this->network_info->type != MOTHER_NETWORK_TYPE) {
         unset($network['manage_taketour']);
         unset($network['manage_emblem']);
     }
     //end
     /// second level menu for network
     $level_3 = array('user' => @$user_children, 'people' => @$people_children, 'family' => @$family_children, 'groups' => $groups_children, 'network' => $network, 'network_notify' => $network_notify, 'network_module_selector' => $network_module_selector, 'network_setting' => $network_setting, 'network_default' => $network_default, 'manage_network' => $manage_network, 'network_stats' => $network_stats);
     ///EOF second level menu children
     ///set level menu items
     $this->level_1 = $level_1;
     $this->level_2 = $level_2;
     $this->level_3 = $level_3;
 }
Esempio n. 25
0
if (is_array($members)) {
    $count = count($members);
    $users_data = array();
    foreach ($members as $member) {
        $count_relations = Relation::get_relations($member['user_id']);
        $group_member = new User();
        $group_member->load((int) $member['user_id']);
        $login_name = $group_member->login_name;
        $user_picture = $group_member->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;
//p($users);
if (Group::member_exists((int) $group->collection_id, (int) $login_uid)) {
    $is_member = TRUE;
    $header->is_member = TRUE;
}
$is_admin_member = FALSE;
// set the default value to
if (Group::is_admin((int) $_REQUEST['gid'], (int) $login_uid)) {
    $is_admin_member = TRUE;
    $header->is_admin_member = TRUE;
}
$group_details['is_member'] = $is_member;
$show_content = TRUE;
$member_type = Group::get_user_type($login_uid, (int) $gid);
function setup_module($column, $module, $obj)
{
    global $group_details, $users, $content_type, $request_info, $title, $body, $is_member, $paging, $msg, $access, $group, $upload_array, $post_type_message, $post_type, $group_top_mesg, $join_group_string, $member_type, $login_uid;