function initializeModule($request_method, $request_data)
 {
     $this->groupCount = array();
     $classname = ucfirst($this->directoryType) . "TypedGroupEntity";
     $instance = new $classname();
     $this->profilefields = $instance->get_profile_fields();
     if (!empty($_REQUEST['sort_by'])) {
         $this->sort_by = $_REQUEST['sort_by'];
     } else {
         $this->sort_by = 'name';
     }
     $this->sortFields = array(array('name' => 'name', 'label' => __('Name')));
     foreach ($this->profilefields as $i => $field) {
         if (!empty($field['sort'])) {
             $this->sortFields[] = array('name' => $field['name'], 'label' => $field['label']);
         }
     }
     // get TypedGroupEntities for this type and build paging etc
     if (!empty($request_data['page'])) {
         $this->page = (int) $request_data['page'];
     }
     $this->Paging['page'] = $this->page;
     $this->Paging['show'] = $this->show;
     $this->groupCount[$this->directoryType] = TypedGroupentity::get_count($this->directoryType);
     // load list of entities
     $this->typedGroupEntities = TypedGroupentity::get_entities($this->directoryType, $this->sort_by, $this->page, $this->show);
     $this->Paging['count'] = $this->groupCount[$this->directoryType];
     $Pagination = new Pagination();
     $Pagination->setPaging($this->Paging);
     $this->page_first = $Pagination->getFirstPage();
     $this->page_last = $Pagination->getLastPage();
     $this->page_links = $Pagination->getPageLinks();
 }
 function generate_inner_html()
 {
     global $app;
     switch ($this->type) {
         case 'forum':
             $inner_template = PA::$blockmodule_path . '/' . get_class($this) . '/forum_inner_template.tpl';
             break;
         default:
             $inner_template = PA::$blockmodule_path . '/' . get_class($this) . '/center_inner_private.tpl';
     }
     $Pagination = new Pagination();
     $Pagination->setPaging($this->Paging);
     $this->page_first = $Pagination->getFirstPage();
     $this->page_last = $Pagination->getLastPage();
     $this->page_links = $Pagination->getPageLinks();
     $inner_html_gen = new Template($inner_template);
     $inner_html_gen->set('links', $this->links);
     $inner_html_gen->set('back_page', PA::$url . $app->current_route);
     $inner_html_gen->set('type', $this->type);
     $inner_html_gen->set('page_first', $this->page_first);
     $inner_html_gen->set('page_last', $this->page_last);
     $inner_html_gen->set('page_links', $this->page_links);
     $inner_html = $inner_html_gen->fetch();
     return $inner_html;
 }
Пример #3
0
 function generate_inner_html()
 {
     global $current_blockmodule_path;
     global $number_user;
     $msg = @$this->msg;
     $Pagination = new Pagination();
     $Pagination->setPaging($this->Paging);
     $this->page_first = $Pagination->getFirstPage($this->search_data);
     $this->page_last = $Pagination->getLastPage($this->search_data);
     $this->page_links = $Pagination->getPageLinks($this->search_data);
     switch ($this->mode) {
         default:
             //$tmp_file = dirname(__FILE__).'/center_inner_public.tpl';
             $tmp_file = dirname(__FILE__) . '/facewall.tpl';
     }
     $inner_html_gen =& new Template($tmp_file);
     $inner_html_gen->set('links', $this->users_data);
     $inner_html_gen->set('error_msg', $msg);
     $inner_html_gen->set('page_first', $this->page_first);
     $inner_html_gen->set('page_last', $this->page_last);
     $inner_html_gen->set('page_links', $this->page_links);
     $inner_html_gen->set('people_count', $this->Paging["count"]);
     $row_count = ceil($this->Paging["count"] / FACEWALL_COLUMN_COUNT) > 10 ? 10 : ceil($this->Paging["count"] / FACEWALL_COLUMN_COUNT);
     $number_user = $this->Paging["count"];
     $inner_html_gen->set("row_count", $row_count);
     $inner_html_gen->set('show_advance_search_options', $this->show_advance_search_options);
     $inner_html_gen->set('search_data', $this->search_data);
     $inner_html = $inner_html_gen->fetch();
     return $inner_html;
 }
 function generate_inner_html()
 {
     $links = $this->media_data;
     // Here we get all the comment of that content
     $comment = new Comment();
     $comment->parent_id = $links->content_id;
     $comment->parent_type = TYPE_CONTENT;
     $this->Paging["count"] = $comment->get_multiples_comment($cnt = TRUE);
     $result = $comment->get_multiples_comment($cnt = FALSE, $this->Paging["show"], $this->Paging["page"]);
     $this->comments = $result;
     $param = $this->handle_field_param($links);
     $Pagination = new Pagination();
     $Pagination->setPaging($this->Paging);
     $this->page_first = $Pagination->getFirstPage();
     $this->page_last = $Pagination->getLastPage();
     $this->page_links = $Pagination->getPageLinks();
     switch ($this->mode) {
         default:
             $inner_template = dirname(__FILE__) . '/center_inner_public.tpl';
     }
     $info =& new Template($inner_template);
     $info->set_object('param', $param);
     $info->set_object('uid', $this->uid);
     $info->set_object('links', $links);
     $info->set_object('comments', $this->comments);
     $info->set('back', $_SERVER['HTTP_REFERER']);
     $info->set('page_first', $this->page_first);
     $info->set('page_last', $this->page_last);
     $info->set('page_links', $this->page_links);
     $inner_html = $info->fetch();
     return $inner_html;
 }
