dirroot.'/blocks/modlos/version.php'); $this->title = get_string('modlos_menu', 'block_modlos'); $this->version = $plugin->version; $this->release = $plugin->release; // $this->grid_name = $CFG->modlos_grid_name; $this->grid_status = false; $this->now_online = '0'; $this->lastmonth_online = '0'; $this->user_count = '0'; $this->region_count = '0'; $this->cron = '1'; if (!isset($CFG->sloodle_update)) set_config('sloodle_update', 0); if (!isset($CFG->opensim_update)) set_config('opensim_update', 0); } function get_content() { global $CFG, $USER; if ($this->content!=NULL) { return $this->content; } $id = optional_param('id', 0, PARAM_INT); $db_ver = opensim_get_db_version(); $this->content = new stdClass; $this->content->text = ''. get_string('modlos_status','block_modlos').'
'; $this->content->text.= ''. get_string('modlos_world_map','block_modlos').'
'; $this->content->text.= ''.get_string('modlos_regions_list','block_modlos').'
'; $isguest = isguestuser(); if (!$isguest) { $this->content->text.= ''.get_string('modlos_avatars_list','block_modlos').'
'; $isAvatarMax = false; if ($db_ver!=null) { $avatars_num = modlos_get_avatars_num($USER->id); $max_avatars = $CFG->modlos_max_own_avatars; if (!hasModlosPermit($id) and $max_avatars>=0 and $avatars_num>=$max_avatars) $isAvatarMax = true; } if (!$isAvatarMax) { $this->content->text.= ''.get_string('modlos_avatar_create','block_modlos').'
'; } if ($CFG->modlos_activate_events) { $this->content->text.= ''.get_string('modlos_events_list','block_modlos').'
'; } if (hasModlosPermit($id)) { $this->content->text.= ''.get_string('modlos_manage_menu','block_modlos').'
'; } } $this->content->text.= "
"; if ($db_ver!=null) { $db_state = opensim_check_db(); $this->grid_status = $db_state['grid_status']; $this->now_online = $db_state['now_online']; $this->lastmonth_online = $db_state['lastmonth_online']; $this->user_count = $db_state['user_count']; $this->region_count = $db_state['region_count']; } else { $this->grid_status = false; $this->now_online = 0; $this->lastmonth_online = 0; $this->user_count = 0; $this->region_count = 0; } $this->content->text.= "
".$this->grid_name."
"; $this->content->text.= get_string('modlos_db_status','block_modlos').": "; if ($this->grid_status) $this->content->text.= "ONLINE
"; else $this->content->text.= "OFFLINE
"; $this->content->text.= get_string('modlos_total_users','block_modlos').": ".$this->user_count."
"; $this->content->text.= get_string('modlos_total_regions','block_modlos').": ".$this->region_count."
"; $this->content->text.= get_string('modlos_visitors_last30days','block_modlos').": ".$this->lastmonth_online."
"; $this->content->text.= get_string('modlos_online_now','block_modlos').": ".$this->now_online."
"; $this->content->footer = '
Modlos '.$this->release.''; return $this->content; } // setting of instance block. need config_instance.html function instance_allow_config() { return false; } // setting block. need settings.php function has_config() { return true; } // hide block header? function hide_header() { return false; } // exec parser function cron(){ global $CFG; require($CFG->dirroot.'/blocks/modlos/include/cron.php'); } } ?>