<?php

header("Content-type: text/xml");
define("ROOT", "../../../../../../users/");
define("LEVEL_IDS_FILE_NAME", "level_ids");
define("FIELD_SEPARATOR", "|");
define("FILE_SPECIAL_CHARACTER", "_");
define("LEVEL_FILE_EXTENSION", ".xml.gz");

$id = $_GET["id"];
$path = build_path($id);
if (!file_exists($path))
{
   $path = str_replace(".gz", "", $path);
}
ob_start();
readgzfile($path);
ob_end_flush();

function build_path($id)
{
   $entry = file_read_line($id);
   $fields = explode(FIELD_SEPARATOR, $entry);
   $user = $fields[0];
   $file_name = convert_name($fields[1]) . LEVEL_FILE_EXTENSION;
   $path = ROOT . $user . "/levels/" . $file_name;
   return $path;
}
function file_read_line($line)
{
   $path = ROOT . "/" . LEVEL_IDS_FILE_NAME;
   $levels = file($path);
   return trim($levels[$line - 1]);
}
function convert_name($name)
{
   $name = preg_replace("/[^a-zA-Z0-9]{1}/", FILE_SPECIAL_CHARACTER, $name);
   return strtolower($name);
}
EVR.Level.Summary.Time = function(container, level)
{
   this.container = container;
   this.level = level;
   this.set();
}
EVR.Level.Summary.Time.prototype.set = function()
{
   var level = this.level;
   var container = this.container;
   var relative = level.container;
   var font = TIME_FONT;
   var color = this.determine_color();
   var size = TIME_FONT_SIZE;
   var text = level.history.get_newest().time;
   this.text = new EVR.Text(container, text, font, color, size, relative);
   this.set_line_height();
   this.text.css.overflow = "visible";
   var style = container.style;
   style.verticalAlign = "middle";
   style.paddingLeft = TIME_PADDING;
   style.letterSpacing = TIME_LETTER_SPACING;
   style.overflow = "visible";
}
EVR.Level.Summary.Time.prototype.determine_color = function()
{
   if (this.level.goal_cleared())
   {
      return TIME_CLEAR_FONT_COLOR;
   }
   return TIME_FAIL_FONT_COLOR;
}
EVR.Level.Summary.Time.prototype.set_line_height = function()
{
   var text = this.text;
   var height = text.get_font_size();
   height -= height * TIME_LINE_HEIGHT_MODIFIER;
   text.set_line_height(height);
}
EVR.Level.Summary.Time.prototype.draw = function()
{
   this.text.set_font_size();
   this.set_line_height();
}
EVR.Level.Summary.Time.prototype.toString = function()
{
   return "[object EVR.Level.Summary.Time]";
}
EVR.Level.Summary.Goal = function(container, level)
{
   this.container = container;
   this.level = level;
   this.set();
}
EVR.Level.Summary.Goal.prototype.set = function()
{
   var level = this.level;
   var container = this.container;
   var string = this.get_goal_string();
   var family = GOAL_FONT_FAMILY;
   var color = GOAL_FONT_COLOR;
   var size = GOAL_FONT_SIZE;
   var relative = level.container;
   this.text = new EVR.Text(container, string, family, color, size, relative);
   this.set_attributes();
}
EVR.Level.Summary.Goal.prototype.get_goal_string = function()
{
   var level = this.level;
   var goal, text;
   if (level.is_clear())
   {
      goal = level.advanced;
      text = GOAL_ADVANCED_TEXT;
   }
   else
   {
      goal = level.goal;
      text = GOAL_TEXT;
   }
   return text + " " + goal.toString(0, 1);
}
EVR.Level.Summary.Goal.prototype.set_attributes = function()
{
   var text = this.text;
   text.set_color(GOAL_BACKGROUND);
   text.css.textAlign = GOAL_TEXT_ALIGN;
   text.css.letterSpacing = GOAL_LETTER_SPACING;
   text.css.marginTop = GOAL_MARGIN;
   text.css.padding = GOAL_PADDING + " 0";
}
EVR.Level.Summary.Goal.prototype.draw = function()
{
   this.text.set_font_size();
}
EVR.Level.Summary.Goal.prototype.toString = function()
{
   return "[object EVR.Level.Summary.Goal]";
}
EVR.Level.Summary.Accuracy = function(container, level)
{
   this.container = container;
   this.field = level.container;
   this.path = level.road.path;
   this.history = level.history;
   this.align();
   this.add_heading();
   this.add_accuracy();
}
EVR.Level.Summary.Accuracy.prototype.align = function()
{
   var style = this.container.style;
   style.verticalAlign = "middle";
   style.textAlign = "center";
}
EVR.Level.Summary.Accuracy.prototype.add_heading = function()
{
   var cell = this.container;
   var text = ACCURACY_HEADING;
   var font = ACCURACY_HEADING_FONT;
   var size = ACCURACY_HEADING_FONT_SIZE;
   var color = ACCURACY_FONT_COLOR;
   var heading = new EVR.Text(cell, text, font, color, size, this.field);
   heading.css.textDecoration = ACCURACY_HEADING_TEXT_DECORATION;
   heading.css.letterSpacing = ACCURACY_HEADING_LETTER_SPACING;
   heading.css.backgroundColor = ACCURACY_BACKGROUND_COLOR;
   heading.css.borderBottom = ACCURACY_HEADING_BORDER;
   this.heading = heading;
}
EVR.Level.Summary.Accuracy.prototype.add_accuracy = function()
{
   var cell = this.container;
   var size = ACCURACY_FONT_SIZE;
   var text = this.history.get_newest().accuracy;
   var font = ACCURACY_FONT;
   var color = ACCURACY_FONT_COLOR;
   var accuracy = new EVR.Text(cell, text, font, color, size, this.field);
   accuracy.css.fontWeight = ACCURACY_FONT_WEIGHT;
   accuracy.css.letterSpacing = ACCURACY_LETTER_SPACING;
   accuracy.css.backgroundColor = ACCURACY_BACKGROUND_COLOR;
   accuracy.css.padding = "0 " + ACCURACY_PADDING + "px";
   this.accuracy = accuracy;
}
EVR.Level.Summary.Accuracy.prototype.draw = function()
{
   this.heading.set_font_size();
   this.accuracy.set_font_size();
}
EVR.Level.Summary.Accuracy.toString = function()
{
   return "[object EVR.Level.Summary.Accuracy]";
}
EVR.include("level/summary/Accuracy.js");
EVR.include("level/summary/Time.js");
EVR.include("level/summary/Goal.js");
EVR.include("level/summary/comparison/Comparison.js");
EVR.include("level/summary/graph/Graph.js");
EVR.Level.Summary = function(level)
{
   EVR.Table.call(this, level.road, "1%", "100%");
   level.road.set_color(SUMMARY_BACKGROUND);
   this.level = level;
   this.row = this.insert_row();
   this.add_finish_line();
   this.add_widgets();
   this.append();
}
EVR.Level.Summary.prototype = new EVR.Table;
EVR.Level.Summary.prototype.add_finish_line = function()
{
   var road = this.container;
   var finish_line = new EVR.Level.Road.Path.Line(road, LINE_FINISH);
   finish_line.place(SUMMARY_FINISH_LINE_OFFSET);
   finish_line.append();
   this.finish_line = finish_line;
}
EVR.Level.Summary.prototype.add_widgets = function()
{
   var level = this.level;
   var cell = this.insert_cell();
   this.accuracy = new EVR.Level.Summary.Accuracy(cell, level);
   this.goal = new EVR.Level.Summary.Goal(cell, level);
   this.graph = new EVR.Level.Summary.Graph(this.insert_cell(), level);
   this.comparison = new EVR.Level.Summary.Comparison(this.row, level);
   this.time = new EVR.Level.Summary.Time(this.insert_cell(), level);
}
EVR.Level.Summary.prototype.draw = function()
{
   this.comparison.draw();
   this.time.draw();
   this.goal.draw();
   this.accuracy.draw();
   this.graph.draw();
   this.finish_line.draw();
}
EVR.Level.Summary.prototype.toString = function()
{
   return "[object EVR.Level.Summary]";
}
216.73.216.175
216.73.216.175
216.73.216.175
 
