1, 'show'=>5, 'network_id'=>$network_info->network_id)); $total_users = count($users['users_data']); // counting no of relation of each users 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); } /** * Function : setup_module() * Purpose : call back function to set up variables * used in PageRenderer class * To see how it is used see api/PageRenderer/PageRenderer.php * @param $column - string - contains left, middle, right * position of the block module * @param $moduleName - string - contains name of the block module * @param $obj - object - object reference of the block module * @return type string - returns skip means skip the block module * returns rendered html code of block module */ /* Remove the dependancy of Alignment ('Left , Right') */ /* Now we can align Module whenever we want */ function setup_module($column, $moduleName, $obj) { global $content_type, $users, $post_type_message, $post_type,$network_info,$paging; switch ($moduleName) { case 'MembersFacewallModule': $obj->links = $users; $obj->sort_by = TRUE; break; case 'ImagesModule': $obj->block_type = 'Gallery'; $obj->page = "homepage"; $obj->title = __("Recent Media"); break; case 'ShowContentModule': //not sure why this is being used here // TODO : find out reason of using this and fix it $obj->cid = @$_GET['cid']; $obj->mode = PUB; $obj->block_type = HOMEPAGE; $obj->content_type = $content_type; $obj->uid = 0; $obj->message = $post_type_message[$post_type]; // This message array is defined in config.inc $obj->Paging["page"] = $paging["page"];; $obj->Paging["show"] = 10; break; case 'AdsByGoogleModule': $obj->block_type = HOMEPAGE; break; case 'NewestGroupsModule': $obj->block_type = HOMEPAGE_SORTBY; $obj->sort_by = TRUE; break; case 'RecentPostModule': $obj->type = 'homepage'; break; } } $page = new PageRenderer("setup_module", PAGE_HOMEPAGE, $network_info->name.' Home Page', "container_three_column.tpl", "header.tpl", PUB, HOMEPAGE, $network_info); /* This function shows the Error message */ uihelper_error_msg(@$_GET['msg']); $page->add_header_html($parameter); $page->html_body_attributes = 'class="no_second_tier" id="pg_homepage"'; $rss_data=''; $page->add_header_html($rss_data); /* This function set the network theme in this page */ uihelper_get_network_style(); echo $page->render(); ?>