Пример #5
0
 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;
 }
 function generate_inner_html()
 {
     $tmp_file = dirname(__FILE__) . '/center_inner_public.tpl';
     $inner_html_gen =& new Template($tmp_file);
     $inner_html_gen->set('links', $this->links);
     $Pagination = new Pagination();
     $Pagination->setPaging($this->Paging);
     $this->page_first = $Pagination->getFirstPage();
     $this->page_last = $Pagination->getLastPage();
     $this->page_links = $Pagination->getPageLinks();
     $inner_html_gen->set('page_first', $this->page_first);
     $inner_html_gen->set('page_last', $this->page_last);
     $inner_html_gen->set('page_links', $this->page_links);
     $inner_html = $inner_html_gen->fetch();
     return $inner_html;
 }
 function generate_inner_html()
 {
     $tmp_file = PA::$blockmodule_path . '/' . get_class($this) . '/center_inner_public.tpl';
     $inner_html_gen = new Template($tmp_file, $this);
     $inner_html_gen->set('links', $this->links);
     $inner_html_gen->set('mode', $this->mode);
     $Pagination = new Pagination();
     //    $Pagination->page_var = 'pg';
     $Pagination->setPaging($this->Paging);
     $this->page_first = $Pagination->getFirstPage();
     $this->page_last = $Pagination->getLastPage();
     $this->page_links = $Pagination->getPageLinks();
     $inner_html_gen->set('page_first', $this->page_first);
     $inner_html_gen->set('page_last', $this->page_last);
     $inner_html_gen->set('page_links', $this->page_links);
     $inner_html = $inner_html_gen->fetch();
     return $inner_html;
 }
 function generate_inner_html()
 {
     $links = $this->get_links();
     // set links for pagination
     $Pagination = new Pagination();
     $Pagination->setPaging($this->Paging);
     $this->page_first = $Pagination->getFirstPage();
     $this->page_last = $Pagination->getLastPage();
     $this->page_links = $Pagination->getPageLinks();
     $tmp_file = PA::$blockmodule_path . '/' . get_class($this) . '/center_inner_private.tpl';
     $inner_html_gen = new Template($tmp_file, $this);
     $inner_html_gen->set('links', $links);
     $inner_html_gen->set('edit', $this->edit);
     $inner_html_gen->set('form_data', $this->form_data);
     $inner_html_gen->set('page_first', $this->page_first);
     $inner_html_gen->set('page_last', $this->page_last);
     $inner_html_gen->set('page_links', $this->page_links);
     $inner_html = $inner_html_gen->fetch();
     return $inner_html;
 }
 function generate_inner_html()
 {
     $links = $this->get_links();
     // set links for pagination
     $Pagination = new Pagination();
     $Pagination->setPaging($this->Paging);
     $this->page_first = $Pagination->getFirstPage();
     $this->page_last = $Pagination->getLastPage();
     $this->page_links = $Pagination->getPageLinks();
     $tmp_file = dirname(__FILE__) . '/center_inner_private.tpl';
     $inner_html_gen =& new Template($tmp_file);
     $inner_html_gen->set('links', $links);
     $inner_html_gen->set('selected', $this->selected);
     $inner_html_gen->set('form_data', @$this->form_data);
     $inner_html_gen->set('page_first', $this->page_first);
     $inner_html_gen->set('page_last', $this->page_last);
     $inner_html_gen->set('page_links', $this->page_links);
     $inner_html = $inner_html_gen->fetch();
     return $inner_html;
 }
 function generate_inner_html()
 {
     switch ($this->mode) {
         default:
             $inner_template = dirname(__FILE__) . '/center_inner_public.tpl';
     }
     $Pagination = new Pagination();
     $Pagination->setPaging($this->Paging);
     $this->page_first = $Pagination->getFirstPage();
     $this->page_last = $Pagination->getLastPage();
     $this->page_links = $Pagination->getPageLinks();
     $inner_html_gen =& new Template($inner_template);
     $inner_html_gen->set('links', $this->links);
     $inner_html_gen->set('page_first', $this->page_first);
     $inner_html_gen->set('page_last', $this->page_last);
     $inner_html_gen->set('page_links', $this->page_links);
     $inner_html_gen->set('config_navigation_url', network_config_navigation('manage_comments'));
     $inner_html = $inner_html_gen->fetch();
     return $inner_html;
 }
 function generate_inner_html()
 {
     switch ($this->mode) {
         default:
             $inner_template = PA::$blockmodule_path . '/' . get_class($this) . '/center_inner_private.tpl';
     }
     $Pagination = new Pagination();
     $Pagination->setPaging($this->Paging);
     $this->page_first = $Pagination->getFirstPage();
     $this->page_last = $Pagination->getLastPage();
     $this->page_links = $Pagination->getPageLinks();
     $inner_html_gen = new Template($inner_template);
     $inner_html_gen->set('links', $this->links);
     $inner_html_gen->set('page_first', $this->page_first);
     $inner_html_gen->set('page_last', $this->page_last);
     $inner_html_gen->set('page_links', $this->page_links);
     $inner_html_gen->set('super_user_and_mothership', $this->super_user_and_mothership);
     $inner_html = $inner_html_gen->fetch();
     return $inner_html;
 }
 /** this function set variable for tpls
  * and fetches the respective tpl
  */
 function generate_inner_html()
 {
     switch ($this->mode) {
         default:
             $inner_template = PA::$blockmodule_path . '/' . get_class($this) . '/center_inner_private.tpl';
     }
     $Pagination = new Pagination();
     $Pagination->setPaging($this->Paging);
     $this->page_first = $Pagination->getFirstPage();
     $this->page_last = $Pagination->getLastPage();
     $this->page_links = $Pagination->getPageLinks();
     $inner_html_gen = new Template($inner_template);
     $inner_html_gen->set('links', $this->links);
     $inner_html_gen->set('page_first', $this->page_first);
     $inner_html_gen->set('page_last', $this->page_last);
     $inner_html_gen->set('page_links', $this->page_links);
     $inner_html_gen->set('config_navigation_url', network_config_navigation('moderate_content'));
     $inner_html = $inner_html_gen->fetch();
     return $inner_html;
 }
 function generate_inner_html()
 {
     switch ($this->mode) {
         default:
             $inner_template = PA::$blockmodule_path . '/' . get_class($this) . '/center_inner_public.tpl';
     }
     $Pagination = new Pagination();
     $Pagination->setPaging($this->Paging);
     $this->page_first = $Pagination->getFirstPage();
     $this->page_last = $Pagination->getLastPage();
     $this->page_links = $Pagination->getPageLinks();
     $inner_html_gen = new Template($inner_template);
     $inner_html_gen->set('links', $this->links);
     $inner_html_gen->set('show_view', $this->show_view);
     $inner_html_gen->set('item_id', $this->item_id);
     $inner_html_gen->set('page_first', $this->page_first);
     $inner_html_gen->set('page_last', $this->page_last);
     $inner_html_gen->set('page_links', $this->page_links);
     $inner_html = $inner_html_gen->fetch();
     return $inner_html;
 }