July 18, 2022


A new era ‼

Our infrastructure has recently upgraded ‼

Nugget Communications Bureau 👍

You've never emailed like this before ‼

Roundcube

Webmail software for reading and sending email from @nugget.fun and @shampoo.ooo addresses.

Mailman3

Email discussion lists, modernized with likes and emojis. It can be used for announcements and newsletters in addition to discussions. See lists for Picture Processing or Scrapeboard. Nowadays, people use Discord, but you really don't have to!

FreshRSS

With this hidden in plain sight, old technology, even regular people like you and me can start our own newspaper or social media feed.

Nugget Streaming Media 👍

The content you crave ‼

HLS

A live streaming, video format based on M3U playlists that can be played with HTML5.

RTMP

A plugin for Nginx can receive streaming video from ffmpeg or OBS and forward it as an RTMP stream to sites like Youtube and Twitch or directly to VLC.


Professional ‼

Nugget Productivity Suite 👍

Unleash your potential ‼

Kanboard

Virtual index cards you can use to gamify your daily grind.

Gitea

Grab whatever game code you want, share your edits, and report bugs.

Nugget Security 👍

The real Turing test ‼

Fail2ban

Banning is even more fun when it's automated.

Spamassassin

The documentation explains, "an email which mentions rolex watches, Viagra, porn, and debt all in one" will probably be considered spam.

GoAccess

Display HTTP requests in real time, so you can watch bots try to break into WordPress.

Nugget Entertainment Software 👍

The best in gaming entertainment ‼

Emoticon vs. Rainbow

With everything upgraded to the bleeding edge, this HTML4 game is running better than ever.


Zoom ‼

The game engine I've been working on, SPACE BOX, is now able to export to web, so I'm planning on turning nugget.fun into a games portal by releasing my games on it and adding an accounts system. The upgraded server and software will make it easier to create and maintain. I'm also thinking of using advertising and subscriptions to support the portal, so some of these services, like webmail or the RSS reader, may be offered to accounts that upgrade to a paid subscription.