private function get_links() { //get total count $param = array('network_id' => PA::$network_info->network_id, 'cnt' => TRUE, 'neglect_owner' => TRUE); //search by login name, including full names also if (!empty($this->keyword)) { $param['search_keyword'] = $this->keyword; $param['also_search_fullname'] = true; } $param['sort_by'] = $this->sort_by; $param['direction'] = $this->direction; $param['show_waiting_users'] = true; $this->Paging["count"] = Network::get_members($param); //now we dont need $param['cnt'] unset($param['cnt']); $param['show'] = $this->Paging['show']; $param['page'] = $this->Paging['page']; //get actual list $users = Network::get_members($param); $links = $users['users_data']; $objects = array('network' => true, 'groups' => array(), 'forums' => array()); //echo serialize($objects); // echo '<pre>'.print_r($links,1).'</pre>'; return $links; }
function generate_inner_html($links) { global $network_info; if ($this->market_report == TRUE) { // if marketting report is to be viewed $params = NULL; $inner_template = dirname(__FILE__) . '/center_inner_market_report.tpl'; $next_prev_navigation = 'marketing_report'; if ($this->email_sorting == NULL || $this->email_sorting == 'all') { $params = array('network_id' => $network_info->network_id, 'neglect_owner' => FALSE, 'cnt' => TRUE); // setting variables for pagination $this->Paging["count"] = Network::get_members($params); unset($params['cnt']); $params['show'] = $this->Paging['show']; $params['page'] = $this->Paging['page']; $users = Network::get_members($params); $this->email_addresses = $users['users_data']; } else { if ($this->email_sorting == 'dormant') { $params = array("order_by" => 3); // 3 for sort by dormant user } $this->Paging["count"] = Ranking::get_top_ranked_users(TRUE, $params); $params['show'] = $this->Paging['show']; $params['page'] = $this->Paging['page']; $this->email_addresses = Ranking::get_top_ranked_users(FALSE, $params); } // Set pagination variable $Pagination = new Pagination(); $Pagination->setPaging($this->Paging); $this->page_first = $Pagination->getFirstPage(); $this->page_last = $Pagination->getLastPage(); $this->page_links = $Pagination->getPageLinks(); } else { $inner_template = dirname(__FILE__) . '/center_inner_private.tpl'; $next_prev_navigation = 'mis_count'; } $obj_inner_template =& new Template($inner_template); $obj_inner_template->set('links', $links); $obj_inner_template->set('email_domain_array', $this->email_domain_array); $obj_inner_template->set('blog_post', $this->blog_post); $obj_inner_template->set('images', $this->images); $obj_inner_template->set('profile_views', $this->profile_views); $obj_inner_template->set('profile_visits_by_user', $this->profile_visits_by_user); $obj_inner_template->set('relationship_stats', $this->relationship_stats); $obj_inner_template->set('emails', $this->email_addresses); $obj_inner_template->set('page_first', $this->page_first); $obj_inner_template->set('page_last', $this->page_last); $obj_inner_template->set('page_links', $this->page_links); $obj_inner_template->set('parameters', Ranking::get_parameters()); $obj_inner_template->set('config_navigation_url', network_config_navigation($next_prev_navigation)); $inner_html = $obj_inner_template->fetch(); return $inner_html; }
/** * The default constructor for MembersFacewallModule class. * It initializes the default values of vars */ function __construct() { $this->title = __("Members"); $this->html_block_id = "members"; $this->view_all_url = 'view_all_members.php'; $users = Network::get_members(array('page' => 1, 'show' => 5, 'network_id' => PA::$network_info->network_id)); $total_users = count($users['users_data']); // counting no of relation of each user for ($i = 0; $i < $total_users; $i++) { $count_relations = Relation::get_relations($users['users_data'][$i]['user_id']); $users['users_data'][$i]['no_of_relations'] = count($count_relations); } $this->links = $users; $this->sort_by = TRUE; }
public function initializeModule($request_method, $request_data) { if (!empty($this->shared_data['group_info'])) { $sort = $this->sort_by == 'last_login' ? 'last_login' : 'created'; $group = $this->shared_data['group_info']; $this->gid = $group->collection_id; $users = $group->get_members($cnt = FALSE, 5, 1, $sort, 'DESC', FALSE); $total_users = count($users); } else { $this->title = __('Members'); $net_params = array('page' => 1, 'show' => 5, 'network_id' => PA::$network_info->network_id); if ($this->sort_by == 'last_login') { $sort = array('sort_by' => 'U.last_login'); $net_params = array_merge($net_params, $sort); } $users = Network::get_members($net_params); $total_users = count($users['users_data']); } $users_data = array(); $status = null; if (!empty(PA::$extra['reciprocated_relationship']) && PA::$extra['reciprocated_relationship'] == NET_YES) { $status = APPROVED; } if (!empty($users)) { if (!empty($this->shared_data['group_info'])) { foreach ($users as $user) { $count_relations = Relation::get_relations($user['user_id'], $status, PA::$network_info->network_id); $group_member = new User(); $group_member->load((int) $user['user_id']); $users_data[] = array('user_id' => $user['user_id'], 'picture' => $group_member->picture, 'login_name' => $group_member->login_name, 'display_name' => $group_member->display_name, 'no_of_relations' => count($count_relations)); } $users = array('users_data' => $users_data, 'total_users' => $total_users); } else { // counting no of relation of each user for ($i = 0; $i < $total_users; $i++) { $count_relations = Relation::get_relations($users['users_data'][$i]['user_id'], $status, PA::$network_info->network_id); $curr_user_relations = $count_relations; $users['users_data'][$i]['no_of_relations'] = count($count_relations); } } $this->links = $users; $this->sort_by = TRUE; } else { $this->do_skip = TRUE; } }
private function get_links() { global $network_info; //get total count $param = array('network_id' => $network_info->network_id, 'cnt' => TRUE, 'neglect_owner' => TRUE); //search by login name if (!empty($this->keyword)) { $param['search_keyword'] = $this->keyword; } $param['sort_by'] = $this->sort_by; $param['direction'] = $this->direction; $this->Paging["count"] = Network::get_members($param); //now we dont need $param['cnt'] unset($param['cnt']); $param['show'] = $this->Paging['show']; $param['page'] = $this->Paging['page']; //get actual list $users = Network::get_members($param); $links = $users['users_data']; return $links; }
function get_networks_users_id() { $users = array(); $users_ids = array(); $users = Network::get_members(array('network_id' => PA::$network_info->network_id)); if ($users['total_users']) { for ($i = 0; $i < $users['total_users']; $i++) { $users_ids[] = $users['users_data'][$i]['user_id']; } } return $users_ids; }
} if (empty($_POST['inbox']) && empty($_POST['mail']) && empty($_POST['network_home'])) { // if no destination is selected $error_msg .= 'Please specify at least one destination'; } if (!$error_msg) { // if no errors yet if (!empty($_POST['bulletins'])) { // send to all members $subject = $_POST['title']; $bull_message = $_POST['bulletin_body']; $from = (int) PA::$login_uid; if (PA::$network_info) { // getting network's users $param = array('network_id' => PA::$network_info->network_id, 'neglect_owner' => FALSE); $to_member = Network::get_members($param); } if (!empty($to_member)) { // if member exists $no_reg_user = FALSE; foreach ($to_member['users_data'] as $recipient) { PANotify::send("bulletin_sent", $recipient['user_obj'], PA::$network_info, array('bulletin.message' => $bull_message, 'bulletin.subject' => $subject)); } } else { // else no registered member if ($_POST['inbox'] == 1 || $_POST['mail'] == 1) { $no_reg_user = TRUE; } else { $no_reg_user = FALSE; } }
/** This function will return statistics of a network * @access public * @return count of registered members, count of groups, count of contents */ public static function get_network_statistics($param) { // setting count variables to 0 $groups_count = $contents_count = $registered_members_count = $online_members_count = 0; $param['cnt'] = TRUE; $param['neglect_owner'] = FALSE; //network owner is a member with type OWNER $registered_members_count = Network::get_members($param); $sql = ' SELECT count(*) AS cnt FROM {groups} AS G,{contentcollections} AS CC WHERE CC. collection_id = G.group_id AND CC.is_active = ? AND G.reg_type <> ? '; $data = array(ACTIVE, REG_INVITE); $res = Dal::query($sql, $data); if ($res->numRows()) { $row = $res->fetchRow(DB_FETCHMODE_OBJECT); $groups_count = $row->cnt; } $sql = 'SELECT count(*) as cnt FROM {contents} WHERE is_active = ?'; $data = array(ACTIVE); $res = Dal::query($sql, $data); if ($res->numRows()) { $row = $res->fetchRow(DB_FETCHMODE_OBJECT); $contents_count = $row->cnt; } //getting count of online registered users $timestamp = time() - MAX_TIME_ONLINE_USER; // MAX_TIME_ONLINE_USER = 1800 sec to get a realistic count of currently online users $online_members_count = User::count_online_users($timestamp); return array('registered_members_count' => $registered_members_count, 'groups_count' => $groups_count, 'contents_count' => $contents_count, 'online_members_count' => $online_members_count); }
function set_vars() { global $login_uid, $network_info; /* For handling the Album according to thier type */ switch ($this->type) { case 'Images': $all_albums = Album::load_all($this->uid, IMAGE_ALBUM); break; case 'Videos': $all_albums = Album::load_all($this->uid, VIDEO_ALBUM); break; case 'Audios': $all_albums = Album::load_all($this->uid, AUDIO_ALBUM); break; default: // Treating Images are the default parameters break; } /* setting all the album for this page */ /* Retrive the All album of user */ $album = array(); $j = 0; if (!empty($all_albums)) { foreach ($all_albums as $alb) { $album[$j]['id'] = $alb['collection_id']; $album[$j]['name'] = $alb['title']; $j++; } $this->default_album_id = @$album[0]['id']; $this->default_album_name = @$album[0]['name']; $this->my_all_album = $album; } /* For handling Users Friend Album*/ if (isset($login_uid)) { /* Here we calculate all the relation (Friend's) Ids TODO: add a check to load it only when a user wants to see his friend's gallery */ $relations_ids = Relation::get_all_relations((int) $login_uid); $users = array(); $users_ids = array(); $users = Network::get_members(array('network_id' => $network_info->network_id)); if ($users['total_users']) { for ($i = 0; $i < $users['total_users']; $i++) { $users_ids[] = $users['users_data'][$i]['user_id']; } } if (!empty($relations_ids)) { $cnt = count($relations_ids); for ($i = 0; $i < $cnt; $i++) { if (!in_array($relations_ids[$i]['user_id'], $users_ids)) { unset($relations_ids[$i]); } } } // extracting some name who are not member of that network ;) /* Here varify that users has any relation or not ... as well as loads all album */ if (!empty($relations_ids)) { /* Here we get all the frnds list of login User */ $frnd_albums = array(); $i = 0; sortByFunc($relations_ids, create_function('$relations_ids', 'return $relations_ids["login_name"];')); foreach ($relations_ids as $frnd_id) { $frnd_list[$i]['name'] = $frnd_id['login_name']; $frnd_list[$i]['id'] = $frnd_id['user_id']; $i++; } } } // End of Friend Album $this->friend_list = @$frnd_list; // can be empty }
* [description including history] * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @author [creator, or "Original Author"] * @license http://bit.ly/aVWqRV PayAsYouGo License * @copyright Copyright (c) 2010 Broadband Mechanics * @package PeopleAggregator */ $login_required = FALSE; $use_theme = 'Beta'; $parameter = ''; include_once "web/includes/page.php"; global $login_uid; error_reporting(0); $parameter .= js_includes('common.js'); // for memeber facewall module. $users = Network::get_members(array('page' => 1, 'show' => 5, 'network_id' => PA::$network_info->network_id)); function setup_module($column, $moduleName, $obj) { global $users, $view_previous; switch ($moduleName) { case 'MembersFacewallModule': $obj->links = $users; $obj->sort_by = TRUE; break; case 'PollModule': $obj->view_previous = TRUE; break; } } $page = new PageRenderer("setup_module", PAGE_VIEWPOLL, "viewpoll", "container_three_column.tpl", "header.tpl", PRI, HOMEPAGE, PA::$network_info); $page->add_header_html($parameter);