Пример #14
0
 function generate_inner_html()
 {
     $Pagination = new Pagination();
     $Pagination->setPaging($this->Paging);
     $this->page_first = $Pagination->getFirstPage();
     $this->page_last = $Pagination->getLastPage();
     $this->page_links = $Pagination->getPageLinks();
     $inner_template = NULL;
     switch ($this->mode) {
         default:
             $inner_template = dirname(__FILE__) . '/center_inner_public.tpl';
     }
     $inner_html_gen =& new Template($inner_template);
     $inner_html_gen->set('links', $this->links);
     $inner_html_gen->set('search_str', get_tag_search_option());
     $inner_html_gen->set('page_first', $this->page_first);
     $inner_html_gen->set('page_last', $this->page_last);
     $inner_html_gen->set('page_links', $this->page_links);
     $inner_html = $inner_html_gen->fetch();
     return $inner_html;
 }
 function generate_inner_html()
 {
     $links = $this->get_links();
     // set links for pagination
     $Pagination = new Pagination();
     $Pagination->setPaging($this->Paging);
     $this->page_first = $Pagination->getFirstPage();
     $this->page_last = $Pagination->getLastPage();
     $this->page_links = $Pagination->getPageLinks();
     $tmp_file = dirname(__FILE__) . '/center_inner_public.tpl';
     $inner_html_gen =& new Template($tmp_file);
     $inner_html_gen->set('links', $links);
     $inner_html_gen->set('edit', $this->edit);
     $inner_html_gen->set('form_data', $this->form_data);
     $inner_html_gen->set('page_first', $this->page_first);
     $inner_html_gen->set('page_last', $this->page_last);
     $inner_html_gen->set('page_links', $this->page_links);
     $inner_html_gen->set('config_navigation_url', network_config_navigation('manage_ad_center'));
     $inner_html = $inner_html_gen->fetch();
     return $inner_html;
 }
 function generate_inner_html()
 {
     switch ($this->type) {
         case 'forum':
             $inner_template = dirname(__FILE__) . '/forum_inner_template.tpl';
             break;
         default:
             $inner_template = dirname(__FILE__) . '/center_inner_private.tpl';
     }
     $Pagination = new Pagination();
     $Pagination->setPaging($this->Paging);
     $this->page_first = $Pagination->getFirstPage();
     $this->page_last = $Pagination->getLastPage();
     $this->page_links = $Pagination->getPageLinks();
     $inner_html_gen =& new Template($inner_template);
     $inner_html_gen->set('links', $this->links);
     $inner_html_gen->set('type', $this->type);
     $inner_html_gen->set('page_first', $this->page_first);
     $inner_html_gen->set('page_last', $this->page_last);
     $inner_html_gen->set('page_links', $this->page_links);
     $inner_html = $inner_html_gen->fetch();
     return $inner_html;
 }
 function generate_inner_html()
 {
     $links = $this->media_data;
     // Here we get all the comment of that content
     $comment = new Comment();
     $comment->parent_id = $links->content_id;
     $comment->parent_type = TYPE_CONTENT;
     $this->Paging["count"] = $comment->get_multiples_comment($cnt = TRUE);
     $result = $comment->get_multiples_comment($cnt = FALSE, $this->Paging["show"], $this->Paging["page"]);
     $this->comments = $result;
     $param = $this->handle_field_param($links);
     $Pagination = new Pagination();
     $Pagination->setPaging($this->Paging);
     $this->page_first = $Pagination->getFirstPage();
     $this->page_last = $Pagination->getLastPage();
     $this->page_links = $Pagination->getPageLinks();
     switch ($this->mode) {
         default:
             $inner_template = PA::$blockmodule_path . '/' . get_class($this) . '/center_inner_public.tpl';
     }
     $info = new Template($inner_template);
     $info->set_object('param', $param);
     $info->set_object('uid', $this->uid);
     $info->set_object('links', $links);
     $info->set_object('comments', $this->comments);
     $info->set('back', @$_SERVER['HTTP_REFERER']);
     $info->set('page_first', $this->page_first);
     $info->set('page_last', $this->page_last);
     $info->set('page_links', $this->page_links);
     // when we show Group media - check is user still Group member
     if (isset($_GET['gid'])) {
         $is_author_member = $this->is_author_group_member($links->author_id, $_GET['gid']);
         $info->set('is_author_member', $is_author_member);
     }
     $inner_html = $info->fetch();
     return $inner_html;
 }
 function generate_inner_html()
 {
     switch ($this->mode) {
         default:
             $inner_template = dirname(__FILE__) . '/center_inner_private.tpl';
     }
     $Pagination = new Pagination();
     $Pagination->setPaging($this->Paging);
     $this->page_first = $Pagination->getFirstPage();
     $this->page_last = $Pagination->getLastPage();
     $this->page_links = $Pagination->getPageLinks();
     $role = new Roles();
     $this->role_links = $role->get_multiple();
     $inner_html_gen =& new Template($inner_template);
     $inner_html_gen->set('links', $this->links);
     $inner_html_gen->set('link_role', $this->role_links);
     $inner_html_gen->set('page_first', $this->page_first);
     $inner_html_gen->set('page_last', $this->page_last);
     $inner_html_gen->set('page_links', $this->page_links);
     $inner_html_gen->set('super_user_and_mothership', $this->super_user_and_mothership);
     $inner_html_gen->set('config_navigation_url', network_config_navigation('manage_user'));
     $inner_html = $inner_html_gen->fetch();
     return $inner_html;
 }
 function generate_inner_html()
 {
     switch ($this->mode) {
         default:
             $inner_template = PA::$blockmodule_path . '/' . get_class($this) . '/center_inner_private.tpl';
     }
     $Pagination = new Pagination();
     $Pagination->setPaging($this->Paging);
     $this->page_first = $Pagination->getFirstPage();
     $this->page_last = $Pagination->getLastPage();
     $this->page_links = $Pagination->getPageLinks();
     $role = new Roles();
     $this->role_links = $role->get_multiple(null, DB_FETCHMODE_ASSOC);
     $inner_html_gen = new Template($inner_template);
     $inner_html_gen->set('links', $this->links);
     $inner_html_gen->set('link_role', $this->role_links);
     $inner_html_gen->set('page_first', $this->page_first);
     $inner_html_gen->set('page_last', $this->page_last);
     $inner_html_gen->set('page_links', $this->page_links);
     $inner_html_gen->set('super_user_and_mothership', $this->super_user_and_mothership);
     $inner_html_gen->set('config_navigation_url', network_config_navigation('manage_user'));
     $inner_html = $inner_html_gen->fetch();
     return $inner_html;
 }
 function generate_inner_html($links)
 {
     global $login_uid, $page_uid;
     $usr = new User();
     $network = new Network();
     if ($links) {
         foreach ($links as $link_var) {
             if ($link_var->owner_id) {
                 $usr->load((int) $link_var->owner_id);
                 $owner_info[$link_var->network_id]['name'] = $usr->login_name;
             } else {
                 $owner_info[$link_var->network_id]['name'] = "None";
             }
         }
         // End of foreach
     }
     $users_network = NULL;
     if (@$_SESSION['user']['id']) {
         if ($login_uid == $page_uid) {
             $users_network = $network->get_networks_by_user($_SESSION['user']['id'], FALSE, 'ALL', 1, 'created', 'DESC', ALL_NETWORKS);
         } else {
             $users_network = $network->get_networks_by_user($_SESSION['user']['id']);
         }
         $users_network = $this->get_user_network_id($users_network);
     }
     $Pagination = new Pagination();
     $Pagination->setPaging($this->Paging);
     $this->page_first = $Pagination->getFirstPage();
     $this->page_last = $Pagination->getLastPage();
     $this->page_links = $Pagination->getPageLinks();
     switch ($this->mode) {
         default:
             $inner_template = dirname(__FILE__) . '/center_inner_public.tpl';
     }
     $this->Paging["count"] = @$this->uid ? count($links) : $this->Paging["count"];
     $inner_html_gen =& new Template($inner_template);
     $inner_html_gen->set('links', @$links);
     $inner_html_gen->set('owner_info', @$owner_info);
     $inner_html_gen->set('users_network', @$users_network);
     $inner_html_gen->set('total', $this->Paging["count"]);
     $inner_html_gen->set('search_str', get_network_search_options());
     $inner_html_gen->set('page_first', $this->page_first);
     $inner_html_gen->set('page_last', $this->page_last);
     $inner_html_gen->set('page_links', $this->page_links);
     $inner_html = $inner_html_gen->fetch();
     return $inner_html;
 }
 private function showPointsDirectory($request_data)
 {
     if (!empty($this->fid)) {
         $this->Paging["querystring"] = "fid={$this->fid}&gid={$this->fid}";
     } else {
         if (!empty($this->user_id)) {
             $this->Paging["querystring"] = "uid={$this->user_id}";
         }
     }
     $this->Paging['page'] = $this->page;
     $this->Paging['show'] = $this->limit;
     $this->Paging['count'] = PointsEntity::search($this->criteria, true);
     $pagination = new Pagination();
     $pagination->setPaging($this->Paging);
     $this->page_first = $pagination->getFirstPage();
     $this->page_last = $pagination->getLastPage();
     $this->page_links = $pagination->getPageLinks();
     $items = PointsEntity::search($this->criteria, false, "(SELECT attribute_value FROM entityattributes where attribute_name = 'created' AND id = EA.id) DESC", $this->page, $this->limit);
     $this->items = $this->build_list_of_items($items);
     $this->inner_HTML = $this->generate_inner_html(array('sub_title' => $this->sub_title, 'category' => $this->category, 'categories' => $this->categories, 'items' => $this->items, 'edit_perm' => $this->edit_perm, 'user_id' => $this->user_id, 'page_first' => $this->page_first, 'page_last' => $this->page_last, 'page_links' => $this->page_links, 'url_base' => $this->url_base, 'message' => isset($request_data['message']) ? $request_data['message'] : null, 'fid' => isset($this->fid) ? $this->fid : null, 'fam_members' => isset($this->fam_members) ? $this->fam_members : null));
 }
 function generate_inner_html()
 {
     global $number_user;
     $extra = unserialize(PA::$network_info->extra);
     $this->rel_term = __('Friend');
     // default title
     if (isset($extra['relationship_show_mode']['term'])) {
         $this->rel_term = $extra['relationship_show_mode']['term'];
     }
     $msg = @$this->msg;
     $Pagination = new Pagination();
     $Pagination->setPaging($this->Paging);
     $this->page_first = $Pagination->getFirstPage($this->search_data);
     $this->page_last = $Pagination->getLastPage($this->search_data);
     $this->page_links = $Pagination->getPageLinks($this->search_data);
     switch ($this->mode) {
         default:
             $tmp_file = PA::$blockmodule_path . '/' . get_class($this) . '/facewall.tpl';
     }
     $inner_html_gen = new Template($tmp_file);
     $inner_html_gen->set('links', $this->users_data);
     $inner_html_gen->set('error_msg', $msg);
     $inner_html_gen->set('page_first', $this->page_first);
     $inner_html_gen->set('page_last', $this->page_last);
     $inner_html_gen->set('facewall_path', @$this->facewall_path);
     $inner_html_gen->set('page_links', $this->page_links);
     $inner_html_gen->set('people_count', $this->Paging["count"]);
     $row_count = ceil($this->Paging["count"] / FACEWALL_COLUMN_COUNT) > 10 ? 10 : ceil($this->Paging["count"] / FACEWALL_COLUMN_COUNT);
     $number_user = $this->Paging["count"];
     $inner_html_gen->set("row_count", $row_count);
     $inner_html_gen->set('show_advance_search_options', $this->show_advance_search_options);
     $inner_html_gen->set('search_data', $this->search_data);
     $inner_html_gen->set('rel_term', $this->rel_term);
     $inner_html_gen->set('no_photo_ok', $this->no_photo_ok);
     $inner_html_gen->set('show_people_with_photo', $this->show_people_with_photo);
     $inner_html_gen->set('only_with_photo', $this->only_with_photo);
     $inner_html = $inner_html_gen->fetch();
     return $inner_html;
 }
 function generate_inner_html()
 {
     $Pagination = new Pagination();
     $group = new group();
     $user_group_ids = array();
     if (@$_SESSION['user']['id']) {
         $user_group_ids = $group->get_user_groups($_SESSION['user']['id']);
         $user_group_ids = $this->get_user_group_id($user_group_ids);
     }
     $Pagination->setPaging($this->Paging);
     $this->page_first = $Pagination->getFirstPage();
     $this->page_last = $Pagination->getLastPage();
     $this->page_links = $Pagination->getPageLinks();
     $inner_template = NULL;
     switch ($this->mode) {
         default:
             $inner_template = PA::$blockmodule_path . '/' . get_class($this) . '/center_inner_public.tpl';
     }
     $inner_html_gen = new Template($inner_template);
     $this->links = objtoarray($this->links);
     $inner_html_gen->set('title', NULL);
     // $this->title
     $inner_html_gen->set('links', $this->links);
     $inner_html_gen->set('total', $this->total);
     $inner_html_gen->set('search_str', get_groups_search_options());
     $inner_html_gen->set('user_group_ids', $user_group_ids);
     $inner_html_gen->set('current_theme_path', PA::$theme_url);
     $inner_html_gen->set('page_first', $this->page_first);
     $inner_html_gen->set('page_last', $this->page_last);
     $inner_html_gen->set('page_links', $this->page_links);
     $inner_html = $inner_html_gen->fetch();
     return $inner_html;
 }
 function initializeModule($request_method, $request_data)
 {
     if (empty(PA::$config->useTypedGroups)) {
         return 'skip';
     }
     $this->availTypes = TypedGroupentity::get_avail_types();
     $this->directoryType = NULL;
     $this->groupCount = array();
     if (!empty($request_data['type'])) {
         if (!empty($this->availTypes[$request_data['type']])) {
             // we have been passed a valid TypedGroupEntity type
             $this->directoryType = $request_data['type'];
         }
     }
     if ($this->directoryType) {
         $this->title = sprintf(__("%s directory"), $this->availTypes[$this->directoryType]);
         $this->inner_template = PA::$blockmodule_path . '/' . get_class($this) . "/type_directory.tpl.php";
         $classname = ucfirst($this->directoryType) . "TypedGroupEntity";
         @(include_once "api/Entity/{$classname}.php");
         if (class_exists($classname)) {
             $instance = new $classname();
         } else {
             // just get default
             $instance = new TypedGroupEntity();
         }
         $this->profilefields = $instance->get_profile_fields();
         if (!empty($_REQUEST['sort_by'])) {
             $this->sort_by = $_REQUEST['sort_by'];
         } else {
             $this->sort_by = 'name';
         }
         $this->sortFields = array(array('name' => 'name', 'label' => __('Name')));
         foreach ($this->profilefields as $i => $field) {
             if (!empty($field['sort'])) {
                 $this->sortFields[] = array('name' => $field['name'], 'label' => $field['label']);
             }
         }
         // get TypedGroupEntities for this type and build paging etc
         if (!empty($request_data['page'])) {
             $this->page = (int) $request_data['page'];
         }
         $this->Paging['page'] = $this->page;
         $this->Paging['show'] = $this->show;
         $this->groupCount[$this->directoryType] = TypedGroupentity::get_count($this->directoryType);
         // load list of entities
         $this->typedGroupEntities = TypedGroupentity::get_entities($this->directoryType, $this->sort_by, $this->page, $this->show);
         $this->Paging['count'] = $this->groupCount[$this->directoryType];
         $Pagination = new Pagination();
         $Pagination->setPaging($this->Paging);
         $this->page_first = $Pagination->getFirstPage();
         $this->page_last = $Pagination->getLastPage();
         $this->page_links = $Pagination->getPageLinks();
     } else {
         $this->title = 'Organizations';
         $this->inner_template = PA::$blockmodule_path . '/' . get_class($this) . "/type_directory.tpl.php";
         $classname = "TypedGroupEntity";
         @(include_once "api/Entity/{$classname}.php");
         if (class_exists($classname)) {
             $instance = new $classname();
         } else {
             // just get default
             $instance = new TypedGroupEntity();
         }
         $this->profilefields = $instance->get_profile_fields();
         if (!empty($_REQUEST['sort_by'])) {
             $this->sort_by = $_REQUEST['sort_by'];
         } else {
             $this->sort_by = 'name';
         }
         $this->sortFields = array(array('name' => 'name', 'label' => __('Name')), array('name' => 'created', 'label' => __('Date Created')), array('name' => 'updated', 'label' => __('Last Updated')));
         foreach ($this->profilefields as $i => $field) {
             if (!empty($field['sort'])) {
                 $this->sortFields[] = array('name' => $field['name'], 'label' => $field['label']);
             }
         }
         // get TypedGroupEntities for this type and build paging etc
         if (!empty($request_data['page'])) {
             $this->page = (int) $request_data['page'];
         }
         $this->Paging['page'] = $this->page;
         $this->Paging['show'] = $this->show;
         $this->totalGroupCount = TypedGroupentity::get_total_count();
         // load list of entities
         $this->typedGroupEntities = TypedGroupentity::get_all_entities($this->sort_by, $this->page, $this->show);
         $this->Paging['count'] = $this->totalGroupCount;
         $Pagination = new Pagination();
         $Pagination->setPaging($this->Paging);
         $this->page_first = $Pagination->getFirstPage();
         $this->page_last = $Pagination->getLastPage();
         $this->page_links = $Pagination->getPageLinks();
     }
     switch ($this->column) {
         case 'middle':
             break;
         case 'left':
         case 'right':
         default:
             break;
     }
 }
