/**
   Get all the links of different network of given search String 
   **/
 private function get_links()
 {
     $network = new Network();
     if (!empty($this->name_string)) {
         $condition = array('name_string' => $this->name_string, 'keyword' => $this->keyword);
         $this->Paging["count"] = $network->get_networks_info_by_search($condition, TRUE);
         if (empty($this->sort_by) || $this->sort_by == 'alphabetic') {
             $links = $network->get_networks_info_by_search($condition, FALSE, $this->Paging["show"], $this->Paging["page"], 'name', 'ASC');
         }
         if (!empty($this->sort_by) && $this->sort_by == 'members') {
             $links = $network->get_networks_info_by_search($condition, FALSE, $this->Paging["show"], $this->Paging["page"], 'members');
         }
         if (!empty($this->sort_by) && $this->sort_by == 'created') {
             $links = $network->get_networks_info_by_search($condition, FALSE, $this->Paging["show"], $this->Paging["page"]);
         }
     } else {
         $this->Paging["count"] = $network->get_largest_networks(TRUE);
         if (!empty($this->sort_by) && $this->sort_by == 'alphabetic' || !$this->sort_by) {
             $links = $network->get_largest_networks(FALSE, $this->Paging["show"], $this->Paging["page"], 'name', 'ASC');
         }
         if (!empty($this->sort_by) && $this->sort_by == 'members') {
             $links = $network->get_largest_networks(FALSE, $this->Paging["show"], $this->Paging["page"], 'members');
         }
         if (!empty($this->sort_by) && $this->sort_by == 'created') {
             $links = $network->get_largest_networks(FALSE, $this->Paging["show"], $this->Paging["page"]);
         }
     }
     return $links;
 }
 public function render()
 {
     if (empty($this->links)) {
         $this->links = Network::get_largest_networks(false, 5, 1);
     }
     $this->inner_HTML = $this->generate_inner_html($this->links);
     if ($this->mode == SORT_BY) {
         $content = $this->inner_HTML;
     } else {
         $content = parent::render();
     }
     return $content;
 }
 * http://wiki.peopleaggregator.org/index.php
 * 
 */
$login_required = FALSE;
$use_theme = 'Beta';
//TODO : Remove this when new UI is completely implemented.
include "includes/page.php";
require "{$current_blockmodule_path}/NewestNetworkModule/NewestNetworkModule.php";
$uid = @$_GET['uid'];
$selected_option = @$_GET['sort_by'];
$sorting_options[] = array('caption' => __('Recently Created'), 'value' => 'created');
$sorting_options[] = array('caption' => __('Recently Modified'), 'value' => 'changed');
$sorting_options[] = array('caption' => __('Largest Group'), 'value' => 'members');
$links = '';
if ($selected_option == 'members') {
    $links = Network::get_largest_networks(false, 5, 1, 'member_count');
} else {
    if ($selected_option == 'created') {
        $links = Network::get_largest_networks(false, 5, 1, 'created');
    } else {
        if ($selected_option == 'changed') {
            $links = Network::get_largest_networks(false, 5, 1, 'changed');
        }
    }
}
$obj = new NewestNetworkModule();
$obj->mode = $obj->sort_by = SORT_BY;
$obj->links = $links;
$obj->sorting_options = $sorting_options;
$obj->selected_option = $selected_option;
echo $obj->render();