Exemple #1
0
/**
 * stats table function
 *
 * @param code_common $common calling page
 */
function stats_table($common)
{
    $common->core("rpg_stats");
    if (!$common->player->do_rpg) {
        // because we no longer necessarily have the rpg data
        /*require_once("code/player/code_player_rpg.php");
          $player = new code_player_rpg();*/
        // outdated >.>
        $player = $common->core("player");
        $player->do_rpg = true;
        if (!$player->get_player($common->player->id)) {
            return '';
        }
    } else {
        $player =& $common->player;
    }
    $skin = $common->page_generation->make_skin("skin_stats", '', 'public');
    if ($_GET['action'] == "spend" && $player->stat_points > 0) {
        $stat = $_POST['stat'];
        $success = $common->rpg_stats->spend($player, $stat);
        if ($success) {
            $message = $skin->stat_increased($stat, $player->{$stat});
        } else {
            $code_stats = $common->skin->error_box($common->lang->no_stat_points);
        }
    }
    if ($player->is_member == 1 && $player->stat_points > 0) {
        $stats_table = $skin->stats_table_can_spend($player->stat_points, $player->strength, $player->vitality, $player->agility);
    } else {
        $stats_table = $skin->stats_table($player->strength, $player->vitality, $player->agility);
    }
    $table = $skin->common_table($stats_table, $player->level, $player->exp, $player->exp_max, $player->hp, $player->hp_percent, $player->energy, $player->energy_max, $common->page_generation->format_time($player->registered), $common->page_generation->format_time($player->last_active), $message);
    return $table;
}
Exemple #2
0
 /**
  * fatal exception, shut shit down.
  */
 public function __construct($message = "", $code = 0, $previous = NULL)
 {
     $page = new code_common();
     $page->core("default_lang");
     $page->core("page_generation");
     $page->skin =& $page->page_generation->make_skin();
     if (isset($page->settings->get['name'])) {
         $site_name = $page->settings->get['name'];
     } else {
         $site_name = "Error";
     }
     $output = $page->skin->start_header("Error", $site_name);
     $output .= $page->skin->error_page($page->lang->{$message});
     $output .= $page->skin->footer();
     print $output;
 }
Exemple #3
0
 public function initiate($skin_name = "", $override = "")
 {
     parent::initiate($skin_name, $override);
     if ($this->player->rank != "Admin") {
         // yeah, I know, poor implementation of permissions
         $this->page_generation->error_page($this->lang->access_denied);
     }
 }
Exemple #4
0
 /**
  * error handling function
  *
  * @param <type> $id
  * @param <type> $text
  * @param <type> $file
  * @param <type> $line
  */
 public function error_handler($id, $text, $file, $line)
 {
     if (!isset($this->common->lang)) {
         $this->core("default_lang");
     }
     if (isset($this->common->page_generation)) {
         if (!$this->common->skin) {
             $this->common->page_generation->make_skin();
         }
         if (isset($this->common->settings->get['name'])) {
             $site_name = $this->common->settings->get['name'];
         } else {
             $site_name = "Quest";
         }
         $output = $this->common->skin->start_header("Error", $site_name, "default.css");
         $output .= $this->common->skin->error_page($text . " @ " . $file . " line " . $line . ".");
         $output .= $this->common->skin->footer();
     } else {
         try {
             require_once "code/common/code_common.php";
             $common = new code_common();
             $common->core('default_lang');
             $common->core('page_generation');
             $common->skin =& $common->page_generation->make_skin();
             if (isset($this->common->settings->get['name'])) {
                 $site_name = $this->common->settings->get['name'];
             } else {
                 $site_name = "Quest";
             }
             $output = $common->skin->start_header("Error", $site_name, "default.css");
             $output .= $common->skin->error_page($text . " @ " . $file . " line " . $line . ".");
             $output .= $common->skin->footer();
         } catch (Exception $e) {
             print $id . $text . $file . $line;
             $output = "Error time!";
         }
     }
     print $output;
     die;
 }