Пример #25
0
 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;
 }
 function render()
 {
     if ($this->type == 'group') {
         $this->outer_template = 'outer_show_content_group_module.tpl';
         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 = $this->group->get_contents_for_collection($this->content_type, TRUE, 10, 1, 'created', 'DESC', TRUE);
             $this->contents = $this->group->get_contents_for_collection($this->content_type, FALSE, $this->Paging["show"], $this->Paging["page"], 'created', 'DESC', TRUE);
         } else {
             $this->Paging["count"] = $this->links = $this->group->get_contents_for_collection($type = 'all', $cnt = TRUE, 'all', 0, $sort_by = 'created', $direction = 'DESC');
             $this->contents = $this->group->get_contents_for_collection($type = 'all', $cnt = FALSE, $this->Paging["show"], $this->Paging["page"], 'created', 'DESC');
         }
         $this->title = chop_string(sprintf(__("%s's Group Blog"), $this->group->title, 32));
     } 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"]);
             if (!empty($this->contents)) {
                 foreach ($this->contents as $key => $value) {
                     $this->contents[$key]['content_id'] = $value['id'];
                 }
             }
         } 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 {
                 $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);
     if ($this->do_pagination) {
         $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;
 }
 public function generate_inner_html($links)
 {
     $usr = new User();
     $network = new Network();
     if (!empty($links)) {
         foreach ($links as $link_var) {
             if ($link_var->owner_id) {
                 $usr->load((int) $link_var->owner_id);
                 $owner_info[$link_var->network_id]['name'] = $usr->login_name;
             } else {
                 $owner_info[$link_var->network_id]['name'] = "None";
             }
         }
         // End of foreach
     }
     $users_network = NULL;
     if (!is_null(PA::$login_uid) && PA::$login_uid == PA::$page_uid) {
         $users_network = $network->get_networks_by_user(PA::$login_uid, FALSE, 'ALL', 1, 'created', 'DESC', ALL_NETWORKS);
     } else {
         if (!is_null(PA::$login_uid)) {
             $users_network = $network->get_networks_by_user(PA::$login_uid);
             $users_network = $this->get_user_network_id($users_network);
         }
     }
     $Pagination = new Pagination();
     $Pagination->setPaging($this->Paging);
     $this->page_first = $Pagination->getFirstPage();
     $this->page_last = $Pagination->getLastPage();
     $this->page_links = $Pagination->getPageLinks();
     switch ($this->mode) {
         default:
             $inner_template = PA::$blockmodule_path . '/' . get_class($this) . '/center_inner_public.tpl';
     }
     $this->Paging["count"] = @$this->uid ? count($links) : $this->Paging["count"];
     $inner_html_gen = new Template($inner_template);
     $inner_html_gen->set('links', $links);
     if (!empty($owner_info)) {
         $inner_html_gen->set('owner_info', $owner_info);
     }
     $inner_html_gen->set('users_network', $users_network);
     $inner_html_gen->set('total', $this->Paging["count"]);
     $inner_html_gen->set('search_str', get_network_search_options());
     $inner_html_gen->set('page_first', $this->page_first);
     $inner_html_gen->set('page_last', $this->page_last);
     $inner_html_gen->set('page_links', $this->page_links);
     $inner_html = $inner_html_gen->fetch();
     return $inner_html;
 }
 function generate_inner_html()
 {
     $links = $this->get_links();
     // set links for pagination
     $Pagination = new Pagination();
     $Pagination->setPaging($this->Paging);
     $this->page_first = $Pagination->getFirstPage();
     $this->page_last = $Pagination->getLastPage();
     $this->page_links = $Pagination->getPageLinks();
     $tmp_file = NULL;
     $config_link_page = NULL;
     switch ($this->mode) {
         case 'textpad':
             $tmp_file = PA::$blockmodule_path . '/' . get_class($this) . '/textpad.tpl';
             $config_link_page = 'manage_textpads';
             break;
         default:
             $tmp_file = PA::$blockmodule_path . '/' . get_class($this) . '/center_inner_public.tpl';
             $config_link_page = 'manage_ad_center';
     }
     $inner_html_gen = new Template($tmp_file, $this);
     $inner_html_gen->set('links', $links);
     $inner_html_gen->set('edit', $this->edit);
     $inner_html_gen->set('form_data', $this->form_data);
     $inner_html_gen->set('page_first', $this->page_first);
     $inner_html_gen->set('page_last', $this->page_last);
     $inner_html_gen->set('page_links', $this->page_links);
     $inner_html_gen->set('config_navigation_url', network_config_navigation($config_link_page));
     $inner_html = $inner_html_gen->fetch();
     return $inner_html;
 }