Page MenuHomeCode

No OneTemporary

This file is larger than 256 KB, so syntax highlighting was skipped.
This document is not UTF8. It was detected as ISO-8859-1 (Latin 1) and converted to UTF8 for display.
diff --git a/.htaccess b/.htaccess
index a171cd1..b2e04a9 100644
--- a/.htaccess
+++ b/.htaccess
@@ -1,7 +1,7 @@
-<IfModule mod_rewrite.c>
- RewriteEngine On
- RewriteBase /
- RewriteCond %{REQUEST_FILENAME} !-f
- RewriteCond %{REQUEST_FILENAME} !-d
- RewriteRule . /index.php [L]
-</IfModule>
\ No newline at end of file
+<IfModule mod_rewrite.c>
+ RewriteEngine On
+ RewriteBase /
+ RewriteCond %{REQUEST_FILENAME} !-f
+ RewriteCond %{REQUEST_FILENAME} !-d
+ RewriteRule . /index.php [L]
+</IfModule>
diff --git a/README b/README
index 3d374cf..2132dc5 100644
--- a/README
+++ b/README
@@ -1,164 +1,164 @@
- ZzzzzzZ zz
- Z z z The spatial gallery / social network / lounge
- z z (c) 2010, Dereckson, some rights reserved.
- z zzzzz zzzzz
- z z z z z 0.1 alpha technical preview
- z zzzzzzz z z
- z z z z Last update hypership time: 5.096
- z Z z z z z
- ZzzzzzZ zzzzz zzzzzz
-
-=========
- INSTALL
-=========
-
- * Zed is a PHP 5.3 application.
-
- * You can import dev/schema-mysql.sql as original SQL schema
-
- * The configuration file is includes/config.php
-
- * Files are cached in 3 directories of the cache folder, sets appropriate
- write permissions to:
- compiled openid sessions
-
- * Zed needs but doesn't include in its code the Janrain OpenID PHP libraries:
- http://www.janrain.com/openid-enabled - http://github.com/openid/php-openid
-
- Put the Auth folder somewhere in your include_dir path.
-
- bcmath and GMP php extensions are recommended (required?) for OpenID.
- Our dev environment outputs a white page without error if GMP isn't here.
-
- If you don't wish to enable OpenID, replace your includes/login.php by
- http://hg.dereckson.be/zed/src/0ffd1b08f33c/includes/login.php
-
- * Another used PHP extension is the WDDX one, to store session information in
- a human-readable format, easier to debug.
-
- If you don't want that, comment the following line from includes/config.php:
- ini_set('session.serialize_handler', 'wddx');
-
-=========
- UPGRADE
-=========
-
- * For our main prod install, we use a script exporting last repo revision with
- hg archive and applying a patch to config.php.
-
-===========
- LOCATIONS
-===========
-
- * Global location is a 9 letters code
- <B,S> <body or spaceship id> <place where you are in this body/spaceship>
- zerofilled 5 digits zerofilled 3 digits
-
- You can also find 6 digits expressions e.g. B00001 is the hypership
-
- * Local location varies of the place.
- - On hypership core (B00001002): Sector C<0-8> Level <z> Zone <x-y>
- - 0 is the gravity center
- - 1-8 the 8 cubes surrounding it: 1-4 below, 5-8 above
- - On the ship tower (B00001001): Sector T<z> Couloir <1-6>
- - z is the level
- - couloir depends of your x, y position (polar coordinates could help)
-
-=================
- HYPERSHIP TIME?
-=================
-
- * The amount of days since hypership launch, July 3rd 2010 00:00 UTC
- * So the decimal part is like internet time, but in GMT and not CET/CEST
-
-===============
- SIDE PROJECTS
-===============
-
- * A pazaak game, to have something to play
- * Will be an Arzakon client
-
-=================
- I WANT TO HELP!
-=================
-
- * You can create new SmartLine commands
-
- * You can translate it in a new language
- Start point: http://zed.dereckson.be/lang/en/core.conf
-
- * You can code a bit of adventure, places description, stuff to do
- as long you don't transform it in ogame clone (we're building a community
- who want or don't want to play, but not a mechanic game)
- and as long no money is involved (if you ask why, read Iain M. Banks novels)
- in the hypership (in far asteroids, orbitals, planets you do what you want)
-
-============
- KNOWN BUGS
-============
-
- * Javascript get_hypership_time will returns 5.94 instead 5.094
-
- Some %03d to add in /js/misc.js
-
- * The floater rendering adds a black line under Opera
-
- dojox.layout.floatingPane bug, need to check with last dojo version
-
- * API /location query will break indent on location->body->location
-
- beautify XML code to improve
-
- * do.php allows any local location move, discarding FrL status
-
- * The upload artwork dojo form can't be closed under Opera
-
-=======================
- API - General methods
-=======================
-
- * /api.php/time
-
- Returns hypership time
- Public access
-
- * /api.php/perso/<perso_id>
-
- Returns perso object
- Created only to test extensively recursivity of api xml output
- It's disabled since 10.811 on zed.dereckson.be, if you need an alternative,
- open a bug report with the fields you need. Ship API should be able to manage
- inventory if user is on. Ship API must also be able to get/set custom flags.
- Requires a key
-
- * /api.php/location/<location code or name>
-
- Returns location object
- Tip: to get the full name, use string eg /api.php/location/Zeta?format=string
- Requires a key
-
- * GET/POST API parameters
-
- - key
- API key, ask it at zed at dereckson be, object [DEV] api key request
-
- - format
- - preview print_r representation, so you've an idea of the object
- - json json_encode() output
- - php serialize() output
- - wddx WDDX were an early universal serialization attempt
- - xml XML document
- - string output "as is" (or if it's an object, calls __toString())
-
-============
- API - Ship
-=============
-
- * /api.php/ship/authenticate/<perso nickname>
-
-=================
- ACKNOWLEDGEMENT
-=================
-
-Elfix, to have let me figure a regexp correction, instead to throw away regexp
-validation for places local location.
+ ZzzzzzZ zz
+ Z z z The spatial gallery / social network / lounge
+ z z (c) 2010, Dereckson, some rights reserved.
+ z zzzzz zzzzz
+ z z z z z 0.1 alpha technical preview
+ z zzzzzzz z z
+ z z z z Last update hypership time: 5.096
+ z Z z z z z
+ ZzzzzzZ zzzzz zzzzzz
+
+=========
+ INSTALL
+=========
+
+ * Zed is a PHP 5.3 application.
+
+ * You can import dev/schema-mysql.sql as original SQL schema
+
+ * The configuration file is includes/config.php
+
+ * Files are cached in 3 directories of the cache folder, sets appropriate
+ write permissions to:
+ compiled openid sessions
+
+ * Zed needs but doesn't include in its code the Janrain OpenID PHP libraries:
+ http://www.janrain.com/openid-enabled - http://github.com/openid/php-openid
+
+ Put the Auth folder somewhere in your include_dir path.
+
+ bcmath and GMP php extensions are recommended (required?) for OpenID.
+ Our dev environment outputs a white page without error if GMP isn't here.
+
+ If you don't wish to enable OpenID, replace your includes/login.php by
+ http://hg.dereckson.be/zed/src/0ffd1b08f33c/includes/login.php
+
+ * Another used PHP extension is the WDDX one, to store session information in
+ a human-readable format, easier to debug.
+
+ If you don't want that, comment the following line from includes/config.php:
+ ini_set('session.serialize_handler', 'wddx');
+
+=========
+ UPGRADE
+=========
+
+ * For our main prod install, we use a script exporting last repo revision with
+ hg archive and applying a patch to config.php.
+
+===========
+ LOCATIONS
+===========
+
+ * Global location is a 9 letters code
+ <B,S> <body or spaceship id> <place where you are in this body/spaceship>
+ zerofilled 5 digits zerofilled 3 digits
+
+ You can also find 6 digits expressions e.g. B00001 is the hypership
+
+ * Local location varies of the place.
+ - On hypership core (B00001002): Sector C<0-8> Level <z> Zone <x-y>
+ - 0 is the gravity center
+ - 1-8 the 8 cubes surrounding it: 1-4 below, 5-8 above
+ - On the ship tower (B00001001): Sector T<z> Couloir <1-6>
+ - z is the level
+ - couloir depends of your x, y position (polar coordinates could help)
+
+=================
+ HYPERSHIP TIME?
+=================
+
+ * The amount of days since hypership launch, July 3rd 2010 00:00 UTC
+ * So the decimal part is like internet time, but in GMT and not CET/CEST
+
+===============
+ SIDE PROJECTS
+===============
+
+ * A pazaak game, to have something to play
+ * Will be an Arzakon client
+
+=================
+ I WANT TO HELP!
+=================
+
+ * You can create new SmartLine commands
+
+ * You can translate it in a new language
+ Start point: http://zed.dereckson.be/lang/en/core.conf
+
+ * You can code a bit of adventure, places description, stuff to do
+ as long you don't transform it in ogame clone (we're building a community
+ who want or don't want to play, but not a mechanic game)
+ and as long no money is involved (if you ask why, read Iain M. Banks novels)
+ in the hypership (in far asteroids, orbitals, planets you do what you want)
+
+============
+ KNOWN BUGS
+============
+
+ * Javascript get_hypership_time will returns 5.94 instead 5.094
+
+ Some %03d to add in /js/misc.js
+
+ * The floater rendering adds a black line under Opera
+
+ dojox.layout.floatingPane bug, need to check with last dojo version
+
+ * API /location query will break indent on location->body->location
+
+ beautify XML code to improve
+
+ * do.php allows any local location move, discarding FrL status
+
+ * The upload artwork dojo form can't be closed under Opera
+
+=======================
+ API - General methods
+=======================
+
+ * /api.php/time
+
+ Returns hypership time
+ Public access
+
+ * /api.php/perso/<perso_id>
+
+ Returns perso object
+ Created only to test extensively recursivity of api xml output
+ It's disabled since 10.811 on zed.dereckson.be, if you need an alternative,
+ open a bug report with the fields you need. Ship API should be able to manage
+ inventory if user is on. Ship API must also be able to get/set custom flags.
+ Requires a key
+
+ * /api.php/location/<location code or name>
+
+ Returns location object
+ Tip: to get the full name, use string eg /api.php/location/Zeta?format=string
+ Requires a key
+
+ * GET/POST API parameters
+
+ - key
+ API key, ask it at zed at dereckson be, object [DEV] api key request
+
+ - format
+ - preview print_r representation, so you've an idea of the object
+ - json json_encode() output
+ - php serialize() output
+ - wddx WDDX were an early universal serialization attempt
+ - xml XML document
+ - string output "as is" (or if it's an object, calls __toString())
+
+============
+ API - Ship
+=============
+
+ * /api.php/ship/authenticate/<perso nickname>
+
+=================
+ ACKNOWLEDGEMENT
+=================
+
+Elfix, to have let me figure a regexp correction, instead to throw away regexp
+validation for places local location.
diff --git a/apps/pazaak/debug.php b/apps/pazaak/debug.php
index 6896360..8fa3803 100644
--- a/apps/pazaak/debug.php
+++ b/apps/pazaak/debug.php
@@ -1,63 +1,63 @@
-<?php
-
-/**
- * Pazaak webservice client, debug console
- *
- * This is a sandbox to test the Pazaak web service.
- *
- * 2010-07-20: Pazaak will be noted as a deprecated project at 2010-09-15.
- *
- * @package Zed
- * @subpackage Pazaak
- * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
- * @copyright 2010 Sébastien Santoro aka Dereckson
- * @license http://www.opensource.org/licenses/bsd-license.php BSD
- * @version 0.1
- * @link http://scherzo.dereckson.be/doc/zed
- * @link http://zed.dereckson.be/
- * @filesource
- */
-
-/**
- * Prints human-readable information about a variable (like the print_r command),
- * enclosed in <div class="debugCode"><pre></pre></div> tags,
- * to have a preformatted HTML output.
- *
- * @param mixed The expression to be printed
- */
-function dprint_r ($expression) {
- echo '<div class="debugCode"><pre>';
- print_r($expression);
- echo '</pre></div>';
-}
-
-$client = new SoapClient('http://10.0.0.4:49319/PazaakService.asmx?WSDL');
-$game = $client->QuickQuickStart()->QuickQuickStartResult;
-
-echo "<h1>Game $game->GUID</h1>";
-echo "<h2>Table</h2>";
-$cards = $game->PlayerTable->string;
-if (is_array($cards)) {
- echo "<table><tr>";
- foreach ($cards as $card)
- echo "<td>$card</td>";
- echo "</tr></table>";
-} else {
- echo "<p>$cards</p>";
-}
-echo "<h2>Your hand</h2>";
-
-$cards = $game->PlayerHand->string;
-if (count($cards)) {
- echo "<table><tr>";
- foreach ($cards as $card)
- echo "<td>$card</td>";
- echo "</tr></table>";
-} else {
- echo "<p>-</p>";
-}
-
-echo "<h2>Debug</h2>";
-dprint_r($game);
-
+<?php
+
+/**
+ * Pazaak webservice client, debug console
+ *
+ * This is a sandbox to test the Pazaak web service.
+ *
+ * 2010-07-20: Pazaak will be noted as a deprecated project at 2010-09-15.
+ *
+ * @package Zed
+ * @subpackage Pazaak
+ * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
+ * @copyright 2010 Sébastien Santoro aka Dereckson
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD
+ * @version 0.1
+ * @link http://scherzo.dereckson.be/doc/zed
+ * @link http://zed.dereckson.be/
+ * @filesource
+ */
+
+/**
+ * Prints human-readable information about a variable (like the print_r command),
+ * enclosed in <div class="debugCode"><pre></pre></div> tags,
+ * to have a preformatted HTML output.
+ *
+ * @param mixed The expression to be printed
+ */
+function dprint_r ($expression) {
+ echo '<div class="debugCode"><pre>';
+ print_r($expression);
+ echo '</pre></div>';
+}
+
+$client = new SoapClient('http://10.0.0.4:49319/PazaakService.asmx?WSDL');
+$game = $client->QuickQuickStart()->QuickQuickStartResult;
+
+echo "<h1>Game $game->GUID</h1>";
+echo "<h2>Table</h2>";
+$cards = $game->PlayerTable->string;
+if (is_array($cards)) {
+ echo "<table><tr>";
+ foreach ($cards as $card)
+ echo "<td>$card</td>";
+ echo "</tr></table>";
+} else {
+ echo "<p>$cards</p>";
+}
+echo "<h2>Your hand</h2>";
+
+$cards = $game->PlayerHand->string;
+if (count($cards)) {
+ echo "<table><tr>";
+ foreach ($cards as $card)
+ echo "<td>$card</td>";
+ echo "</tr></table>";
+} else {
+ echo "<p>-</p>";
+}
+
+echo "<h2>Debug</h2>";
+dprint_r($game);
+
?>
\ No newline at end of file
diff --git a/cache/compiled/index.html b/cache/compiled/index.html
index 0dc4615..492df2b 100644
--- a/cache/compiled/index.html
+++ b/cache/compiled/index.html
@@ -1,20 +1,20 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd"
- >
-<html lang="en">
-<head>
- <title>Restricted directory</title>
- <link rel="Stylesheet" href="../../css/zed/theme.css" type="text/css" />
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-</head>
-<body>
- <div style="width: 960px; margin: auto; margin-top: 3em;">
- <h1 style="font-size: 3em;">Zed</h1>
- <h2>Restricted directory</h2>
- <p>As you can guess from the URL, this directory contains <em>precompiled</em> cached information.</p>
-
- <h3>Security tip</h3>
- <p>To improve security, please move the <tt>/cache</tt> directory outside the webserver hierarchy.</p>
- </div>
-</body>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd"
+ >
+<html lang="en">
+<head>
+ <title>Restricted directory</title>
+ <link rel="Stylesheet" href="../../css/zed/theme.css" type="text/css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+</head>
+<body>
+ <div style="width: 960px; margin: auto; margin-top: 3em;">
+ <h1 style="font-size: 3em;">Zed</h1>
+ <h2>Restricted directory</h2>
+ <p>As you can guess from the URL, this directory contains <em>precompiled</em> cached information.</p>
+
+ <h3>Security tip</h3>
+ <p>To improve security, please move the <tt>/cache</tt> directory outside the webserver hierarchy.</p>
+ </div>
+</body>
</html>
\ No newline at end of file
diff --git a/cache/index.html b/cache/index.html
index 8fead83..48eb53f 100644
--- a/cache/index.html
+++ b/cache/index.html
@@ -1,20 +1,20 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd"
- >
-<html lang="en">
-<head>
- <title>Restricted directory</title>
- <link rel="Stylesheet" href="../css/zed/theme.css" type="text/css" />
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-</head>
-<body>
- <div style="width: 960px; margin: auto; margin-top: 3em;">
- <h1 style="font-size: 3em;">Zed</h1>
- <h2>Restricted directory</h2>
- <p>As you can guess from the URL, this directory contains cached information.</p>
-
- <h3>Security tip</h3>
- <p>To improve security, please move the <tt>/cache</tt> directory outside the webserver hierarchy.</p>
- </div>
-</body>
-</html>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd"
+ >
+<html lang="en">
+<head>
+ <title>Restricted directory</title>
+ <link rel="Stylesheet" href="../css/zed/theme.css" type="text/css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+</head>
+<body>
+ <div style="width: 960px; margin: auto; margin-top: 3em;">
+ <h1 style="font-size: 3em;">Zed</h1>
+ <h2>Restricted directory</h2>
+ <p>As you can guess from the URL, this directory contains cached information.</p>
+
+ <h3>Security tip</h3>
+ <p>To improve security, please move the <tt>/cache</tt> directory outside the webserver hierarchy.</p>
+ </div>
+</body>
+</html>
diff --git a/cache/openid/index.html b/cache/openid/index.html
index 29ca0c3..1ffdf6c 100644
--- a/cache/openid/index.html
+++ b/cache/openid/index.html
@@ -1,20 +1,20 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd"
- >
-<html lang="en">
-<head>
- <title>Restricted directory</title>
- <link rel="Stylesheet" href="../../css/zed/theme.css" type="text/css" />
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-</head>
-<body>
- <div style="width: 960px; margin: auto; margin-top: 3em;">
- <h1 style="font-size: 3em;">Zed</h1>
- <h2>Restricted directory</h2>
- <p>As you can guess from the URL, this directory contains <em>OpenID</em> cached information.</p>
-
- <h3>Security tip</h3>
- <p>To improve security, please move the <tt>/cache</tt> directory outside the webserver hierarchy.</p>
- </div>
-</body>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd"
+ >
+<html lang="en">
+<head>
+ <title>Restricted directory</title>
+ <link rel="Stylesheet" href="../../css/zed/theme.css" type="text/css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+</head>
+<body>
+ <div style="width: 960px; margin: auto; margin-top: 3em;">
+ <h1 style="font-size: 3em;">Zed</h1>
+ <h2>Restricted directory</h2>
+ <p>As you can guess from the URL, this directory contains <em>OpenID</em> cached information.</p>
+
+ <h3>Security tip</h3>
+ <p>To improve security, please move the <tt>/cache</tt> directory outside the webserver hierarchy.</p>
+ </div>
+</body>
</html>
\ No newline at end of file
diff --git a/cache/sessions/index.html b/cache/sessions/index.html
index 2b7e6bd..e601ea2 100644
--- a/cache/sessions/index.html
+++ b/cache/sessions/index.html
@@ -1,20 +1,20 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd"
- >
-<html lang="en">
-<head>
- <title>Restricted directory</title>
- <link rel="Stylesheet" href="../../css/zed/theme.css" type="text/css" />
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-</head>
-<body>
- <div style="width: 960px; margin: auto; margin-top: 3em;">
- <h1 style="font-size: 3em;">Zed</h1>
- <h2>Restricted directory</h2>
- <p>As you can guess from the URL, this directory contains sessions information.</p>
-
- <h3>Security tip</h3>
- <p>To improve security, please move the <tt>/cache</tt> directory outside the webserver hierarchy.</p>
- </div>
-</body>
-</html>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd"
+ >
+<html lang="en">
+<head>
+ <title>Restricted directory</title>
+ <link rel="Stylesheet" href="../../css/zed/theme.css" type="text/css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+</head>
+<body>
+ <div style="width: 960px; margin: auto; margin-top: 3em;">
+ <h1 style="font-size: 3em;">Zed</h1>
+ <h2>Restricted directory</h2>
+ <p>As you can guess from the URL, this directory contains sessions information.</p>
+
+ <h3>Security tip</h3>
+ <p>To improve security, please move the <tt>/cache</tt> directory outside the webserver hierarchy.</p>
+ </div>
+</body>
+</html>
diff --git a/content/index.html b/content/index.html
index f63127e..233eb57 100644
--- a/content/index.html
+++ b/content/index.html
@@ -1,18 +1,18 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd"
- >
-<html lang="en">
-<head>
- <title>Restricted directory</title>
- <link rel="Stylesheet" href="../css/zed/theme.css" type="text/css" />
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-</head>
-<body>
- <div style="width: 960px; margin: auto; margin-top: 3em;">
- <h1 style="font-size: 3em;">Zed</h1>
- <h2>Content directory</h2>
- <p>As you can guess from the URL, this directory contains static <em>content</em>.</p>
- <p>To browse it, you've to use the Zed application.</p>
- </div>
-</body>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd"
+ >
+<html lang="en">
+<head>
+ <title>Restricted directory</title>
+ <link rel="Stylesheet" href="../css/zed/theme.css" type="text/css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+</head>
+<body>
+ <div style="width: 960px; margin: auto; margin-top: 3em;">
+ <h1 style="font-size: 3em;">Zed</h1>
+ <h2>Content directory</h2>
+ <p>As you can guess from the URL, this directory contains static <em>content</em>.</p>
+ <p>To browse it, you've to use the Zed application.</p>
+ </div>
+</body>
</html>
\ No newline at end of file
diff --git a/content/scenes/B00001001/couloir/bay/hyper/index.html b/content/scenes/B00001001/couloir/bay/hyper/index.html
index 96c56d4..7e1c9cb 100644
--- a/content/scenes/B00001001/couloir/bay/hyper/index.html
+++ b/content/scenes/B00001001/couloir/bay/hyper/index.html
@@ -1,20 +1,20 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd"
- >
-<html lang="en">
-<head>
- <title>Restricted directory</title>
- <link rel="Stylesheet" href="../../../../../../css/zed/theme.css" type="text/css" />
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-</head>
-<body>
- <div style="width: 960px; margin: auto; margin-top: 3em;">
- <h1 style="font-size: 3em;">Zed</h1>
- <h2>Content directory</h2>
- <p>As you can guess from the URL, this directory contains the bays for B00001001 couloirs scene content, when in hyperspace.</p>
- <p>To browse it, you've to use the Zed application.</p>
- <h3>Did you know?</h3>
- <p>B00001001 is the geocode for the hypership.</p>
- </div>
-</body>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd"
+ >
+<html lang="en">
+<head>
+ <title>Restricted directory</title>
+ <link rel="Stylesheet" href="../../../../../../css/zed/theme.css" type="text/css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+</head>
+<body>
+ <div style="width: 960px; margin: auto; margin-top: 3em;">
+ <h1 style="font-size: 3em;">Zed</h1>
+ <h2>Content directory</h2>
+ <p>As you can guess from the URL, this directory contains the bays for B00001001 couloirs scene content, when in hyperspace.</p>
+ <p>To browse it, you've to use the Zed application.</p>
+ <h3>Did you know?</h3>
+ <p>B00001001 is the geocode for the hypership.</p>
+ </div>
+</body>
</html>
\ No newline at end of file
diff --git a/content/scenes/B00001001/couloir/bay/index.html b/content/scenes/B00001001/couloir/bay/index.html
index 4e6c1f5..3aa6746 100644
--- a/content/scenes/B00001001/couloir/bay/index.html
+++ b/content/scenes/B00001001/couloir/bay/index.html
@@ -1,20 +1,20 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd"
- >
-<html lang="en">
-<head>
- <title>Restricted directory</title>
- <link rel="Stylesheet" href="../../../../../css/zed/theme.css" type="text/css" />
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-</head>
-<body>
- <div style="width: 960px; margin: auto; margin-top: 3em;">
- <h1 style="font-size: 3em;">Zed</h1>
- <h2>Content directory</h2>
- <p>As you can guess from the URL, this directory contains the bays for B00001001 couloirs scene content.</p>
- <p>To browse it, you've to use the Zed application.</p>
- <h3>Did you know?</h3>
- <p>B00001001 is the geocode for the hypership.</p>
- </div>
-</body>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd"
+ >
+<html lang="en">
+<head>
+ <title>Restricted directory</title>
+ <link rel="Stylesheet" href="../../../../../css/zed/theme.css" type="text/css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+</head>
+<body>
+ <div style="width: 960px; margin: auto; margin-top: 3em;">
+ <h1 style="font-size: 3em;">Zed</h1>
+ <h2>Content directory</h2>
+ <p>As you can guess from the URL, this directory contains the bays for B00001001 couloirs scene content.</p>
+ <p>To browse it, you've to use the Zed application.</p>
+ <h3>Did you know?</h3>
+ <p>B00001001 is the geocode for the hypership.</p>
+ </div>
+</body>
</html>
\ No newline at end of file
diff --git a/content/scenes/B00001001/couloir/index.html b/content/scenes/B00001001/couloir/index.html
index 459f699..6c7c692 100644
--- a/content/scenes/B00001001/couloir/index.html
+++ b/content/scenes/B00001001/couloir/index.html
@@ -1,20 +1,20 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd"
- >
-<html lang="en">
-<head>
- <title>Restricted directory</title>
- <link rel="Stylesheet" href="../../../../css/zed/theme.css" type="text/css" />
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-</head>
-<body>
- <div style="width: 960px; margin: auto; margin-top: 3em;">
- <h1 style="font-size: 3em;">Zed</h1>
- <h2>Content directory</h2>
- <p>As you can guess from the URL, this directory contains the couloirs scene content for B00001001.</p>
- <p>To browse it, you've to use the Zed application.</p>
- <h3>Did you know?</h3>
- <p>B00001001 is the geocode for the hypership.</p>
- </div>
-</body>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd"
+ >
+<html lang="en">
+<head>
+ <title>Restricted directory</title>
+ <link rel="Stylesheet" href="../../../../css/zed/theme.css" type="text/css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+</head>
+<body>
+ <div style="width: 960px; margin: auto; margin-top: 3em;">
+ <h1 style="font-size: 3em;">Zed</h1>
+ <h2>Content directory</h2>
+ <p>As you can guess from the URL, this directory contains the couloirs scene content for B00001001.</p>
+ <p>To browse it, you've to use the Zed application.</p>
+ <h3>Did you know?</h3>
+ <p>B00001001 is the geocode for the hypership.</p>
+ </div>
+</body>
</html>
\ No newline at end of file
diff --git a/content/scenes/B00001001/index.html b/content/scenes/B00001001/index.html
index 7fa96ab..5ed8b5e 100644
--- a/content/scenes/B00001001/index.html
+++ b/content/scenes/B00001001/index.html
@@ -1,20 +1,20 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd"
- >
-<html lang="en">
-<head>
- <title>Restricted directory</title>
- <link rel="Stylesheet" href="../../../css/zed/theme.css" type="text/css" />
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-</head>
-<body>
- <div style="width: 960px; margin: auto; margin-top: 3em;">
- <h1 style="font-size: 3em;">Zed</h1>
- <h2>Content directory</h2>
- <p>As you can guess from the URL, this directory contains scenes content for B00001001.</p>
- <p>To browse it, you've to use the Zed application.</p>
- <h3>Did you know?</h3>
- <p>B00001001 is the geocode for the hypership.</p>
- </div>
-</body>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd"
+ >
+<html lang="en">
+<head>
+ <title>Restricted directory</title>
+ <link rel="Stylesheet" href="../../../css/zed/theme.css" type="text/css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+</head>
+<body>
+ <div style="width: 960px; margin: auto; margin-top: 3em;">
+ <h1 style="font-size: 3em;">Zed</h1>
+ <h2>Content directory</h2>
+ <p>As you can guess from the URL, this directory contains scenes content for B00001001.</p>
+ <p>To browse it, you've to use the Zed application.</p>
+ <h3>Did you know?</h3>
+ <p>B00001001 is the geocode for the hypership.</p>
+ </div>
+</body>
</html>
\ No newline at end of file
diff --git a/content/scenes/B00001001/tower.js b/content/scenes/B00001001/tower.js
index 343d6d6..2d8d138 100644
--- a/content/scenes/B00001001/tower.js
+++ b/content/scenes/B00001001/tower.js
@@ -1,608 +1,608 @@
-/* -------------------------------------------------------------
- Zed hypership tower javascript code
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Authors: Dereckson (tower, passage and gallery classes)
- G. Fernandez (tv, Library classes)
- Tags: animation upload presentation diaporama
- Filename: tower.js
- Version: 1.0
- Created: 2010-01-31
- Updated: 2010-02-23
- Licences: Dereckson code is dual licensed:
- BSD and Creative Commons BY 3.0.
- G. Fernandez code is licensed under CC-BY-NC 2.0.
- Dependencies: dojo (xhr calls, dialog ui)
- ------------------------------------------------------------- */
-
-/* -------------------------------------------------------------
- Tower class
- Prints a tower map, with hl on current corridor
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-var tower = {
- //The source to highlight picture
- hl: 'hl.png',
-
- //The highlighted corridor (1-6). 0 = no hl
- i: 0,
-
- //The corridor 4 (top) hl starts at:
- hlStartPosition: [163, 93],
-
- //Gets CurrentPerso html code
- getHighlightCode: function () {
- return '<img id="tower_hl" src="' + this.hl + '" alt="Corridor ' + this.i + '" />';
- },
-
- highlight: function (i) {
- //If already there, nothing to do
- if (this.i == i) return;
-
- //Puts hl
- this.i = i;
- var tower = document.getElementById("tower");
- if (tower != null) {
- tower.innerHTML = this.getHighlightCode();
- var towerHl = document.getElementById("tower_hl");
- if (towerHl != null) {
- towerHl.style.left = this.hlStartPosition[0] + "px";
- towerHl.style.top = this.hlStartPosition[1] + "px";
-
- //The 4 is okay
- if (i == 4) return;
-
- //Gets rotation angle
- if (i > 4) {
- angle = 60 * (i - 4);
- } else {
- angle = 180 + (i -1) * 60;
- }
- }
- }
- }
-}
-
-/* -------------------------------------------------------------
- Passage class
- Prints relevant bay
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-//Corridors are like art galleries
-var passage = {
- //Parameters
- shipGlobalLocation: null,
- persoLocalLocation: null,
- bayPath: '',
- id: 'passage',
-
- //gets hyperspace bay
- //randomly selected from 23 choices
- getHyperspaceBay: function () {
- var n = Math.floor(Math.random() * 23 + 1);
- return 'hyper/' + ((n.toString().length == 1) ? "0" + n : n) + '.png';
- },
-
- getBay: function () {
- //The bay depends of ship location
- if (this.shipGlobalLocation[0] == 'B') {
- //TODO: handle orientation of the ship and objects
- //{$bay = substr($location->global, 0, 6)}
- return this.shipGlobalLocation.substring(0, 6) + '.png';
- } else {
- //TODO: check if we're really in hyperspace.
- //If not, we should fallback on default.png
- return this.getHyperspaceBay();
- }
-
- return 'default.png'; //will be reachable, cf. upper
- },
-
- updateBay: function () {
- var bgImage = 'url("' + this.bayPath + this.getBay() + '")';
- document.getElementById(this.id).style.backgroundImage = bgImage;
- },
-
- getLocalLocation: function () {
- //Splits TtCc expression at C
- // '0' => "T2"
- // '1' => "1"
- var location = this.persoLocalLocation.split('C');
-
- if (location.length == 2 && location[0][0] == 'T') {
- //Current t, c coordinates
- var t = location[0].substring(1);
- var c = location[1];
- }
-
- return [t, c];
- },
-
- goLeft: function () {
- //TxC1 -> TxC6 -> TxC5 -> TxC4 -> TxC3 -> TxC2 -> TxC1
- tc = this.getLocalLocation();
- t = tc[0];
- c = tc[1];
-
- //New c coordinates
- var nc = (c == 1) ? 6 : c - 1;
-
- this.moveTo(t, nc);
- },
-
- goUp: function () {
- //TxCy -> T[x+1]Cy
- tc = this.getLocalLocation();
- t = tc[0];
- c = tc[1];
-
- if (t > 1) {
- this.moveTo(--t, c);
- }
- },
-
- goDown: function () {
- //TxCy -> T[x+1]Cy
- tc = this.getLocalLocation();
- t = tc[0];
- c = tc[1];
-
- this.moveTo(++t, c);
- },
-
- goRight: function () {
- //TxC1 -> TxC2 -> TxC3 -> TxC4 -> TxC5 -> TxC6 -> TxC1
- tc = this.getLocalLocation();
- t = tc[0];
- c = tc[1];
-
- //New c coordinates
- var nc = (c == 6) ? 1 : eval(c) + 1;
-
- this.moveTo(t, nc);
- },
-
- moveTo: function (t, c) {
- //New local location
- local_location = 'T' + t + 'C' + c;
- passage.persoLocalLocation = local_location;
-
- //Updates coordinates
- dojo.byId('TowerCouloir').innerHTML = c;
- dojo.byId('TowerFloor').innerHTML = t;
- dojo.byId('location_local').value = local_location;
-
- //Updates bays
- //passage.updateBay();
-
- //TODO: make url parameter compatible to any URL scheme
- //TODO: check in dojo doc if the local_location have to be encoded
- dojo.xhrGet({
- handleAs: "json",
- url: "/do.php/set_local_location/" + local_location,
- preventCache: true,
- handle: function (response, ioArgs) {
- //Loads new gallery content
- if (gallery.initialized) {
- gallery.loadPics();
- }
- }
- });
- },
-
- onGalleryInitialized: function () {
- //Adds left and right arrows
- this.addLeftArrow();
- this.addRightArrow();
- },
-
- addLeftArrow: function () {
- //Adds left arrow
- var element = document.getElementById(this.id);
- var left = element.offsetLeft + 28;
- var top = element.offsetTop + 173;
-
- element.innerHTML += '<div id="passage_left" onClick="passage.goLeft()" style="display: none; position: absolute; top: ' + top + 'px; left: ' + left + 'px"></div>';
- },
-
- addRightArrow: function () {
- //Adds right arrow
- var element = document.getElementById(this.id);
- var left = element.offsetLeft + 898;
- var top = element.offsetTop + 173;
-
- element.innerHTML += '<div id="passage_right" onClick="passage.goRight()" style="display: none; position: absolute; top: ' + top + 'px; left: ' + left + 'px"></div>';
- },
-
- displayArrows: function (state) {
- //Displays left and right arrows?
- var display = [false, false];
-
- switch (state) {
- case "left":
- display[0] = true;
- break;
-
- case "right":
- display[1] = true;
- break;
- }
-
- document.getElementById("passage_left").style.display = display[0] ? 'block' : 'none';
- document.getElementById("passage_right").style.display = display[1] ? 'block' : 'none';
- },
-
- onmousemove: function () {
- var element = document.getElementById(this.id);
- var left = element.offsetLeft;
- var top = element.offsetTop;
-
- //alert(element.offsetWidth);
- var inPassage = (
- mouse.x >= left && mouse.y >= top &&
- mouse.x <= left + element.offsetWidth &&
- mouse.y <= top + element.offsetHeight
- )
-
- if (inPassage) {
- var x = mouse.x - left;
- var y = mouse.y - top;
- if (x < 130) {
- this.displayArrows('left');
- } else if (x > 830) {
- this.displayArrows('right');
- } else {
- this.displayArrows('none');
- }
- }
- },
-
- isValidLocalLocation: function (localLocation) {
- return /^T[1-9][0-9]*C[1-6]$/.test(localLocation);
- },
-
- initialize: function (shipGlobalLocation, persoLocalLocation) {
- this.shipGlobalLocation = shipGlobalLocation;
- this.persoLocalLocation = persoLocalLocation;
- if (!this.isValidLocalLocation(persoLocalLocation)) {
- this.moveTo(2, 1);
-
- //Notify (this code requires prototype.js (or jquery, but in this case, simplify it with a insertAfter call))
- //TODO: ensure this code have dojo as only dependency
- $("header").replace('<div id="header">' + $("header").innerHTML + '</div><div class="container_16"><div class="grid_16 alpha omega"><div class="notify">As you were losing yourself in the hypership tower, your paths guide you to the second floor.</div></div></div>');
- }
- this.updateBay();
- }
-}
-
-/* -------------------------------------------------------------
- Gallery class
- Prints the gallery and calls artwork script
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-var gallery = {
- pics: [],
-
- initialized: false,
-
- artworkDisplayMode: false,
-
- currentPic: -1,
-
- path: '',
-
- loadXhrUrl: null,
-
- getSquare: function (url) {
- //Gets extension position (last . position)
- var pos = url.lastIndexOf('.');
-
- return url.substring(0, pos) + 'Square' + url.substring(pos);
- },
-
- showGallery: function () {
- var html = '<ul>';
- for (var i = 0 ; i < this.pics.length ; i++) {
- if (this.pics[i] != null) {
- //Shows artwork
- html += '\n\t<li><img src="' + this.getSquare(this.pics[i]) + '" onClick="gallery.show(' + i + ')" /></li>';
- } else {
- //Shows placeholder
- html += '\n\t<li onClick="gallery.uploadDialog(' + i + ');"></li>';
- }
- }
- html += '\n</ul>';
- document.getElementById('passage_gallery').innerHTML = html;
- passage.onGalleryInitialized();
- },
-
- hideGallery: function () {
- var elem = document.getElementById('passage_gallery');
- Effect.Puff(elem);
- },
-
- loadPics: function () {
- dojo.xhrGet({
- handleAs: 'json',
- url: this.loadXhrUrl + '?location_local=' + passage.persoLocalLocation,
- preventCache: true,
- handle: function (response, ioArgs) {
- //TODO: in the future, we should print some metadata,
- // and the objects will be useful.
- // Meanwhile, we transform it to an array line.
-
- var pics = [null, null, null];
-
- //Builds pics array
- for (var i = 0 ; i < response.length ; i++) {
- if (response[i]['location_k'] > -1 && response[i]['location_k'] < 3) {
- pics[response[i]['location_k']] = gallery.path + '/' + response[i]['path'];
- }
- }
-
- //alert(dump(response));
- gallery.loadPicsCallback(pics);
-
- }
- });
- },
-
- loadPicsCallback: function (pics) {
- //Sets pics array
- this.pics = pics;
-
- //Show gallery
- this.showGallery();
-
- //Init done
- if (!this.initialized) {
- this.initialized = true;
- }
- },
-
- show: function (i) {
- //Hides gallery
- this.hideGallery();
-
- //Shows image
- setTimeout('gallery.showImage(' + i + ')', 800);
- },
-
- showImage: function (i) {
- //Sets image information
- this.currentPic = i; //currently not used
- this.artworkDisplayMode = true; //to handle properly ESC key down.
-
- //New HTML passage code
- document.getElementById('passage').innerHTML = '<div id="screen"></div><div id="bankImages"><img src="' + this.pics[i] + '" /></div>';
-
- //Calls Photo3D script
- onresize = tv.resize;
- tv.init();
- },
-
- backToGallery: function () {
- //Fades current picture
- Effect.Fade(document.getElementById('screen'));
-
- //Rebuilds gallery (in 800 ms, to let time to fading effect)
- setTimeout("document.getElementById('passage').innerHTML = '<div id=\"passage_gallery\"></div>'; gallery.showGallery()", 800);
-
- //Sets image information
- this.currentPic = -1; //currently not used
- this.artworkDisplayMode = false; //to handle properly ESC key down.
- },
-
- uploadDialog: function (i) {
- document.getElementById('i').value = i;
- dijit.byId('uploadDialog').show();
- },
-
- initialize: function (path, loadXhrUrl) {
- //Sets load xhr url
- this.path = path;
- this.loadXhrUrl = loadXhrUrl;
-
- //Loads pics
- this.loadPics();
-
- //Listens ESC key
- document.onkeydown = function (e) {
- if (e.keyCode == 27) {
- if (gallery.artworkDisplayMode) {
- gallery.backToGallery();
- } else {
- gallery.hideGallery();
- }
- }
- }
- }
-}
-
-/* -------------------------------------------------------------
- Photo3D G. Fernandez script
- http://www.dhteumeuleu.com/runscript.php?scr=photo3D.html
-
- TODO: simplify code to handle one picture, and not an array
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-var gridsize = 1;
-
-var Library = {};
-Library.ease = function() {
- this.target = 0;
-
- this.position = 0;
-
- this.move = function(_1, _2) {
- this.position += (_1 - this.position) * _2;
- };
-};
-
-var tv = {
- O: [],
-
- screen: {},
-
- grid: {
- size: gridsize,
- borderSize: 6,
- zoomed: false
- },
-
- angle: {
- x: new Library.ease(),
- y: new Library.ease()
- },
-
- camera: {
- x: new Library.ease(),
- y: new Library.ease(),
- zoom: new Library.ease(),
- focalLength: 750
- },
-
- init: function() {
- this.screen.obj = document.getElementById("screen");
- var images = document.getElementById("bankImages").getElementsByTagName("img");
-
- this.screen.obj.onselectstart = function () {
- return false;
- };
- this.screen.obj.ondrag = function () {
- return false;
- };
- var ni = 0;
- var n = (tv.grid.size / 2) - 0.5;
- for (var y = - n ; y <= n ; y++) {
- for (var x = - n ; x <= n; x++) {
- var o = document.createElement("img");
- var i = images[(ni++) % images.length];
- o.className = "tvout";
- o.src = i.src;
- tv.screen.obj.appendChild(o);
- o.point3D = {
- x: x,
- y: y,
- z: new Library.ease()
- };
- o.point2D = {};
- o.ratioImage = 1;
- tv.O.push(o);
-
- o.onmouseover = function () {
- if (!tv.grid.zoomed) {
- if (tv.o) {
- tv.o.point3D.z.target = 0;
- tv.o.className = "tvout";
- }
- this.className = "tvover";
- this.point3D.z.target = - 0.5;
- tv.o = this;
- }
- };
-
- o.onclick = function () {
- if (!tv.grid.zoomed) {
- tv.camera.x.target = this.point3D.x;
- tv.camera.y.target = this.point3D.y;
- tv.camera.zoom.target = tv.screen.w * 1.25;
- tv.grid.zoomed = this;
- } else {
- if (this == tv.grid.zoomed) {
- tv.camera.x.target = 0;
- tv.camera.y.target = 0;
- tv.camera.zoom.target = tv.screen.w / (tv.grid.size + 0.1);
- tv.grid.zoomed = false;
- }
- }
- };
-
- o.calc = function () {
- this.point3D.z.move(this.point3D.z.target, 0.5);
- var x = (this.point3D.x - tv.camera.x.position) * tv.camera.zoom.position;
- var y = (this.point3D.y - tv.camera.y.position) * tv.camera.zoom.position;
- var z = this.point3D.z.position * tv.camera.zoom.position;
- var xy = tv.angle.cx * y - tv.angle.sx * z;
- var xz = tv.angle.sx * y+tv.angle.cx * z;
- var yz = tv.angle.cy * xz - tv.angle.sy * x;
- var yx = tv.angle.sy * xz+tv.angle.cy * x;
- this.point2D.scale = tv.camera.focalLength / (tv.camera.focalLength+yz);
- this.point2D.x = yx * this.point2D.scale;
- this.point2D.y = xy * this.point2D.scale;
- this.point2D.w = Math.round(Math.max(0, this.point2D.scale * tv.camera.zoom.position * 0.8));
- if (this.ratioImage > 1) {
- this.point2D.h = Math.round(this.point2D.w / this.ratioImage);
- } else {
- this.point2D.h = this.point2D.w;this.point2D.w = Math.round(this.point2D.h * this.ratioImage);
- }
- };
-
- o.draw = function () {
- if (this.complete) {
- if (!this.loaded) {
- if (!this.img) {
- this.img = new Image();
- this.img.src = this.src;
- }
- if (this.img.complete) {
- this.style.visibility = "visible";
- this.ratioImage = this.img.width / this.img.height;
- this.loaded = true;this.img = false;
- }
- }
- this.style.left = Math.round(this.point2D.x * this.point2D.scale + tv.screen.w - this.point2D.w * 0.5) + "px";
- this.style.top = Math.round(this.point2D.y * this.point2D.scale + tv.screen.h - this.point2D.h * 0.5) + "px";
- this.style.width = this.point2D.w + "px";
- this.style.height = this.point2D.h + "px";
- this.style.borderWidth = Math.round(Math.max(this.point2D.w, this.point2D.h) * tv.grid.borderSize * 0.01) + "px";
- this.style.zIndex = Math.floor(this.point2D.scale * 100);
- }
- };
- }
- }
- tv.resize();
- mouse.y = tv.screen.y+tv.screen.h;
- mouse.x = tv.screen.x+tv.screen.w;
- tv.run();
- },
-
- resize: function() {
- var o = tv.screen.obj;
- tv.screen.w = o.offsetWidth / 2;
- tv.screen.h = o.offsetHeight / 2;
- tv.camera.zoom.target = tv.screen.w / (tv.grid.size + 0.1);
- for (tv.screen.x = 0, tv.screen.y = 0 ; o != null ; o = o.offsetParent) {
- tv.screen.x += o.offsetLeft;
- tv.screen.y = o.offsetTop;
- }
- },
-
- run: function () {
- tv.angle.x.move(-(mouse.y - tv.screen.h - tv.screen.y) * 0.0025, 0.1);
- tv.angle.y.move((mouse.x - tv.screen.w - tv.screen.x) * 0.0025, 0.1);
- tv.camera.x.move(tv.camera.x.target, tv.grid.zoomed ? 0.25: 0.025);
- tv.camera.y.move(tv.camera.y.target, tv.grid.zoomed ? 0.25: 0.025);
- tv.camera.zoom.move(tv.camera.zoom.target, 0.05);
- tv.angle.cx = Math.cos(tv.angle.x.position);
- tv.angle.sx = Math.sin(tv.angle.x.position);
- tv.angle.cy = Math.cos(tv.angle.y.position);
- tv.angle.sy = Math.sin(tv.angle.y.position);
- for (var i = 0, o ; o = tv.O[i] ; i++) {
- o.calc();
- o.draw();
- }
- setTimeout(tv.run, 32);
- }
-};
-
-var mouse = {x: 0, y: 0};
-
-document.onmousemove = function (e) {
- if (window.event) {
- e = window.event;
- }
- mouse.x = e.clientX;
- mouse.y = e.clientY;
- passage.onmousemove();
- return false;
-};
+/* -------------------------------------------------------------
+ Zed hypership tower javascript code
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ Authors: Dereckson (tower, passage and gallery classes)
+ G. Fernandez (tv, Library classes)
+ Tags: animation upload presentation diaporama
+ Filename: tower.js
+ Version: 1.0
+ Created: 2010-01-31
+ Updated: 2010-02-23
+ Licences: Dereckson code is dual licensed:
+ BSD and Creative Commons BY 3.0.
+ G. Fernandez code is licensed under CC-BY-NC 2.0.
+ Dependencies: dojo (xhr calls, dialog ui)
+ ------------------------------------------------------------- */
+
+/* -------------------------------------------------------------
+ Tower class
+ Prints a tower map, with hl on current corridor
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+
+var tower = {
+ //The source to highlight picture
+ hl: 'hl.png',
+
+ //The highlighted corridor (1-6). 0 = no hl
+ i: 0,
+
+ //The corridor 4 (top) hl starts at:
+ hlStartPosition: [163, 93],
+
+ //Gets CurrentPerso html code
+ getHighlightCode: function () {
+ return '<img id="tower_hl" src="' + this.hl + '" alt="Corridor ' + this.i + '" />';
+ },
+
+ highlight: function (i) {
+ //If already there, nothing to do
+ if (this.i == i) return;
+
+ //Puts hl
+ this.i = i;
+ var tower = document.getElementById("tower");
+ if (tower != null) {
+ tower.innerHTML = this.getHighlightCode();
+ var towerHl = document.getElementById("tower_hl");
+ if (towerHl != null) {
+ towerHl.style.left = this.hlStartPosition[0] + "px";
+ towerHl.style.top = this.hlStartPosition[1] + "px";
+
+ //The 4 is okay
+ if (i == 4) return;
+
+ //Gets rotation angle
+ if (i > 4) {
+ angle = 60 * (i - 4);
+ } else {
+ angle = 180 + (i -1) * 60;
+ }
+ }
+ }
+ }
+}
+
+/* -------------------------------------------------------------
+ Passage class
+ Prints relevant bay
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+
+//Corridors are like art galleries
+var passage = {
+ //Parameters
+ shipGlobalLocation: null,
+ persoLocalLocation: null,
+ bayPath: '',
+ id: 'passage',
+
+ //gets hyperspace bay
+ //randomly selected from 23 choices
+ getHyperspaceBay: function () {
+ var n = Math.floor(Math.random() * 23 + 1);
+ return 'hyper/' + ((n.toString().length == 1) ? "0" + n : n) + '.png';
+ },
+
+ getBay: function () {
+ //The bay depends of ship location
+ if (this.shipGlobalLocation[0] == 'B') {
+ //TODO: handle orientation of the ship and objects
+ //{$bay = substr($location->global, 0, 6)}
+ return this.shipGlobalLocation.substring(0, 6) + '.png';
+ } else {
+ //TODO: check if we're really in hyperspace.
+ //If not, we should fallback on default.png
+ return this.getHyperspaceBay();
+ }
+
+ return 'default.png'; //will be reachable, cf. upper
+ },
+
+ updateBay: function () {
+ var bgImage = 'url("' + this.bayPath + this.getBay() + '")';
+ document.getElementById(this.id).style.backgroundImage = bgImage;
+ },
+
+ getLocalLocation: function () {
+ //Splits TtCc expression at C
+ // '0' => "T2"
+ // '1' => "1"
+ var location = this.persoLocalLocation.split('C');
+
+ if (location.length == 2 && location[0][0] == 'T') {
+ //Current t, c coordinates
+ var t = location[0].substring(1);
+ var c = location[1];
+ }
+
+ return [t, c];
+ },
+
+ goLeft: function () {
+ //TxC1 -> TxC6 -> TxC5 -> TxC4 -> TxC3 -> TxC2 -> TxC1
+ tc = this.getLocalLocation();
+ t = tc[0];
+ c = tc[1];
+
+ //New c coordinates
+ var nc = (c == 1) ? 6 : c - 1;
+
+ this.moveTo(t, nc);
+ },
+
+ goUp: function () {
+ //TxCy -> T[x+1]Cy
+ tc = this.getLocalLocation();
+ t = tc[0];
+ c = tc[1];
+
+ if (t > 1) {
+ this.moveTo(--t, c);
+ }
+ },
+
+ goDown: function () {
+ //TxCy -> T[x+1]Cy
+ tc = this.getLocalLocation();
+ t = tc[0];
+ c = tc[1];
+
+ this.moveTo(++t, c);
+ },
+
+ goRight: function () {
+ //TxC1 -> TxC2 -> TxC3 -> TxC4 -> TxC5 -> TxC6 -> TxC1
+ tc = this.getLocalLocation();
+ t = tc[0];
+ c = tc[1];
+
+ //New c coordinates
+ var nc = (c == 6) ? 1 : eval(c) + 1;
+
+ this.moveTo(t, nc);
+ },
+
+ moveTo: function (t, c) {
+ //New local location
+ local_location = 'T' + t + 'C' + c;
+ passage.persoLocalLocation = local_location;
+
+ //Updates coordinates
+ dojo.byId('TowerCouloir').innerHTML = c;
+ dojo.byId('TowerFloor').innerHTML = t;
+ dojo.byId('location_local').value = local_location;
+
+ //Updates bays
+ //passage.updateBay();
+
+ //TODO: make url parameter compatible to any URL scheme
+ //TODO: check in dojo doc if the local_location have to be encoded
+ dojo.xhrGet({
+ handleAs: "json",
+ url: "/do.php/set_local_location/" + local_location,
+ preventCache: true,
+ handle: function (response, ioArgs) {
+ //Loads new gallery content
+ if (gallery.initialized) {
+ gallery.loadPics();
+ }
+ }
+ });
+ },
+
+ onGalleryInitialized: function () {
+ //Adds left and right arrows
+ this.addLeftArrow();
+ this.addRightArrow();
+ },
+
+ addLeftArrow: function () {
+ //Adds left arrow
+ var element = document.getElementById(this.id);
+ var left = element.offsetLeft + 28;
+ var top = element.offsetTop + 173;
+
+ element.innerHTML += '<div id="passage_left" onClick="passage.goLeft()" style="display: none; position: absolute; top: ' + top + 'px; left: ' + left + 'px"></div>';
+ },
+
+ addRightArrow: function () {
+ //Adds right arrow
+ var element = document.getElementById(this.id);
+ var left = element.offsetLeft + 898;
+ var top = element.offsetTop + 173;
+
+ element.innerHTML += '<div id="passage_right" onClick="passage.goRight()" style="display: none; position: absolute; top: ' + top + 'px; left: ' + left + 'px"></div>';
+ },
+
+ displayArrows: function (state) {
+ //Displays left and right arrows?
+ var display = [false, false];
+
+ switch (state) {
+ case "left":
+ display[0] = true;
+ break;
+
+ case "right":
+ display[1] = true;
+ break;
+ }
+
+ document.getElementById("passage_left").style.display = display[0] ? 'block' : 'none';
+ document.getElementById("passage_right").style.display = display[1] ? 'block' : 'none';
+ },
+
+ onmousemove: function () {
+ var element = document.getElementById(this.id);
+ var left = element.offsetLeft;
+ var top = element.offsetTop;
+
+ //alert(element.offsetWidth);
+ var inPassage = (
+ mouse.x >= left && mouse.y >= top &&
+ mouse.x <= left + element.offsetWidth &&
+ mouse.y <= top + element.offsetHeight
+ )
+
+ if (inPassage) {
+ var x = mouse.x - left;
+ var y = mouse.y - top;
+ if (x < 130) {
+ this.displayArrows('left');
+ } else if (x > 830) {
+ this.displayArrows('right');
+ } else {
+ this.displayArrows('none');
+ }
+ }
+ },
+
+ isValidLocalLocation: function (localLocation) {
+ return /^T[1-9][0-9]*C[1-6]$/.test(localLocation);
+ },
+
+ initialize: function (shipGlobalLocation, persoLocalLocation) {
+ this.shipGlobalLocation = shipGlobalLocation;
+ this.persoLocalLocation = persoLocalLocation;
+ if (!this.isValidLocalLocation(persoLocalLocation)) {
+ this.moveTo(2, 1);
+
+ //Notify (this code requires prototype.js (or jquery, but in this case, simplify it with a insertAfter call))
+ //TODO: ensure this code have dojo as only dependency
+ $("header").replace('<div id="header">' + $("header").innerHTML + '</div><div class="container_16"><div class="grid_16 alpha omega"><div class="notify">As you were losing yourself in the hypership tower, your paths guide you to the second floor.</div></div></div>');
+ }
+ this.updateBay();
+ }
+}
+
+/* -------------------------------------------------------------
+ Gallery class
+ Prints the gallery and calls artwork script
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+
+var gallery = {
+ pics: [],
+
+ initialized: false,
+
+ artworkDisplayMode: false,
+
+ currentPic: -1,
+
+ path: '',
+
+ loadXhrUrl: null,
+
+ getSquare: function (url) {
+ //Gets extension position (last . position)
+ var pos = url.lastIndexOf('.');
+
+ return url.substring(0, pos) + 'Square' + url.substring(pos);
+ },
+
+ showGallery: function () {
+ var html = '<ul>';
+ for (var i = 0 ; i < this.pics.length ; i++) {
+ if (this.pics[i] != null) {
+ //Shows artwork
+ html += '\n\t<li><img src="' + this.getSquare(this.pics[i]) + '" onClick="gallery.show(' + i + ')" /></li>';
+ } else {
+ //Shows placeholder
+ html += '\n\t<li onClick="gallery.uploadDialog(' + i + ');"></li>';
+ }
+ }
+ html += '\n</ul>';
+ document.getElementById('passage_gallery').innerHTML = html;
+ passage.onGalleryInitialized();
+ },
+
+ hideGallery: function () {
+ var elem = document.getElementById('passage_gallery');
+ Effect.Puff(elem);
+ },
+
+ loadPics: function () {
+ dojo.xhrGet({
+ handleAs: 'json',
+ url: this.loadXhrUrl + '?location_local=' + passage.persoLocalLocation,
+ preventCache: true,
+ handle: function (response, ioArgs) {
+ //TODO: in the future, we should print some metadata,
+ // and the objects will be useful.
+ // Meanwhile, we transform it to an array line.
+
+ var pics = [null, null, null];
+
+ //Builds pics array
+ for (var i = 0 ; i < response.length ; i++) {
+ if (response[i]['location_k'] > -1 && response[i]['location_k'] < 3) {
+ pics[response[i]['location_k']] = gallery.path + '/' + response[i]['path'];
+ }
+ }
+
+ //alert(dump(response));
+ gallery.loadPicsCallback(pics);
+
+ }
+ });
+ },
+
+ loadPicsCallback: function (pics) {
+ //Sets pics array
+ this.pics = pics;
+
+ //Show gallery
+ this.showGallery();
+
+ //Init done
+ if (!this.initialized) {
+ this.initialized = true;
+ }
+ },
+
+ show: function (i) {
+ //Hides gallery
+ this.hideGallery();
+
+ //Shows image
+ setTimeout('gallery.showImage(' + i + ')', 800);
+ },
+
+ showImage: function (i) {
+ //Sets image information
+ this.currentPic = i; //currently not used
+ this.artworkDisplayMode = true; //to handle properly ESC key down.
+
+ //New HTML passage code
+ document.getElementById('passage').innerHTML = '<div id="screen"></div><div id="bankImages"><img src="' + this.pics[i] + '" /></div>';
+
+ //Calls Photo3D script
+ onresize = tv.resize;
+ tv.init();
+ },
+
+ backToGallery: function () {
+ //Fades current picture
+ Effect.Fade(document.getElementById('screen'));
+
+ //Rebuilds gallery (in 800 ms, to let time to fading effect)
+ setTimeout("document.getElementById('passage').innerHTML = '<div id=\"passage_gallery\"></div>'; gallery.showGallery()", 800);
+
+ //Sets image information
+ this.currentPic = -1; //currently not used
+ this.artworkDisplayMode = false; //to handle properly ESC key down.
+ },
+
+ uploadDialog: function (i) {
+ document.getElementById('i').value = i;
+ dijit.byId('uploadDialog').show();
+ },
+
+ initialize: function (path, loadXhrUrl) {
+ //Sets load xhr url
+ this.path = path;
+ this.loadXhrUrl = loadXhrUrl;
+
+ //Loads pics
+ this.loadPics();
+
+ //Listens ESC key
+ document.onkeydown = function (e) {
+ if (e.keyCode == 27) {
+ if (gallery.artworkDisplayMode) {
+ gallery.backToGallery();
+ } else {
+ gallery.hideGallery();
+ }
+ }
+ }
+ }
+}
+
+/* -------------------------------------------------------------
+ Photo3D G. Fernandez script
+ http://www.dhteumeuleu.com/runscript.php?scr=photo3D.html
+
+ TODO: simplify code to handle one picture, and not an array
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+
+var gridsize = 1;
+
+var Library = {};
+Library.ease = function() {
+ this.target = 0;
+
+ this.position = 0;
+
+ this.move = function(_1, _2) {
+ this.position += (_1 - this.position) * _2;
+ };
+};
+
+var tv = {
+ O: [],
+
+ screen: {},
+
+ grid: {
+ size: gridsize,
+ borderSize: 6,
+ zoomed: false
+ },
+
+ angle: {
+ x: new Library.ease(),
+ y: new Library.ease()
+ },
+
+ camera: {
+ x: new Library.ease(),
+ y: new Library.ease(),
+ zoom: new Library.ease(),
+ focalLength: 750
+ },
+
+ init: function() {
+ this.screen.obj = document.getElementById("screen");
+ var images = document.getElementById("bankImages").getElementsByTagName("img");
+
+ this.screen.obj.onselectstart = function () {
+ return false;
+ };
+ this.screen.obj.ondrag = function () {
+ return false;
+ };
+ var ni = 0;
+ var n = (tv.grid.size / 2) - 0.5;
+ for (var y = - n ; y <= n ; y++) {
+ for (var x = - n ; x <= n; x++) {
+ var o = document.createElement("img");
+ var i = images[(ni++) % images.length];
+ o.className = "tvout";
+ o.src = i.src;
+ tv.screen.obj.appendChild(o);
+ o.point3D = {
+ x: x,
+ y: y,
+ z: new Library.ease()
+ };
+ o.point2D = {};
+ o.ratioImage = 1;
+ tv.O.push(o);
+
+ o.onmouseover = function () {
+ if (!tv.grid.zoomed) {
+ if (tv.o) {
+ tv.o.point3D.z.target = 0;
+ tv.o.className = "tvout";
+ }
+ this.className = "tvover";
+ this.point3D.z.target = - 0.5;
+ tv.o = this;
+ }
+ };
+
+ o.onclick = function () {
+ if (!tv.grid.zoomed) {
+ tv.camera.x.target = this.point3D.x;
+ tv.camera.y.target = this.point3D.y;
+ tv.camera.zoom.target = tv.screen.w * 1.25;
+ tv.grid.zoomed = this;
+ } else {
+ if (this == tv.grid.zoomed) {
+ tv.camera.x.target = 0;
+ tv.camera.y.target = 0;
+ tv.camera.zoom.target = tv.screen.w / (tv.grid.size + 0.1);
+ tv.grid.zoomed = false;
+ }
+ }
+ };
+
+ o.calc = function () {
+ this.point3D.z.move(this.point3D.z.target, 0.5);
+ var x = (this.point3D.x - tv.camera.x.position) * tv.camera.zoom.position;
+ var y = (this.point3D.y - tv.camera.y.position) * tv.camera.zoom.position;
+ var z = this.point3D.z.position * tv.camera.zoom.position;
+ var xy = tv.angle.cx * y - tv.angle.sx * z;
+ var xz = tv.angle.sx * y+tv.angle.cx * z;
+ var yz = tv.angle.cy * xz - tv.angle.sy * x;
+ var yx = tv.angle.sy * xz+tv.angle.cy * x;
+ this.point2D.scale = tv.camera.focalLength / (tv.camera.focalLength+yz);
+ this.point2D.x = yx * this.point2D.scale;
+ this.point2D.y = xy * this.point2D.scale;
+ this.point2D.w = Math.round(Math.max(0, this.point2D.scale * tv.camera.zoom.position * 0.8));
+ if (this.ratioImage > 1) {
+ this.point2D.h = Math.round(this.point2D.w / this.ratioImage);
+ } else {
+ this.point2D.h = this.point2D.w;this.point2D.w = Math.round(this.point2D.h * this.ratioImage);
+ }
+ };
+
+ o.draw = function () {
+ if (this.complete) {
+ if (!this.loaded) {
+ if (!this.img) {
+ this.img = new Image();
+ this.img.src = this.src;
+ }
+ if (this.img.complete) {
+ this.style.visibility = "visible";
+ this.ratioImage = this.img.width / this.img.height;
+ this.loaded = true;this.img = false;
+ }
+ }
+ this.style.left = Math.round(this.point2D.x * this.point2D.scale + tv.screen.w - this.point2D.w * 0.5) + "px";
+ this.style.top = Math.round(this.point2D.y * this.point2D.scale + tv.screen.h - this.point2D.h * 0.5) + "px";
+ this.style.width = this.point2D.w + "px";
+ this.style.height = this.point2D.h + "px";
+ this.style.borderWidth = Math.round(Math.max(this.point2D.w, this.point2D.h) * tv.grid.borderSize * 0.01) + "px";
+ this.style.zIndex = Math.floor(this.point2D.scale * 100);
+ }
+ };
+ }
+ }
+ tv.resize();
+ mouse.y = tv.screen.y+tv.screen.h;
+ mouse.x = tv.screen.x+tv.screen.w;
+ tv.run();
+ },
+
+ resize: function() {
+ var o = tv.screen.obj;
+ tv.screen.w = o.offsetWidth / 2;
+ tv.screen.h = o.offsetHeight / 2;
+ tv.camera.zoom.target = tv.screen.w / (tv.grid.size + 0.1);
+ for (tv.screen.x = 0, tv.screen.y = 0 ; o != null ; o = o.offsetParent) {
+ tv.screen.x += o.offsetLeft;
+ tv.screen.y = o.offsetTop;
+ }
+ },
+
+ run: function () {
+ tv.angle.x.move(-(mouse.y - tv.screen.h - tv.screen.y) * 0.0025, 0.1);
+ tv.angle.y.move((mouse.x - tv.screen.w - tv.screen.x) * 0.0025, 0.1);
+ tv.camera.x.move(tv.camera.x.target, tv.grid.zoomed ? 0.25: 0.025);
+ tv.camera.y.move(tv.camera.y.target, tv.grid.zoomed ? 0.25: 0.025);
+ tv.camera.zoom.move(tv.camera.zoom.target, 0.05);
+ tv.angle.cx = Math.cos(tv.angle.x.position);
+ tv.angle.sx = Math.sin(tv.angle.x.position);
+ tv.angle.cy = Math.cos(tv.angle.y.position);
+ tv.angle.sy = Math.sin(tv.angle.y.position);
+ for (var i = 0, o ; o = tv.O[i] ; i++) {
+ o.calc();
+ o.draw();
+ }
+ setTimeout(tv.run, 32);
+ }
+};
+
+var mouse = {x: 0, y: 0};
+
+document.onmousemove = function (e) {
+ if (window.event) {
+ e = window.event;
+ }
+ mouse.x = e.clientX;
+ mouse.y = e.clientY;
+ passage.onmousemove();
+ return false;
+};
diff --git a/content/scenes/B00001002_C0.tpl b/content/scenes/B00001002_C0.tpl
index 8ba0e92..5d0d4cf 100644
--- a/content/scenes/B00001002_C0.tpl
+++ b/content/scenes/B00001002_C0.tpl
@@ -1,34 +1,34 @@
- <!--
- Global location: B00001002
- Local location: (0, 0, 0)
- -->
- <div class="grid_7 alpha">
- {#Sector#} C<span id="sector">0</span>
- </div>
- <div class="grid_9 omega" style="text-align: right; margin-bottom: 1em;">
- {#Core#}
- </div>
-
- <div class="clear"></div>
-
- <div class="content_wrapper">
- <h1>{#Core#}</h1>
-
- <div class="grid_9 suffix_1 content alpha">
- <h2>{#YouAreInCore#}</h2>
- {#CoreInfo#}
- <h2>{#ShipNavigationControl#}</h2>
- <p><strong>{#CurrentLocation#}{#_t#}</strong> {$location}</p>
- </div>
- <div class="grid_6 omega">
- <p><a href="{get_url('do.php')}/local_move/-1,1,-1?redirectTo=/">C1</a><br>
- <a href="{get_url('do.php')}/local_move/1,1,-1?redirectTo=/">C2</a><br>
- <a href="{get_url('do.php')}/local_move/-1,-1,-1?redirectTo=/">C3</a><br>
- <a href="{get_url('do.php')}/local_move/1,-1,-1?redirectTo=/">C4</a><br></p>
- <p><a href="{get_url('do.php')}/local_move/-1,1,1?redirectTo=/">C5</a><br>
- <a href="{get_url('do.php')}/local_move/1,1,1?redirectTo=/">C6</a><br>
- <a href="{get_url('do.php')}/local_move/-1,-1,1?redirectTo=/">C7</a><br>
- <a href="{get_url('do.php')}/local_move/1,-1,1?redirectTo=/">C8</a><br></p>
- </div>
- <div class="clear fixclear"></div>
-</div>
+ <!--
+ Global location: B00001002
+ Local location: (0, 0, 0)
+ -->
+ <div class="grid_7 alpha">
+ {#Sector#} C<span id="sector">0</span>
+ </div>
+ <div class="grid_9 omega" style="text-align: right; margin-bottom: 1em;">
+ {#Core#}
+ </div>
+
+ <div class="clear"></div>
+
+ <div class="content_wrapper">
+ <h1>{#Core#}</h1>
+
+ <div class="grid_9 suffix_1 content alpha">
+ <h2>{#YouAreInCore#}</h2>
+ {#CoreInfo#}
+ <h2>{#ShipNavigationControl#}</h2>
+ <p><strong>{#CurrentLocation#}{#_t#}</strong> {$location}</p>
+ </div>
+ <div class="grid_6 omega">
+ <p><a href="{get_url('do.php')}/local_move/-1,1,-1?redirectTo=/">C1</a><br>
+ <a href="{get_url('do.php')}/local_move/1,1,-1?redirectTo=/">C2</a><br>
+ <a href="{get_url('do.php')}/local_move/-1,-1,-1?redirectTo=/">C3</a><br>
+ <a href="{get_url('do.php')}/local_move/1,-1,-1?redirectTo=/">C4</a><br></p>
+ <p><a href="{get_url('do.php')}/local_move/-1,1,1?redirectTo=/">C5</a><br>
+ <a href="{get_url('do.php')}/local_move/1,1,1?redirectTo=/">C6</a><br>
+ <a href="{get_url('do.php')}/local_move/-1,-1,1?redirectTo=/">C7</a><br>
+ <a href="{get_url('do.php')}/local_move/1,-1,1?redirectTo=/">C8</a><br></p>
+ </div>
+ <div class="clear fixclear"></div>
+</div>
diff --git a/content/scenes/B00002.tpl b/content/scenes/B00002.tpl
index d046fbf..fe6e7ce 100644
--- a/content/scenes/B00002.tpl
+++ b/content/scenes/B00002.tpl
@@ -1,7 +1,7 @@
- <!--
- Global location: B00002
- -->
- <img class="SpaceScene" src="{$SCENE_URL}/B00002.png" alt="{sprintf(#SpaceAround#, $CurrentPerso->location->body->name)}" border="0" usemap="#SceneMap" />
- <map name="SceneMap" id="SceneMap">
- <area shape="circle" coords="155,144,93" href="{get_url('explore')}" alt="{$CurrentPerso->location->body->name}" />
+ <!--
+ Global location: B00002
+ -->
+ <img class="SpaceScene" src="{$SCENE_URL}/B00002.png" alt="{sprintf(#SpaceAround#, $CurrentPerso->location->body->name)}" border="0" usemap="#SceneMap" />
+ <map name="SceneMap" id="SceneMap">
+ <area shape="circle" coords="155,144,93" href="{get_url('explore')}" alt="{$CurrentPerso->location->body->name}" />
</map>
\ No newline at end of file
diff --git a/content/scenes/B00003.tpl b/content/scenes/B00003.tpl
index 51211f7..067cad4 100644
--- a/content/scenes/B00003.tpl
+++ b/content/scenes/B00003.tpl
@@ -1,7 +1,7 @@
- <!--
- Global location: B00003
- -->
- <img class="SpaceScene" src="{$SCENE_URL}/B00003.jpg" alt="{sprintf(#SpaceAround#, $CurrentPerso->location->body->name)}" border="0" usemap="#SceneMap" />
- <map name="SceneMap" id="SceneMap">
- <area shape="circle" coords="732,207,129" href="{get_url('explore')}" alt="{$CurrentPerso->location->body->name}" />
+ <!--
+ Global location: B00003
+ -->
+ <img class="SpaceScene" src="{$SCENE_URL}/B00003.jpg" alt="{sprintf(#SpaceAround#, $CurrentPerso->location->body->name)}" border="0" usemap="#SceneMap" />
+ <map name="SceneMap" id="SceneMap">
+ <area shape="circle" coords="732,207,129" href="{get_url('explore')}" alt="{$CurrentPerso->location->body->name}" />
</map>
\ No newline at end of file
diff --git a/content/scenes/index.html b/content/scenes/index.html
index 4c943a1..f0aade9 100644
--- a/content/scenes/index.html
+++ b/content/scenes/index.html
@@ -1,18 +1,18 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd"
- >
-<html lang="en">
-<head>
- <title>Restricted directory</title>
- <link rel="Stylesheet" href="../../css/zed/theme.css" type="text/css" />
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-</head>
-<body>
- <div style="width: 960px; margin: auto; margin-top: 3em;">
- <h1 style="font-size: 3em;">Zed</h1>
- <h2>Content directory</h2>
- <p>As you can guess from the URL, this directory contains scenes content.</p>
- <p>To browse it, you've to use the Zed application.</p>
- </div>
-</body>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd"
+ >
+<html lang="en">
+<head>
+ <title>Restricted directory</title>
+ <link rel="Stylesheet" href="../../css/zed/theme.css" type="text/css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+</head>
+<body>
+ <div style="width: 960px; margin: auto; margin-top: 3em;">
+ <h1 style="font-size: 3em;">Zed</h1>
+ <h2>Content directory</h2>
+ <p>As you can guess from the URL, this directory contains scenes content.</p>
+ <p>To browse it, you've to use the Zed application.</p>
+ </div>
+</body>
</html>
\ No newline at end of file
diff --git a/content/stories/B00003001.xml b/content/stories/B00003001.xml
index a8e2908..99a7981 100644
--- a/content/stories/B00003001.xml
+++ b/content/stories/B00003001.xml
@@ -1,176 +1,176 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-Zeta, Kaos
-Dereckson, 2010-01-31 ; Dereckson, Dédé, Mystique 2010-06-25.
-
-TODO: It's a start location. So it should provide a way to to reach hypership
-TODO: <section id="mines.entry"></section>
-TODO: .en
-TODO: Écrire les chapitres The hole
--->
-<story>
- <title>Zeta, Kaos</title>
- <section start="true" id="panorama">
- <title>Panorama</title>
- <description>
- Zeta est une ville venteuse, plongée dans la nuit et le bruit.
-
-Ce qui ressemble à de petites créatures illuminent la route s'étendant devant vous et serpentant vers le centre ville.
-
-À la surface travaillent d'honnêtes mineur de cobalt et de davyrium, les mines ceinturant le sud de la ville.
-
-Au nord, The Hole, une ancienne mine dont les mineurs évitent de parler.
-
-À l'est, un petit spatioport.
- </description>
- <choices>
- <choice goto="city.entry">Descendre vers le centre ville</choice>
- <choice goto="hole.entry">Se diriger vers The Hole</choice>
- <choice goto="spatioport.entry">Se rendre au spatioport</choice>
- <choice goto="mines.entry">Vers les mines</choice>
- </choices>
- <local>1</local>
- </section>
-
- <!--
- Le centre ville
-
- Sa bibliothèque. Son bar.
- -->
- <section id="city.entry">
- <title>Le centre ville</title>
- <description>
- Le centre ville de Zeta alterne des zones plongées dans l'obscurité et des zones suréclairées au néon.
- </description>
- </section>
-
- <!--
- Le spatioport
- -->
- <section id="spatioport.entry">
- <title>Spatioport</title>
- <description>
- Le spatioport se présente sous la forme d'un large dôme cobalt où se reflète la lueur de Thétys, un astéroïde gravitant autour de Kaos tel une lune.
-
- À l'arrière, un cratère évasé peut accueillir une trentaine de vaisseaux de taille modeste et de conception variée.
- </description>
- <hooks>
- <hook type="spatioport" />
- </hooks>
- <choices>
- <choice goto="panorama">Retourner en ville</choice>
- </choices>
-
- <local>3</local>
- </section>
-
-
- <!--
- The Hole
-
- Lieu d'exil de ce secteur de la galaxie. Lieu de tous les traffics. The Hole.
- -->
- <section id="hole.entry">
- <title>The Hole</title>
- <description>
- The Hole. Une ancienne mine désaffectée depuis trois siècles. Aujourd'hui, un squat. L'endroit où tout se passe sur Zeta. Refuge des rebelles. Lieu d'exil de ce secteur de la galaxie. Lieu de tous les traffics. The Hole.
-
- Une bande d'une douzaine de jeunes armés de lasers et de fouets neuroniques en garde l'entrée, deux vous regardant d'un œil plutôt menaçant.
-
- Ils vous refusent le passage.
- </description>
- <choices>
- <choice goto="hole.entry.chat">Dialoguer avec les jeunes de l'entrée</choice>
- <choice goto="spatioport.entry">Se rendre au spatioport</choice>
- <choice goto="mines.entry">Vers les mines</choice>
- <choice goto="panorama">Retourner en ville</choice>
- </choices>
- <local>2</local>
- </section>
- <section id="hole.entry.chat">
- <title>The Hole</title>
- <description>
- Vous vous avancez prudemment, tout en observant le garde de gauche qui pose la main sur son blaster, duquel clignote le mot CRÉMATORIUM.
- </description>
- <choices>
- <choice goto="hole.entry.chat.Zeta">Obtenir des informations sur Zeta</choice>
- <choice goto="hole.entry.chat.Hole">Se renseigner sur cet endroit</choice>
- <choice goto="hole.entry.chat.weapons">Leur demander pourquoi ils sont armés.</choice>
- <choice goto="hole.entry.chat.fear">Vérifier qu'il est possible de partir sans heurt ni date de décès prématurée.</choice>
- <choice goto="hole.entry.chat.goaway">Reculer</choice>
- </choices>
- </section>
- <section id="hole.entry.chat.fear">
- <title>The Hole</title>
- <description>
- Vous rassurez les gardes en leur disant que vous ne faites que passer, et s'il est possible de faire demi tour.
-
- Un garde aux rangers noires, pantalon argenté troué, non rasé depuis trois jours, une cicatrice près de l'arcade sourcillière : « wesh et très vite ».
-
- L'on entend à l'arrière « Court Forest, court » pendant que le second garde émet deux érecutements successifs de la gorge, tout en pointant son arme vers vous.
- </description>
- <choices>
- <choice goto="panorama">Obtempérer et retourner en ville</choice>
- <choice goto="hole.entry.chat.Zeta">Tenter d'obtenir des informations sur Zeta</choice>
- <choice goto="hole.entry.chat.Hole">Se renseigner sur cet endroit</choice>
- <choice goto="hole.entry.chat.weapons">Leur demander pourquoi ils sont armés.</choice>
- </choices>
- </section>
- <section id="hole.entry.chat.Zeta">
- <title>The Hole</title>
- <description>
- Un jeune de grande taille s'avance, ses deux étranges cornes sortent des avants-bras, un de ses lobes d'oreilles descendant vers le bas, d'étranges inscriptions ressemblant à des tatouages sur le haut de son crâne dégarni.
-
- Il vous indique le bas de la colline, et vous invite à retourner en ville.
-
- Vous insistez quelque peu, il se contente de vous dire qu'il n'est pas guide touristique.
-
- Ils refusent de répondre à toute autre question et vous ignorent.
- </description>
- <choices>
- <choice goto="panorama">Retourner en ville</choice>
- </choices>
- </section>
- <section id="hole.entry.chat.Hole">
- <title>The Hole</title>
- <description>
- – « Qu'est-ce que vous gardez d'aussi important ? Pourquoi les mineurs évitent d'en parler ? »
-
- – « Revenez quand vous saurez. »
- </description>
- <choices>
- <choice goto="panorama">Obtempérer et retourner en ville</choice>
- <choice goto="hole.entry.chat.Zeta">Tenter d'obtenir des informations sur Zeta</choice>
- <choice goto="hole.entry.chat.Hole">Se renseigner sur cet endroit</choice>
- <choice goto="hole.entry.chat.weapons">Leur demander pourquoi ils sont armés.</choice>
- </choices>
- </section>
- <section id="hole.entry.chat.weapons">
- <title>The Hole</title>
- <description>
- Vous leur demandez pourquoi sont-ils aussi bien vêtus, en espérant qu'ils comprennent l'allusion aux armes.
-
- Ne semblant pas obtenir de réponse, vous leur demandez ce que sont leurs jouets.
-
- Un garde sourit, s'avance, et appuie sur son fouet neuronique.
-
- Les autres éclatent de rire pendant que vous vous tordez au sol, pris de convulsions.
- </description>
- <choices>
- <choice goto="panorama">Se relever et partir en courant</choice>
- <choice goto="panorama">Se relever en tentant de conserver un peu de dignité et partir doucement</choice>
- </choices>
- </section>
- <section id="hole.entry.chat.goaway">
- <title>The Hole</title>
- <description>
- Vous reculez prudemment, tout doucement, avec un grand sourire.
-
- Un des gardes vous regarde vexé, scrutant le moindre signe supplémentaire de provocation.
- </description>
-
- <choices>
- <choice goto="panorama">Retourner en ville</choice>
- </choices>
- </section>
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+Zeta, Kaos
+Dereckson, 2010-01-31 ; Dereckson, Dédé, Mystique 2010-06-25.
+
+TODO: It's a start location. So it should provide a way to to reach hypership
+TODO: <section id="mines.entry"></section>
+TODO: .en
+TODO: Écrire les chapitres The hole
+-->
+<story>
+ <title>Zeta, Kaos</title>
+ <section start="true" id="panorama">
+ <title>Panorama</title>
+ <description>
+ Zeta est une ville venteuse, plongée dans la nuit et le bruit.
+
+Ce qui ressemble à de petites créatures illuminent la route s'étendant devant vous et serpentant vers le centre ville.
+
+À la surface travaillent d'honnêtes mineur de cobalt et de davyrium, les mines ceinturant le sud de la ville.
+
+Au nord, The Hole, une ancienne mine dont les mineurs évitent de parler.
+
+À l'est, un petit spatioport.
+ </description>
+ <choices>
+ <choice goto="city.entry">Descendre vers le centre ville</choice>
+ <choice goto="hole.entry">Se diriger vers The Hole</choice>
+ <choice goto="spatioport.entry">Se rendre au spatioport</choice>
+ <choice goto="mines.entry">Vers les mines</choice>
+ </choices>
+ <local>1</local>
+ </section>
+
+ <!--
+ Le centre ville
+
+ Sa bibliothèque. Son bar.
+ -->
+ <section id="city.entry">
+ <title>Le centre ville</title>
+ <description>
+ Le centre ville de Zeta alterne des zones plongées dans l'obscurité et des zones suréclairées au néon.
+ </description>
+ </section>
+
+ <!--
+ Le spatioport
+ -->
+ <section id="spatioport.entry">
+ <title>Spatioport</title>
+ <description>
+ Le spatioport se présente sous la forme d'un large dôme cobalt où se reflète la lueur de Thétys, un astéroïde gravitant autour de Kaos tel une lune.
+
+ À l'arrière, un cratère évasé peut accueillir une trentaine de vaisseaux de taille modeste et de conception variée.
+ </description>
+ <hooks>
+ <hook type="spatioport" />
+ </hooks>
+ <choices>
+ <choice goto="panorama">Retourner en ville</choice>
+ </choices>
+
+ <local>3</local>
+ </section>
+
+
+ <!--
+ The Hole
+
+ Lieu d'exil de ce secteur de la galaxie. Lieu de tous les traffics. The Hole.
+ -->
+ <section id="hole.entry">
+ <title>The Hole</title>
+ <description>
+ The Hole. Une ancienne mine désaffectée depuis trois siècles. Aujourd'hui, un squat. L'endroit où tout se passe sur Zeta. Refuge des rebelles. Lieu d'exil de ce secteur de la galaxie. Lieu de tous les traffics. The Hole.
+
+ Une bande d'une douzaine de jeunes armés de lasers et de fouets neuroniques en garde l'entrée, deux vous regardant d'un œil plutôt menaçant.
+
+ Ils vous refusent le passage.
+ </description>
+ <choices>
+ <choice goto="hole.entry.chat">Dialoguer avec les jeunes de l'entrée</choice>
+ <choice goto="spatioport.entry">Se rendre au spatioport</choice>
+ <choice goto="mines.entry">Vers les mines</choice>
+ <choice goto="panorama">Retourner en ville</choice>
+ </choices>
+ <local>2</local>
+ </section>
+ <section id="hole.entry.chat">
+ <title>The Hole</title>
+ <description>
+ Vous vous avancez prudemment, tout en observant le garde de gauche qui pose la main sur son blaster, duquel clignote le mot CRÉMATORIUM.
+ </description>
+ <choices>
+ <choice goto="hole.entry.chat.Zeta">Obtenir des informations sur Zeta</choice>
+ <choice goto="hole.entry.chat.Hole">Se renseigner sur cet endroit</choice>
+ <choice goto="hole.entry.chat.weapons">Leur demander pourquoi ils sont armés.</choice>
+ <choice goto="hole.entry.chat.fear">Vérifier qu'il est possible de partir sans heurt ni date de décès prématurée.</choice>
+ <choice goto="hole.entry.chat.goaway">Reculer</choice>
+ </choices>
+ </section>
+ <section id="hole.entry.chat.fear">
+ <title>The Hole</title>
+ <description>
+ Vous rassurez les gardes en leur disant que vous ne faites que passer, et s'il est possible de faire demi tour.
+
+ Un garde aux rangers noires, pantalon argenté troué, non rasé depuis trois jours, une cicatrice près de l'arcade sourcillière : « wesh et très vite ».
+
+ L'on entend à l'arrière « Court Forest, court » pendant que le second garde émet deux érecutements successifs de la gorge, tout en pointant son arme vers vous.
+ </description>
+ <choices>
+ <choice goto="panorama">Obtempérer et retourner en ville</choice>
+ <choice goto="hole.entry.chat.Zeta">Tenter d'obtenir des informations sur Zeta</choice>
+ <choice goto="hole.entry.chat.Hole">Se renseigner sur cet endroit</choice>
+ <choice goto="hole.entry.chat.weapons">Leur demander pourquoi ils sont armés.</choice>
+ </choices>
+ </section>
+ <section id="hole.entry.chat.Zeta">
+ <title>The Hole</title>
+ <description>
+ Un jeune de grande taille s'avance, ses deux étranges cornes sortent des avants-bras, un de ses lobes d'oreilles descendant vers le bas, d'étranges inscriptions ressemblant à des tatouages sur le haut de son crâne dégarni.
+
+ Il vous indique le bas de la colline, et vous invite à retourner en ville.
+
+ Vous insistez quelque peu, il se contente de vous dire qu'il n'est pas guide touristique.
+
+ Ils refusent de répondre à toute autre question et vous ignorent.
+ </description>
+ <choices>
+ <choice goto="panorama">Retourner en ville</choice>
+ </choices>
+ </section>
+ <section id="hole.entry.chat.Hole">
+ <title>The Hole</title>
+ <description>
+ – « Qu'est-ce que vous gardez d'aussi important ? Pourquoi les mineurs évitent d'en parler ? »
+
+ – « Revenez quand vous saurez. »
+ </description>
+ <choices>
+ <choice goto="panorama">Obtempérer et retourner en ville</choice>
+ <choice goto="hole.entry.chat.Zeta">Tenter d'obtenir des informations sur Zeta</choice>
+ <choice goto="hole.entry.chat.Hole">Se renseigner sur cet endroit</choice>
+ <choice goto="hole.entry.chat.weapons">Leur demander pourquoi ils sont armés.</choice>
+ </choices>
+ </section>
+ <section id="hole.entry.chat.weapons">
+ <title>The Hole</title>
+ <description>
+ Vous leur demandez pourquoi sont-ils aussi bien vêtus, en espérant qu'ils comprennent l'allusion aux armes.
+
+ Ne semblant pas obtenir de réponse, vous leur demandez ce que sont leurs jouets.
+
+ Un garde sourit, s'avance, et appuie sur son fouet neuronique.
+
+ Les autres éclatent de rire pendant que vous vous tordez au sol, pris de convulsions.
+ </description>
+ <choices>
+ <choice goto="panorama">Se relever et partir en courant</choice>
+ <choice goto="panorama">Se relever en tentant de conserver un peu de dignité et partir doucement</choice>
+ </choices>
+ </section>
+ <section id="hole.entry.chat.goaway">
+ <title>The Hole</title>
+ <description>
+ Vous reculez prudemment, tout doucement, avec un grand sourire.
+
+ Un des gardes vous regarde vexé, scrutant le moindre signe supplémentaire de provocation.
+ </description>
+
+ <choices>
+ <choice goto="panorama">Retourner en ville</choice>
+ </choices>
+ </section>
</story>
\ No newline at end of file
diff --git a/content/stories/B00004001.xml b/content/stories/B00004001.xml
index 3a806c9..28b1e71 100644
--- a/content/stories/B00004001.xml
+++ b/content/stories/B00004001.xml
@@ -1,77 +1,77 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-Gné
-Dimi, Inferno, DcK 2010-07-04
-
-TODO: .en
-TODO: playtesting
--->
-<story>
- <title>Gné, Gné</title>
- <section start="true" id="panorama">
- <title>Gné</title>
- <description>
- L'air est nauséabond, difficilement respirable, comme l'odeur des effluves d'une centaine d'humanoïdes crasseux et suant de tous pores.
-
-Aucune vie animale ni végétale aux alentours, si ce n'est une étrange mousse ressemblant quelque peu à de la moisissure.
-
-L'on distingue peu de bâtiments, au profit de petites huttes dispersées dans un capharnaüm apparent.
-
-Derrière, s'élève un grand temple en terre cuite, aux formes tantôt arrondies, tantôt acerbes.
- </description>
- <choices>
- <choice goto="huttes.entry">Explorer les huttes</choice>
- <choice goto="temple.entry">Entrer dans le temple</choice>
- <choice goto="spatioport.entry">Se rendre au spatioport</choice>
- </choices>
- <local>1</local>
- </section>
-
- <!--
- Les huttes
- -->
- <section id="huttes.entry">
- <title>Les huttes</title>
- <description>
- Quatre huttes retiennent particulièrement votre attention :
- </description>
- <choices>
- <choice goto="huttes.A"></choice>
- <choice goto="huttes.B"></choice>
- <choice goto="huttes.C"></choice>
- <choice goto="huttes.D">Se rendre dans la hutte où l'on entend des tambours</choice>
- </choices>
- <local>1</local>
- </section>
-
- <section id="huttes.D">
- <title>Les huttes</title>
- <description>
- Quatre huttes retiennent particulièrement votre attention :
- </description>
- <choices>
- Des femmes dénudées
- </choices>
- </section>
-
- <!--
- Le spatioport
- -->
- <section id="spatioport.entry">
- <title>Spatioport</title>
- <description>
- Le spatioport, à l'architecture se voulant l'allégorie de la sobriétété, ne comporte ni tourelle, ni dôme, ni technologie apparente, ni lumière accueillante, ni aide à l'amerrisage, comme s'il s'agissait d'un des tous premiers spatioport construit.
- </description>
- <hooks>
- <hook type="spatioport" />
- </hooks>
- <choices>
- <choice goto="panorama">Quitter le spatioport</choice>
- </choices>
- <local>3</local>
- </section>
-
- <!--
- Le temple
- -->
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+Gné
+Dimi, Inferno, DcK 2010-07-04
+
+TODO: .en
+TODO: playtesting
+-->
+<story>
+ <title>Gné, Gné</title>
+ <section start="true" id="panorama">
+ <title>Gné</title>
+ <description>
+ L'air est nauséabond, difficilement respirable, comme l'odeur des effluves d'une centaine d'humanoïdes crasseux et suant de tous pores.
+
+Aucune vie animale ni végétale aux alentours, si ce n'est une étrange mousse ressemblant quelque peu à de la moisissure.
+
+L'on distingue peu de bâtiments, au profit de petites huttes dispersées dans un capharnaüm apparent.
+
+Derrière, s'élève un grand temple en terre cuite, aux formes tantôt arrondies, tantôt acerbes.
+ </description>
+ <choices>
+ <choice goto="huttes.entry">Explorer les huttes</choice>
+ <choice goto="temple.entry">Entrer dans le temple</choice>
+ <choice goto="spatioport.entry">Se rendre au spatioport</choice>
+ </choices>
+ <local>1</local>
+ </section>
+
+ <!--
+ Les huttes
+ -->
+ <section id="huttes.entry">
+ <title>Les huttes</title>
+ <description>
+ Quatre huttes retiennent particulièrement votre attention :
+ </description>
+ <choices>
+ <choice goto="huttes.A"></choice>
+ <choice goto="huttes.B"></choice>
+ <choice goto="huttes.C"></choice>
+ <choice goto="huttes.D">Se rendre dans la hutte où l'on entend des tambours</choice>
+ </choices>
+ <local>1</local>
+ </section>
+
+ <section id="huttes.D">
+ <title>Les huttes</title>
+ <description>
+ Quatre huttes retiennent particulièrement votre attention :
+ </description>
+ <choices>
+ Des femmes dénudées
+ </choices>
+ </section>
+
+ <!--
+ Le spatioport
+ -->
+ <section id="spatioport.entry">
+ <title>Spatioport</title>
+ <description>
+ Le spatioport, à l'architecture se voulant l'allégorie de la sobriétété, ne comporte ni tourelle, ni dôme, ni technologie apparente, ni lumière accueillante, ni aide à l'amerrisage, comme s'il s'agissait d'un des tous premiers spatioport construit.
+ </description>
+ <hooks>
+ <hook type="spatioport" />
+ </hooks>
+ <choices>
+ <choice goto="panorama">Quitter le spatioport</choice>
+ </choices>
+ <local>3</local>
+ </section>
+
+ <!--
+ Le temple
+ -->
</story>
\ No newline at end of file
diff --git a/content/stories/index.html b/content/stories/index.html
index 7c6a2b6..780e487 100644
--- a/content/stories/index.html
+++ b/content/stories/index.html
@@ -1,18 +1,18 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd"
- >
-<html lang="en">
-<head>
- <title>Restricted directory</title>
- <link rel="Stylesheet" href="../../css/zed/theme.css" type="text/css" />
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-</head>
-<body>
- <div style="width: 960px; margin: auto; margin-top: 3em;">
- <h1 style="font-size: 3em;">Zed</h1>
- <h2>Content directory</h2>
- <p>As you can guess from the URL, this directory contains stories content.</p>
- <p>To browse it, you've to use the Zed application.</p>
- </div>
-</body>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd"
+ >
+<html lang="en">
+<head>
+ <title>Restricted directory</title>
+ <link rel="Stylesheet" href="../../css/zed/theme.css" type="text/css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+</head>
+<body>
+ <div style="width: 960px; margin: auto; margin-top: 3em;">
+ <h1 style="font-size: 3em;">Zed</h1>
+ <h2>Content directory</h2>
+ <p>As you can guess from the URL, this directory contains stories content.</p>
+ <p>To browse it, you've to use the Zed application.</p>
+ </div>
+</body>
</html>
\ No newline at end of file
diff --git a/content/users/index.html b/content/users/index.html
index 29efe8c..ad37c3c 100644
--- a/content/users/index.html
+++ b/content/users/index.html
@@ -1,18 +1,18 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd"
- >
-<html lang="en">
-<head>
- <title>Restricted directory</title>
- <link rel="Stylesheet" href="../../css/zed/theme.css" type="text/css" />
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-</head>
-<body>
- <div style="width: 960px; margin: auto; margin-top: 3em;">
- <h1 style="font-size: 3em;">Zed</h1>
- <h2>Content directory</h2>
- <p>As you can guess from the URL, this directory contains user generated content.</p>
- <p>To browse it, you've to use the Zed application.</p>
- </div>
-</body>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd"
+ >
+<html lang="en">
+<head>
+ <title>Restricted directory</title>
+ <link rel="Stylesheet" href="../../css/zed/theme.css" type="text/css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+</head>
+<body>
+ <div style="width: 960px; margin: auto; margin-top: 3em;">
+ <h1 style="font-size: 3em;">Zed</h1>
+ <h2>Content directory</h2>
+ <p>As you can guess from the URL, this directory contains user generated content.</p>
+ <p>To browse it, you've to use the Zed application.</p>
+ </div>
+</body>
</html>
\ No newline at end of file
diff --git a/controllers/builder.php b/controllers/builder.php
index 9a7eaaf..eec0eb3 100644
--- a/controllers/builder.php
+++ b/controllers/builder.php
@@ -1,137 +1,137 @@
-<?php
-
-/**
- * Builder
- *
- * Zed. The immensity of stars. The HyperShip. The people.
- *
- * (c) 2010, Dereckson, some rights reserved.
- * Released under BSD license.
- *
- * @package Zed
- * @subpackage Controllers
- * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
- * @copyright 2010 Sébastien Santoro aka Dereckson
- * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2
- * @version 0.1
- * @link http://scherzo.dereckson.be/doc/zed
- * @link http://zed.dereckson.be/
- * @filesource
- */
-
-require_once('includes/content/zone.php');
-
-//
-// Helper methods
-//
-
-/**
- * Determines if a specified location is buildable
- *
- * @param GeoLocation $location the location to check
- * @param string if the location isn't buidable, a textual description of why.
- * @return bool true if the location is buildable ; otherwise, false
- *
- * @todo create a build.xml document to set what's buildable, and by who
- */
-function is_buildable ($location, &$error = '') {
- //We currently allow build only in the hypership tower and core.
- if (!$location->body->hypership) {
- $error = "You can only invoke the HyperShip builder facilities inside the HyperShip.";
- return false;
- }
-
- //if ($build_location->place->code == "001") {
- // //Don't allow custom builds in the corridor (T?C?)
- //}
-
- if ($build_location->place->code == "003") {
- message_die("Bays aren't buildable.");
- return false;
- }
-
- return true;
-}
-
-//
-// Determines mode and initializes resources
-//
-
-switch ($build_mode = $url[1]) {
- case 'map':
- require_once('includes/geo/octocube.php');
-
- $build_mode = 'map';
-
- //Get zones at this floor
- if ($CurrentPerso->location->global == 'B00001002') {
- $point = GeoPoint3D::fromString($CurrentPerso->location->local);
- $sector = GeoOctocube::get_sector_from_point3D($point);
- $pattern = GeoOctocube::get_rlike_pattern_from_sector($sector, $point->z);
- $zones = ContentZone::search($CurrentPerso->location->global, $pattern, true);
- } else {
- message_die(GENERAL_ERROR, "Can't map this area.", "Builder :: Map");
- }
-
- //Template
- define('DOJO', true);
- $smarty->assign('zones', $zones);
- $template = "builder_map.tpl";
-
- break;
-
- case '':
- case 'hotglue':
- //Temporary initialization code, to allow some build during the Zed alphatest
- $build_location = $CurrentPerso->location;
- $build_mode = 'hotglue';
-
- $error = '';
- if (!is_buildable($build_location, $error)) {
- message_die(GENERAL_ERROR, $error, "Can't build");
- }
-
- //Gets or creates a new zone at build location
- $zone = ContentZone::at($build_location->global, $build_location->local, true);
- switch ($zone->type) {
- case 'hotglue':
- //All rulez
- break;
-
- case '':
- //New zone
- $zone->title = "Sandbox hotglue zone for $build_location->global $build_location->local";
- $zone->type = 'hotglue';
- $zone->save_to_database();
- break;
-
- default:
- message_die("This isn't a zone managed by hotglue.");
- }
- unset($error);
-
- //Template
- $smarty->assign('location', $build_location);
- $smarty->assign('zone', $zone);
- $smarty->assign('IFRAME_SRC', '/apps/hotglue/index.php?zone_' . $zone->id . '/edit');
- $template = 'builder_hotglue.tpl';
- break;
-
- default:
- message_die(GENERAL_ERROR, "Unknown build mode: $build_mode");
-}
-
-//
-// HTML output
-//
-//Serves header
-$smarty->assign('PAGE_TITLE', 'Builder');
-include('header.php');
-
-//Serves content
-$smarty->display($template);
-
-//Serves footer
-include('footer.php');
-
-?>
+<?php
+
+/**
+ * Builder
+ *
+ * Zed. The immensity of stars. The HyperShip. The people.
+ *
+ * (c) 2010, Dereckson, some rights reserved.
+ * Released under BSD license.
+ *
+ * @package Zed
+ * @subpackage Controllers
+ * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
+ * @copyright 2010 Sébastien Santoro aka Dereckson
+ * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2
+ * @version 0.1
+ * @link http://scherzo.dereckson.be/doc/zed
+ * @link http://zed.dereckson.be/
+ * @filesource
+ */
+
+require_once('includes/content/zone.php');
+
+//
+// Helper methods
+//
+
+/**
+ * Determines if a specified location is buildable
+ *
+ * @param GeoLocation $location the location to check
+ * @param string if the location isn't buidable, a textual description of why.
+ * @return bool true if the location is buildable ; otherwise, false
+ *
+ * @todo create a build.xml document to set what's buildable, and by who
+ */
+function is_buildable ($location, &$error = '') {
+ //We currently allow build only in the hypership tower and core.
+ if (!$location->body->hypership) {
+ $error = "You can only invoke the HyperShip builder facilities inside the HyperShip.";
+ return false;
+ }
+
+ //if ($build_location->place->code == "001") {
+ // //Don't allow custom builds in the corridor (T?C?)
+ //}
+
+ if ($build_location->place->code == "003") {
+ message_die("Bays aren't buildable.");
+ return false;
+ }
+
+ return true;
+}
+
+//
+// Determines mode and initializes resources
+//
+
+switch ($build_mode = $url[1]) {
+ case 'map':
+ require_once('includes/geo/octocube.php');
+
+ $build_mode = 'map';
+
+ //Get zones at this floor
+ if ($CurrentPerso->location->global == 'B00001002') {
+ $point = GeoPoint3D::fromString($CurrentPerso->location->local);
+ $sector = GeoOctocube::get_sector_from_point3D($point);
+ $pattern = GeoOctocube::get_rlike_pattern_from_sector($sector, $point->z);
+ $zones = ContentZone::search($CurrentPerso->location->global, $pattern, true);
+ } else {
+ message_die(GENERAL_ERROR, "Can't map this area.", "Builder :: Map");
+ }
+
+ //Template
+ define('DOJO', true);
+ $smarty->assign('zones', $zones);
+ $template = "builder_map.tpl";
+
+ break;
+
+ case '':
+ case 'hotglue':
+ //Temporary initialization code, to allow some build during the Zed alphatest
+ $build_location = $CurrentPerso->location;
+ $build_mode = 'hotglue';
+
+ $error = '';
+ if (!is_buildable($build_location, $error)) {
+ message_die(GENERAL_ERROR, $error, "Can't build");
+ }
+
+ //Gets or creates a new zone at build location
+ $zone = ContentZone::at($build_location->global, $build_location->local, true);
+ switch ($zone->type) {
+ case 'hotglue':
+ //All rulez
+ break;
+
+ case '':
+ //New zone
+ $zone->title = "Sandbox hotglue zone for $build_location->global $build_location->local";
+ $zone->type = 'hotglue';
+ $zone->save_to_database();
+ break;
+
+ default:
+ message_die("This isn't a zone managed by hotglue.");
+ }
+ unset($error);
+
+ //Template
+ $smarty->assign('location', $build_location);
+ $smarty->assign('zone', $zone);
+ $smarty->assign('IFRAME_SRC', '/apps/hotglue/index.php?zone_' . $zone->id . '/edit');
+ $template = 'builder_hotglue.tpl';
+ break;
+
+ default:
+ message_die(GENERAL_ERROR, "Unknown build mode: $build_mode");
+}
+
+//
+// HTML output
+//
+//Serves header
+$smarty->assign('PAGE_TITLE', 'Builder');
+include('header.php');
+
+//Serves content
+$smarty->display($template);
+
+//Serves footer
+include('footer.php');
+
+?>
diff --git a/controllers/explore.php b/controllers/explore.php
index 345b679..d2f5c28 100644
--- a/controllers/explore.php
+++ b/controllers/explore.php
@@ -1,51 +1,51 @@
-<?php
-
-/**
- * Explore current location
- *
- * Zed. The immensity of stars. The HyperShip. The people.
- *
- * (c) 2010, Dereckson, some rights reserved.
- * Released under BSD license.
- *
- * This is a redirect controller to call the relevant controller,
- * according to the location.
- *
- * It handles /explore URL
- *
- * @package Zed
- * @subpackage Controllers
- * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
- * @copyright 2010 Sébastien Santoro aka Dereckson
- * @license http://www.opensource.org/licenses/bsd-license.php BSD
- * @version 0.1
- * @link http://scherzo.dereckson.be/doc/zed
- * @link http://zed.dereckson.be/
- * @filesource
- */
-
-//
-// Determines the kind of content user wants to explore
-//
-
-$explore_controller = '';
-
-if (file_exists(STORIES_DIR . '/' . $CurrentPerso->location_global . '.xml')) {
- $explore_controller = 'story';
-}
-
-//
-// No relevant controller found
-//
-
-if ($explore_controller == '') {
- message_die(GENERAL_ERROR, "<p>Congratulations! You've just found a shiny new place.</p><p>You've so the opportunity to define what this place should be, writing a story, preparing a puzzle or some images.</p><p>If you're interested, contact Dereckson.</p>", "Exploration error");
-}
-
-//
-// Calls relevant controller
-//
-
-include($explore_controller . '.php');
-
+<?php
+
+/**
+ * Explore current location
+ *
+ * Zed. The immensity of stars. The HyperShip. The people.
+ *
+ * (c) 2010, Dereckson, some rights reserved.
+ * Released under BSD license.
+ *
+ * This is a redirect controller to call the relevant controller,
+ * according to the location.
+ *
+ * It handles /explore URL
+ *
+ * @package Zed
+ * @subpackage Controllers
+ * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
+ * @copyright 2010 Sébastien Santoro aka Dereckson
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD
+ * @version 0.1
+ * @link http://scherzo.dereckson.be/doc/zed
+ * @link http://zed.dereckson.be/
+ * @filesource
+ */
+
+//
+// Determines the kind of content user wants to explore
+//
+
+$explore_controller = '';
+
+if (file_exists(STORIES_DIR . '/' . $CurrentPerso->location_global . '.xml')) {
+ $explore_controller = 'story';
+}
+
+//
+// No relevant controller found
+//
+
+if ($explore_controller == '') {
+ message_die(GENERAL_ERROR, "<p>Congratulations! You've just found a shiny new place.</p><p>You've so the opportunity to define what this place should be, writing a story, preparing a puzzle or some images.</p><p>If you're interested, contact Dereckson.</p>", "Exploration error");
+}
+
+//
+// Calls relevant controller
+//
+
+include($explore_controller . '.php');
+
?>
\ No newline at end of file
diff --git a/controllers/footer.php b/controllers/footer.php
index ee3ae15..3a8e04b 100644
--- a/controllers/footer.php
+++ b/controllers/footer.php
@@ -1,54 +1,54 @@
-<?php
-
-/**
- * Footer
- *
- * Zed. The immensity of stars. The HyperShip. The people.
- *
- * (c) 2010, Dereckson, some rights reserved.
- * Released under BSD license.
- *
- * This is a redirect controller to call the relevant controller,
- * according to the location.
- *
- * It handles and prints the footer elements (tutorial, SmartLine, html footer)
- *
- * @package Zed
- * @subpackage Controllers
- * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
- * @copyright 2010 Sébastien Santoro aka Dereckson
- * @license http://www.opensource.org/licenses/bsd-license.php BSD
- * @version 0.1
- * @link http://scherzo.dereckson.be/doc/zed
- * @link http://zed.dereckson.be/
- * @filesource
- */
-
-if (!defined('NO_FOOTER_EXTRA')) {
- ///
- /// Tutorials div
- ///
- if ($controller != 'explore' && (!array_key_exists('hypership.reached', $CurrentPerso->flags) || $CurrentPerso->flags['hypership.reached'] < 1)) {
- if (!DOJO) $smarty->display('tutorial/dojo.tpl');
- lang_load("tutorials.conf", "ReachHypership");
- $smarty->assign('controller', $controller);
- $smarty->display('tutorial/hypership_reach.tpl');
- }
-
- ///
- /// Footer options
- ///
-
- $smarty->assign('MultiPerso', isset($_SESSION['UserWithSeveralPersos']) && $_SESSION['UserWithSeveralPersos']);
- $smarty->assign('SmartLinePrint', (string)$CurrentPerso->get_flag('site.smartline.show') != "0");
- $smarty->assign('SmartLineFormMethod', $CurrentPerso->get_flag('site.smartline.method'));
-}
-
-///
-/// HTML output
-///
-
-lang_load('footer.conf');
-$smarty->display('footer.tpl');
-
-?>
+<?php
+
+/**
+ * Footer
+ *
+ * Zed. The immensity of stars. The HyperShip. The people.
+ *
+ * (c) 2010, Dereckson, some rights reserved.
+ * Released under BSD license.
+ *
+ * This is a redirect controller to call the relevant controller,
+ * according to the location.
+ *
+ * It handles and prints the footer elements (tutorial, SmartLine, html footer)
+ *
+ * @package Zed
+ * @subpackage Controllers
+ * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
+ * @copyright 2010 Sébastien Santoro aka Dereckson
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD
+ * @version 0.1
+ * @link http://scherzo.dereckson.be/doc/zed
+ * @link http://zed.dereckson.be/
+ * @filesource
+ */
+
+if (!defined('NO_FOOTER_EXTRA')) {
+ ///
+ /// Tutorials div
+ ///
+ if ($controller != 'explore' && (!array_key_exists('hypership.reached', $CurrentPerso->flags) || $CurrentPerso->flags['hypership.reached'] < 1)) {
+ if (!DOJO) $smarty->display('tutorial/dojo.tpl');
+ lang_load("tutorials.conf", "ReachHypership");
+ $smarty->assign('controller', $controller);
+ $smarty->display('tutorial/hypership_reach.tpl');
+ }
+
+ ///
+ /// Footer options
+ ///
+
+ $smarty->assign('MultiPerso', isset($_SESSION['UserWithSeveralPersos']) && $_SESSION['UserWithSeveralPersos']);
+ $smarty->assign('SmartLinePrint', (string)$CurrentPerso->get_flag('site.smartline.show') != "0");
+ $smarty->assign('SmartLineFormMethod', $CurrentPerso->get_flag('site.smartline.method'));
+}
+
+///
+/// HTML output
+///
+
+lang_load('footer.conf');
+$smarty->display('footer.tpl');
+
+?>
diff --git a/controllers/header.php b/controllers/header.php
index 7876a36..f3879a1 100644
--- a/controllers/header.php
+++ b/controllers/header.php
@@ -1,62 +1,62 @@
-<?php
-
-/**
- * Header
- * Zed. The immensity of stars. The HyperShip. The people.
- *
- * (c) 2010, Dereckson, some rights reserved.
- * Released under BSD license.
- *
- * This controller handle the header (MOTD, html header)
- *
- * @package Zed
- * @subpackage Controllers
- * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
- * @copyright 2010 Sébastien Santoro aka Dereckson
- * @license http://www.opensource.org/licenses/bsd-license.php BSD
- * @version 0.1
- * @link http://scherzo.dereckson.be/doc/zed
- * @link http://zed.dereckson.be/
- * @filesource
- *
- * @todo cache MOTD fragments (sql performance)
- */
-
-//
-// MOTD
-//
-
-//TODO: this is a potentially very intensive SQL query
-$sql = 'SELECT p.perso_nickname as username, p.perso_name as name, m.motd_text FROM ' . TABLE_PERSOS . ' p, ' . TABLE_MOTD . ' m WHERE p.perso_id = m.perso_id ORDER BY rand() LIMIT 1';
-if (!$result = $db->sql_query($sql)) message_die(SQL_ERROR, "Can't query MOTD", '', __LINE__, __FILE__, $sql);
-$row = $db->sql_fetchrow($result);
-$smarty->assign('WALL_TEXT', $row['motd_text']);
-$smarty->assign('WALL_USER', $row['name']);
-$smarty->assign('WALL_USER_URL', get_url('who', $row['username']));
-
-//
-// HTML output
-//
-
-//Defines DOJO if needed, and assigns DOJO/DIJIT smarty variables
-if (!defined('DOJO')) {
- /**
- * Determines if the dojo library have or not been loaded
- *
- * If true, there's a code like <script src="js/dojo/dojo/dojo.js"><script>
- * in the <head> block of the code.
- */
- define('DOJO', defined('DIJIT'));
-}
-
-if (defined('DIJIT')) $smarty->assign('DIJIT', true);
-$smarty->assign('DOJO', DOJO);
-
-//Prints the template
-$smarty->display('header.tpl');
-
-/**
- * This constant indicates the header have been printed
- */
-define('HEADER_PRINTED', true);
-?>
+<?php
+
+/**
+ * Header
+ * Zed. The immensity of stars. The HyperShip. The people.
+ *
+ * (c) 2010, Dereckson, some rights reserved.
+ * Released under BSD license.
+ *
+ * This controller handle the header (MOTD, html header)
+ *
+ * @package Zed
+ * @subpackage Controllers
+ * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
+ * @copyright 2010 Sébastien Santoro aka Dereckson
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD
+ * @version 0.1
+ * @link http://scherzo.dereckson.be/doc/zed
+ * @link http://zed.dereckson.be/
+ * @filesource
+ *
+ * @todo cache MOTD fragments (sql performance)
+ */
+
+//
+// MOTD
+//
+
+//TODO: this is a potentially very intensive SQL query
+$sql = 'SELECT p.perso_nickname as username, p.perso_name as name, m.motd_text FROM ' . TABLE_PERSOS . ' p, ' . TABLE_MOTD . ' m WHERE p.perso_id = m.perso_id ORDER BY rand() LIMIT 1';
+if (!$result = $db->sql_query($sql)) message_die(SQL_ERROR, "Can't query MOTD", '', __LINE__, __FILE__, $sql);
+$row = $db->sql_fetchrow($result);
+$smarty->assign('WALL_TEXT', $row['motd_text']);
+$smarty->assign('WALL_USER', $row['name']);
+$smarty->assign('WALL_USER_URL', get_url('who', $row['username']));
+
+//
+// HTML output
+//
+
+//Defines DOJO if needed, and assigns DOJO/DIJIT smarty variables
+if (!defined('DOJO')) {
+ /**
+ * Determines if the dojo library have or not been loaded
+ *
+ * If true, there's a code like <script src="js/dojo/dojo/dojo.js"><script>
+ * in the <head> block of the code.
+ */
+ define('DOJO', defined('DIJIT'));
+}
+
+if (defined('DIJIT')) $smarty->assign('DIJIT', true);
+$smarty->assign('DOJO', DOJO);
+
+//Prints the template
+$smarty->display('header.tpl');
+
+/**
+ * This constant indicates the header have been printed
+ */
+define('HEADER_PRINTED', true);
+?>
diff --git a/controllers/motd.php b/controllers/motd.php
index 67652ab..8f6dcbc 100644
--- a/controllers/motd.php
+++ b/controllers/motd.php
@@ -1,56 +1,56 @@
-<?php
-
-/**
- * MOTD
-
- * Zed. The immensity of stars. The HyperShip. The people.
- *
- * (c) 2010, Dereckson, some rights reserved.
- * Released under BSD license.
- *
- * This controller handle the /push "secret" URL.
- *
- * It allows to add a message in the MOTD (messages printed in the header on
- * the top of each page).
- *
- * It usees the motd_add.tpl view and the MOTD class.
- *
- * @package Zed
- * @subpackage Controllers
- * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
- * @copyright 2010 Sébastien Santoro aka Dereckson
- * @license http://www.opensource.org/licenses/bsd-license.php BSD
- * @version 0.1
- * @link http://scherzo.dereckson.be/doc/zed
- * @link http://zed.dereckson.be/
- * @filesource
- */
-
-//
-// Handles form
-//
-
-if ($_REQUEST['text']) {
- require_once('includes/objects/motd.php');
- $motd = new MOTD();
- $motd->text = $_REQUEST['text'];
- $motd->perso_id = $CurrentPerso->id;
- $motd->save_to_database();
- $smarty->assign('WAP', lang_get('Published'));
-}
-
-//
-// HTML output
-//
-
-//Serves header
-$smarty->assign('PAGE_TITLE', lang_get('PushMessage'));
-include('header.php');
-
-//Serves content
-$smarty->display('motd_add.tpl');
-
-//Servers footer
-include('footer.php');
-
+<?php
+
+/**
+ * MOTD
+
+ * Zed. The immensity of stars. The HyperShip. The people.
+ *
+ * (c) 2010, Dereckson, some rights reserved.
+ * Released under BSD license.
+ *
+ * This controller handle the /push "secret" URL.
+ *
+ * It allows to add a message in the MOTD (messages printed in the header on
+ * the top of each page).
+ *
+ * It usees the motd_add.tpl view and the MOTD class.
+ *
+ * @package Zed
+ * @subpackage Controllers
+ * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
+ * @copyright 2010 Sébastien Santoro aka Dereckson
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD
+ * @version 0.1
+ * @link http://scherzo.dereckson.be/doc/zed
+ * @link http://zed.dereckson.be/
+ * @filesource
+ */
+
+//
+// Handles form
+//
+
+if ($_REQUEST['text']) {
+ require_once('includes/objects/motd.php');
+ $motd = new MOTD();
+ $motd->text = $_REQUEST['text'];
+ $motd->perso_id = $CurrentPerso->id;
+ $motd->save_to_database();
+ $smarty->assign('WAP', lang_get('Published'));
+}
+
+//
+// HTML output
+//
+
+//Serves header
+$smarty->assign('PAGE_TITLE', lang_get('PushMessage'));
+include('header.php');
+
+//Serves content
+$smarty->display('motd_add.tpl');
+
+//Servers footer
+include('footer.php');
+
?>
\ No newline at end of file
diff --git a/controllers/profile.php b/controllers/profile.php
index f77c337..3f4e002 100644
--- a/controllers/profile.php
+++ b/controllers/profile.php
@@ -1,346 +1,346 @@
-<?php
-
-/**
- * User profile
- *
- * Zed. The immensity of stars. The HyperShip. The people.
- *
- * (c) 2010, Dereckson, some rights reserved.
- * Released under BSD license.
- *
- * This is a controller allowing user profile view and edit.
- *
- * It handles the following URLs:
- * /who/<perso nickname> views the nickname's profile,
- * /who/random views a random profile,
- * /who/edit/profile edits its profileq
- * /who/edit/account edits its account (disabled on Zed, cf. settings),
- * /who/edit/photo(s) manages its profile's photos,
- * /who/edit/photo/edit/<photo id> edits a photo properties,
- * /who/edit/photo/delete/<photo id> deletes a photo,
- * /who/edit/photo/avatar/<photo id> promotes a photo to avatar.
- *
- * The following views are used:
- * profile.tpl,
- * profile_edit.tpl,
- * user_account.tpl,
- * profile_photo.tpl,
- * profile_photo_edit.tpl.
- *
- * The following models are used:
- * Profile,
- * ProfilePhoto,
- * ProfileComment.
- *
- * The view profile_tags.tpl is indirectly used by the Profile model.
- *
- * This code is maintained in // with Azhàr.
- *
- * @package Zed
- * @subpackage Controllers
- * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
- * @copyright 2010 Sébastien Santoro aka Dereckson
- * @license http://www.opensource.org/licenses/bsd-license.php BSD
- * @version 0.1
- * @link http://scherzo.dereckson.be/doc/zed
- * @link http://zed.dereckson.be/
- * @filesource
- */
-
-//Loads language file
-lang_load('profile.conf');
-
-//Gets perso nickname from URL
-$who = $url[1];
-
-switch ($who) {
- case 'edit':
- $mode = 'edit';
- $who = $CurrentPerso->nickname;
- break;
-
- case 'random':
- $mode = 'view';
- $who = $db->sql_query_express("SELECT perso_id FROM " . TABLE_PROFILES . " ORDER BY rand() LIMIT 1");
- break;
-
- default:
- $mode = 'view';
-}
-
-if (!$who) {
- message_die(GENERAL_ERROR, "Who?", "URL error");
-}
-
-//Libs
-require_once('includes/objects/profile.php');
-require_once('includes/objects/profilecomment.php');
-require_once('includes/objects/profilephoto.php');
-
-//Gets perso information
-require_once('includes/objects/perso.php');
-$perso = Perso::get($who);
-if ($perso->lastError) {
- message_die(GENERAL_ERROR, $perso->lastError, "Error");
-}
-$smarty->assign('perso', $perso);
-
-//Gets profile
-$profile = new Profile($perso->id);
-
-//Handles form
-if ($_POST['EditProfile']) {
- $profile->load_from_form();
- $profile->updated = time();
- $profile->save_to_database();
- $mode = 'view';
-} elseif ($_POST['UserAccount']) {
- $smarty->assign('WAP', "This form have been deprecated. You can write instead settings in the SmartLine");
-} elseif ($_POST['message_type'] == 'private_message') {
- //Sends a message
- require_once('includes/objects/message.php');
- $msg = new Message();
- $msg->from = $CurrentPerso->id;
- $msg->to = $perso->id;
- $msg->text = $_POST['message'];
- $msg->send();
- if ($msg->from == $msg->to) {
- $smarty->assign('NOTIFY', lang_get('MessageSentSelf'));
- } else {
- $smarty->assign('NOTIFY', lang_get('MessageSent'));
- }
-} elseif ($_POST['message_type'] == 'profile_comment') {
- //New profile comment
- $comment = new ProfileComment();
- $comment->author = $CurrentPerso->id;
- $comment->perso_id = $perso->id;
- $comment->text = $_POST['message'];
- $comment->publish();
- $smarty->assign('NOTIFY', lang_get('CommentPublished'));
-} elseif ($_FILES['photo']) {
- #We've a file !
-
- $hash = md5(microtime() . serialize($_FILES));
- $extension = get_extension($_FILES['photo']['name']);
- $filename = $CurrentPerso->id . '_' . $hash . '.' . $extension;
-
- #We ignore $_FILES[photo][error] 4, this means no file has been uploaded
- #(so user doesn't want upload a new file)
- #See http:/www.php.net/features.file-upload and http://www.php.net/manual/en/features.file-upload.errors.php about common errors
- #Not valid before PHP 4.2.0
- switch ($_FILES['photo']['error']) {
- case 0:
- #There is no error, the file uploaded with success.
-
- if (!move_uploaded_file($_FILES['photo']['tmp_name'], PHOTOS_DIR . '/' . $filename)) {
- $errors[] = "Upload successful, but error saving it.";
- } else {
- //Attaches the picture to the profile
- $photo = new ProfilePhoto();
- $photo->name = $filename;
- $photo->perso_id = $CurrentPerso->id;
- $photo->description = $_POST['description'];
- if ($photo->avatar) $photo->promote_to_avatar();
- $photo->save_to_database();
-
- //Generates thumbnail
- if (!$photo->generate_thumbnail()) {
- $smarty->assign('WAP', "Error generating thumbnail.");
- }
-
- $smarty->assign('NOTIFY', lang_get('PhotoUploaded'));
- $mode = 'view';
- }
- break;
-
- case 1:
- $errors[] = "The file is too large.";
- break;
-
- #TODO : more explicit error messages
-
- default:
- $errors[] = "Unknown error (#" . $_FILES['photo']['error'] . ")";
- break;
- }
-
- if (count($errors)) {
- $smarty->assign('WAP', join($errors, '<br />'));
- }
-} elseif ($_POST['id']) {
- //Edits photo properties
- $photo = new ProfilePhoto($_POST['id']);
- if ($photo->lastError) {
- $smarty->assign('WAP', $photo->lastError);
- $mode = 'view';
- } elseif ($photo->perso_id != $CurrentPerso->id) {
- $smarty->assign('WAP', lang_get('NotYourPic'));
- $mode = 'view';
- } else {
- //OK
- $wereAvatar = $photo->avatar;
- $photo->load_from_form();
- if (!$wereAvatar && $photo->avatar) {
- //Promote to avatar
- $photo->promote_to_avatar();
- }
- $photo->save_to_database();
- }
-}
-
-//Prepares output
-if ($profile->text) {
- //Profile
- $smarty->assign('PROFILE_TEXT', $profile->text);
- $smarty->assign('PROFILE_FIXEDWIDTH', $profile->fixedwidth);
-}
-
-if ($mode == 'view') {
- require_once('includes/objects/profilephoto.php');
-
- //Self profile?
- $self = $CurrentPerso->id == $profile->perso_id;
-
- //Gets profiles comments, photos, tags
- $comments = ProfileComment::get_comments($profile->perso_id);
- $photos = ProfilePhoto::get_photos($profile->perso_id);
- $tags = $profile->get_cached_tags();
-
- //Records timestamp, to be able to track new comments
- if ($self) $CurrentPerso->set_flag('profile.lastvisit', time());
-
- //Template
- $smarty->assign('PROFILE_COMMENTS', $comments);
- $smarty->assign('PROFILE_SELF', $self);
- if ($tags) $smarty->assign('PROFILE_TAGS', $tags);
- $smarty->assign('USERNAME', $perso->username);
- $smarty->assign('NAME', $perso->name ? $perso->name : $perso->nickname);
- $template = 'profile.tpl';
-} elseif ($mode == 'edit') {
- switch ($url[2]) {
- case 'profile':
- $smarty->assign('USERNAME', $perso->name);
- $smarty->assign('DIJIT', true);
- $css[] = THEME . '/forms.css';
- $template = 'profile_edit.tpl';
- break;
-
- case 'account':
- $smarty->assign('user', $CurrentUser);
- $smarty->assign('DIJIT', true);
- $css[] = THEME . '/forms.css';
- $template = 'user_account.tpl';
- break;
-
- case '':
- $smarty->assign('NOTIFY', "What do you want to edit ? Append /profile, /account or /photos to the URL");
- break;
-
- case 'photo':
- case 'photos':
- $smarty->assign('USERNAME', $perso->name);
- switch ($action = $url[3]) {
- case '':
- //Nothing to do
- break;
-
- case 'delete':
- //Deletes a picture
- if (!$id = $url[4]) {
- $smarty->assign('WAP', "URL error. Parameter missing: picture id.");
- } else {
- $photo = new ProfilePhoto($id);
- if ($photo->lastError) {
- //Probably an non existent id (e.g. double F5, photo already deleted)
- $smarty->assign('WAP', $photo->lastError);
- } elseif ($photo->perso_id != $CurrentPerso->id) {
- $smarty->assign('WAP', lang_get('NotYourPic'));
- } else {
- //OK we can delete it
- $photo->delete();
- $smarty->assign('NOTIFY', lang_get('PictureDeleted'));
- }
- }
- break;
-
- case 'edit':
- if (!$id = $url[4]) {
- $smarty->assign('WAP', "URL error. Parameter missing: picture id.");
- } else {
- $photo = new ProfilePhoto($id);
- if ($photo->lastError) {
- //Probably an non existent id (e.g. double F5, photo already deleted)
- $smarty->assign('WAP', $photo->lastError);
- } elseif ($photo->perso_id != $CurrentPerso->id) {
- $smarty->assign('WAP', lang_get('NotYourPic'));
- } else {
- //Photo information edit form
- $smarty->assign('photo', $photo);
- $template = 'profile_photo_edit.tpl';
- }
- }
- break;
-
- case 'avatar':
- //Promotes a picture to avatar
- if (!$id = $url[4]) {
- $smarty->assign('WAP', "URL error. Parameter missing: picture id.");
- } else {
- $photo = new ProfilePhoto($id);
- if ($photo->lastError) {
- $smarty->assign('WAP', $photo->lastError);
- } elseif ($photo->perso_id != $CurrentPerso->id) {
- $smarty->assign('WAP', lang_get('NotYourPic'));
- } else {
- //OK, promote it to avatar
- $photo->promote_to_avatar();
- $photo->save_to_database();
- $smarty->assign('NOTIFY', lang_get('PromotedToAvatar'));
- }
- }
- break;
-
- default:
- $smarty->assign('WAP', "Unknown URL. To delete a picture it's /delete/<picture id>. To edit it /edit/<picture id>");
- break;
- }
-
- if (!$template) {
- $photos = ProfilePhoto::get_photos($profile->perso_id);
- if (!$smarty->tpl_vars['NOTIFY'])
- $smarty->assign('NOTIFY', "Your feedback is valued. Report any bug or suggestion on the graffiti wall.");
- $template = 'profile_photo.tpl';
- }
- break;
-
- default:
- $smarty->assign('WAP', "URL error. You can use /edit with profile, account or photos.");
- break;
- }
-}
-
-//
-// HTML output
-//
-
-//Photos
-if (count($photos) || $photo) {
- $smarty->assign('URL_PICS', PHOTOS_URL);
- $css[] = 'lightbox.css';
- $smarty->assign('PAGE_JS', array('prototype.js', 'effects.js', 'lightbox.js'));
- $smarty->assign('PICS', $photos);
-}
-
-//Serves header
-$css[] = THEME . "/profile.css";
-$smarty->assign('PAGE_CSS', $css);
-$smarty->assign('PAGE_TITLE', $perso->name);
-include('header.php');
-
-//Serves content
-if ($template) $smarty->display($template);
-
-//Serves footer
-include('footer.php');
-
+<?php
+
+/**
+ * User profile
+ *
+ * Zed. The immensity of stars. The HyperShip. The people.
+ *
+ * (c) 2010, Dereckson, some rights reserved.
+ * Released under BSD license.
+ *
+ * This is a controller allowing user profile view and edit.
+ *
+ * It handles the following URLs:
+ * /who/<perso nickname> views the nickname's profile,
+ * /who/random views a random profile,
+ * /who/edit/profile edits its profileq
+ * /who/edit/account edits its account (disabled on Zed, cf. settings),
+ * /who/edit/photo(s) manages its profile's photos,
+ * /who/edit/photo/edit/<photo id> edits a photo properties,
+ * /who/edit/photo/delete/<photo id> deletes a photo,
+ * /who/edit/photo/avatar/<photo id> promotes a photo to avatar.
+ *
+ * The following views are used:
+ * profile.tpl,
+ * profile_edit.tpl,
+ * user_account.tpl,
+ * profile_photo.tpl,
+ * profile_photo_edit.tpl.
+ *
+ * The following models are used:
+ * Profile,
+ * ProfilePhoto,
+ * ProfileComment.
+ *
+ * The view profile_tags.tpl is indirectly used by the Profile model.
+ *
+ * This code is maintained in // with Azhàr.
+ *
+ * @package Zed
+ * @subpackage Controllers
+ * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
+ * @copyright 2010 Sébastien Santoro aka Dereckson
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD
+ * @version 0.1
+ * @link http://scherzo.dereckson.be/doc/zed
+ * @link http://zed.dereckson.be/
+ * @filesource
+ */
+
+//Loads language file
+lang_load('profile.conf');
+
+//Gets perso nickname from URL
+$who = $url[1];
+
+switch ($who) {
+ case 'edit':
+ $mode = 'edit';
+ $who = $CurrentPerso->nickname;
+ break;
+
+ case 'random':
+ $mode = 'view';
+ $who = $db->sql_query_express("SELECT perso_id FROM " . TABLE_PROFILES . " ORDER BY rand() LIMIT 1");
+ break;
+
+ default:
+ $mode = 'view';
+}
+
+if (!$who) {
+ message_die(GENERAL_ERROR, "Who?", "URL error");
+}
+
+//Libs
+require_once('includes/objects/profile.php');
+require_once('includes/objects/profilecomment.php');
+require_once('includes/objects/profilephoto.php');
+
+//Gets perso information
+require_once('includes/objects/perso.php');
+$perso = Perso::get($who);
+if ($perso->lastError) {
+ message_die(GENERAL_ERROR, $perso->lastError, "Error");
+}
+$smarty->assign('perso', $perso);
+
+//Gets profile
+$profile = new Profile($perso->id);
+
+//Handles form
+if ($_POST['EditProfile']) {
+ $profile->load_from_form();
+ $profile->updated = time();
+ $profile->save_to_database();
+ $mode = 'view';
+} elseif ($_POST['UserAccount']) {
+ $smarty->assign('WAP', "This form have been deprecated. You can write instead settings in the SmartLine");
+} elseif ($_POST['message_type'] == 'private_message') {
+ //Sends a message
+ require_once('includes/objects/message.php');
+ $msg = new Message();
+ $msg->from = $CurrentPerso->id;
+ $msg->to = $perso->id;
+ $msg->text = $_POST['message'];
+ $msg->send();
+ if ($msg->from == $msg->to) {
+ $smarty->assign('NOTIFY', lang_get('MessageSentSelf'));
+ } else {
+ $smarty->assign('NOTIFY', lang_get('MessageSent'));
+ }
+} elseif ($_POST['message_type'] == 'profile_comment') {
+ //New profile comment
+ $comment = new ProfileComment();
+ $comment->author = $CurrentPerso->id;
+ $comment->perso_id = $perso->id;
+ $comment->text = $_POST['message'];
+ $comment->publish();
+ $smarty->assign('NOTIFY', lang_get('CommentPublished'));
+} elseif ($_FILES['photo']) {
+ #We've a file !
+
+ $hash = md5(microtime() . serialize($_FILES));
+ $extension = get_extension($_FILES['photo']['name']);
+ $filename = $CurrentPerso->id . '_' . $hash . '.' . $extension;
+
+ #We ignore $_FILES[photo][error] 4, this means no file has been uploaded
+ #(so user doesn't want upload a new file)
+ #See http:/www.php.net/features.file-upload and http://www.php.net/manual/en/features.file-upload.errors.php about common errors
+ #Not valid before PHP 4.2.0
+ switch ($_FILES['photo']['error']) {
+ case 0:
+ #There is no error, the file uploaded with success.
+
+ if (!move_uploaded_file($_FILES['photo']['tmp_name'], PHOTOS_DIR . '/' . $filename)) {
+ $errors[] = "Upload successful, but error saving it.";
+ } else {
+ //Attaches the picture to the profile
+ $photo = new ProfilePhoto();
+ $photo->name = $filename;
+ $photo->perso_id = $CurrentPerso->id;
+ $photo->description = $_POST['description'];
+ if ($photo->avatar) $photo->promote_to_avatar();
+ $photo->save_to_database();
+
+ //Generates thumbnail
+ if (!$photo->generate_thumbnail()) {
+ $smarty->assign('WAP', "Error generating thumbnail.");
+ }
+
+ $smarty->assign('NOTIFY', lang_get('PhotoUploaded'));
+ $mode = 'view';
+ }
+ break;
+
+ case 1:
+ $errors[] = "The file is too large.";
+ break;
+
+ #TODO : more explicit error messages
+
+ default:
+ $errors[] = "Unknown error (#" . $_FILES['photo']['error'] . ")";
+ break;
+ }
+
+ if (count($errors)) {
+ $smarty->assign('WAP', join($errors, '<br />'));
+ }
+} elseif ($_POST['id']) {
+ //Edits photo properties
+ $photo = new ProfilePhoto($_POST['id']);
+ if ($photo->lastError) {
+ $smarty->assign('WAP', $photo->lastError);
+ $mode = 'view';
+ } elseif ($photo->perso_id != $CurrentPerso->id) {
+ $smarty->assign('WAP', lang_get('NotYourPic'));
+ $mode = 'view';
+ } else {
+ //OK
+ $wereAvatar = $photo->avatar;
+ $photo->load_from_form();
+ if (!$wereAvatar && $photo->avatar) {
+ //Promote to avatar
+ $photo->promote_to_avatar();
+ }
+ $photo->save_to_database();
+ }
+}
+
+//Prepares output
+if ($profile->text) {
+ //Profile
+ $smarty->assign('PROFILE_TEXT', $profile->text);
+ $smarty->assign('PROFILE_FIXEDWIDTH', $profile->fixedwidth);
+}
+
+if ($mode == 'view') {
+ require_once('includes/objects/profilephoto.php');
+
+ //Self profile?
+ $self = $CurrentPerso->id == $profile->perso_id;
+
+ //Gets profiles comments, photos, tags
+ $comments = ProfileComment::get_comments($profile->perso_id);
+ $photos = ProfilePhoto::get_photos($profile->perso_id);
+ $tags = $profile->get_cached_tags();
+
+ //Records timestamp, to be able to track new comments
+ if ($self) $CurrentPerso->set_flag('profile.lastvisit', time());
+
+ //Template
+ $smarty->assign('PROFILE_COMMENTS', $comments);
+ $smarty->assign('PROFILE_SELF', $self);
+ if ($tags) $smarty->assign('PROFILE_TAGS', $tags);
+ $smarty->assign('USERNAME', $perso->username);
+ $smarty->assign('NAME', $perso->name ? $perso->name : $perso->nickname);
+ $template = 'profile.tpl';
+} elseif ($mode == 'edit') {
+ switch ($url[2]) {
+ case 'profile':
+ $smarty->assign('USERNAME', $perso->name);
+ $smarty->assign('DIJIT', true);
+ $css[] = THEME . '/forms.css';
+ $template = 'profile_edit.tpl';
+ break;
+
+ case 'account':
+ $smarty->assign('user', $CurrentUser);
+ $smarty->assign('DIJIT', true);
+ $css[] = THEME . '/forms.css';
+ $template = 'user_account.tpl';
+ break;
+
+ case '':
+ $smarty->assign('NOTIFY', "What do you want to edit ? Append /profile, /account or /photos to the URL");
+ break;
+
+ case 'photo':
+ case 'photos':
+ $smarty->assign('USERNAME', $perso->name);
+ switch ($action = $url[3]) {
+ case '':
+ //Nothing to do
+ break;
+
+ case 'delete':
+ //Deletes a picture
+ if (!$id = $url[4]) {
+ $smarty->assign('WAP', "URL error. Parameter missing: picture id.");
+ } else {
+ $photo = new ProfilePhoto($id);
+ if ($photo->lastError) {
+ //Probably an non existent id (e.g. double F5, photo already deleted)
+ $smarty->assign('WAP', $photo->lastError);
+ } elseif ($photo->perso_id != $CurrentPerso->id) {
+ $smarty->assign('WAP', lang_get('NotYourPic'));
+ } else {
+ //OK we can delete it
+ $photo->delete();
+ $smarty->assign('NOTIFY', lang_get('PictureDeleted'));
+ }
+ }
+ break;
+
+ case 'edit':
+ if (!$id = $url[4]) {
+ $smarty->assign('WAP', "URL error. Parameter missing: picture id.");
+ } else {
+ $photo = new ProfilePhoto($id);
+ if ($photo->lastError) {
+ //Probably an non existent id (e.g. double F5, photo already deleted)
+ $smarty->assign('WAP', $photo->lastError);
+ } elseif ($photo->perso_id != $CurrentPerso->id) {
+ $smarty->assign('WAP', lang_get('NotYourPic'));
+ } else {
+ //Photo information edit form
+ $smarty->assign('photo', $photo);
+ $template = 'profile_photo_edit.tpl';
+ }
+ }
+ break;
+
+ case 'avatar':
+ //Promotes a picture to avatar
+ if (!$id = $url[4]) {
+ $smarty->assign('WAP', "URL error. Parameter missing: picture id.");
+ } else {
+ $photo = new ProfilePhoto($id);
+ if ($photo->lastError) {
+ $smarty->assign('WAP', $photo->lastError);
+ } elseif ($photo->perso_id != $CurrentPerso->id) {
+ $smarty->assign('WAP', lang_get('NotYourPic'));
+ } else {
+ //OK, promote it to avatar
+ $photo->promote_to_avatar();
+ $photo->save_to_database();
+ $smarty->assign('NOTIFY', lang_get('PromotedToAvatar'));
+ }
+ }
+ break;
+
+ default:
+ $smarty->assign('WAP', "Unknown URL. To delete a picture it's /delete/<picture id>. To edit it /edit/<picture id>");
+ break;
+ }
+
+ if (!$template) {
+ $photos = ProfilePhoto::get_photos($profile->perso_id);
+ if (!$smarty->tpl_vars['NOTIFY'])
+ $smarty->assign('NOTIFY', "Your feedback is valued. Report any bug or suggestion on the graffiti wall.");
+ $template = 'profile_photo.tpl';
+ }
+ break;
+
+ default:
+ $smarty->assign('WAP', "URL error. You can use /edit with profile, account or photos.");
+ break;
+ }
+}
+
+//
+// HTML output
+//
+
+//Photos
+if (count($photos) || $photo) {
+ $smarty->assign('URL_PICS', PHOTOS_URL);
+ $css[] = 'lightbox.css';
+ $smarty->assign('PAGE_JS', array('prototype.js', 'effects.js', 'lightbox.js'));
+ $smarty->assign('PICS', $photos);
+}
+
+//Serves header
+$css[] = THEME . "/profile.css";
+$smarty->assign('PAGE_CSS', $css);
+$smarty->assign('PAGE_TITLE', $perso->name);
+include('header.php');
+
+//Serves content
+if ($template) $smarty->display($template);
+
+//Serves footer
+include('footer.php');
+
?>
\ No newline at end of file
diff --git a/controllers/raw.php b/controllers/raw.php
index c19e194..4431fcf 100644
--- a/controllers/raw.php
+++ b/controllers/raw.php
@@ -1,63 +1,63 @@
-<?php
-
-/**
- * Raw text ou HTML content
- *
- * Zed. The immensity of stars. The HyperShip. The people.
- *
- * (c) 2010, Dereckson, some rights reserved.
- * Released under BSD license.
- *
- * This is a controller printing HTML content as is.
- *
- * It prints the raw.tpl view containing two variables:
- * - PAGE_TITLE (optionnal), to add a H1 page title
- * - CONTENT (should be defined), the content to print
- *
- * To use it:
- * <code>
- * //(1) Assign your HTML content in CONTENT smarty variable:
- * $content = "Hello World!";
- * $smarty->assign('CONTENT', $content);
- *
- * //(2) Call the raw controller
- * include('controllers/raw.php');
- *
- * //That's all folk.
- * </code>
- *
- * To add a title:
- * <code>
- * $content = "Hello World";
- * $title = "Raw sample";
- *
- * $smarty->assign('PAGE_TITLE', $title);
- * $smarty->assign('CONTENT', $content);
- * </code>
- *
- * @package Zed
- * @subpackage Controllers
- * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
- * @copyright 2010 Sébastien Santoro aka Dereckson
- * @license http://www.opensource.org/licenses/bsd-license.php BSD
- * @version 0.1
- * @link http://scherzo.dereckson.be/doc/zed
- * @link http://zed.dereckson.be/
- * @filesource
- */
-
-//
-// HTML output
-//
-
-//Serves header
-$smarty->assign('PAGE_TITLE', $title);
-include('header.php');
-
-//Serves content
-$smarty->display('raw.tpl');
-
-//Serves footer
-include('footer.php');
-
+<?php
+
+/**
+ * Raw text ou HTML content
+ *
+ * Zed. The immensity of stars. The HyperShip. The people.
+ *
+ * (c) 2010, Dereckson, some rights reserved.
+ * Released under BSD license.
+ *
+ * This is a controller printing HTML content as is.
+ *
+ * It prints the raw.tpl view containing two variables:
+ * - PAGE_TITLE (optionnal), to add a H1 page title
+ * - CONTENT (should be defined), the content to print
+ *
+ * To use it:
+ * <code>
+ * //(1) Assign your HTML content in CONTENT smarty variable:
+ * $content = "Hello World!";
+ * $smarty->assign('CONTENT', $content);
+ *
+ * //(2) Call the raw controller
+ * include('controllers/raw.php');
+ *
+ * //That's all folk.
+ * </code>
+ *
+ * To add a title:
+ * <code>
+ * $content = "Hello World";
+ * $title = "Raw sample";
+ *
+ * $smarty->assign('PAGE_TITLE', $title);
+ * $smarty->assign('CONTENT', $content);
+ * </code>
+ *
+ * @package Zed
+ * @subpackage Controllers
+ * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
+ * @copyright 2010 Sébastien Santoro aka Dereckson
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD
+ * @version 0.1
+ * @link http://scherzo.dereckson.be/doc/zed
+ * @link http://zed.dereckson.be/
+ * @filesource
+ */
+
+//
+// HTML output
+//
+
+//Serves header
+$smarty->assign('PAGE_TITLE', $title);
+include('header.php');
+
+//Serves content
+$smarty->display('raw.tpl');
+
+//Serves footer
+include('footer.php');
+
?>
\ No newline at end of file
diff --git a/controllers/request.php b/controllers/request.php
index 7492096..4ccd910 100644
--- a/controllers/request.php
+++ b/controllers/request.php
@@ -1,95 +1,95 @@
-<?php
-
-/**
- * Requests controller
- *
- * Zed. The immensity of stars. The HyperShip. The people.
- *
- * (c) 2010, Dereckson, some rights reserved.
- * Released under BSD license.
- *
- * This controller allows the perso to send requests to the HyperShip,
- * to a specified ship, or to a specify port requiring PTA.
- *
- * It handles all the forms output, handling and notifications
- * for queries from users to users.
- *
- * It handles /request URL, is called from tutorial.
- *
- * @package Zed
- * @subpackage Controllers
- * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
- * @copyright 2010 Sébastien Santoro aka Dereckson
- * @license http://www.opensource.org/licenses/bsd-license.php BSD
- * @version 0.1
- * @link http://scherzo.dereckson.be/doc/zed
- * @link http://zed.dereckson.be/
- * @filesource
- *
- * @todo complete requests implementation
- * @todo call this controller from Ship fly out if port is a PTA
- * @todo call this controller from HyperShip entrance perso request
- * @todo add hook to launch some events on a new request, reply or status change.
- */
-
-//
-// Prepare fields
-//
-
-if (count($url) < 3) message_die(HACK_ERROR, "Expected URL: /request/code_to/code_object");
-
-//
-// Handles or print form
-//
-if (false) {
- //Saves the request reply
-} elseif ($_POST['title'] || $_POST['message']) {
- //Saves the request
- require_once('includes/objects/request.php');
- $request = new Request();
- $request->load_from_form();
- $request->author = $CurrentPerso->id;
- $request->to = $url[1];
- $request->code = $url[2];
- $request->location_global = $CurrentPerso->location_global;
- $request->location_local = $CurrentPerso->location_local;
- $request->save_to_database();
-
- //Confirmation
- $template = "requests/confirm.tpl";
-} else {
- $request->to = $url[1];
- $request->obj = $url[2];
-
- //Checks if the request template exists
- if (!file_exists(sprintf("skins/%s/requests/%s.tpl", THEME, $request->obj))) {
- message_die(HACK_ERROR, "$url[2] isn't a valid request object code");
- }
-
- $template = "requests/$request->obj.tpl";
- switch ($request->obj) {
- case "aid.reach":
- if ($request->to == "B00001")
- $request->title = "Shuttle pick up request";
- break;
- }
-}
-
-//
-// HTML output
-//
-
-//Serves header
-define('DIJIT', true);
-$smarty->assign('PAGE_TITLE', lang_get('Request'));
-include('header.php');
-
-//Serves content
-$smarty->assign('request', $request);
-$smarty->display($template);
-
-//Serves footer
-$smarty->assign("screen", "$url[2] request");
-include('footer.php');
-
+<?php
+
+/**
+ * Requests controller
+ *
+ * Zed. The immensity of stars. The HyperShip. The people.
+ *
+ * (c) 2010, Dereckson, some rights reserved.
+ * Released under BSD license.
+ *
+ * This controller allows the perso to send requests to the HyperShip,
+ * to a specified ship, or to a specify port requiring PTA.
+ *
+ * It handles all the forms output, handling and notifications
+ * for queries from users to users.
+ *
+ * It handles /request URL, is called from tutorial.
+ *
+ * @package Zed
+ * @subpackage Controllers
+ * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
+ * @copyright 2010 Sébastien Santoro aka Dereckson
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD
+ * @version 0.1
+ * @link http://scherzo.dereckson.be/doc/zed
+ * @link http://zed.dereckson.be/
+ * @filesource
+ *
+ * @todo complete requests implementation
+ * @todo call this controller from Ship fly out if port is a PTA
+ * @todo call this controller from HyperShip entrance perso request
+ * @todo add hook to launch some events on a new request, reply or status change.
+ */
+
+//
+// Prepare fields
+//
+
+if (count($url) < 3) message_die(HACK_ERROR, "Expected URL: /request/code_to/code_object");
+
+//
+// Handles or print form
+//
+if (false) {
+ //Saves the request reply
+} elseif ($_POST['title'] || $_POST['message']) {
+ //Saves the request
+ require_once('includes/objects/request.php');
+ $request = new Request();
+ $request->load_from_form();
+ $request->author = $CurrentPerso->id;
+ $request->to = $url[1];
+ $request->code = $url[2];
+ $request->location_global = $CurrentPerso->location_global;
+ $request->location_local = $CurrentPerso->location_local;
+ $request->save_to_database();
+
+ //Confirmation
+ $template = "requests/confirm.tpl";
+} else {
+ $request->to = $url[1];
+ $request->obj = $url[2];
+
+ //Checks if the request template exists
+ if (!file_exists(sprintf("skins/%s/requests/%s.tpl", THEME, $request->obj))) {
+ message_die(HACK_ERROR, "$url[2] isn't a valid request object code");
+ }
+
+ $template = "requests/$request->obj.tpl";
+ switch ($request->obj) {
+ case "aid.reach":
+ if ($request->to == "B00001")
+ $request->title = "Shuttle pick up request";
+ break;
+ }
+}
+
+//
+// HTML output
+//
+
+//Serves header
+define('DIJIT', true);
+$smarty->assign('PAGE_TITLE', lang_get('Request'));
+include('header.php');
+
+//Serves content
+$smarty->assign('request', $request);
+$smarty->display($template);
+
+//Serves footer
+$smarty->assign("screen", "$url[2] request");
+include('footer.php');
+
?>
\ No newline at end of file
diff --git a/controllers/ship.php b/controllers/ship.php
index ae4bc45..e6c2124 100644
--- a/controllers/ship.php
+++ b/controllers/ship.php
@@ -1,91 +1,91 @@
-<?php
-
-/**
- * Ship
- *
- * Zed. The immensity of stars. The HyperShip. The people.
- *
- * (c) 2010, Dereckson, some rights reserved.
- * Released under BSD license.
- *
- * This controller handle the /ship URL
- *
- * It allows the user to let personal notes about the ship.
- *
- * It uses the Ship model and the ship.tpl view
- *
- * @package Zed
- * @subpackage Controllers
- * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
- * @copyright 2010 Sébastien Santoro aka Dereckson
- * @license http://www.opensource.org/licenses/bsd-license.php BSD
- * @version 0.1
- * @link http://scherzo.dereckson.be/doc/zed
- * @link http://zed.dereckson.be/
- * @filesource
- *
- * @todo prints information indicating if we're or not in the ship
- * @todo implement a console to control the ship
- */
-
-//
-// Load library and language file
-//
-
-require_once('includes/objects/ship.php');
-lang_load('ships.conf');
-
-//
-// Ship information
-//
-
-//Gets ship from URL
-if (count($url) < 2) {
- //No parameter, gets ship perso is onboard
- if (!$code = $CurrentPerso->location->ship_code) {
- message_die(GENERAL_ERROR, "/ship/ must be followed by valid ship code.<br />/ship alone only works when you're aboard a ship", "URL error");
- }
- $code = 'S' . $code;
-} else {
- //Code have been specified
- $code = $url[1];
- if (!preg_match("/^S[0-9]{5}$/", $code)) {
- message_die(GENERAL_ERROR, "/ship/ must be followed by valid ship code", "URL error");
- }
-}
-
-//Gets ship information
-$ship = Ship::get($code);
-
-//Gets perso note about this ship
-$note = $CurrentPerso->get_note($code);
-
-//Determines the spatial relation between perso and ship
-//dieprint_r($CurrentPerso->location->ship_code);
-
-//
-// Actions handling
-//
-if ($_REQUEST['action'] == 'ship.setnote' && $_REQUEST['note'] != $note) {
- //Updates note content
- $CurrentPerso->set_note($code, $_REQUEST['note']);
- $note = $_REQUEST['note'];
-}
-
-//
-// HTML output
-//
-
-//Serves header
-$smarty->assign('PAGE_TITLE', $ship->name);
-include('header.php');
-
-//Serves content
-$smarty->assign('note', $note);
-$smarty->assign('ship', $ship);
-$smarty->display('ship.tpl');
-
-//Serves footer
-include('footer.php');
-
+<?php
+
+/**
+ * Ship
+ *
+ * Zed. The immensity of stars. The HyperShip. The people.
+ *
+ * (c) 2010, Dereckson, some rights reserved.
+ * Released under BSD license.
+ *
+ * This controller handle the /ship URL
+ *
+ * It allows the user to let personal notes about the ship.
+ *
+ * It uses the Ship model and the ship.tpl view
+ *
+ * @package Zed
+ * @subpackage Controllers
+ * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
+ * @copyright 2010 Sébastien Santoro aka Dereckson
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD
+ * @version 0.1
+ * @link http://scherzo.dereckson.be/doc/zed
+ * @link http://zed.dereckson.be/
+ * @filesource
+ *
+ * @todo prints information indicating if we're or not in the ship
+ * @todo implement a console to control the ship
+ */
+
+//
+// Load library and language file
+//
+
+require_once('includes/objects/ship.php');
+lang_load('ships.conf');
+
+//
+// Ship information
+//
+
+//Gets ship from URL
+if (count($url) < 2) {
+ //No parameter, gets ship perso is onboard
+ if (!$code = $CurrentPerso->location->ship_code) {
+ message_die(GENERAL_ERROR, "/ship/ must be followed by valid ship code.<br />/ship alone only works when you're aboard a ship", "URL error");
+ }
+ $code = 'S' . $code;
+} else {
+ //Code have been specified
+ $code = $url[1];
+ if (!preg_match("/^S[0-9]{5}$/", $code)) {
+ message_die(GENERAL_ERROR, "/ship/ must be followed by valid ship code", "URL error");
+ }
+}
+
+//Gets ship information
+$ship = Ship::get($code);
+
+//Gets perso note about this ship
+$note = $CurrentPerso->get_note($code);
+
+//Determines the spatial relation between perso and ship
+//dieprint_r($CurrentPerso->location->ship_code);
+
+//
+// Actions handling
+//
+if ($_REQUEST['action'] == 'ship.setnote' && $_REQUEST['note'] != $note) {
+ //Updates note content
+ $CurrentPerso->set_note($code, $_REQUEST['note']);
+ $note = $_REQUEST['note'];
+}
+
+//
+// HTML output
+//
+
+//Serves header
+$smarty->assign('PAGE_TITLE', $ship->name);
+include('header.php');
+
+//Serves content
+$smarty->assign('note', $note);
+$smarty->assign('ship', $ship);
+$smarty->display('ship.tpl');
+
+//Serves footer
+include('footer.php');
+
?>
\ No newline at end of file
diff --git a/controllers/story.php b/controllers/story.php
index 13c9b2f..ba8fbc9 100644
--- a/controllers/story.php
+++ b/controllers/story.php
@@ -1,131 +1,131 @@
-<?php
-
-/**
- * Story
- *
- * Zed. The immensity of stars. The HyperShip. The people.
- *
- * (c) 2010, Dereckson, some rights reserved.
- * Released under BSD license.
- *
- * This controller is a storytelling engine allowing to explore a place like
- * in fighting fantasy gamebooks / livres dont vous êtes le héros.
- *
- * This controller is called by the explore controller and handles /explore URL.
- *
- * It uses the Story classes, the story.tpl view and content/stories/*.xml as
- * stories content datasource.
- *
- * @package Zed
- * @subpackage Controllers
- * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
- * @copyright 2010 Sébastien Santoro aka Dereckson
- * @license http://www.opensource.org/licenses/bsd-license.php BSD
- * @version 0.1
- * @link http://scherzo.dereckson.be/doc/zed
- * @link http://zed.dereckson.be/
- * @filesource
- *
- * @todo Create a separate release from Zed based on this controller and the Story library.
- * @todo Add code to handle actions defined in choices like inventory management
- */
-
-//
-// Helper method
-//
-
-/**
- * Gets section to print to the user
- * @param Story the story the section to get (yep, we could've global $story)
- * @return StorySection the section, or null if not found
- */
-function get_section ($story) {
- global $url, $smarty, $CurrentPerso;
-
- //If the URL contains a choice guid, use it as story progress source
- //e.g. /explore/143f7200-766b-7b8b-e3f4-9fbfeeaeb5dd
- if (count($url) > 1) {
- $guid = $url[1];
-
- //Ensures we've a StorySection object in the Story variable
- if (!array_key_exists('StoryChoices', $_SESSION)) {
- $smarty->assign('WAP', lang_get('ExpiredStorySession'));
- } else {
- //Gets StoryChoice (creating a dummy section to use get_choice method)
- $section = new StorySection("void");
- $section->choices = $_SESSION['StoryChoices'];
- if (!$choice = $section->get_choice($guid)) {
- $smarty->assign('WAP', lang_get('InvalidStoryGUID'));
- }
-
- //TODO: add code here to handle actions defined in choices
- //e.g. item added to inventory
-
- //Gets section
- if ($section_id = $choice->goto) {
- if (!array_key_exists($section_id, $story->sections)) {
- message_die(GENERAL_ERROR, "Choice <em>$choice->text</em> redirects to <em>$section_id</em> but this section doesn't exist.", "Story error");
- }
- return $story->sections[$section_id];
- }
- }
- }
-
- if (!$CurrentPerso->location_local) {
- //Gets start section
- return $story->get_start_section();
- }
-
- //Gets section matching perso location
- return $story->get_section_from_location($CurrentPerso->location_local);
-}
-
-//
-// Opens .xml file
-//
-
-$file = STORIES_DIR . '/' . $CurrentPerso->location_global . '.xml';
-if (!file_exists($file)) {
- message_die(GENERAL_ERROR, "If you want to write a story for this place, contact Dereckson — $file", "No story defined");
-}
-
-//
-// Gets story
-//
-
-//Loads story and tries to get the section
-require_once('includes/story/story.php');
-$story = new Story($file);
-$section = get_section($story);
-
-//Ensures we've a section
-if (!$section) {
- message_die(GENERAL_ERROR, "Nothing to do at this location. Contact Dereckson if you think it's a bug or you want to write a story here.", "Story");
-}
-
-//Performs section actions
-if ($section->location_local) {
- //Moves perso to section local location
- $CurrentPerso->move_to(null, $section->location_local);
-}
-
-//Saves section in session, for choices handling
-$_SESSION['StoryChoices'] = $section->choices;
-
-//
-// HTML output
-//
-
-//Serves header
-$smarty->assign('PAGE_TITLE', $story->title);
-include('header.php');
-
-//Serves content
-$smarty->assign("section", $section);
-$smarty->display('story.tpl');
-
-//Serves footer
-$smarty->assign('screen', "Story, section $section->id");
-include('footer.php');
-
+<?php
+
+/**
+ * Story
+ *
+ * Zed. The immensity of stars. The HyperShip. The people.
+ *
+ * (c) 2010, Dereckson, some rights reserved.
+ * Released under BSD license.
+ *
+ * This controller is a storytelling engine allowing to explore a place like
+ * in fighting fantasy gamebooks / livres dont vous êtes le héros.
+ *
+ * This controller is called by the explore controller and handles /explore URL.
+ *
+ * It uses the Story classes, the story.tpl view and content/stories/*.xml as
+ * stories content datasource.
+ *
+ * @package Zed
+ * @subpackage Controllers
+ * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
+ * @copyright 2010 Sébastien Santoro aka Dereckson
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD
+ * @version 0.1
+ * @link http://scherzo.dereckson.be/doc/zed
+ * @link http://zed.dereckson.be/
+ * @filesource
+ *
+ * @todo Create a separate release from Zed based on this controller and the Story library.
+ * @todo Add code to handle actions defined in choices like inventory management
+ */
+
+//
+// Helper method
+//
+
+/**
+ * Gets section to print to the user
+ * @param Story the story the section to get (yep, we could've global $story)
+ * @return StorySection the section, or null if not found
+ */
+function get_section ($story) {
+ global $url, $smarty, $CurrentPerso;
+
+ //If the URL contains a choice guid, use it as story progress source
+ //e.g. /explore/143f7200-766b-7b8b-e3f4-9fbfeeaeb5dd
+ if (count($url) > 1) {
+ $guid = $url[1];
+
+ //Ensures we've a StorySection object in the Story variable
+ if (!array_key_exists('StoryChoices', $_SESSION)) {
+ $smarty->assign('WAP', lang_get('ExpiredStorySession'));
+ } else {
+ //Gets StoryChoice (creating a dummy section to use get_choice method)
+ $section = new StorySection("void");
+ $section->choices = $_SESSION['StoryChoices'];
+ if (!$choice = $section->get_choice($guid)) {
+ $smarty->assign('WAP', lang_get('InvalidStoryGUID'));
+ }
+
+ //TODO: add code here to handle actions defined in choices
+ //e.g. item added to inventory
+
+ //Gets section
+ if ($section_id = $choice->goto) {
+ if (!array_key_exists($section_id, $story->sections)) {
+ message_die(GENERAL_ERROR, "Choice <em>$choice->text</em> redirects to <em>$section_id</em> but this section doesn't exist.", "Story error");
+ }
+ return $story->sections[$section_id];
+ }
+ }
+ }
+
+ if (!$CurrentPerso->location_local) {
+ //Gets start section
+ return $story->get_start_section();
+ }
+
+ //Gets section matching perso location
+ return $story->get_section_from_location($CurrentPerso->location_local);
+}
+
+//
+// Opens .xml file
+//
+
+$file = STORIES_DIR . '/' . $CurrentPerso->location_global . '.xml';
+if (!file_exists($file)) {
+ message_die(GENERAL_ERROR, "If you want to write a story for this place, contact Dereckson — $file", "No story defined");
+}
+
+//
+// Gets story
+//
+
+//Loads story and tries to get the section
+require_once('includes/story/story.php');
+$story = new Story($file);
+$section = get_section($story);
+
+//Ensures we've a section
+if (!$section) {
+ message_die(GENERAL_ERROR, "Nothing to do at this location. Contact Dereckson if you think it's a bug or you want to write a story here.", "Story");
+}
+
+//Performs section actions
+if ($section->location_local) {
+ //Moves perso to section local location
+ $CurrentPerso->move_to(null, $section->location_local);
+}
+
+//Saves section in session, for choices handling
+$_SESSION['StoryChoices'] = $section->choices;
+
+//
+// HTML output
+//
+
+//Serves header
+$smarty->assign('PAGE_TITLE', $story->title);
+include('header.php');
+
+//Serves content
+$smarty->assign("section", $section);
+$smarty->display('story.tpl');
+
+//Serves footer
+$smarty->assign('screen', "Story, section $section->id");
+include('footer.php');
+
?>
\ No newline at end of file
diff --git a/controllers/void.php b/controllers/void.php
index 958d1f4..ccb25a9 100644
--- a/controllers/void.php
+++ b/controllers/void.php
@@ -1,37 +1,37 @@
-<?php
-
-/**
- * Void content
- *
- * Zed. The immensity of stars. The HyperShip. The people.
- *
- * (c) 2010, Dereckson, some rights reserved.
- * Released under BSD license.
- *
- * This is a controller doing nothing else than call header and footer.
- *
- * @package Zed
- * @subpackage Controllers
- * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
- * @copyright 2010 Sébastien Santoro aka Dereckson
- * @license http://www.opensource.org/licenses/bsd-license.php BSD
- * @version 0.1
- * @link http://scherzo.dereckson.be/doc/zed
- * @link http://zed.dereckson.be/
- * @filesource
- */
-
-//
-// HTML output
-//
-
-//Serves header
-$smarty->assign('PAGE_TITLE', $title);
-include('header.php');
-
-//Doesn't serve any content;
-
-//Servers footer
-include('footer.php');
-
+<?php
+
+/**
+ * Void content
+ *
+ * Zed. The immensity of stars. The HyperShip. The people.
+ *
+ * (c) 2010, Dereckson, some rights reserved.
+ * Released under BSD license.
+ *
+ * This is a controller doing nothing else than call header and footer.
+ *
+ * @package Zed
+ * @subpackage Controllers
+ * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
+ * @copyright 2010 Sébastien Santoro aka Dereckson
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD
+ * @version 0.1
+ * @link http://scherzo.dereckson.be/doc/zed
+ * @link http://zed.dereckson.be/
+ * @filesource
+ */
+
+//
+// HTML output
+//
+
+//Serves header
+$smarty->assign('PAGE_TITLE', $title);
+include('header.php');
+
+//Doesn't serve any content;
+
+//Servers footer
+include('footer.php');
+
?>
\ No newline at end of file
diff --git a/css/grid.css b/css/grid.css
index dd21d4e..0c66317 100644
--- a/css/grid.css
+++ b/css/grid.css
@@ -1,491 +1,491 @@
-/*
- 960 Grid System ~ Core CSS.
- Learn more ~ http://960.gs/
-
- Licensed under GPL and MIT.
-*/
-
-/* =Containers
---------------------------------------------------------------------------------*/
-
-.container_12,
-.container_16
-{
- width: 92%;
- margin-left: 4%;
- margin-right: 4%;
-}
-
-/* =Grid >> Global
---------------------------------------------------------------------------------*/
-
-.grid_1,
-.grid_2,
-.grid_3,
-.grid_4,
-.grid_5,
-.grid_6,
-.grid_7,
-.grid_8,
-.grid_9,
-.grid_10,
-.grid_11,
-.grid_12,
-.grid_13,
-.grid_14,
-.grid_15,
-.grid_16
-{
- display: inline;
- float: left;
- margin-left: 1%;
- margin-right: 1%;
-}
-
-.container_12 .grid_3,
-.container_16 .grid_4
-{
- width: 23%;
-}
-
-.container_12 .grid_6,
-.container_16 .grid_8
-{
- width: 48%;
-}
-
-.container_12 .grid_9,
-.container_16 .grid_12
-{
- width: 73%;
-}
-
-.container_12 .grid_12,
-.container_16 .grid_16
-{
- width: 98%;
-}
-
-/* =Grid >> Children (Alpha ~ First, Omega ~ Last)
---------------------------------------------------------------------------------*/
-
-.alpha
-{
- margin-left: 0;
-}
-
-.omega
-{
- margin-right: 0;
-}
-
-/* =Grid >> 12 Columns
---------------------------------------------------------------------------------*/
-
-.container_12 .grid_1
-{
- width: 6.333%;
-}
-
-.container_12 .grid_2
-{
- width: 14.666%;
-}
-
-.container_12 .grid_4
-{
- width: 31.333%;
-}
-
-.container_12 .grid_5
-{
- width: 39.666%;
-}
-
-.container_12 .grid_7
-{
- width: 56.333%;
-}
-
-.container_12 .grid_8
-{
- width: 64.666%;
-}
-
-.container_12 .grid_10
-{
- width: 81.333%;
-}
-
-.container_12 .grid_11
-{
- width: 89.666%;
-}
-
-/* =Grid >> 16 Columns
---------------------------------------------------------------------------------*/
-
-.container_16 .grid_1
-{
- width: 4.25%;
-}
-
-.container_16 .grid_2
-{
- width: 10.5%;
-}
-
-.container_16 .grid_3
-{
- width: 16.75%;
-}
-
-.container_16 .grid_5
-{
- width: 29.25%;
-}
-
-.container_16 .grid_6
-{
- width: 35.5%;
-}
-
-.container_16 .grid_7
-{
- width: 41.75%;
-}
-
-.container_16 .grid_9
-{
- width: 54.25%;
-}
-
-.container_16 .grid_10
-{
- width: 60.5%;
-}
-
-.container_16 .grid_11
-{
- width: 66.75%;
-}
-
-.container_16 .grid_13
-{
- width: 79.25%;
-}
-
-.container_16 .grid_14
-{
- width: 85.5%;
-}
-
-.container_16 .grid_15
-{
- width: 91.75%;
-}
-
-/* =Prefix Extra Space >> Global
---------------------------------------------------------------------------------*/
-
-.container_12 .prefix_3,
-.container_16 .prefix_4
-{
- padding-left: 25%;
-}
-
-.container_12 .prefix_6,
-.container_16 .prefix_8
-{
- padding-left: 50%;
-}
-
-.container_12 .prefix_9,
-.container_16 .prefix_12
-{
- padding-left: 75%;
-}
-
-/* =Prefix Extra Space >> 12 Columns
---------------------------------------------------------------------------------*/
-
-.container_12 .prefix_1
-{
- padding-left: 8.333%;
-}
-
-.container_12 .prefix_2
-{
- padding-left: 16.666%;
-}
-
-.container_12 .prefix_4
-{
- padding-left: 33.333%;
-}
-
-.container_12 .prefix_5
-{
- padding-left: 41.666%;
-}
-
-.container_12 .prefix_7
-{
- padding-left: 58.333%;
-}
-
-.container_12 .prefix_8
-{
- padding-left: 66.666%;
-}
-
-.container_12 .prefix_10
-{
- padding-left: 83.333%;
-}
-
-.container_12 .prefix_11
-{
- padding-left: 91.666%;
-}
-
-/* =Prefix Extra Space >> 16 Columns
---------------------------------------------------------------------------------*/
-
-.container_16 .prefix_1
-{
- padding-left: 6.25%;
-}
-
-.container_16 .prefix_2
-{
- padding-left: 12.5%;
-}
-
-.container_16 .prefix_3
-{
- padding-left: 18.75%;
-}
-
-.container_16 .prefix_5
-{
- padding-left: 31.25%;
-}
-
-.container_16 .prefix_6
-{
- padding-left: 37.5%;
-}
-
-.container_16 .prefix_7
-{
- padding-left: 43.75%;
-}
-
-.container_16 .prefix_9
-{
- padding-left: 56.25%;
-}
-
-.container_16 .prefix_10
-{
- padding-left: 62.5%;
-}
-
-.container_16 .prefix_11
-{
- padding-left: 68.75%;
-}
-
-.container_16 .prefix_13
-{
- padding-left: 81.25%;
-}
-
-.container_16 .prefix_14
-{
- padding-left: 87.5%;
-}
-
-.container_16 .prefix_15
-{
- padding-left: 93.75%;
-}
-
-/* =Suffix Extra Space >> Global
---------------------------------------------------------------------------------*/
-
-.container_12 .suffix_3,
-.container_16 .suffix_4
-{
- padding-right: 25%;
-}
-
-.container_12 .suffix_6,
-.container_16 .suffix_8
-{
- padding-right: 50%;
-}
-
-.container_12 .suffix_9,
-.container_16 .suffix_12
-{
- padding-right: 75%;
-}
-
-/* =Suffix Extra Space >> 12 Columns
---------------------------------------------------------------------------------*/
-
-.container_12 .suffix_1
-{
- padding-right: 8.333%;
-}
-
-.container_12 .suffix_2
-{
- padding-right: 16.666%;
-}
-
-.container_12 .suffix_4
-{
- padding-right: 33.333%;
-}
-
-.container_12 .suffix_5
-{
- padding-right: 41.666%;
-}
-
-.container_12 .suffix_7
-{
- padding-right: 58.333%;
-}
-
-.container_12 .suffix_8
-{
- padding-right: 66.666%;
-}
-
-.container_12 .suffix_10
-{
- padding-right: 83.333%;
-}
-
-.container_12 .suffix_11
-{
- padding-right: 91.666%;
-}
-
-/* =Suffix Extra Space >> 16 Columns
---------------------------------------------------------------------------------*/
-
-.container_16 .suffix_1
-{
- padding-right: 6.25%;
-}
-
-.container_16 .suffix_2
-{
- padding-right: 16.5%;
-}
-
-.container_16 .suffix_3
-{
- padding-right: 18.75%;
-}
-
-.container_16 .suffix_5
-{
- padding-right: 31.25%;
-}
-
-.container_16 .suffix_6
-{
- padding-right: 37.5%;
-}
-
-.container_16 .suffix_7
-{
- padding-right: 43.75%;
-}
-
-.container_16 .suffix_9
-{
- padding-right: 56.25%;
-}
-
-.container_16 .suffix_10
-{
- padding-right: 62.5%;
-}
-
-.container_16 .suffix_11
-{
- padding-right: 68.75%;
-}
-
-.container_16 .suffix_13
-{
- padding-right: 81.25%;
-}
-
-.container_16 .suffix_14
-{
- padding-right: 87.5%;
-}
-
-.container_16 .suffix_15
-{
- padding-right: 93.75%;
-}
-
-/* =Clear Floated Elements
---------------------------------------------------------------------------------*/
-
-/* http://sonspring.com/journal/clearing-floats */
-
-html body * span.clear,
-html body * div.clear,
-html body * li.clear,
-html body * dd.clear
-{
- background: none;
- border: 0;
- clear: both;
- display: block;
- float: none;
- font-size: 0;
- list-style: none;
- margin: 0;
- padding: 0;
- overflow: hidden;
- visibility: hidden;
- width: 0;
- height: 0;
-}
-
-/* http://www.positioniseverything.net/easyclearing.html */
-
-.clearfix:after
-{
- clear: both;
- content: '.';
- display: block;
- visibility: hidden;
- height: 0;
-}
-
-.clearfix
-{
- display: inline-block;
-}
-
-* html .clearfix
-{
- height: 1%;
-}
-
-.clearfix
-{
- display: block;
+/*
+ 960 Grid System ~ Core CSS.
+ Learn more ~ http://960.gs/
+
+ Licensed under GPL and MIT.
+*/
+
+/* =Containers
+--------------------------------------------------------------------------------*/
+
+.container_12,
+.container_16
+{
+ width: 92%;
+ margin-left: 4%;
+ margin-right: 4%;
+}
+
+/* =Grid >> Global
+--------------------------------------------------------------------------------*/
+
+.grid_1,
+.grid_2,
+.grid_3,
+.grid_4,
+.grid_5,
+.grid_6,
+.grid_7,
+.grid_8,
+.grid_9,
+.grid_10,
+.grid_11,
+.grid_12,
+.grid_13,
+.grid_14,
+.grid_15,
+.grid_16
+{
+ display: inline;
+ float: left;
+ margin-left: 1%;
+ margin-right: 1%;
+}
+
+.container_12 .grid_3,
+.container_16 .grid_4
+{
+ width: 23%;
+}
+
+.container_12 .grid_6,
+.container_16 .grid_8
+{
+ width: 48%;
+}
+
+.container_12 .grid_9,
+.container_16 .grid_12
+{
+ width: 73%;
+}
+
+.container_12 .grid_12,
+.container_16 .grid_16
+{
+ width: 98%;
+}
+
+/* =Grid >> Children (Alpha ~ First, Omega ~ Last)
+--------------------------------------------------------------------------------*/
+
+.alpha
+{
+ margin-left: 0;
+}
+
+.omega
+{
+ margin-right: 0;
+}
+
+/* =Grid >> 12 Columns
+--------------------------------------------------------------------------------*/
+
+.container_12 .grid_1
+{
+ width: 6.333%;
+}
+
+.container_12 .grid_2
+{
+ width: 14.666%;
+}
+
+.container_12 .grid_4
+{
+ width: 31.333%;
+}
+
+.container_12 .grid_5
+{
+ width: 39.666%;
+}
+
+.container_12 .grid_7
+{
+ width: 56.333%;
+}
+
+.container_12 .grid_8
+{
+ width: 64.666%;
+}
+
+.container_12 .grid_10
+{
+ width: 81.333%;
+}
+
+.container_12 .grid_11
+{
+ width: 89.666%;
+}
+
+/* =Grid >> 16 Columns
+--------------------------------------------------------------------------------*/
+
+.container_16 .grid_1
+{
+ width: 4.25%;
+}
+
+.container_16 .grid_2
+{
+ width: 10.5%;
+}
+
+.container_16 .grid_3
+{
+ width: 16.75%;
+}
+
+.container_16 .grid_5
+{
+ width: 29.25%;
+}
+
+.container_16 .grid_6
+{
+ width: 35.5%;
+}
+
+.container_16 .grid_7
+{
+ width: 41.75%;
+}
+
+.container_16 .grid_9
+{
+ width: 54.25%;
+}
+
+.container_16 .grid_10
+{
+ width: 60.5%;
+}
+
+.container_16 .grid_11
+{
+ width: 66.75%;
+}
+
+.container_16 .grid_13
+{
+ width: 79.25%;
+}
+
+.container_16 .grid_14
+{
+ width: 85.5%;
+}
+
+.container_16 .grid_15
+{
+ width: 91.75%;
+}
+
+/* =Prefix Extra Space >> Global
+--------------------------------------------------------------------------------*/
+
+.container_12 .prefix_3,
+.container_16 .prefix_4
+{
+ padding-left: 25%;
+}
+
+.container_12 .prefix_6,
+.container_16 .prefix_8
+{
+ padding-left: 50%;
+}
+
+.container_12 .prefix_9,
+.container_16 .prefix_12
+{
+ padding-left: 75%;
+}
+
+/* =Prefix Extra Space >> 12 Columns
+--------------------------------------------------------------------------------*/
+
+.container_12 .prefix_1
+{
+ padding-left: 8.333%;
+}
+
+.container_12 .prefix_2
+{
+ padding-left: 16.666%;
+}
+
+.container_12 .prefix_4
+{
+ padding-left: 33.333%;
+}
+
+.container_12 .prefix_5
+{
+ padding-left: 41.666%;
+}
+
+.container_12 .prefix_7
+{
+ padding-left: 58.333%;
+}
+
+.container_12 .prefix_8
+{
+ padding-left: 66.666%;
+}
+
+.container_12 .prefix_10
+{
+ padding-left: 83.333%;
+}
+
+.container_12 .prefix_11
+{
+ padding-left: 91.666%;
+}
+
+/* =Prefix Extra Space >> 16 Columns
+--------------------------------------------------------------------------------*/
+
+.container_16 .prefix_1
+{
+ padding-left: 6.25%;
+}
+
+.container_16 .prefix_2
+{
+ padding-left: 12.5%;
+}
+
+.container_16 .prefix_3
+{
+ padding-left: 18.75%;
+}
+
+.container_16 .prefix_5
+{
+ padding-left: 31.25%;
+}
+
+.container_16 .prefix_6
+{
+ padding-left: 37.5%;
+}
+
+.container_16 .prefix_7
+{
+ padding-left: 43.75%;
+}
+
+.container_16 .prefix_9
+{
+ padding-left: 56.25%;
+}
+
+.container_16 .prefix_10
+{
+ padding-left: 62.5%;
+}
+
+.container_16 .prefix_11
+{
+ padding-left: 68.75%;
+}
+
+.container_16 .prefix_13
+{
+ padding-left: 81.25%;
+}
+
+.container_16 .prefix_14
+{
+ padding-left: 87.5%;
+}
+
+.container_16 .prefix_15
+{
+ padding-left: 93.75%;
+}
+
+/* =Suffix Extra Space >> Global
+--------------------------------------------------------------------------------*/
+
+.container_12 .suffix_3,
+.container_16 .suffix_4
+{
+ padding-right: 25%;
+}
+
+.container_12 .suffix_6,
+.container_16 .suffix_8
+{
+ padding-right: 50%;
+}
+
+.container_12 .suffix_9,
+.container_16 .suffix_12
+{
+ padding-right: 75%;
+}
+
+/* =Suffix Extra Space >> 12 Columns
+--------------------------------------------------------------------------------*/
+
+.container_12 .suffix_1
+{
+ padding-right: 8.333%;
+}
+
+.container_12 .suffix_2
+{
+ padding-right: 16.666%;
+}
+
+.container_12 .suffix_4
+{
+ padding-right: 33.333%;
+}
+
+.container_12 .suffix_5
+{
+ padding-right: 41.666%;
+}
+
+.container_12 .suffix_7
+{
+ padding-right: 58.333%;
+}
+
+.container_12 .suffix_8
+{
+ padding-right: 66.666%;
+}
+
+.container_12 .suffix_10
+{
+ padding-right: 83.333%;
+}
+
+.container_12 .suffix_11
+{
+ padding-right: 91.666%;
+}
+
+/* =Suffix Extra Space >> 16 Columns
+--------------------------------------------------------------------------------*/
+
+.container_16 .suffix_1
+{
+ padding-right: 6.25%;
+}
+
+.container_16 .suffix_2
+{
+ padding-right: 16.5%;
+}
+
+.container_16 .suffix_3
+{
+ padding-right: 18.75%;
+}
+
+.container_16 .suffix_5
+{
+ padding-right: 31.25%;
+}
+
+.container_16 .suffix_6
+{
+ padding-right: 37.5%;
+}
+
+.container_16 .suffix_7
+{
+ padding-right: 43.75%;
+}
+
+.container_16 .suffix_9
+{
+ padding-right: 56.25%;
+}
+
+.container_16 .suffix_10
+{
+ padding-right: 62.5%;
+}
+
+.container_16 .suffix_11
+{
+ padding-right: 68.75%;
+}
+
+.container_16 .suffix_13
+{
+ padding-right: 81.25%;
+}
+
+.container_16 .suffix_14
+{
+ padding-right: 87.5%;
+}
+
+.container_16 .suffix_15
+{
+ padding-right: 93.75%;
+}
+
+/* =Clear Floated Elements
+--------------------------------------------------------------------------------*/
+
+/* http://sonspring.com/journal/clearing-floats */
+
+html body * span.clear,
+html body * div.clear,
+html body * li.clear,
+html body * dd.clear
+{
+ background: none;
+ border: 0;
+ clear: both;
+ display: block;
+ float: none;
+ font-size: 0;
+ list-style: none;
+ margin: 0;
+ padding: 0;
+ overflow: hidden;
+ visibility: hidden;
+ width: 0;
+ height: 0;
+}
+
+/* http://www.positioniseverything.net/easyclearing.html */
+
+.clearfix:after
+{
+ clear: both;
+ content: '.';
+ display: block;
+ visibility: hidden;
+ height: 0;
+}
+
+.clearfix
+{
+ display: inline-block;
+}
+
+* html .clearfix
+{
+ height: 1%;
+}
+
+.clearfix
+{
+ display: block;
}
\ No newline at end of file
diff --git a/css/ie.css b/css/ie.css
index 7fe61ff..df7c813 100644
--- a/css/ie.css
+++ b/css/ie.css
@@ -1,31 +1,31 @@
-/*
- Fluid 960 Grid System - IE Fixes (IE7 and greater)
- Learn more ~ http://www.designinfluences.com/
-
- Licensed under GPL and MIT.
-*/
-
-/* =Grid >> Global
---------------------------------------------------------------------------------*/
-
-.grid_1,
-.grid_2,
-.grid_3,
-.grid_4,
-.grid_5,
-.grid_6,
-.grid_7,
-.grid_8,
-.grid_9,
-.grid_10,
-.grid_11,
-.grid_12,
-.grid_13,
-.grid_14,
-.grid_15,
-.grid_16
-{
- margin-left: .92%;
- margin-right: .92%;
-}
-
+/*
+ Fluid 960 Grid System - IE Fixes (IE7 and greater)
+ Learn more ~ http://www.designinfluences.com/
+
+ Licensed under GPL and MIT.
+*/
+
+/* =Grid >> Global
+--------------------------------------------------------------------------------*/
+
+.grid_1,
+.grid_2,
+.grid_3,
+.grid_4,
+.grid_5,
+.grid_6,
+.grid_7,
+.grid_8,
+.grid_9,
+.grid_10,
+.grid_11,
+.grid_12,
+.grid_13,
+.grid_14,
+.grid_15,
+.grid_16
+{
+ margin-left: .92%;
+ margin-right: .92%;
+}
+
diff --git a/css/ie6.css b/css/ie6.css
index b1ff5b5..aa6eb13 100644
--- a/css/ie6.css
+++ b/css/ie6.css
@@ -1,31 +1,31 @@
-/*
- Fluid 960 Grid System - IE6 Fixes
- Learn more ~ http://www.designinfluences.com/
-
- Licensed under GPL and MIT.
-*/
-
-/* =Grid >> Global
---------------------------------------------------------------------------------*/
-
-.grid_1,
-.grid_2,
-.grid_3,
-.grid_4,
-.grid_5,
-.grid_6,
-.grid_7,
-.grid_8,
-.grid_9,
-.grid_10,
-.grid_11,
-.grid_12,
-.grid_13,
-.grid_14,
-.grid_15,
-.grid_16
-{
- margin-left: .8%;
- margin-right: .8%;
-}
-
+/*
+ Fluid 960 Grid System - IE6 Fixes
+ Learn more ~ http://www.designinfluences.com/
+
+ Licensed under GPL and MIT.
+*/
+
+/* =Grid >> Global
+--------------------------------------------------------------------------------*/
+
+.grid_1,
+.grid_2,
+.grid_3,
+.grid_4,
+.grid_5,
+.grid_6,
+.grid_7,
+.grid_8,
+.grid_9,
+.grid_10,
+.grid_11,
+.grid_12,
+.grid_13,
+.grid_14,
+.grid_15,
+.grid_16
+{
+ margin-left: .8%;
+ margin-right: .8%;
+}
+
diff --git a/css/layout.css b/css/layout.css
index cba4989..0f71542 100644
--- a/css/layout.css
+++ b/css/layout.css
@@ -1,523 +1,523 @@
-/*
------------------------------------------------
-Grey Box Method - Layout CSS
------------------------------------------------ */
-
-body {
- background: #eee;
- border-top: 5px solid #000;
- color: #333;
- font-size: 11px;
- padding: 0 0 40px;
-}
-
-
-/* anchors
------------------------------------------------ */
-a {
- color: #000;
- font-weight:bold;
- text-decoration: none;
-}
-a:hover {
- color:#333;
-}
-
-
-/* 960 grid system container background
------------------------------------------------ */
-.container_12,
-.container_16 {
- background:#fff;
-}
-
-
-/* headings
------------------------------------------------ */
-h1, h2, h3, h4, h5, h6 {line-height:1.2em; margin-bottom:.3em;}
-h2 {margin-top:1em;}
-h5 {font-size:1.2em;}
-h6 {font-size:1em; text-transform:uppercase;}
-
-
-h1 a {
- font-weight:normal;
-}
-
-
-/* branding
------------------------------------------------ */
-h1#branding {
- font-weight:normal;
- font-size:3em;
- text-align:left;
- background:#aaa;
- padding:.7em 1em;
- margin-bottom:0;
-}
-
-
-/* page heading
------------------------------------------------ */
-h2#page-heading {
- font-weight:normal;
- padding:.5em;
- margin:0 0 10px 0;
- border-bottom:1px solid #ccc;
-}
-
-
-/* boxes
------------------------------------------------ */
-.box {
- background:#ddd;
- margin-bottom:20px;
- padding:10px 10px 1px 10px;
-}
-.box h2 {
- font-size:1em;
- font-weight:normal;
- text-transform:uppercase;
- color:#fff;
- background:#333;
- margin:-10px -10px 0 -10px;
- padding:6px 12px;
-}
-.box h2 a,
-.box h2 a.visible {
- color:#fff;
- background:#333 url("../img/switch_minus.gif") 97% 50% no-repeat;
- display:block;
- padding:6px 12px;
- margin:-6px -12px;
- border:none;
-}
-.grid_4 .box h2 a {
- background-position: 97% 50%;
-}
-.grid_5 .box h2 a {
- background-position: 98% 50%;
-}
-.grid_12 .box h2 a {
- background-position: 99% 50%;
-}
-
-
-.box h2 a.hidden,
-.box h2 a.hidden:hover {
- background-image: url("../img/switch_plus.gif");
-}
-.box h2 a:hover {
- background-color:#111;
-}
-.block {
- padding-top:10px;
-}
-div.menu {
- padding:0;
-}
-div.menu h2 {
- margin:0;
-}
-div.menu .block {
- padding-top:0;
-}
-
-
-/* paragraphs, quotes and lists
------------------------------------------------ */
-p {
- margin-bottom:1em;
-}
-blockquote {
- font-family: Georgia, 'Times New Roman', serif;
- font-size:1.2em;
- padding-left:1em;
- border-left:4px solid #ccc;
-}
-blockquote cite {
- font-size:.9em;
-}
-ul, ol {
- padding-top:0;
-}
-
-
-/* menus
------------------------------------------------ */
-ul.menu {
- list-style:none;
- border-top:1px solid #bbb;
-}
-ul.menu li {
- margin:0;
-}
-ul.menu li a {
- display:block;
- padding:4px 10px;
- border-bottom:1px solid #ccc;
-}
-ul.menu li a:hover {
- background:#eee;
-}
-ul.menu li a:active {
- background:#ccc;
-}
-
-
-/* submenus
------------------------------------------------ */
-ul.menu ul {
- list-style:none;
- margin:0;
-}
-ul.menu ul li a {
- padding-left:30px;
-}
-
-
-/* section menus
------------------------------------------------ */
-ul.section {
- border-top:0;
- margin-bottom:0;
-}
-ul.section li {
- text-transform:uppercase;
-}
-ul.section li a {
- background:#bbb;
-}
-ul.section li a:hover {
- background:#aaa;
-}
-ul.section li a:active {
- color:#fff;
- background:#666;
-}
-ul.section li li a {
- background:#ddd;
- border-bottom:1px solid #eee;
-}
-ul.section li li a:hover {
- background:#ccc;
-}
-ul.section li li a:active {
- color:#000;
- background:#fff;
-}
-ul.section ul li {
- text-transform:none;
-}
-ul.section ul.current li a {
- background:#eee;
- border-bottom:1px solid #fff;
-}
-ul.section ul.current li a:hover {
- background:#ddd;
-}
-ul.section ul.current li a:active {
- background:#fff;
-}
-ul.section li a.current {
- color:#fff;
- background:#666;
-}
-ul.section li a.current:hover {
- background:#555;
-}
-ul.section li a.current:active {
- background:#444;
-}
-ul.section li a.active {
- background:#fff;
- cursor:default;
-}
-ul.section li.current > a.active,
-ul.section li.current > a.active:hover {
- color:#fff;
- background:#666;
- cursor:default;
-}
-
-
-/* table
------------------------------------------------ */
-table {
- width:100%;
- border:1px solid #bbb;
- margin-bottom:10px;
-}
-col.colC {
- width:8em;
-}
-th, td {
- padding:.2em 1em;
- text-align:left;
-}
-thead th {
- border-bottom:2px solid #888;
- background:#bbb;
- padding:.4em 1em .2em;
-}
-thead th.table-head {
- font-size:1em;
- font-weight:normal;
- text-transform:uppercase;
- color:#fff;
- background:#555;
- border:1px solid #555;
-}
-tbody th,
-tbody td {
- border-top:1px solid #bbb;
- border-bottom:1px solid #bbb;
- background:#eee;
-}
-tbody tr.odd th,
-tbody tr.odd td {
- background:#fff;
-}
-tfoot th,
-tfoot td {
- border-top:2px solid #666;
- background:#eee;
-}
-tfoot tr.total th,
-tfoot tr.total td {
- border-top:6px double #666;
-}
-tfoot tr.total th {
- text-transform:uppercase;
-}
-th.currency,
-td.currency {
- text-align:right;
-}
-
-
-/* forms
------------------------------------------------ */
-form {
- overflow:hidden;
-}
-fieldset {
- border:1px solid #bbb;
- padding:10px;
- position:relative;
- background:#e9e9e9;
- margin-bottom:10px;
-}
-legend {
- font-size:1.1em;
- padding:.4em .8em;
- background:#fff;
- border:1px solid #bbb;
-}
-fieldset.login p {
- margin-bottom:1em;
- margin-top:0pt;
-}
-fieldset p label {
- width:98%;
-}
-fieldset p input {
- width:98%;
-}
-fieldset p select {
- width:99%;
-}
-fieldset.login p label {
- float:left;
- line-height:2em;
- margin-right:3%;
- text-align:right;
- width:32%;
-}
-fieldset.login p input {
- width:60%;
-}
-fieldset.login input.button {
- margin-left:35%;
-}
-form p.notice {
- font-weight:bold;
-}
-input.search.text {
- width:66%;
-}
-input.search.button {
- width:28%;
- margin-left:2%;
-}
-
-
-/* articles
------------------------------------------------ */
-.articles {
- padding:0;
-}
-.articles h2 {
- margin:0;
-}
-#articles {
- padding-top:0;
-}
-.article {
- border-top:1px solid #666;
- padding-top:.5em;
-}
-.box .article {
- border-top:3px solid #fff;
- padding:13px 10px 0 10px;
-}
-.article h2 {
- font-size:2em;
- font-weight:normal;
- text-transform:none;
- color:#333;
- background:transparent;
- padding:0;
- margin:0;
- border:none;
-}
-.article h3 {
- margin-bottom:.2em;
- font-size:1.6em;
-}
-.box .first {
- border-top:none;
-}
-.article h4 {
- font-size:1.2em;
- text-transform:uppercase;
- margin-bottom:.5em;
-}
-.article a.image {
- float:left;
- margin:3px 10px 3px 0;
- padding:4px;
- border:1px solid #bbb;
- background:#fff;
-}
-.article a.image:hover {
- border:1px solid #666;
-}
-.article a.image img {
- float:left;
-}
-.article p.meta {
- color:#666;
- border-top:1px dotted #999;
- border-bottom:1px dotted #999;
- padding:.3em 0;
- margin-bottom:.8em;
-}
-
-
-/* site information
------------------------------------------------ */
-#site_info .box {
- color:#ccc;
- background:#666;
- margin-bottom:10px;
-}
-#site_info a {
- color:#fff;
-}
-#site_info a:hover {
- color:#000;
-}
-
-
-/* AJAX sliding shelf
------------------------------------------------ */
-#loading {float:right; margin-right:14px; margin-top:-2px;}
-.block {padding-bottom:1px;}
-
-
-/* Accordian
------------------------------------------------ */
-.toggler {
- color: #222;
- margin: 0;
- padding: 2px 5px;
- background: #eee;
- border-bottom: 1px solid #ddd;
- border-right: 1px solid #ddd;
- border-top: 1px solid #f5f5f5;
- border-left: 1px solid #f5f5f5;
- font-size:1.1em;
- font-weight: normal;
-}
-.element h4 {
- margin: 0;
- padding:4px;
- line-height:1.2em;
-}
-.element p {
- margin: 0;
- padding: 4px;
-}
-.float-right {
- padding:10px 20px;
- float:right;
-}
-
-#accordian-block {
- padding-bottom:10px;
-}
-
-
-/* Mootools Kwicks
------------------------------------------------ */
-#kwick-box {
- padding:0;
- overflow:hidden;
-}
-#kwick-box h2 {
- margin:0;
-}
-#kwick {
- position: relative;
-}
-#kwick .kwicks {
- display: block;
- background: #999;
- height: 470px;
- list-style:none;
- margin:0;
- overflow:hidden;
-}
-#kwick li {
- float: left;
- margin:0;
- padding:0;
-}
-#kwick .kwick {
- display: block;
- cursor: pointer;
- overflow: hidden;
- height: 470px;
- width: 215px;
- padding: 10px;
- background: #fff;
-}
-#kwick .kwick span {
- color:#fff;
-}
-#kwick .one {
- background: #666;
- background-image: url(../img/tour/What.jpg);
-}
-#kwick .two {
- background: #777;
-}
-#kwick .three {
- background: #888;
-
-}
-#kwick .four {
- background: #999;
- background-image: url(../img/tour/Where.jpg);
-}
+/*
+-----------------------------------------------
+Grey Box Method - Layout CSS
+----------------------------------------------- */
+
+body {
+ background: #eee;
+ border-top: 5px solid #000;
+ color: #333;
+ font-size: 11px;
+ padding: 0 0 40px;
+}
+
+
+/* anchors
+----------------------------------------------- */
+a {
+ color: #000;
+ font-weight:bold;
+ text-decoration: none;
+}
+a:hover {
+ color:#333;
+}
+
+
+/* 960 grid system container background
+----------------------------------------------- */
+.container_12,
+.container_16 {
+ background:#fff;
+}
+
+
+/* headings
+----------------------------------------------- */
+h1, h2, h3, h4, h5, h6 {line-height:1.2em; margin-bottom:.3em;}
+h2 {margin-top:1em;}
+h5 {font-size:1.2em;}
+h6 {font-size:1em; text-transform:uppercase;}
+
+
+h1 a {
+ font-weight:normal;
+}
+
+
+/* branding
+----------------------------------------------- */
+h1#branding {
+ font-weight:normal;
+ font-size:3em;
+ text-align:left;
+ background:#aaa;
+ padding:.7em 1em;
+ margin-bottom:0;
+}
+
+
+/* page heading
+----------------------------------------------- */
+h2#page-heading {
+ font-weight:normal;
+ padding:.5em;
+ margin:0 0 10px 0;
+ border-bottom:1px solid #ccc;
+}
+
+
+/* boxes
+----------------------------------------------- */
+.box {
+ background:#ddd;
+ margin-bottom:20px;
+ padding:10px 10px 1px 10px;
+}
+.box h2 {
+ font-size:1em;
+ font-weight:normal;
+ text-transform:uppercase;
+ color:#fff;
+ background:#333;
+ margin:-10px -10px 0 -10px;
+ padding:6px 12px;
+}
+.box h2 a,
+.box h2 a.visible {
+ color:#fff;
+ background:#333 url("../img/switch_minus.gif") 97% 50% no-repeat;
+ display:block;
+ padding:6px 12px;
+ margin:-6px -12px;
+ border:none;
+}
+.grid_4 .box h2 a {
+ background-position: 97% 50%;
+}
+.grid_5 .box h2 a {
+ background-position: 98% 50%;
+}
+.grid_12 .box h2 a {
+ background-position: 99% 50%;
+}
+
+
+.box h2 a.hidden,
+.box h2 a.hidden:hover {
+ background-image: url("../img/switch_plus.gif");
+}
+.box h2 a:hover {
+ background-color:#111;
+}
+.block {
+ padding-top:10px;
+}
+div.menu {
+ padding:0;
+}
+div.menu h2 {
+ margin:0;
+}
+div.menu .block {
+ padding-top:0;
+}
+
+
+/* paragraphs, quotes and lists
+----------------------------------------------- */
+p {
+ margin-bottom:1em;
+}
+blockquote {
+ font-family: Georgia, 'Times New Roman', serif;
+ font-size:1.2em;
+ padding-left:1em;
+ border-left:4px solid #ccc;
+}
+blockquote cite {
+ font-size:.9em;
+}
+ul, ol {
+ padding-top:0;
+}
+
+
+/* menus
+----------------------------------------------- */
+ul.menu {
+ list-style:none;
+ border-top:1px solid #bbb;
+}
+ul.menu li {
+ margin:0;
+}
+ul.menu li a {
+ display:block;
+ padding:4px 10px;
+ border-bottom:1px solid #ccc;
+}
+ul.menu li a:hover {
+ background:#eee;
+}
+ul.menu li a:active {
+ background:#ccc;
+}
+
+
+/* submenus
+----------------------------------------------- */
+ul.menu ul {
+ list-style:none;
+ margin:0;
+}
+ul.menu ul li a {
+ padding-left:30px;
+}
+
+
+/* section menus
+----------------------------------------------- */
+ul.section {
+ border-top:0;
+ margin-bottom:0;
+}
+ul.section li {
+ text-transform:uppercase;
+}
+ul.section li a {
+ background:#bbb;
+}
+ul.section li a:hover {
+ background:#aaa;
+}
+ul.section li a:active {
+ color:#fff;
+ background:#666;
+}
+ul.section li li a {
+ background:#ddd;
+ border-bottom:1px solid #eee;
+}
+ul.section li li a:hover {
+ background:#ccc;
+}
+ul.section li li a:active {
+ color:#000;
+ background:#fff;
+}
+ul.section ul li {
+ text-transform:none;
+}
+ul.section ul.current li a {
+ background:#eee;
+ border-bottom:1px solid #fff;
+}
+ul.section ul.current li a:hover {
+ background:#ddd;
+}
+ul.section ul.current li a:active {
+ background:#fff;
+}
+ul.section li a.current {
+ color:#fff;
+ background:#666;
+}
+ul.section li a.current:hover {
+ background:#555;
+}
+ul.section li a.current:active {
+ background:#444;
+}
+ul.section li a.active {
+ background:#fff;
+ cursor:default;
+}
+ul.section li.current > a.active,
+ul.section li.current > a.active:hover {
+ color:#fff;
+ background:#666;
+ cursor:default;
+}
+
+
+/* table
+----------------------------------------------- */
+table {
+ width:100%;
+ border:1px solid #bbb;
+ margin-bottom:10px;
+}
+col.colC {
+ width:8em;
+}
+th, td {
+ padding:.2em 1em;
+ text-align:left;
+}
+thead th {
+ border-bottom:2px solid #888;
+ background:#bbb;
+ padding:.4em 1em .2em;
+}
+thead th.table-head {
+ font-size:1em;
+ font-weight:normal;
+ text-transform:uppercase;
+ color:#fff;
+ background:#555;
+ border:1px solid #555;
+}
+tbody th,
+tbody td {
+ border-top:1px solid #bbb;
+ border-bottom:1px solid #bbb;
+ background:#eee;
+}
+tbody tr.odd th,
+tbody tr.odd td {
+ background:#fff;
+}
+tfoot th,
+tfoot td {
+ border-top:2px solid #666;
+ background:#eee;
+}
+tfoot tr.total th,
+tfoot tr.total td {
+ border-top:6px double #666;
+}
+tfoot tr.total th {
+ text-transform:uppercase;
+}
+th.currency,
+td.currency {
+ text-align:right;
+}
+
+
+/* forms
+----------------------------------------------- */
+form {
+ overflow:hidden;
+}
+fieldset {
+ border:1px solid #bbb;
+ padding:10px;
+ position:relative;
+ background:#e9e9e9;
+ margin-bottom:10px;
+}
+legend {
+ font-size:1.1em;
+ padding:.4em .8em;
+ background:#fff;
+ border:1px solid #bbb;
+}
+fieldset.login p {
+ margin-bottom:1em;
+ margin-top:0pt;
+}
+fieldset p label {
+ width:98%;
+}
+fieldset p input {
+ width:98%;
+}
+fieldset p select {
+ width:99%;
+}
+fieldset.login p label {
+ float:left;
+ line-height:2em;
+ margin-right:3%;
+ text-align:right;
+ width:32%;
+}
+fieldset.login p input {
+ width:60%;
+}
+fieldset.login input.button {
+ margin-left:35%;
+}
+form p.notice {
+ font-weight:bold;
+}
+input.search.text {
+ width:66%;
+}
+input.search.button {
+ width:28%;
+ margin-left:2%;
+}
+
+
+/* articles
+----------------------------------------------- */
+.articles {
+ padding:0;
+}
+.articles h2 {
+ margin:0;
+}
+#articles {
+ padding-top:0;
+}
+.article {
+ border-top:1px solid #666;
+ padding-top:.5em;
+}
+.box .article {
+ border-top:3px solid #fff;
+ padding:13px 10px 0 10px;
+}
+.article h2 {
+ font-size:2em;
+ font-weight:normal;
+ text-transform:none;
+ color:#333;
+ background:transparent;
+ padding:0;
+ margin:0;
+ border:none;
+}
+.article h3 {
+ margin-bottom:.2em;
+ font-size:1.6em;
+}
+.box .first {
+ border-top:none;
+}
+.article h4 {
+ font-size:1.2em;
+ text-transform:uppercase;
+ margin-bottom:.5em;
+}
+.article a.image {
+ float:left;
+ margin:3px 10px 3px 0;
+ padding:4px;
+ border:1px solid #bbb;
+ background:#fff;
+}
+.article a.image:hover {
+ border:1px solid #666;
+}
+.article a.image img {
+ float:left;
+}
+.article p.meta {
+ color:#666;
+ border-top:1px dotted #999;
+ border-bottom:1px dotted #999;
+ padding:.3em 0;
+ margin-bottom:.8em;
+}
+
+
+/* site information
+----------------------------------------------- */
+#site_info .box {
+ color:#ccc;
+ background:#666;
+ margin-bottom:10px;
+}
+#site_info a {
+ color:#fff;
+}
+#site_info a:hover {
+ color:#000;
+}
+
+
+/* AJAX sliding shelf
+----------------------------------------------- */
+#loading {float:right; margin-right:14px; margin-top:-2px;}
+.block {padding-bottom:1px;}
+
+
+/* Accordian
+----------------------------------------------- */
+.toggler {
+ color: #222;
+ margin: 0;
+ padding: 2px 5px;
+ background: #eee;
+ border-bottom: 1px solid #ddd;
+ border-right: 1px solid #ddd;
+ border-top: 1px solid #f5f5f5;
+ border-left: 1px solid #f5f5f5;
+ font-size:1.1em;
+ font-weight: normal;
+}
+.element h4 {
+ margin: 0;
+ padding:4px;
+ line-height:1.2em;
+}
+.element p {
+ margin: 0;
+ padding: 4px;
+}
+.float-right {
+ padding:10px 20px;
+ float:right;
+}
+
+#accordian-block {
+ padding-bottom:10px;
+}
+
+
+/* Mootools Kwicks
+----------------------------------------------- */
+#kwick-box {
+ padding:0;
+ overflow:hidden;
+}
+#kwick-box h2 {
+ margin:0;
+}
+#kwick {
+ position: relative;
+}
+#kwick .kwicks {
+ display: block;
+ background: #999;
+ height: 470px;
+ list-style:none;
+ margin:0;
+ overflow:hidden;
+}
+#kwick li {
+ float: left;
+ margin:0;
+ padding:0;
+}
+#kwick .kwick {
+ display: block;
+ cursor: pointer;
+ overflow: hidden;
+ height: 470px;
+ width: 215px;
+ padding: 10px;
+ background: #fff;
+}
+#kwick .kwick span {
+ color:#fff;
+}
+#kwick .one {
+ background: #666;
+ background-image: url(../img/tour/What.jpg);
+}
+#kwick .two {
+ background: #777;
+}
+#kwick .three {
+ background: #888;
+
+}
+#kwick .four {
+ background: #999;
+ background-image: url(../img/tour/Where.jpg);
+}
diff --git a/css/nav.css b/css/nav.css
index 53bff8d..94f3d42 100644
--- a/css/nav.css
+++ b/css/nav.css
@@ -1,167 +1,167 @@
-/*
------------------------------------------------
-Navigation
------------------------------------------------ */
-
-/* navigation (horizontal subnavigation)
------------------------------------------------ */
-ul.nav,
-ul.nav * { margin:0;padding:0;}
-ul.nav {
- position:relative;
- background:#666;
- max-width:100%;
- height:2.5em;
- }
-ul.nav li {
- cursor:pointer;
- float:left;
- text-align:center;
- list-style-type:none;
- font-weight:normal;
-}
-ul.nav li ul {
- cursor:default;
- width:100%;
- max-width:100%;
- position:absolute;
- height:auto;
- top:2.5em;
- background-position:0 0 !important;
- left:-9000px;
-}
-ul.nav li ul li {
- padding:0;
- border:none;
- width:auto;
- max-width:none;
-}
-ul.nav li a {
- color:#fff;
- background:#666;
- font-weight:bold;
- text-decoration:none;
- display:block;
- float:left;
- padding:0 1em;
- height:2.4em;
- line-height:2.5em;
-}
-ul.nav li ul li a {
- position:relative !important; /* ie Mac */
- cursor:pointer !important;
- white-space:nowrap;
- line-height:2em;
- height:2em;
- font-weight:normal;
- color:#666;
- background-position:0 50% !important;
-}
-
-ul.nav li:hover a,
-ul.nav li a:hover,
-ul.nav li a:focus {color:#000; background:#ccc;}
-ul.nav li a:active {color:#666; background:#fff;}
-ul.nav li:hover ul {left:0;z-index:10}
-ul.nav li ul,
-ul.nav li {background:#ccc !important}
-ul.nav li:hover ul li a {color:#444;}
-ul.nav li:hover ul li a:hover {color:#000; background:#fff;}
-ul.nav li:hover ul li a:active {color:#666; background:#fff;}
-
-ul.nav li.current a {color:#666; background:#fff; cursor:default; font-weight:bold;}
-ul.nav li.current ul {left:0;z-index:5}
-ul.nav li.current ul,
-ul.nav li.current {background:#ccc !important}
-ul.nav li.current ul li a {color:#444; background:#ccc; font-weight:normal;}
-ul.nav li.current ul li a:hover {color:#000; background:#fff;}
-ul.nav li ul li.current a,
-ul.nav li ul li.current a:hover,
-ul.nav li.current:hover ul li a:active {color:#666; background:#fff;}
-
-
-/* navigation (vertical subnavigation)
------------------------------------------------ */
-ul.nav {
- background:#666;
-}
-ul.main li {
- position:relative;
- top:0;
- left:0;
-}
-ul.main li ul {
- border-top:0;
-}
-ul.main li ul li {
- float:left;
-}
-ul.main li a {
- height:2.5em;
- line-height:2.5em;
- border:0;
- color:#fff;
- background:#666;
-}
-ul.main li ul li a {
- width:12em;
- line-height:2em;
- height:2em;
- text-align:left;
- color:#fff;
- border-top:1px solid #444;
- background:#444;
-}
-ul.main li a:focus {color:#fff; background:#666;}
-ul.main li ul li a:hover {
- color:#fff;
- background:#555;
-}
-ul.main li:hover a {
- color:#fff;
- background:#555;
-}
-ul.main li:hover ul li a {color:#fff;}
-ul.main li:hover ul li a:hover {color:#fff; background:#444;}
-ul.main li:hover a:active {background:#444;}
-ul.main li:hover ul li a:active {color:#fff; background:#222;}
-
-
-/* secondary list
------------------------------------------------ */
-ul.nav li.secondary {
- float:right;
- color:#cde;
- background:transparent !important;
-}
-ul.nav li.secondary span.status {
- float:left;
- padding:0 1em;
- line-height:2.77em;
- height:2.77em;
- font-size:0.9em;
-}
-ul.nav li.secondary span.status a {
- float:none;
- display:inline;
- padding:0;
- height:auto;
- line-height:auto;
- color:#cde;
- background:transparent;
-}
-ul.nav li.secondary span.status a:hover {
- color:#fff;
- background:transparent;
-}
-ul.nav li.secondary span.status span {
- text-transform:capitalize;
-}
-ul.nav li.secondary:hover a {
- color:#fff;
- background:#666;
-}
-ul.nav li.secondary:hover a:hover {
- background:#555;
-}
-ul.nav li.secondary:hover a:active {background:#444;}
+/*
+-----------------------------------------------
+Navigation
+----------------------------------------------- */
+
+/* navigation (horizontal subnavigation)
+----------------------------------------------- */
+ul.nav,
+ul.nav * { margin:0;padding:0;}
+ul.nav {
+ position:relative;
+ background:#666;
+ max-width:100%;
+ height:2.5em;
+ }
+ul.nav li {
+ cursor:pointer;
+ float:left;
+ text-align:center;
+ list-style-type:none;
+ font-weight:normal;
+}
+ul.nav li ul {
+ cursor:default;
+ width:100%;
+ max-width:100%;
+ position:absolute;
+ height:auto;
+ top:2.5em;
+ background-position:0 0 !important;
+ left:-9000px;
+}
+ul.nav li ul li {
+ padding:0;
+ border:none;
+ width:auto;
+ max-width:none;
+}
+ul.nav li a {
+ color:#fff;
+ background:#666;
+ font-weight:bold;
+ text-decoration:none;
+ display:block;
+ float:left;
+ padding:0 1em;
+ height:2.4em;
+ line-height:2.5em;
+}
+ul.nav li ul li a {
+ position:relative !important; /* ie Mac */
+ cursor:pointer !important;
+ white-space:nowrap;
+ line-height:2em;
+ height:2em;
+ font-weight:normal;
+ color:#666;
+ background-position:0 50% !important;
+}
+
+ul.nav li:hover a,
+ul.nav li a:hover,
+ul.nav li a:focus {color:#000; background:#ccc;}
+ul.nav li a:active {color:#666; background:#fff;}
+ul.nav li:hover ul {left:0;z-index:10}
+ul.nav li ul,
+ul.nav li {background:#ccc !important}
+ul.nav li:hover ul li a {color:#444;}
+ul.nav li:hover ul li a:hover {color:#000; background:#fff;}
+ul.nav li:hover ul li a:active {color:#666; background:#fff;}
+
+ul.nav li.current a {color:#666; background:#fff; cursor:default; font-weight:bold;}
+ul.nav li.current ul {left:0;z-index:5}
+ul.nav li.current ul,
+ul.nav li.current {background:#ccc !important}
+ul.nav li.current ul li a {color:#444; background:#ccc; font-weight:normal;}
+ul.nav li.current ul li a:hover {color:#000; background:#fff;}
+ul.nav li ul li.current a,
+ul.nav li ul li.current a:hover,
+ul.nav li.current:hover ul li a:active {color:#666; background:#fff;}
+
+
+/* navigation (vertical subnavigation)
+----------------------------------------------- */
+ul.nav {
+ background:#666;
+}
+ul.main li {
+ position:relative;
+ top:0;
+ left:0;
+}
+ul.main li ul {
+ border-top:0;
+}
+ul.main li ul li {
+ float:left;
+}
+ul.main li a {
+ height:2.5em;
+ line-height:2.5em;
+ border:0;
+ color:#fff;
+ background:#666;
+}
+ul.main li ul li a {
+ width:12em;
+ line-height:2em;
+ height:2em;
+ text-align:left;
+ color:#fff;
+ border-top:1px solid #444;
+ background:#444;
+}
+ul.main li a:focus {color:#fff; background:#666;}
+ul.main li ul li a:hover {
+ color:#fff;
+ background:#555;
+}
+ul.main li:hover a {
+ color:#fff;
+ background:#555;
+}
+ul.main li:hover ul li a {color:#fff;}
+ul.main li:hover ul li a:hover {color:#fff; background:#444;}
+ul.main li:hover a:active {background:#444;}
+ul.main li:hover ul li a:active {color:#fff; background:#222;}
+
+
+/* secondary list
+----------------------------------------------- */
+ul.nav li.secondary {
+ float:right;
+ color:#cde;
+ background:transparent !important;
+}
+ul.nav li.secondary span.status {
+ float:left;
+ padding:0 1em;
+ line-height:2.77em;
+ height:2.77em;
+ font-size:0.9em;
+}
+ul.nav li.secondary span.status a {
+ float:none;
+ display:inline;
+ padding:0;
+ height:auto;
+ line-height:auto;
+ color:#cde;
+ background:transparent;
+}
+ul.nav li.secondary span.status a:hover {
+ color:#fff;
+ background:transparent;
+}
+ul.nav li.secondary span.status span {
+ text-transform:capitalize;
+}
+ul.nav li.secondary:hover a {
+ color:#fff;
+ background:#666;
+}
+ul.nav li.secondary:hover a:hover {
+ background:#555;
+}
+ul.nav li.secondary:hover a:active {background:#444;}
diff --git a/css/reset.css b/css/reset.css
index 3aadd3d..13f8e0a 100644
--- a/css/reset.css
+++ b/css/reset.css
@@ -1,53 +1,53 @@
-/* http://meyerweb.com/eric/tools/css/reset/ */
-/* v1.0 | 20080212 */
-
-html, body, div, span, applet, object, iframe,
-h1, h2, h3, h4, h5, h6, p, blockquote, pre,
-a, abbr, acronym, address, big, cite, code,
-del, dfn, em, font, img, ins, kbd, q, s, samp,
-small, strike, strong, sub, sup, tt, var,
-b, u, i, center,
-dl, dt, dd, ol, ul, li,
-fieldset, form, label, legend,
-table, caption, tbody, tfoot, thead, tr, th, td {
- margin: 0;
- padding: 0;
- border: 0;
- outline: 0;
- font-size: 100%;
- vertical-align: baseline;
- background: transparent;
-}
-body {
- line-height: 1;
-}
-ol, ul {
- list-style: none;
-}
-blockquote, q {
- quotes: none;
-}
-blockquote:before, blockquote:after,
-q:before, q:after {
- content: '';
- content: none;
-}
-
-/* remember to define focus styles! */
-:focus {
- outline: 0;
-}
-
-/* remember to highlight inserts somehow! */
-ins {
- text-decoration: none;
-}
-del {
- text-decoration: line-through;
-}
-
-/* tables still need 'cellspacing="0"' in the markup */
-table {
- border-collapse: collapse;
- border-spacing: 0;
+/* http://meyerweb.com/eric/tools/css/reset/ */
+/* v1.0 | 20080212 */
+
+html, body, div, span, applet, object, iframe,
+h1, h2, h3, h4, h5, h6, p, blockquote, pre,
+a, abbr, acronym, address, big, cite, code,
+del, dfn, em, font, img, ins, kbd, q, s, samp,
+small, strike, strong, sub, sup, tt, var,
+b, u, i, center,
+dl, dt, dd, ol, ul, li,
+fieldset, form, label, legend,
+table, caption, tbody, tfoot, thead, tr, th, td {
+ margin: 0;
+ padding: 0;
+ border: 0;
+ outline: 0;
+ font-size: 100%;
+ vertical-align: baseline;
+ background: transparent;
+}
+body {
+ line-height: 1;
+}
+ol, ul {
+ list-style: none;
+}
+blockquote, q {
+ quotes: none;
+}
+blockquote:before, blockquote:after,
+q:before, q:after {
+ content: '';
+ content: none;
+}
+
+/* remember to define focus styles! */
+:focus {
+ outline: 0;
+}
+
+/* remember to highlight inserts somehow! */
+ins {
+ text-decoration: none;
+}
+del {
+ text-decoration: line-through;
+}
+
+/* tables still need 'cellspacing="0"' in the markup */
+table {
+ border-collapse: collapse;
+ border-spacing: 0;
}
\ No newline at end of file
diff --git a/css/text.css b/css/text.css
index b6a687b..db71f11 100644
--- a/css/text.css
+++ b/css/text.css
@@ -1,98 +1,98 @@
-/*
- 960 Grid System ~ Text CSS.
- Learn more ~ http://960.gs/
-
- Licensed under GPL and MIT.
-*/
-
-/* =Basic HTML
---------------------------------------------------------------------------------*/
-
-body
-{
- font: 13px/1.5 Helvetica, Arial, 'Liberation Sans', FreeSans, sans-serif;
-}
-
-a:focus
-{
- outline: 1px dotted invert;
-}
-
-hr
-{
- border-color: #ccc;
- border-style: solid;
- border-width: 1px 0 0;
- clear: both;
- height: 0;
-}
-
-/* =Headings
---------------------------------------------------------------------------------*/
-
-h1
-{
- font-size: 25px;
-}
-
-h2
-{
- font-size: 23px;
-}
-
-h3
-{
- font-size: 21px;
-}
-
-h4
-{
- font-size: 19px;
-}
-
-h5
-{
- font-size: 17px;
-}
-
-h6
-{
- font-size: 15px;
-}
-
-/* =Spacing
---------------------------------------------------------------------------------*/
-
-ol
-{
- list-style: decimal;
-}
-
-ul
-{
- list-style: square;
-}
-
-li
-{
- margin-left: 30px;
-}
-
-p,
-dl,
-hr,
-h1,
-h2,
-h3,
-h4,
-h5,
-h6,
-ol,
-ul,
-pre,
-table,
-address,
-fieldset
-{
- margin-bottom: 20px;
+/*
+ 960 Grid System ~ Text CSS.
+ Learn more ~ http://960.gs/
+
+ Licensed under GPL and MIT.
+*/
+
+/* =Basic HTML
+--------------------------------------------------------------------------------*/
+
+body
+{
+ font: 13px/1.5 Helvetica, Arial, 'Liberation Sans', FreeSans, sans-serif;
+}
+
+a:focus
+{
+ outline: 1px dotted invert;
+}
+
+hr
+{
+ border-color: #ccc;
+ border-style: solid;
+ border-width: 1px 0 0;
+ clear: both;
+ height: 0;
+}
+
+/* =Headings
+--------------------------------------------------------------------------------*/
+
+h1
+{
+ font-size: 25px;
+}
+
+h2
+{
+ font-size: 23px;
+}
+
+h3
+{
+ font-size: 21px;
+}
+
+h4
+{
+ font-size: 19px;
+}
+
+h5
+{
+ font-size: 17px;
+}
+
+h6
+{
+ font-size: 15px;
+}
+
+/* =Spacing
+--------------------------------------------------------------------------------*/
+
+ol
+{
+ list-style: decimal;
+}
+
+ul
+{
+ list-style: square;
+}
+
+li
+{
+ margin-left: 30px;
+}
+
+p,
+dl,
+hr,
+h1,
+h2,
+h3,
+h4,
+h5,
+h6,
+ol,
+ul,
+pre,
+table,
+address,
+fieldset
+{
+ margin-bottom: 20px;
}
\ No newline at end of file
diff --git a/css/zed/forms.css b/css/zed/forms.css
index 34c58fd..07c2b7e 100644
--- a/css/zed/forms.css
+++ b/css/zed/forms.css
@@ -1,97 +1,97 @@
-@charset "utf-8";
-
-/* -------------------------------------------------------------
- Zed
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Author: Dereckson
- Tags: space retro futurist
- Filename: forms.css
- Version: 1.1
- Created: 2010-01-27
- Updated: 2010-07-02
- Licence: Creative Commons BY 3.0
- ------------------------------------------------------------- */
-
-/* -------------------------------------------------------------
- Import dojo CSS
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-@import "/js/dojo/dijit/themes/tundra/tundra.css";
-
-/* -------------------------------------------------------------
- Forms rows
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-form {
- color: black;
-}
-
-form div.row {
- margin-bottom: 0.8em;
-}
-
-hr {
- width: 90%;
- color: lightgray;
- margin: 2em auto 2em auto;
-}
-
-/* -------------------------------------------------------------
- input tags width
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-.small {
- width: 5em;
-}
-
-.medium {
- width: 12em;
-}
-
-.long {
- width: 20em;
-}
-
-/* -------------------------------------------------------------
- Labels (from dojo CSS)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-label {
- color: white;
-}
-
-.firstLabel {
- display: inline-block;
- display: -moz-inline-box;
- width: 10em;
- min-width: 10em;
- vertical-align: top;
-}
-
-.secondLabel {
- width: auto;
- margin-left: 5em;
- margin-right: 1em;
-}
-
-fieldset label {
- margin-right: 1em;
-}
-
-/* -------------------------------------------------------------
- Misc
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-/* Doesn't display DOJO tooltips provider if JS disabled */
-.dojotooltip {
- display: none;
-}
-
-/* Kludge: normal font size for form items */
-form {
- font-size: 90%;
-}
-
-label {
- font-size: medium;
+@charset "utf-8";
+
+/* -------------------------------------------------------------
+ Zed
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ Author: Dereckson
+ Tags: space retro futurist
+ Filename: forms.css
+ Version: 1.1
+ Created: 2010-01-27
+ Updated: 2010-07-02
+ Licence: Creative Commons BY 3.0
+ ------------------------------------------------------------- */
+
+/* -------------------------------------------------------------
+ Import dojo CSS
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+
+@import "/js/dojo/dijit/themes/tundra/tundra.css";
+
+/* -------------------------------------------------------------
+ Forms rows
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+
+form {
+ color: black;
+}
+
+form div.row {
+ margin-bottom: 0.8em;
+}
+
+hr {
+ width: 90%;
+ color: lightgray;
+ margin: 2em auto 2em auto;
+}
+
+/* -------------------------------------------------------------
+ input tags width
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+
+.small {
+ width: 5em;
+}
+
+.medium {
+ width: 12em;
+}
+
+.long {
+ width: 20em;
+}
+
+/* -------------------------------------------------------------
+ Labels (from dojo CSS)
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+
+label {
+ color: white;
+}
+
+.firstLabel {
+ display: inline-block;
+ display: -moz-inline-box;
+ width: 10em;
+ min-width: 10em;
+ vertical-align: top;
+}
+
+.secondLabel {
+ width: auto;
+ margin-left: 5em;
+ margin-right: 1em;
+}
+
+fieldset label {
+ margin-right: 1em;
+}
+
+/* -------------------------------------------------------------
+ Misc
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+
+/* Doesn't display DOJO tooltips provider if JS disabled */
+.dojotooltip {
+ display: none;
+}
+
+/* Kludge: normal font size for form items */
+form {
+ font-size: 90%;
+}
+
+label {
+ font-size: medium;
}
\ No newline at end of file
diff --git a/css/zed/login.css b/css/zed/login.css
index 7a7c27d..7de7ac6 100644
--- a/css/zed/login.css
+++ b/css/zed/login.css
@@ -1,122 +1,122 @@
-@charset "utf-8";
-
-/* -------------------------------------------------------------
- Zed
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Author: Dereckson
- Tags: space retro futurist
- Filename: login.css
- Version: 1.0
- Created: 2010-01-27
- Updated: 2010-02-09
- Licence: Creative Commons BY 3.0
- ------------------------------------------------------------- */
-
-/* -------------------------------------------------------------
- Page
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-body {
- margin: 0 0 0 0;
- background-color: #343434;
- font-family: "FixedSys", monospace;
-}
-
-/* -------------------------------------------------------------
- Login form
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-#LoginBox {
- background-image: url("../../img/login/bg.jpg");
- width: 341px;
- height: 516px;
- margin: 0 auto 0 auto;
-}
-
-#LoginBox label { display:none; }
-
-#LoginBox input {
- width: 150px;
- font-weight: 900;
- border: none;
- background-color: #3b3f55;
- color: white;
-}
-
-#LoginBox #username {
- position: relative;
- top: 250px;
- left: 150px;
-}
-
-#LoginBox #password {
- position: relative;
- top: 300px;
- left: 150px;
-}
-
-#LoginBox #openid {
- position: relative;
- top: 390px;
- width: 230px;
- left: 50px;
-
- /* OpenID */
- background-image: url("../../img/login/openid.png");
- background-position: 0% 50%;
- background-repeat: no-repeat;
- padding-left: 20px;
-}
-
-#LoginBox #submit {
- position: relative;
- top: 420px;
- left: 250px;
- width: 50px;
-}
-
-.error {
- position: relative;
- width: 290px;
- margin: 0 10px 0 10px;
- text-align: right;
- color: #3b3f55;
- top: 274px;
-}
-
-/* -------------------------------------------------------------
- Bottom right vertical links
-
- Inspiration: mono lab "monochrome" wordpress theme
- http://www.mono-lab.net
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-#link_tour a {
- position: absolute;
- position: fixed;
- right: 15px;
- bottom: 15px;
- width: 18px;
- height: 84px;
- display: block;
- background: url("../../img/login/tour.png") no-repeat left top;
-}
-
-#link_tour a:hover {
- background:url("../../img/login/tour.png") no-repeat right top;
-}
-
-#link_blog a {
- position:absolute;
- position:fixed;
- right:35px;
- bottom:15px;
- width:18px;
- height:84px;
- display:block;
- background:url("../../img/login/blog.png") no-repeat left top;
-}
-
-#link_blog a:hover {
- background:url("../../img/login/blog.png") no-repeat right top;
+@charset "utf-8";
+
+/* -------------------------------------------------------------
+ Zed
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ Author: Dereckson
+ Tags: space retro futurist
+ Filename: login.css
+ Version: 1.0
+ Created: 2010-01-27
+ Updated: 2010-02-09
+ Licence: Creative Commons BY 3.0
+ ------------------------------------------------------------- */
+
+/* -------------------------------------------------------------
+ Page
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+
+body {
+ margin: 0 0 0 0;
+ background-color: #343434;
+ font-family: "FixedSys", monospace;
+}
+
+/* -------------------------------------------------------------
+ Login form
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+
+#LoginBox {
+ background-image: url("../../img/login/bg.jpg");
+ width: 341px;
+ height: 516px;
+ margin: 0 auto 0 auto;
+}
+
+#LoginBox label { display:none; }
+
+#LoginBox input {
+ width: 150px;
+ font-weight: 900;
+ border: none;
+ background-color: #3b3f55;
+ color: white;
+}
+
+#LoginBox #username {
+ position: relative;
+ top: 250px;
+ left: 150px;
+}
+
+#LoginBox #password {
+ position: relative;
+ top: 300px;
+ left: 150px;
+}
+
+#LoginBox #openid {
+ position: relative;
+ top: 390px;
+ width: 230px;
+ left: 50px;
+
+ /* OpenID */
+ background-image: url("../../img/login/openid.png");
+ background-position: 0% 50%;
+ background-repeat: no-repeat;
+ padding-left: 20px;
+}
+
+#LoginBox #submit {
+ position: relative;
+ top: 420px;
+ left: 250px;
+ width: 50px;
+}
+
+.error {
+ position: relative;
+ width: 290px;
+ margin: 0 10px 0 10px;
+ text-align: right;
+ color: #3b3f55;
+ top: 274px;
+}
+
+/* -------------------------------------------------------------
+ Bottom right vertical links
+
+ Inspiration: mono lab "monochrome" wordpress theme
+ http://www.mono-lab.net
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+
+#link_tour a {
+ position: absolute;
+ position: fixed;
+ right: 15px;
+ bottom: 15px;
+ width: 18px;
+ height: 84px;
+ display: block;
+ background: url("../../img/login/tour.png") no-repeat left top;
+}
+
+#link_tour a:hover {
+ background:url("../../img/login/tour.png") no-repeat right top;
+}
+
+#link_blog a {
+ position:absolute;
+ position:fixed;
+ right:35px;
+ bottom:15px;
+ width:18px;
+ height:84px;
+ display:block;
+ background:url("../../img/login/blog.png") no-repeat left top;
+}
+
+#link_blog a:hover {
+ background:url("../../img/login/blog.png") no-repeat right top;
}
\ No newline at end of file
diff --git a/css/zed/theme.css b/css/zed/theme.css
index dbb51fd..6abeb56 100644
--- a/css/zed/theme.css
+++ b/css/zed/theme.css
@@ -1,417 +1,417 @@
-@charset "utf-8";
-
-/* -------------------------------------------------------------
- Zed
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Author: Dereckson
- Tags: space retro futurist
- Filename: theme.css
- Version: 1.1
- Created: 2010-01-27
- Updated: 2010-07-02
- Licence: Creative Commons BY 3.0
- ------------------------------------------------------------- */
-
-/* -------------------------------------------------------------
- Page settings
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-body {
- margin: 0.5em 0 0 0;
-
- background-attachment: fixed;
- background-color: #343434;
- background-image: url("../../img/zed/bg.jpg");
- background-position: top left;
- background-repeat: no-repeat;
-
- font-family: "Calibri", "Lucida Sans Unicode", "Trebuchet MS", "Helvetica", "Arial", sans-serif;
-
- min-height: 1200px;
-}
-
-.container_16 {
- color: white;
-}
-
-h1 {
- color: #19B5E7;
- font-size: 21px;
- font-weight: normal;
-}
-
-h2, h3, h4, h5, h6 {
- color: #04acf8;
- font-weight: normal;
-}
-
-h2 {
- font-size: 19px;
-}
-
-h3 {
- color: #04acf8;
- font-size: 16px;
-}
-
-pre {
- font-family: FixedSys, monospace;
-}
-
-/* -------------------------------------------------------------
- Links
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-a {
- color: #1AC8E8;
- text-decoration: none;
-}
-
-a:visited {
- color: gray;
-}
-
-a:hover {
- color: red;
- text-decoration: none;
-}
-
-/* -------------------------------------------------------------
- Notify messages
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-.notify {
- padding-top: 25px;
- padding-bottom: 25px;
-
- margin-bottom: 10px;
-
- text-align: center;
- background: #eeeeee;
- font-size: 1.5em;
- color: black;
-
- border: 5px solid #1AC8E8;
- width: 950px;
-}
-
-.wap {
- padding-top: 50px;
- padding-bottom: 50px;
-
- margin-bottom: 10px;
-
- text-align: center;
- background: #eeeeee;
- font-size: 2em;
- color: black;
-
- border: 5px solid indianred;
- width: 950px;
-
-}
-
-/* -------------------------------------------------------------
- Header
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-#header {
- background-image: url("../../img/zed/bg_header.png");
- background-repeat: no-repeat;
- margin: auto auto;
- margin-bottom: 0.5em;
- height: 104px;
- width: 978px;
-}
-
-#header_content {
- padding-top: 26px;
-}
-
-#HypershipTime {
- color: white;
- font-size: 0.8em;
- background-image: url("../../img/zed/time.png");
- background-position: center left;
- background-repeat: no-repeat;
- text-indent: 2em;
-}
-
-/* -------------------------------------------------------------
- Header - wall
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-.wall {
- text-align: left;
- float:left;
- color: white;
- font-size: 0.8em;
- background-image: url("../../img/zed/quote.png");
- background-position: top left;
- background-repeat: no-repeat;
- text-indent: 2em;
- margin-bottom: 0.8em;
-}
-
-.wall_info {
- display: block;
- text-align: right;
- /* font-size: 80%; */
-}
-
-.wall a {
- color: #a9a49e;
-}
-
-.wall a:hover {
- color: #fd9800;
-}
-
-/* -------------------------------------------------------------
- Content (e.g. stories in /explore)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-.content_wrapper {
- background-color: #171717;
- border: solid 5px black;
- margin-bottom: 1em;
-}
-
-.content_wrapper .content {
- padding: 0 2em 0 2em;
- color: white;
-}
-
-.content_wrapper H1 {
- margin-top: 0;
- padding: 0.25em 0 0.75em 1em;
- background-color: black;
- height: 1em;
-}
-
-/* -------------------------------------------------------------
- Avatars wall
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-.avatar {
- float: left;
- margin-bottom: 2em;
- margin-right: 2em;
- text-align: center;
-}
-
-.avatar img {
- border: solid 1px;
-}
-
-.avatar_name {
- display: block;
-}
-
-.avatar a:hover {
- color: white;
-}
-
-/* -------------------------------------------------------------
- Messages
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-.message {
- margin-bottom: 17px;
- padding: 8px 9px 8px 9px;
- width: 940px;
- font-size: 80%;
-}
-
-.message.light {
- background-color: #fafafa;
- border: 3px solid #dedede;
- width: 938px;
- color: black;
-}
-
-.message.light a {color: #343434;}
-
-.message.dark {
- background-color: #acc0c3;
- border: solid 3px #4e5758;
- width: 938px;
- color: #000033;
-
-}
-.message.dark a {color: #154c4c;}
-
-.message a:hover {
- font-weight: 900;
-}
-
-.message_info {
- text-align: right;
- margin-bottom: 1em;
-}
-
-.message_text {
- font-size: 1.25em;
-}
-
-.message_info {
- color: #343434;
-}
-
-/* -------------------------------------------------------------
- Helper classes
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-.center {
- text-align: center;
-}
-
-/* -------------------------------------------------------------
- Color boxes
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-.plum {
- background-color: plum;
- border: 1px solid #800080;
- color: black;
-}
-.plum a { color: #800080; }
-
-.green {
- background-color: beige;
- border: 1px solid darkgreen;
- color: black;
-}
-.green a { color: darkgreen; }
-
-.skyblue {
- background-color: lightskyblue;
- border: 1px solid #6e47fe;
-}
-.skyblue a { color:navy }
-
-.indigo {
- background-color: #AE97E1;
- border: 1px solid #C97FFF;
-
-}
-.indigo a {color: #800080;}
-
-.yellow {
- background-color: #FFFFCC;
- border: 1px solid #C4B963;
-
-}
-.yellow a {color: navy;}
-
-.orange {
- background-color: #FDD9AC;
- border: 1px solid #eaaf67;
-}
-.orange a {color: #43392e;}
-
-.red {
- background-color: #FFE4E1;
- border: solid 1px #DC7777;
- color: #220000;
-
-}
-.red a {color: #993333;}
-
-.black {
- background-color: black;
- color: #ccc;
- border: solid 2px #555;
-}
-
-.plum a:hover,
-.green a:hover,
-.skyblue a:hover,
-.indigo a:hover,
-.yellow a:hover,
-.orange a:hover,
-.red a:hover{
- font-weight: bold;
-}
-
-/* -------------------------------------------------------------
- SmartLine
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-#SmartLine {
- width: 100%;
-}
-
-#SmartLine .left {
-
-}
-
-#SmartLine .right {
- float: right;
- text-align: right;
-}
-
-/* TODO: ajouter un sélecteur de SmarLine pour chat/commandes (60px) */
-/* grid_1 alpha -> sélecteur, grid_3 -> history, grid_12 > bar */
-
-#SmartLineHistory {
- width: 115%; /* dépasse de sa bordure */
-}
-
-#SmartLineBar{
- /* 99.6% for alignment with .message.light */
- width: 99.6%;
-}
-
-#SmartLineResults {
- font-family: "Fixedsys Excelsior 3.01", FixedSys, Terminal;
- font-size: 12pt;
-}
-
-#SmartLineResults .highlight {
- color: #16c3cc;
-}
-
-#SmartLineResults .error {
- color: red;
-}
-
-#SmartLineResults p {
- padding-left: 1em;
-}
-
-/* -------------------------------------------------------------
- Floating panes
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-.floatingPaneTutorial {
- width: 957.5px;
- margin-bottom: 1em;
- color: black;
-}
-
-.floatingPaneTutorial a {
- color: navy;
-}
-
-.floatingPaneTutorial a:hover {
- color: #5f0505;
-}
-
-.floatingPaneTutorial p {
- color: black;
- margin: 0;
- padding: 5px 10px 0px 10px;
-}
-
-.dojoxDockList {
- color: black;
-}
-
-/* -------------------------------------------------------------
- Footer
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-
-#footer {
- font-size: 80%;
- color: white;
+@charset "utf-8";
+
+/* -------------------------------------------------------------
+ Zed
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ Author: Dereckson
+ Tags: space retro futurist
+ Filename: theme.css
+ Version: 1.1
+ Created: 2010-01-27
+ Updated: 2010-07-02
+ Licence: Creative Commons BY 3.0
+ ------------------------------------------------------------- */
+
+/* -------------------------------------------------------------
+ Page settings
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+
+body {
+ margin: 0.5em 0 0 0;
+
+ background-attachment: fixed;
+ background-color: #343434;
+ background-image: url("../../img/zed/bg.jpg");
+ background-position: top left;
+ background-repeat: no-repeat;
+
+ font-family: "Calibri", "Lucida Sans Unicode", "Trebuchet MS", "Helvetica", "Arial", sans-serif;
+
+ min-height: 1200px;
+}
+
+.container_16 {
+ color: white;
+}
+
+h1 {
+ color: #19B5E7;
+ font-size: 21px;
+ font-weight: normal;
+}
+
+h2, h3, h4, h5, h6 {
+ color: #04acf8;
+ font-weight: normal;
+}
+
+h2 {
+ font-size: 19px;
+}
+
+h3 {
+ color: #04acf8;
+ font-size: 16px;
+}
+
+pre {
+ font-family: FixedSys, monospace;
+}
+
+/* -------------------------------------------------------------
+ Links
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+
+a {
+ color: #1AC8E8;
+ text-decoration: none;
+}
+
+a:visited {
+ color: gray;
+}
+
+a:hover {
+ color: red;
+ text-decoration: none;
+}
+
+/* -------------------------------------------------------------
+ Notify messages
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+
+.notify {
+ padding-top: 25px;
+ padding-bottom: 25px;
+
+ margin-bottom: 10px;
+
+ text-align: center;
+ background: #eeeeee;
+ font-size: 1.5em;
+ color: black;
+
+ border: 5px solid #1AC8E8;
+ width: 950px;
+}
+
+.wap {
+ padding-top: 50px;
+ padding-bottom: 50px;
+
+ margin-bottom: 10px;
+
+ text-align: center;
+ background: #eeeeee;
+ font-size: 2em;
+ color: black;
+
+ border: 5px solid indianred;
+ width: 950px;
+
+}
+
+/* -------------------------------------------------------------
+ Header
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+
+#header {
+ background-image: url("../../img/zed/bg_header.png");
+ background-repeat: no-repeat;
+ margin: auto auto;
+ margin-bottom: 0.5em;
+ height: 104px;
+ width: 978px;
+}
+
+#header_content {
+ padding-top: 26px;
+}
+
+#HypershipTime {
+ color: white;
+ font-size: 0.8em;
+ background-image: url("../../img/zed/time.png");
+ background-position: center left;
+ background-repeat: no-repeat;
+ text-indent: 2em;
+}
+
+/* -------------------------------------------------------------
+ Header - wall
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+
+.wall {
+ text-align: left;
+ float:left;
+ color: white;
+ font-size: 0.8em;
+ background-image: url("../../img/zed/quote.png");
+ background-position: top left;
+ background-repeat: no-repeat;
+ text-indent: 2em;
+ margin-bottom: 0.8em;
+}
+
+.wall_info {
+ display: block;
+ text-align: right;
+ /* font-size: 80%; */
+}
+
+.wall a {
+ color: #a9a49e;
+}
+
+.wall a:hover {
+ color: #fd9800;
+}
+
+/* -------------------------------------------------------------
+ Content (e.g. stories in /explore)
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+
+.content_wrapper {
+ background-color: #171717;
+ border: solid 5px black;
+ margin-bottom: 1em;
+}
+
+.content_wrapper .content {
+ padding: 0 2em 0 2em;
+ color: white;
+}
+
+.content_wrapper H1 {
+ margin-top: 0;
+ padding: 0.25em 0 0.75em 1em;
+ background-color: black;
+ height: 1em;
+}
+
+/* -------------------------------------------------------------
+ Avatars wall
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+
+.avatar {
+ float: left;
+ margin-bottom: 2em;
+ margin-right: 2em;
+ text-align: center;
+}
+
+.avatar img {
+ border: solid 1px;
+}
+
+.avatar_name {
+ display: block;
+}
+
+.avatar a:hover {
+ color: white;
+}
+
+/* -------------------------------------------------------------
+ Messages
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+
+.message {
+ margin-bottom: 17px;
+ padding: 8px 9px 8px 9px;
+ width: 940px;
+ font-size: 80%;
+}
+
+.message.light {
+ background-color: #fafafa;
+ border: 3px solid #dedede;
+ width: 938px;
+ color: black;
+}
+
+.message.light a {color: #343434;}
+
+.message.dark {
+ background-color: #acc0c3;
+ border: solid 3px #4e5758;
+ width: 938px;
+ color: #000033;
+
+}
+.message.dark a {color: #154c4c;}
+
+.message a:hover {
+ font-weight: 900;
+}
+
+.message_info {
+ text-align: right;
+ margin-bottom: 1em;
+}
+
+.message_text {
+ font-size: 1.25em;
+}
+
+.message_info {
+ color: #343434;
+}
+
+/* -------------------------------------------------------------
+ Helper classes
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+
+.center {
+ text-align: center;
+}
+
+/* -------------------------------------------------------------
+ Color boxes
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+
+.plum {
+ background-color: plum;
+ border: 1px solid #800080;
+ color: black;
+}
+.plum a { color: #800080; }
+
+.green {
+ background-color: beige;
+ border: 1px solid darkgreen;
+ color: black;
+}
+.green a { color: darkgreen; }
+
+.skyblue {
+ background-color: lightskyblue;
+ border: 1px solid #6e47fe;
+}
+.skyblue a { color:navy }
+
+.indigo {
+ background-color: #AE97E1;
+ border: 1px solid #C97FFF;
+
+}
+.indigo a {color: #800080;}
+
+.yellow {
+ background-color: #FFFFCC;
+ border: 1px solid #C4B963;
+
+}
+.yellow a {color: navy;}
+
+.orange {
+ background-color: #FDD9AC;
+ border: 1px solid #eaaf67;
+}
+.orange a {color: #43392e;}
+
+.red {
+ background-color: #FFE4E1;
+ border: solid 1px #DC7777;
+ color: #220000;
+
+}
+.red a {color: #993333;}
+
+.black {
+ background-color: black;
+ color: #ccc;
+ border: solid 2px #555;
+}
+
+.plum a:hover,
+.green a:hover,
+.skyblue a:hover,
+.indigo a:hover,
+.yellow a:hover,
+.orange a:hover,
+.red a:hover{
+ font-weight: bold;
+}
+
+/* -------------------------------------------------------------
+ SmartLine
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+
+#SmartLine {
+ width: 100%;
+}
+
+#SmartLine .left {
+
+}
+
+#SmartLine .right {
+ float: right;
+ text-align: right;
+}
+
+/* TODO: ajouter un sélecteur de SmarLine pour chat/commandes (60px) */
+/* grid_1 alpha -> sélecteur, grid_3 -> history, grid_12 > bar */
+
+#SmartLineHistory {
+ width: 115%; /* dépasse de sa bordure */
+}
+
+#SmartLineBar{
+ /* 99.6% for alignment with .message.light */
+ width: 99.6%;
+}
+
+#SmartLineResults {
+ font-family: "Fixedsys Excelsior 3.01", FixedSys, Terminal;
+ font-size: 12pt;
+}
+
+#SmartLineResults .highlight {
+ color: #16c3cc;
+}
+
+#SmartLineResults .error {
+ color: red;
+}
+
+#SmartLineResults p {
+ padding-left: 1em;
+}
+
+/* -------------------------------------------------------------
+ Floating panes
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+.floatingPaneTutorial {
+ width: 957.5px;
+ margin-bottom: 1em;
+ color: black;
+}
+
+.floatingPaneTutorial a {
+ color: navy;
+}
+
+.floatingPaneTutorial a:hover {
+ color: #5f0505;
+}
+
+.floatingPaneTutorial p {
+ color: black;
+ margin: 0;
+ padding: 5px 10px 0px 10px;
+}
+
+.dojoxDockList {
+ color: black;
+}
+
+/* -------------------------------------------------------------
+ Footer
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
+
+#footer {
+ font-size: 80%;
+ color: white;
}
\ No newline at end of file
diff --git a/dev/auth.xsd b/dev/auth.xsd
index 0eeb11c..d99ae1b 100644
--- a/dev/auth.xsd
+++ b/dev/auth.xsd
@@ -1,21 +1,21 @@
-<?xml version="1.0" encoding="utf-8"?>
-<xs:schema id="AuthSchema" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema">
- <xs:element name="auth">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="status" type="xs:integer" minOccurs="1" maxOccurs="1" />
- <xs:element name="perso" minOccurs="0" maxOccurs="1">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="id" type="xs:int" minOccurs="1" maxOccurs="1" />
- <xs:element name="nickname" type="xs:string" minOccurs="1" maxOccurs="1" />
- <xs:element name="name" type="xs:string" minOccurs="1" maxOccurs="1" />
- <xs:element name="onBoard" type="xs:boolean" minOccurs="1" maxOccurs="1" />
- <xs:element name="location_local" type="xs:string" minOccurs="0" maxOccurs="1" />
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
+<?xml version="1.0" encoding="utf-8"?>
+<xs:schema id="AuthSchema" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <xs:element name="auth">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="status" type="xs:integer" minOccurs="1" maxOccurs="1" />
+ <xs:element name="perso" minOccurs="0" maxOccurs="1">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="id" type="xs:int" minOccurs="1" maxOccurs="1" />
+ <xs:element name="nickname" type="xs:string" minOccurs="1" maxOccurs="1" />
+ <xs:element name="name" type="xs:string" minOccurs="1" maxOccurs="1" />
+ <xs:element name="onBoard" type="xs:boolean" minOccurs="1" maxOccurs="1" />
+ <xs:element name="location_local" type="xs:string" minOccurs="0" maxOccurs="1" />
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
</xs:schema>
\ No newline at end of file
diff --git a/dev/index.html b/dev/index.html
index 38aaca2..e93391c 100644
--- a/dev/index.html
+++ b/dev/index.html
@@ -1,22 +1,22 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd"
- >
-<html lang="en">
-<head>
- <title>Restricted directory</title>
- <link rel="Stylesheet" href="../css/zed/theme.css" type="text/css" />
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-</head>
-<body>
- <div style="width: 960px; margin: auto; margin-top: 3em;">
- <h1 style="font-size: 3em;">Zed</h1>
- <h2>Dev directory</h2>
- <p>As you can guess from the URL, this directory contains files <em>for developers</em>.</p>
- <p>You can't fully browse it but here some links:</p>
- <ol style="list-style-type: lower-greek;">
- <li><a href="/dev/auth.xsd">auth.xsd</a> - Ship API authentication schema</li>
- <li><a href="/dev/diff.txt">diff.txt</a> - git diff > dev/diff.txt (will often be 404)</li>
- </ol>
- </div>
-</body>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd"
+ >
+<html lang="en">
+<head>
+ <title>Restricted directory</title>
+ <link rel="Stylesheet" href="../css/zed/theme.css" type="text/css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+</head>
+<body>
+ <div style="width: 960px; margin: auto; margin-top: 3em;">
+ <h1 style="font-size: 3em;">Zed</h1>
+ <h2>Dev directory</h2>
+ <p>As you can guess from the URL, this directory contains files <em>for developers</em>.</p>
+ <p>You can't fully browse it but here some links:</p>
+ <ol style="list-style-type: lower-greek;">
+ <li><a href="/dev/auth.xsd">auth.xsd</a> - Ship API authentication schema</li>
+ <li><a href="/dev/diff.txt">diff.txt</a> - git diff > dev/diff.txt (will often be 404)</li>
+ </ol>
+ </div>
+</body>
</html>
\ No newline at end of file
diff --git a/dev/restore_persos_flags.sql b/dev/restore_persos_flags.sql
index 2717961..1cddb85 100644
--- a/dev/restore_persos_flags.sql
+++ b/dev/restore_persos_flags.sql
@@ -1,14 +1,14 @@
----
---- Empties the table and inserts again my flags
---- Dereckson
----
-
-TRUNCATE `persos_flags`;
-
-INSERT INTO `persos_flags` (`perso_id`, `flag_key`, `flag_value`)
-VALUES
-(5555, 'hypership.reached', '3'),
-(5555, 'admin.pages.editor', '1'),
-(5555, 'admin.api.keyprovider', '1'),
-(1148, 'site.smartline.method', 'get'),
-(5555, 'site.smartline.method', 'get');
+---
+--- Empties the table and inserts again my flags
+--- Dereckson
+---
+
+TRUNCATE `persos_flags`;
+
+INSERT INTO `persos_flags` (`perso_id`, `flag_key`, `flag_value`)
+VALUES
+(5555, 'hypership.reached', '3'),
+(5555, 'admin.pages.editor', '1'),
+(5555, 'admin.api.keyprovider', '1'),
+(1148, 'site.smartline.method', 'get'),
+(5555, 'site.smartline.method', 'get');
diff --git a/dev/test_content.sql b/dev/test_content.sql
index 059475d..a66b4a0 100644
--- a/dev/test_content.sql
+++ b/dev/test_content.sql
@@ -1,56 +1,56 @@
--- Adds two accounts (copyright holders from some of the test content).
--- Login/pass are dereckson / dereckson (1148) and jeronimo / jeronimo (6200)
-
-REPLACE INTO users
- (user_id, username, user_password, user_active)
-VALUES
- (1148, 'dereckson', MD5('dereckson'), 1),
- (6200, 'jeronimo', MD5('jeronimo'), 1);
-
-REPLACE INTO persos
- (perso_id, perso_name, perso_nickname, perso_race, perso_sex,
- user_id, location_global, location_local)
-VALUES
- (1148, 'Dereckson', 'dereckson', 'human', 'M',
- 1148, 'B00001001', 'T2C3'),
- (6200, 'jeronimo', 'jeronimo', 'human', 'M',
- 6200, 'B00001002', '(26, -11, -12)');
-
--- Empties the contents table and inserts content in the repository's info
-
-DELETE FROM content_files WHERE perso_id = 1148 OR perso_id = 6200;
-
--- [1148] Tower artwork
--- TODO: add T2 content from prod server (into _files and _locations tables)
-
--- [1148] Composition test files
-REPLACE INTO content_files
- (content_path, content_title, user_id, perso_id)
-VALUES
- ('users/1148/BlueMetalDrakes.png', 'Blue metal drakes', 1148, 1148),
- ('users/1148/ktor.png', 'Ktor', 1148, 1148);
-
--- [1148] Item test (ringbell for tower appartments)
-REPLACE INTO content_files
- (content_path, content_title, user_id, perso_id)
-VALUES
- ('users/1148/plate.jpg', 'DcK plate', 1148, 1148),
- ('users/1148/warning.mp3', 'Warning sound', 1148, 1148);
-
--- [6200] core Ghost Metro content
-REPLACE INTO content_files
- (content_path, content_title, user_id, perso_id)
-VALUES
- ('users/6200/ghostmetro-A-01.jpg', 'Ghost Metro, set A, image 1', 6200, 6200),
- ('users/6200/ghostmetro-A-02.jpg', 'Ghost Metro, set A, image 2', 6200, 6200),
- ('users/6200/ghostmetro-A-03.jpg', 'Ghost Metro, set A, image 3', 6200, 6200),
- ('users/6200/ghostmetro-A-04.jpg', 'Ghost Metro, set A, image 4', 6200, 6200),
- ('users/6200/ghostmetro-A-05-a.jpg', 'Ghost Metro, set A, image 5a', 6200, 6200),
- ('users/6200/ghostmetro-A-05-b.jpg', 'Ghost Metro, set A, image 5b', 6200, 6200),
- ('users/6200/ghostmetro-A-05-c.jpg', 'Ghost Metro, set A, image 5c', 6200, 6200),
- ('users/6200/ghostmetro-A-06.png', 'Ghost Metro, set A, image 6', 6200, 6200),
- ('users/6200/ghostmetro-A-07.jpg', 'Ghost Metro, set A, image 7', 6200, 6200),
- ('users/6200/ghostmetro-A-08.jpg', 'Ghost Metro, set A, image 8', 6200, 6200),
- ('users/6200/ghostmetro-A-09.jpg', 'Ghost Metro, set A, image 9', 6200, 6200),
- ('users/6200/ghostmetro-A-10.jpg', 'Ghost Metro, set A, image 10', 6200, 6200),
+-- Adds two accounts (copyright holders from some of the test content).
+-- Login/pass are dereckson / dereckson (1148) and jeronimo / jeronimo (6200)
+
+REPLACE INTO users
+ (user_id, username, user_password, user_active)
+VALUES
+ (1148, 'dereckson', MD5('dereckson'), 1),
+ (6200, 'jeronimo', MD5('jeronimo'), 1);
+
+REPLACE INTO persos
+ (perso_id, perso_name, perso_nickname, perso_race, perso_sex,
+ user_id, location_global, location_local)
+VALUES
+ (1148, 'Dereckson', 'dereckson', 'human', 'M',
+ 1148, 'B00001001', 'T2C3'),
+ (6200, 'jeronimo', 'jeronimo', 'human', 'M',
+ 6200, 'B00001002', '(26, -11, -12)');
+
+-- Empties the contents table and inserts content in the repository's info
+
+DELETE FROM content_files WHERE perso_id = 1148 OR perso_id = 6200;
+
+-- [1148] Tower artwork
+-- TODO: add T2 content from prod server (into _files and _locations tables)
+
+-- [1148] Composition test files
+REPLACE INTO content_files
+ (content_path, content_title, user_id, perso_id)
+VALUES
+ ('users/1148/BlueMetalDrakes.png', 'Blue metal drakes', 1148, 1148),
+ ('users/1148/ktor.png', 'Ktor', 1148, 1148);
+
+-- [1148] Item test (ringbell for tower appartments)
+REPLACE INTO content_files
+ (content_path, content_title, user_id, perso_id)
+VALUES
+ ('users/1148/plate.jpg', 'DcK plate', 1148, 1148),
+ ('users/1148/warning.mp3', 'Warning sound', 1148, 1148);
+
+-- [6200] core Ghost Metro content
+REPLACE INTO content_files
+ (content_path, content_title, user_id, perso_id)
+VALUES
+ ('users/6200/ghostmetro-A-01.jpg', 'Ghost Metro, set A, image 1', 6200, 6200),
+ ('users/6200/ghostmetro-A-02.jpg', 'Ghost Metro, set A, image 2', 6200, 6200),
+ ('users/6200/ghostmetro-A-03.jpg', 'Ghost Metro, set A, image 3', 6200, 6200),
+ ('users/6200/ghostmetro-A-04.jpg', 'Ghost Metro, set A, image 4', 6200, 6200),
+ ('users/6200/ghostmetro-A-05-a.jpg', 'Ghost Metro, set A, image 5a', 6200, 6200),
+ ('users/6200/ghostmetro-A-05-b.jpg', 'Ghost Metro, set A, image 5b', 6200, 6200),
+ ('users/6200/ghostmetro-A-05-c.jpg', 'Ghost Metro, set A, image 5c', 6200, 6200),
+ ('users/6200/ghostmetro-A-06.png', 'Ghost Metro, set A, image 6', 6200, 6200),
+ ('users/6200/ghostmetro-A-07.jpg', 'Ghost Metro, set A, image 7', 6200, 6200),
+ ('users/6200/ghostmetro-A-08.jpg', 'Ghost Metro, set A, image 8', 6200, 6200),
+ ('users/6200/ghostmetro-A-09.jpg', 'Ghost Metro, set A, image 9', 6200, 6200),
+ ('users/6200/ghostmetro-A-10.jpg', 'Ghost Metro, set A, image 10', 6200, 6200),
('users/6200/ghostmetro-A-11.jpg', 'Ghost Metro, set A, image 11', 6200, 6200);
\ No newline at end of file
diff --git a/dev/time.html b/dev/time.html
index 32ff769..ae07e6e 100644
--- a/dev/time.html
+++ b/dev/time.html
@@ -1,82 +1,82 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd"
- >
-<html lang="en">
-<head>
- <title>HyperShip Time</title>
- <link rel="Stylesheet" href="../css/zed/theme.css" type="text/css" />
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
- <script type="text/javascript" src="/js/dojo/dojo/dojo.js" djConfig="isDebug:false, parseOnLoad: true"></script>
-</head>
-<body>
- <div style="width: 960px; margin: auto; margin-top: 1em;" class="container_16">
- <h1 style="font-size: 3em;">Zed</h1>
- <h2>HyperShip time</h2>
-
- <script type="text/javascript">
- dojo.require("dojox.charting.Chart2D");
- dojo.require("dojox.date.php");
- dojo.require("dijit.form.NumberSpinner");
-
- var chartTime;
-
- //A method to get the decimal part of hypership time
- function get_hypership_hour () {
- //Gets time
- date = new Date();
- unixtime = Math.floor(date.getTime() / 1000);
- seconds = unixtime - 1278115200;
- return Math.floor((seconds % 86400) / 86.4);
- }
-
- // The data to use.
- var time = get_hypership_hour();
- var timeData = [time, 1000 - time];
-
- // This function creates the chart, and is really all you
- // need. All other code is to allow you to update it on the
- // fly.
- dojo.addOnLoad(function(){
- chartTime = new dojox.charting.Chart2D("timechart");
- chartTime.addPlot("default", {
- type: "Pie",
- fontColor: "white",
- labelOffset: 40,
- radius: 100
- });
- chartTime.addSeries("Time", timeData);
- dojo.require("dojox.charting.themes.PlotKit.cyan");
- chartTime.setTheme(dojox.charting.themes.PlotKit['cyan']);
- chartTime.render();
-
- update_time(chartTime);
- });
-
- function update_time (chart) {
- //Updates chart
- var time = get_hypership_hour();
- chart.updateSeries("Time", [time, 1000 - time]);
- chart.render();
-
- //Updates legend
- var now = new Date();
- dojo.byId("currentTime").innerHTML = dojox.date.php.format(now, 'H:i');
- dojo.byId("currentTimeUTC").innerHTML = now.getUTCHours() + ':' + now.getUTCMinutes();
- dojo.byId("currentHyperShipTime").innerHTML = time;
- }
-
-
- </script>
- <dl>
- <dt>Heure actuelle (fuseau local) :</dt>
- <dd><span id="currentTime"></span></dd>
- <dt>Heure actuelle (fuseau horaire UTC) :</dt>
- <dd><span id="currentTimeUTC"></span></dd>
- <dt>Heure actuelle (HyperShip Time) :</dt>
- <dd><span id="currentHyperShipTime"></span></dd>
- </dl>
- <div id="timechart" style="width: 300px; height: 300px;"></div>
- </div>
-</body>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd"
+ >
+<html lang="en">
+<head>
+ <title>HyperShip Time</title>
+ <link rel="Stylesheet" href="../css/zed/theme.css" type="text/css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+
+ <script type="text/javascript" src="/js/dojo/dojo/dojo.js" djConfig="isDebug:false, parseOnLoad: true"></script>
+</head>
+<body>
+ <div style="width: 960px; margin: auto; margin-top: 1em;" class="container_16">
+ <h1 style="font-size: 3em;">Zed</h1>
+ <h2>HyperShip time</h2>
+
+ <script type="text/javascript">
+ dojo.require("dojox.charting.Chart2D");
+ dojo.require("dojox.date.php");
+ dojo.require("dijit.form.NumberSpinner");
+
+ var chartTime;
+
+ //A method to get the decimal part of hypership time
+ function get_hypership_hour () {
+ //Gets time
+ date = new Date();
+ unixtime = Math.floor(date.getTime() / 1000);
+ seconds = unixtime - 1278115200;
+ return Math.floor((seconds % 86400) / 86.4);
+ }
+
+ // The data to use.
+ var time = get_hypership_hour();
+ var timeData = [time, 1000 - time];
+
+ // This function creates the chart, and is really all you
+ // need. All other code is to allow you to update it on the
+ // fly.
+ dojo.addOnLoad(function(){
+ chartTime = new dojox.charting.Chart2D("timechart");
+ chartTime.addPlot("default", {
+ type: "Pie",
+ fontColor: "white",
+ labelOffset: 40,
+ radius: 100
+ });
+ chartTime.addSeries("Time", timeData);
+ dojo.require("dojox.charting.themes.PlotKit.cyan");
+ chartTime.setTheme(dojox.charting.themes.PlotKit['cyan']);
+ chartTime.render();
+
+ update_time(chartTime);
+ });
+
+ function update_time (chart) {
+ //Updates chart
+ var time = get_hypership_hour();
+ chart.updateSeries("Time", [time, 1000 - time]);
+ chart.render();
+
+ //Updates legend
+ var now = new Date();
+ dojo.byId("currentTime").innerHTML = dojox.date.php.format(now, 'H:i');
+ dojo.byId("currentTimeUTC").innerHTML = now.getUTCHours() + ':' + now.getUTCMinutes();
+ dojo.byId("currentHyperShipTime").innerHTML = time;
+ }
+
+
+ </script>
+ <dl>
+ <dt>Heure actuelle (fuseau local) :</dt>
+ <dd><span id="currentTime"></span></dd>
+ <dt>Heure actuelle (fuseau horaire UTC) :</dt>
+ <dd><span id="currentTimeUTC"></span></dd>
+ <dt>Heure actuelle (HyperShip Time) :</dt>
+ <dd><span id="currentHyperShipTime"></span></dd>
+ </dl>
+ <div id="timechart" style="width: 300px; height: 300px;"></div>
+ </div>
+</body>
</html>
\ No newline at end of file
diff --git a/doc/schema.sql b/doc/schema.sql
index 8e4ce6f..770840f 100644
--- a/doc/schema.sql
+++ b/doc/schema.sql
@@ -1,137 +1,137 @@
-SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
-
---
--- Structure de la table `zed_comments`
---
-
-CREATE TABLE IF NOT EXISTS `zed_comments` (
- `comment_ref` varchar(8) NOT NULL DEFAULT '',
- `comment_id` smallint(6) NOT NULL AUTO_INCREMENT,
- `user_id` varchar(4) DEFAULT NULL,
- `comment_title` varchar(32) NOT NULL DEFAULT '',
- `comment_parent` smallint(6) DEFAULT NULL,
- `comment_text` longtext NOT NULL,
- `comment_date` varchar(10) NOT NULL DEFAULT '',
- `comment_deleted` tinyint(4) NOT NULL DEFAULT '0',
- PRIMARY KEY (`comment_id`),
- KEY `comment_ref` (`comment_ref`),
- KEY `comment_date` (`comment_date`),
- KEY `comment_deleted` (`comment_deleted`),
- FULLTEXT KEY `text` (`comment_title`,`comment_text`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Commentaires';
-
--- --------------------------------------------------------
-
---
--- Structure de la table `zed_messages`
---
-
-CREATE TABLE IF NOT EXISTS `zed_messages` (
- `message_id` mediumint(9) NOT NULL AUTO_INCREMENT,
- `message_date` int(11) NOT NULL DEFAULT '0',
- `message_from` varchar(4) NOT NULL DEFAULT '0',
- `message_to` varchar(4) NOT NULL DEFAULT '0',
- `message_text` longtext NOT NULL,
- `message_flag` tinyint(4) NOT NULL DEFAULT '0',
- PRIMARY KEY (`message_id`),
- KEY `message_to` (`message_to`),
- KEY `message_flag` (`message_flag`),
- KEY `message_date` (`message_date`),
- KEY `inbox` (`message_to`,`message_flag`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Structure de la table `zed_profiles`
---
-
-CREATE TABLE IF NOT EXISTS `zed_profiles` (
- `user_id` int(11) NOT NULL,
- `profile_text` longtext NOT NULL,
- `profile_updated` int(10) NOT NULL,
- `profile_fixedwidth` enum('0','1') NOT NULL,
- PRIMARY KEY (`user_id`),
- KEY `profile_fixedwidth` (`profile_fixedwidth`),
- KEY `profile_updated` (`profile_updated`),
- KEY `profile_updated_2` (`profile_updated`),
- FULLTEXT KEY `profile` (`profile_text`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Structure de la table `zed_profiles_comments`
---
-
-CREATE TABLE IF NOT EXISTS `zed_profiles_comments` (
- `comment_id` mediumint(9) NOT NULL AUTO_INCREMENT,
- `user_id` smallint(5) unsigned NOT NULL,
- `comment_author` smallint(5) unsigned NOT NULL,
- `comment_date` int(10) NOT NULL,
- `comment_text` text NOT NULL,
- PRIMARY KEY (`comment_id`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Structure de la table `zed_profiles_photos`
---
-
-CREATE TABLE IF NOT EXISTS `zed_profiles_photos` (
- `photo_id` int(11) NOT NULL AUTO_INCREMENT,
- `user_id` smallint(6) NOT NULL,
- `photo_name` varchar(63) NOT NULL,
- `photo_description` varchar(63) NOT NULL,
- `photo_avatar` tinyint(4) NOT NULL DEFAULT '0',
- `photo_safe` tinyint(1) NOT NULL DEFAULT '1',
- PRIMARY KEY (`photo_id`),
- UNIQUE KEY `photo_name` (`photo_name`),
- KEY `user_id` (`user_id`),
- KEY `photo_safe` (`photo_safe`),
- KEY `photo_avatar` (`photo_avatar`),
- KEY `user_avatar` (`user_id`,`photo_avatar`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
--- --------------------------------------------------------
-
---
--- Structure de la table `zed_sessions`
---
-
-CREATE TABLE IF NOT EXISTS `zed_sessions` (
- `session_id` varchar(32) NOT NULL DEFAULT '',
- `Where` tinyint(4) NOT NULL DEFAULT '1',
- `IP` varchar(8) NOT NULL DEFAULT '',
- `user_id` smallint(5) NOT NULL DEFAULT '-1',
- `Skin` varchar(31) NOT NULL DEFAULT 'zed',
- `Skin_accent` varchar(31) NOT NULL DEFAULT '',
- `online` tinyint(4) NOT NULL DEFAULT '1',
- `HeureLimite` varchar(15) NOT NULL DEFAULT '',
- `SessionLimite` varchar(15) NOT NULL DEFAULT '',
- PRIMARY KEY (`session_id`),
- KEY `Where` (`Where`),
- KEY `HeureLimite` (`HeureLimite`)
-) ENGINE=MEMORY DEFAULT CHARSET=latin1 COMMENT='Sessions @ Pluton';
-
--- --------------------------------------------------------
-
---
--- Structure de la table `zed_users`
---
-
-CREATE TABLE IF NOT EXISTS `zed_users` (
- `user_id` smallint(11) unsigned NOT NULL,
- `username` varchar(15) NOT NULL,
- `user_password` varchar(32) NOT NULL,
- `user_email` varchar(127) NOT NULL,
- `user_longname` varchar(255) NOT NULL,
- `user_realname` varchar(255) NOT NULL,
- `user_active` tinyint(4) NOT NULL DEFAULT '0',
- `user_regdate` int(10) DEFAULT NULL,
- `haveAdminAccess` tinyint(4) NOT NULL DEFAULT '0',
- PRIMARY KEY (`user_id`),
- UNIQUE KEY `username` (`username`),
- FULLTEXT KEY `name` (`username`,`user_longname`,`user_realname`)
+SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
+
+--
+-- Structure de la table `zed_comments`
+--
+
+CREATE TABLE IF NOT EXISTS `zed_comments` (
+ `comment_ref` varchar(8) NOT NULL DEFAULT '',
+ `comment_id` smallint(6) NOT NULL AUTO_INCREMENT,
+ `user_id` varchar(4) DEFAULT NULL,
+ `comment_title` varchar(32) NOT NULL DEFAULT '',
+ `comment_parent` smallint(6) DEFAULT NULL,
+ `comment_text` longtext NOT NULL,
+ `comment_date` varchar(10) NOT NULL DEFAULT '',
+ `comment_deleted` tinyint(4) NOT NULL DEFAULT '0',
+ PRIMARY KEY (`comment_id`),
+ KEY `comment_ref` (`comment_ref`),
+ KEY `comment_date` (`comment_date`),
+ KEY `comment_deleted` (`comment_deleted`),
+ FULLTEXT KEY `text` (`comment_title`,`comment_text`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Commentaires';
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `zed_messages`
+--
+
+CREATE TABLE IF NOT EXISTS `zed_messages` (
+ `message_id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `message_date` int(11) NOT NULL DEFAULT '0',
+ `message_from` varchar(4) NOT NULL DEFAULT '0',
+ `message_to` varchar(4) NOT NULL DEFAULT '0',
+ `message_text` longtext NOT NULL,
+ `message_flag` tinyint(4) NOT NULL DEFAULT '0',
+ PRIMARY KEY (`message_id`),
+ KEY `message_to` (`message_to`),
+ KEY `message_flag` (`message_flag`),
+ KEY `message_date` (`message_date`),
+ KEY `inbox` (`message_to`,`message_flag`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `zed_profiles`
+--
+
+CREATE TABLE IF NOT EXISTS `zed_profiles` (
+ `user_id` int(11) NOT NULL,
+ `profile_text` longtext NOT NULL,
+ `profile_updated` int(10) NOT NULL,
+ `profile_fixedwidth` enum('0','1') NOT NULL,
+ PRIMARY KEY (`user_id`),
+ KEY `profile_fixedwidth` (`profile_fixedwidth`),
+ KEY `profile_updated` (`profile_updated`),
+ KEY `profile_updated_2` (`profile_updated`),
+ FULLTEXT KEY `profile` (`profile_text`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `zed_profiles_comments`
+--
+
+CREATE TABLE IF NOT EXISTS `zed_profiles_comments` (
+ `comment_id` mediumint(9) NOT NULL AUTO_INCREMENT,
+ `user_id` smallint(5) unsigned NOT NULL,
+ `comment_author` smallint(5) unsigned NOT NULL,
+ `comment_date` int(10) NOT NULL,
+ `comment_text` text NOT NULL,
+ PRIMARY KEY (`comment_id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `zed_profiles_photos`
+--
+
+CREATE TABLE IF NOT EXISTS `zed_profiles_photos` (
+ `photo_id` int(11) NOT NULL AUTO_INCREMENT,
+ `user_id` smallint(6) NOT NULL,
+ `photo_name` varchar(63) NOT NULL,
+ `photo_description` varchar(63) NOT NULL,
+ `photo_avatar` tinyint(4) NOT NULL DEFAULT '0',
+ `photo_safe` tinyint(1) NOT NULL DEFAULT '1',
+ PRIMARY KEY (`photo_id`),
+ UNIQUE KEY `photo_name` (`photo_name`),
+ KEY `user_id` (`user_id`),
+ KEY `photo_safe` (`photo_safe`),
+ KEY `photo_avatar` (`photo_avatar`),
+ KEY `user_avatar` (`user_id`,`photo_avatar`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `zed_sessions`
+--
+
+CREATE TABLE IF NOT EXISTS `zed_sessions` (
+ `session_id` varchar(32) NOT NULL DEFAULT '',
+ `Where` tinyint(4) NOT NULL DEFAULT '1',
+ `IP` varchar(8) NOT NULL DEFAULT '',
+ `user_id` smallint(5) NOT NULL DEFAULT '-1',
+ `Skin` varchar(31) NOT NULL DEFAULT 'zed',
+ `Skin_accent` varchar(31) NOT NULL DEFAULT '',
+ `online` tinyint(4) NOT NULL DEFAULT '1',
+ `HeureLimite` varchar(15) NOT NULL DEFAULT '',
+ `SessionLimite` varchar(15) NOT NULL DEFAULT '',
+ PRIMARY KEY (`session_id`),
+ KEY `Where` (`Where`),
+ KEY `HeureLimite` (`HeureLimite`)
+) ENGINE=MEMORY DEFAULT CHARSET=latin1 COMMENT='Sessions @ Pluton';
+
+-- --------------------------------------------------------
+
+--
+-- Structure de la table `zed_users`
+--
+
+CREATE TABLE IF NOT EXISTS `zed_users` (
+ `user_id` smallint(11) unsigned NOT NULL,
+ `username` varchar(15) NOT NULL,
+ `user_password` varchar(32) NOT NULL,
+ `user_email` varchar(127) NOT NULL,
+ `user_longname` varchar(255) NOT NULL,
+ `user_realname` varchar(255) NOT NULL,
+ `user_active` tinyint(4) NOT NULL DEFAULT '0',
+ `user_regdate` int(10) DEFAULT NULL,
+ `haveAdminAccess` tinyint(4) NOT NULL DEFAULT '0',
+ PRIMARY KEY (`user_id`),
+ UNIQUE KEY `username` (`username`),
+ FULLTEXT KEY `name` (`username`,`user_longname`,`user_realname`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
\ No newline at end of file
diff --git a/includes/api/cerbere.php b/includes/api/cerbere.php
index 4dd6e57..ffea3ec 100755
--- a/includes/api/cerbere.php
+++ b/includes/api/cerbere.php
@@ -1,124 +1,124 @@
-<?php
-
-/**
- * API security
- *
- * Zed. The immensity of stars. The HyperShip. The people.
- *
- * (c) 2010, Dereckson, some rights reserved.
- * Released under BSD license.
- *
- * This file provides a cerbere function, to assert the user is correctly
- * authenticated in the API call.
- *
- * @package Zed
- * @subpackage API
- * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
- * @copyright 2010 Sébastien Santoro aka Dereckson
- * @license http://www.opensource.org/licenses/bsd-license.php BSD
- * @version 0.1
- * @link http://scherzo.dereckson.be/doc/zed
- * @link http://zed.dereckson.be/
- * @filesource
- */
-
-/**
- * Determines if localhost calls could be passed.
- *
- * If true, any call from localhost is valid. Otherwise, normal security rules are applied.
- */
-define('ALLOW_LOCALHOST', false);
-
-/**
- * Determines if error should be printed.
- *
- * If true, the error will be printed according the FORMAT_ERROR setting. Otherwise, a blank page will be served.
- */
-define('OUTPUT_ERROR', true);
-
-/**
- * Determines if the error must be formatted.
- *
- * If true, any error will be sent to api_output ; otherwise, it will be printed as is.
- */
-define('FORMAT_ERROR', false);
-
-
-if (!defined('TABLE_API_KEYS')) {
- /**
- * The table where are located the API keys
- */
- define('TABLE_API_KEYS', 'api_keys');
-}
-
-/**
- * Checks if creditentials are okay and exits if not
- *
- * If the creditentials aren't valid, it will prints an error message if
- * OUTPUT_ERROR is defined and true.
- *
- * This error message will be formatted through the api_output function if
- * FORMAT_ERROR is defined and true ; otherwise, it will be print as is.
- *
- * To help debug, you can also define ALLOW_LOCALHOST. If this constant is
- * defined and true, any call from localhost will be accepted, without checking
- * the key.
- *
- * @see cerbere_die
- */
-function cerbere () {
- //If ALLOW_LOCALHOST is true, we allow 127.0.0.1 queries
- //If you use one of your local IP in your webserver vhost like 10.0.0.3
- //it could be easier to create yourself a test key
- if (ALLOW_LOCALHOST && $_SERVER['REMOTE_ADDR'] == '127.0.0.1') {
- return;
- }
-
- //No key, no authentication
- if (!$guid = $_REQUEST['key']) {
- cerbere_die('You must add creditentials to your request.');
- }
-
- //Authenticates user
- global $db;
- $guid = $db->sql_escape($guid);
- $sql = "SELECT key_active FROM " . TABLE_API_KEYS .
- " WHERE key_guid like '$guid'";
- if (!$result = $db->sql_query($sql)) {
- message_die(SQL_ERROR, "Can't get key", '', __LINE__, __FILE__, $sql);
- }
- if ($row = $db->sql_fetchrow($result)) {
- if ($row['key_active']) {
- //key_hits++
- $sql = "UPDATE " . TABLE_API_KEYS . " SET key_hits = key_hits + 1" .
- " WHERE key_guid like '$guid'";
- if (!$db->sql_query($sql))
- message_die(SQL_ERROR, "Can't record api call", '', __LINE__, __FILE__, $sql);
- } else {
- cerbere_die("Key disabled.");
- }
- } else {
- cerbere_die("Key doesn't exist.");
- }
-}
-
-/**
- * Prints a message in raw or API format, then exits.
- *
- * The error message will be formatted through api_output if the constant
- * FORMAT_ERROR is defined and true. Otherwise, it will be printed as is.
- *
- * @param string $message The error message to print
- */
-function cerbere_die ($message) {
- if (OUTPUT_ERROR) {
- if (FORMAT_ERROR) {
- api_output($message, 'error');
- } else {
- echo $message;
- }
- }
- exit;
-}
-
+<?php
+
+/**
+ * API security
+ *
+ * Zed. The immensity of stars. The HyperShip. The people.
+ *
+ * (c) 2010, Dereckson, some rights reserved.
+ * Released under BSD license.
+ *
+ * This file provides a cerbere function, to assert the user is correctly
+ * authenticated in the API call.
+ *
+ * @package Zed
+ * @subpackage API
+ * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
+ * @copyright 2010 Sébastien Santoro aka Dereckson
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD
+ * @version 0.1
+ * @link http://scherzo.dereckson.be/doc/zed
+ * @link http://zed.dereckson.be/
+ * @filesource
+ */
+
+/**
+ * Determines if localhost calls could be passed.
+ *
+ * If true, any call from localhost is valid. Otherwise, normal security rules are applied.
+ */
+define('ALLOW_LOCALHOST', false);
+
+/**
+ * Determines if error should be printed.
+ *
+ * If true, the error will be printed according the FORMAT_ERROR setting. Otherwise, a blank page will be served.
+ */
+define('OUTPUT_ERROR', true);
+
+/**
+ * Determines if the error must be formatted.
+ *
+ * If true, any error will be sent to api_output ; otherwise, it will be printed as is.
+ */
+define('FORMAT_ERROR', false);
+
+
+if (!defined('TABLE_API_KEYS')) {
+ /**
+ * The table where are located the API keys
+ */
+ define('TABLE_API_KEYS', 'api_keys');
+}
+
+/**
+ * Checks if creditentials are okay and exits if not
+ *
+ * If the creditentials aren't valid, it will prints an error message if
+ * OUTPUT_ERROR is defined and true.
+ *
+ * This error message will be formatted through the api_output function if
+ * FORMAT_ERROR is defined and true ; otherwise, it will be print as is.
+ *
+ * To help debug, you can also define ALLOW_LOCALHOST. If this constant is
+ * defined and true, any call from localhost will be accepted, without checking
+ * the key.
+ *
+ * @see cerbere_die
+ */
+function cerbere () {
+ //If ALLOW_LOCALHOST is true, we allow 127.0.0.1 queries
+ //If you use one of your local IP in your webserver vhost like 10.0.0.3
+ //it could be easier to create yourself a test key
+ if (ALLOW_LOCALHOST && $_SERVER['REMOTE_ADDR'] == '127.0.0.1') {
+ return;
+ }
+
+ //No key, no authentication
+ if (!$guid = $_REQUEST['key']) {
+ cerbere_die('You must add creditentials to your request.');
+ }
+
+ //Authenticates user
+ global $db;
+ $guid = $db->sql_escape($guid);
+ $sql = "SELECT key_active FROM " . TABLE_API_KEYS .
+ " WHERE key_guid like '$guid'";
+ if (!$result = $db->sql_query($sql)) {
+ message_die(SQL_ERROR, "Can't get key", '', __LINE__, __FILE__, $sql);
+ }
+ if ($row = $db->sql_fetchrow($result)) {
+ if ($row['key_active']) {
+ //key_hits++
+ $sql = "UPDATE " . TABLE_API_KEYS . " SET key_hits = key_hits + 1" .
+ " WHERE key_guid like '$guid'";
+ if (!$db->sql_query($sql))
+ message_die(SQL_ERROR, "Can't record api call", '', __LINE__, __FILE__, $sql);
+ } else {
+ cerbere_die("Key disabled.");
+ }
+ } else {
+ cerbere_die("Key doesn't exist.");
+ }
+}
+
+/**
+ * Prints a message in raw or API format, then exits.
+ *
+ * The error message will be formatted through api_output if the constant
+ * FORMAT_ERROR is defined and true. Otherwise, it will be printed as is.
+ *
+ * @param string $message The error message to print
+ */
+function cerbere_die ($message) {
+ if (OUTPUT_ERROR) {
+ if (FORMAT_ERROR) {
+ api_output($message, 'error');
+ } else {
+ echo $message;
+ }
+ }
+ exit;
+}
+
?>
\ No newline at end of file
diff --git a/includes/geo/body.php b/includes/geo/body.php
index f440c94..03c279f 100755
--- a/includes/geo/body.php
+++ b/includes/geo/body.php
@@ -1,174 +1,174 @@
-<?php
-
-/**
- * Geo body class.
- *
- * Zed. The immensity of stars. The HyperShip. The people.
- *
- * (c) 2010, Dereckson, some rights reserved.
- * Released under BSD license.
- *
- * A 3D grid of objects
- *
- * 0.1 2010-01-27 21:51 Autogenerated by Pluton Scaffolding
- *
- * @package Zed
- * @subpackage Geo
- * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
- * @copyright 2010 Sébastien Santoro aka Dereckson
- * @license http://www.opensource.org/licenses/bsd-license.php BSD
- * @version 0.1
- * @link http://scherzo.dereckson.be/doc/zed
- * @link http://zed.dereckson.be/
- * @filesource
- */
+<?php
+
+/**
+ * Geo body class.
+ *
+ * Zed. The immensity of stars. The HyperShip. The people.
+ *
+ * (c) 2010, Dereckson, some rights reserved.
+ * Released under BSD license.
+ *
+ * A 3D grid of objects
+ *
+ * 0.1 2010-01-27 21:51 Autogenerated by Pluton Scaffolding
+ *
+ * @package Zed
+ * @subpackage Geo
+ * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
+ * @copyright 2010 Sébastien Santoro aka Dereckson
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD
+ * @version 0.1
+ * @link http://scherzo.dereckson.be/doc/zed
+ * @link http://zed.dereckson.be/
+ * @filesource
+ */
/**
* Geo body class
- */
-class GeoBody {
-
- public $code;
- public $name;
-
- public $hypership;
- public $asteroid;
- public $moon;
- public $planet;
- public $star;
- public $orbital;
- public $hidden;
-
- public $location;
- public $description;
-
- public $lastError;
-
- /**
+ */
+class GeoBody {
+
+ public $code;
+ public $name;
+
+ public $hypership;
+ public $asteroid;
+ public $moon;
+ public $planet;
+ public $star;
+ public $orbital;
+ public $hidden;
+
+ public $location;
+ public $description;
+
+ public $lastError;
+
+ /**
* Initializes a new instance
- *
- * @param int $code the primary key
- */
- function __construct ($code = null) {
- if ($code) {
- $this->code = $code;
- $this->load_from_database();
- }
- }
-
- /**
+ *
+ * @param int $code the primary key
+ */
+ function __construct ($code = null) {
+ if ($code) {
+ $this->code = $code;
+ $this->load_from_database();
+ }
+ }
+
+ /**
* Loads the object body (ie fill the properties) from the $_POST array
*
- * @param bool $readBoolean if false, don't read any form item matching a boolean field to avoid to set it to false if there are absent from a form.
- */
- function load_from_form ($readBoolean = true) {
- if (array_key_exists('name', $_POST)) $this->name = $_POST['name'];
-
- if ($readBoolean) {
- if (array_key_exists('hypership', $_POST)) $this->hypership = $_POST['hypership'];
- if (array_key_exists('star', $_POST)) $this->start = $_POST['star'];
- if (array_key_exists('asteroid', $_POST)) $this->hypership = $_POST['asteroid'];
- if (array_key_exists('moon', $_POST)) $this->start = $_POST['moon'];
- if (array_key_exists('planet', $_POST)) $this->start = $_POST['planet'];
- if (array_key_exists('orbital', $_POST)) $this->start = $_POST['orbital'];
- if (array_key_exists('hidden', $_POST)) $this->start = $_POST['hidden'];
- }
-
- if (array_key_exists('location', $_POST)) $this->location = $_POST['location'];
- if (array_key_exists('description', $_POST)) $this->description = $_POST['description'];
- }
-
- /**
- * Loads the object body (ie fill the properties) from the database
- */
- function load_from_database () {
- global $db;
- $sql = "SELECT * FROM " . TABLE_BODIES . " WHERE body_code = '" . $this->code . "'";
- if ( !($result = $db->sql_query($sql)) ) message_die(SQL_ERROR, "Unable to query geo_bodies", '', __LINE__, __FILE__, $sql);
- if (!$row = $db->sql_fetchrow($result)) {
- $this->lastError = "body unkwown: " . $this->code;
- return false;
- }
-
- $this->name = $row['body_name'];
- $this->location = $row['body_location'];
- $this->description = $row['body_description'];
-
- if ($row['body_status']) {
- $flags = explode(',', $row['body_status']);
- foreach ($flags as $flag) {
- $this->$flag = true;
- }
- }
-
- return true;
- }
-
- /**
+ * @param bool $readBoolean if false, don't read any form item matching a boolean field to avoid to set it to false if there are absent from a form.
+ */
+ function load_from_form ($readBoolean = true) {
+ if (array_key_exists('name', $_POST)) $this->name = $_POST['name'];
+
+ if ($readBoolean) {
+ if (array_key_exists('hypership', $_POST)) $this->hypership = $_POST['hypership'];
+ if (array_key_exists('star', $_POST)) $this->start = $_POST['star'];
+ if (array_key_exists('asteroid', $_POST)) $this->hypership = $_POST['asteroid'];
+ if (array_key_exists('moon', $_POST)) $this->start = $_POST['moon'];
+ if (array_key_exists('planet', $_POST)) $this->start = $_POST['planet'];
+ if (array_key_exists('orbital', $_POST)) $this->start = $_POST['orbital'];
+ if (array_key_exists('hidden', $_POST)) $this->start = $_POST['hidden'];
+ }
+
+ if (array_key_exists('location', $_POST)) $this->location = $_POST['location'];
+ if (array_key_exists('description', $_POST)) $this->description = $_POST['description'];
+ }
+
+ /**
+ * Loads the object body (ie fill the properties) from the database
+ */
+ function load_from_database () {
+ global $db;
+ $sql = "SELECT * FROM " . TABLE_BODIES . " WHERE body_code = '" . $this->code . "'";
+ if ( !($result = $db->sql_query($sql)) ) message_die(SQL_ERROR, "Unable to query geo_bodies", '', __LINE__, __FILE__, $sql);
+ if (!$row = $db->sql_fetchrow($result)) {
+ $this->lastError = "body unkwown: " . $this->code;
+ return false;
+ }
+
+ $this->name = $row['body_name'];
+ $this->location = $row['body_location'];
+ $this->description = $row['body_description'];
+
+ if ($row['body_status']) {
+ $flags = explode(',', $row['body_status']);
+ foreach ($flags as $flag) {
+ $this->$flag = true;
+ }
+ }
+
+ return true;
+ }
+
+ /**
* Gets the status field
*
- * @return string the status field value (e.g. "asteroid,hidden")
- */
- function get_status () {
- $flags = array('hypership','asteroid','moon','planet','star','orbital','hidden');
- foreach ($flags as $flag) {
- if ($this->$flag) {
- $status[] = $flag;
- }
- }
- return implode(',', $status);
- }
-
- /**
+ * @return string the status field value (e.g. "asteroid,hidden")
+ */
+ function get_status () {
+ $flags = array('hypership','asteroid','moon','planet','star','orbital','hidden');
+ foreach ($flags as $flag) {
+ if ($this->$flag) {
+ $status[] = $flag;
+ }
+ }
+ return implode(',', $status);
+ }
+
+ /**
* Gets the kind of place the body is (e.g. asteroid)
*
- * @return string the kind of place
- */
- function kind () {
- //If a location can be described by 2 flags, order the relevant flags list
- //by priority, as it'll return the first trigerred.
- //e.g. a moon converted in hypership will be "hypership" and not "moon".
- $relevantFlags = array('hypership','asteroid','moon','planet','star','orbital');
- foreach ($relevantFlags as $flag) {
- if ($this->$flag) {
- return $flag;
- }
- }
- return "";
- }
+ * @return string the kind of place
+ */
+ function kind () {
+ //If a location can be described by 2 flags, order the relevant flags list
+ //by priority, as it'll return the first trigerred.
+ //e.g. a moon converted in hypership will be "hypership" and not "moon".
+ $relevantFlags = array('hypership','asteroid','moon','planet','star','orbital');
+ foreach ($relevantFlags as $flag) {
+ if ($this->$flag) {
+ return $flag;
+ }
+ }
+ return "";
+ }
/**
* Gets the name of the body, as a string representation of the object
*
* @return string the name of the body
- */
- function __toString () {
- return $this->name;
- }
-
- /**
- * Saves to database
- */
- function save_to_database () {
- global $db;
-
- $code = $this->code ? "'" . $db->sql_escape($this->code) . "'" : 'NULL';
- $name = $db->sql_escape($this->name);
- $status = get_status();
- $location = $db->sql_escape($this->location);
- $description = $db->sql_escape($this->description);
-
- //Updates or inserts
- $sql = "REPLACE INTO " . TABLE_BODIES . " (`body_code`, `body_name`, `body_status`, `body_location`, `body_description`) VALUES ($code, '$name', '$status', '$location', '$description')";
- if (!$db->sql_query($sql)) {
- message_die(SQL_ERROR, "Unable to save", '', __LINE__, __FILE__, $sql);
- }
-
- if (!$code) {
- //Gets new record code value
- $this->code = $db->sql_nextid();
- }
- }
-}
-
+ */
+ function __toString () {
+ return $this->name;
+ }
+
+ /**
+ * Saves to database
+ */
+ function save_to_database () {
+ global $db;
+
+ $code = $this->code ? "'" . $db->sql_escape($this->code) . "'" : 'NULL';
+ $name = $db->sql_escape($this->name);
+ $status = get_status();
+ $location = $db->sql_escape($this->location);
+ $description = $db->sql_escape($this->description);
+
+ //Updates or inserts
+ $sql = "REPLACE INTO " . TABLE_BODIES . " (`body_code`, `body_name`, `body_status`, `body_location`, `body_description`) VALUES ($code, '$name', '$status', '$location', '$description')";
+ if (!$db->sql_query($sql)) {
+ message_die(SQL_ERROR, "Unable to save", '', __LINE__, __FILE__, $sql);
+ }
+
+ if (!$code) {
+ //Gets new record code value
+ $this->code = $db->sql_nextid();
+ }
+ }
+}
+
?>
\ No newline at end of file
diff --git a/includes/geo/galaxy.php b/includes/geo/galaxy.php
index 5ab4a74..e4aa072 100755
--- a/includes/geo/galaxy.php
+++ b/includes/geo/galaxy.php
@@ -1,119 +1,119 @@
-<?php
-
-/**
- * Geo galaxy class.
- *
- * Zed. The immensity of stars. The HyperShip. The people.
- *
- * (c) 2010, Dereckson, some rights reserved.
- * Released under BSD license.
- *
- * A 3D grid of objects
- *
- * 0.1 2010-02-08 14:02 Initial version [DcK]
- * 0.2 2010-07-25 9:20 Spherical conversion, get objects
- *
- * @package Zed
- * @subpackage Geo
- * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
- * @copyright 2010 Sébastien Santoro aka Dereckson
- * @license http://www.opensource.org/licenses/bsd-license.php BSD
- * @version 0.1
- * @link http://scherzo.dereckson.be/doc/zed
- * @link http://zed.dereckson.be/
- * @filesource
- */
-
-/**
- * Geo galaxy class
- *
- * This class provides methods to convert coordinate polars.
- *
- * @todo create a unit testing file dev/tests/GeoGalaxyTest.php
- * @todo add unit testing for the normalize_angle method in dev/tests/GeoGalaxyTest.php
- */
-class GeoGalaxy {
- /*
- * ----------------------------------------------------------------------- *
- * Objects fetchers
- * ----------------------------------------------------------------------- *
- */
-
- /**
- * Gets all the coordinates of the objects in the galaxy.
- *
- * @return array An array of array. Each item is [string object_name, string object_type, GeoPoint3D coordinates]
- */
- static function get_coordinates () {
- global $db;
- $sql = "SELECT * FROM geo_coordinates";
- if (!$result = $db->sql_query($sql)) message_die(SQL_ERROR, "Can't query geo_coordinates view.", '', __LINE__, __FILE__, $sql);
-
- $objects = array();
- while ($row = $db->sql_fetchrow($result)) {
- //Demios ship xyz: [-50, 30, 40]
- //Kaos asteroid xyz: [150, -129, 10]
- $objects[] = array($row[0], $row[1], GeoPoint3D::fromString($row[2]));
- }
- return $objects;
- }
-
- /*
- * ----------------------------------------------------------------------- *
- * Helper methods - math
- * ----------------------------------------------------------------------- *
- */
-
- /**
- * Normalizes an angle, so 0 =< angle < 2 PI
- *
- * @param float $angle angle in radians (use deg2rad() if you've degrees)
- * @return an angle in the 0 =< angle < 2 PI interval
- */
- static function normalize_angle ($angle) {
- while ($angle < 0) {
- $angle += 2 * M_PI;
- }
- while ($angle >= 2 * M_PI) {
- $angle -= 2 * M_PI;
- }
- return $angle;
- }
-
- /**
- * Converts (x, y, z) cartesian to (ρ, φ, θ) spherical coordinates
- *
- * The algo used is from http://fr.wikipedia.org/wiki/Coordonn%C3%A9es_sph%C3%A9riques#Relation_avec_les_autres_syst.C3.A8mes_de_coordonn.C3.A9es_usuels
- *
- * @param int $x the x coordinate
- * @param int $y the y coordinate
- * @param int $z the z coordinate
- * @return array an array of 3 floats number, representing the (ρ, φ, θ) spherical coordinates
- */
- static function cartesian_to_spherical ($x, $y, $z) {
- $rho = sqrt($x * $x + $y * $y + $z * $z); //ρ = sqrt(x² + y² + z²)
- $theta= acos($z / $rho); //φ = acos z/φ
- $phi = acos($x / sqrt($x * $x + $y * $y)); //θ = acos x / sqrt(x² + y²)
- if (y < 0) $phi = 2 * M_PI - $phi; //∀ y < 0 θ = 2π - θ
-
- return array(round($rho, 2), round(rad2deg($theta), 2), round(rad2deg($phi), 2));
- }
-
- /**
- * Converts (x, y, z) cartesian to (ρ, φ, θ) spherical coordinates
- *
- * The algo used is from http://www.phy225.dept.shef.ac.uk/mediawiki/index.php/Cartesian_to_polar_conversion
- *
- * @param int $x the x coordinate
- * @param int $y the y coordinate
- * @param int $z the z coordinate
- * @return array an array of 3 floats number, representing the (ρ, φ, θ) spherical coordinates
- */
- static function cartesian_to_spherical2 ($x, $y, $z) {
- $rho = sqrt($x * $x + $y * $y + $z * $z); //ρ = sqrt(x² + y² + z²)
- $theta= atan2($y, $x); //φ = atan2 $y $x
- $phi = acos($z / $rho); //θ = acos z/φ
-
- return array(round($rho, 2), round(rad2deg($theta), 2), round(rad2deg($phi), 2));
- }
+<?php
+
+/**
+ * Geo galaxy class.
+ *
+ * Zed. The immensity of stars. The HyperShip. The people.
+ *
+ * (c) 2010, Dereckson, some rights reserved.
+ * Released under BSD license.
+ *
+ * A 3D grid of objects
+ *
+ * 0.1 2010-02-08 14:02 Initial version [DcK]
+ * 0.2 2010-07-25 9:20 Spherical conversion, get objects
+ *
+ * @package Zed
+ * @subpackage Geo
+ * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
+ * @copyright 2010 Sébastien Santoro aka Dereckson
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD
+ * @version 0.1
+ * @link http://scherzo.dereckson.be/doc/zed
+ * @link http://zed.dereckson.be/
+ * @filesource
+ */
+
+/**
+ * Geo galaxy class
+ *
+ * This class provides methods to convert coordinate polars.
+ *
+ * @todo create a unit testing file dev/tests/GeoGalaxyTest.php
+ * @todo add unit testing for the normalize_angle method in dev/tests/GeoGalaxyTest.php
+ */
+class GeoGalaxy {
+ /*
+ * ----------------------------------------------------------------------- *
+ * Objects fetchers
+ * ----------------------------------------------------------------------- *
+ */
+
+ /**
+ * Gets all the coordinates of the objects in the galaxy.
+ *
+ * @return array An array of array. Each item is [string object_name, string object_type, GeoPoint3D coordinates]
+ */
+ static function get_coordinates () {
+ global $db;
+ $sql = "SELECT * FROM geo_coordinates";
+ if (!$result = $db->sql_query($sql)) message_die(SQL_ERROR, "Can't query geo_coordinates view.", '', __LINE__, __FILE__, $sql);
+
+ $objects = array();
+ while ($row = $db->sql_fetchrow($result)) {
+ //Demios ship xyz: [-50, 30, 40]
+ //Kaos asteroid xyz: [150, -129, 10]
+ $objects[] = array($row[0], $row[1], GeoPoint3D::fromString($row[2]));
+ }
+ return $objects;
+ }
+
+ /*
+ * ----------------------------------------------------------------------- *
+ * Helper methods - math
+ * ----------------------------------------------------------------------- *
+ */
+
+ /**
+ * Normalizes an angle, so 0 =< angle < 2 PI
+ *
+ * @param float $angle angle in radians (use deg2rad() if you've degrees)
+ * @return an angle in the 0 =< angle < 2 PI interval
+ */
+ static function normalize_angle ($angle) {
+ while ($angle < 0) {
+ $angle += 2 * M_PI;
+ }
+ while ($angle >= 2 * M_PI) {
+ $angle -= 2 * M_PI;
+ }
+ return $angle;
+ }
+
+ /**
+ * Converts (x, y, z) cartesian to (ρ, φ, θ) spherical coordinates
+ *
+ * The algo used is from http://fr.wikipedia.org/wiki/Coordonn%C3%A9es_sph%C3%A9riques#Relation_avec_les_autres_syst.C3.A8mes_de_coordonn.C3.A9es_usuels
+ *
+ * @param int $x the x coordinate
+ * @param int $y the y coordinate
+ * @param int $z the z coordinate
+ * @return array an array of 3 floats number, representing the (ρ, φ, θ) spherical coordinates
+ */
+ static function cartesian_to_spherical ($x, $y, $z) {
+ $rho = sqrt($x * $x + $y * $y + $z * $z); //ρ = sqrt(x² + y² + z²)
+ $theta= acos($z / $rho); //φ = acos z/φ
+ $phi = acos($x / sqrt($x * $x + $y * $y)); //θ = acos x / sqrt(x² + y²)
+ if (y < 0) $phi = 2 * M_PI - $phi; //∀ y < 0 θ = 2π - θ
+
+ return array(round($rho, 2), round(rad2deg($theta), 2), round(rad2deg($phi), 2));
+ }
+
+ /**
+ * Converts (x, y, z) cartesian to (ρ, φ, θ) spherical coordinates
+ *
+ * The algo used is from http://www.phy225.dept.shef.ac.uk/mediawiki/index.php/Cartesian_to_polar_conversion
+ *
+ * @param int $x the x coordinate
+ * @param int $y the y coordinate
+ * @param int $z the z coordinate
+ * @return array an array of 3 floats number, representing the (ρ, φ, θ) spherical coordinates
+ */
+ static function cartesian_to_spherical2 ($x, $y, $z) {
+ $rho = sqrt($x * $x + $y * $y + $z * $z); //ρ = sqrt(x² + y² + z²)
+ $theta= atan2($y, $x); //φ = atan2 $y $x
+ $phi = acos($z / $rho); //θ = acos z/φ
+
+ return array(round($rho, 2), round(rad2deg($theta), 2), round(rad2deg($phi), 2));
+ }
}
\ No newline at end of file
diff --git a/includes/geo/octocube.php b/includes/geo/octocube.php
index b4f9231..917a539 100755
--- a/includes/geo/octocube.php
+++ b/includes/geo/octocube.php
@@ -1,143 +1,143 @@
-<?php
-
-/**
- * Geo octocube class.
- *
- * Zed. The immensity of stars. The HyperShip. The people.
- *
- * (c) 2010, Dereckson, some rights reserved.
- * Released under BSD license.
- *
- * @package Zed
- * @subpackage Geo
- * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
- * @copyright 2010 Sébastien Santoro aka Dereckson
- * @license http://www.opensource.org/licenses/bsd-license.php BSD
- * @version 0.1
- * @link http://scherzo.dereckson.be/doc/zed
- * @link http://zed.dereckson.be/
- * @filesource
- */
-
-/**
- * Geo octocube class
- *
- * An octocube is a cube divided in 8 parts (sliced in two in x, y and z)
- *
- * The coordinates (0, 0, 0) represents the octocube center.
- */
-class GeoOctocube {
- /**
- * Gets the sector from the (x, y, z) specified coordinates
- *
- * Sector will be:
- * <code>
- * // _____ _____
- * // / 5 / 6 /|
- * // /- - -/- - -/ |
- * // /_____/____ /| |
- * // | | | |/|
- * // | 7 | 8 | / | 2
- * // |_____|_____|/| |
- * // | | | |/
- * // | 3 | 4 | /
- * // |_____|_____|/
- * </code>
- *
- * @param int $x the x coordinate
- * @param int $y the y coordinate
- * @param int $z the z coordinate
- * @return int the number of the sector (0 if x = y = z = 0 ; otherwise, 1 to 8)
- */
- static function get_sector ($x, $y, $z) {
- //Cube center
- if ($x == 0 && $y == 0 && $z == 0) return 0;
-
- //One of the 8 cubes
- $sector = 1;
- if ($x >= 0) $sector++; //we're at right
- if ($y < 0) $sector += 2; //we're at bottom
- if ($z >= 0) $sector += 4; //we're on the top layer
-
- return $sector;
- }
-
- /**
- * Gets the sector from the (x, y, z) specified coordinates
- * @see get_sector
- *
- * @param mixed $pt a GeoPoint3D object for the x, y, z coordinates or a parsable string
- * @return int the number of the sector (0 if x = y = z 0 ; otherwise, 1 to 8)
- */
- static function get_sector_from_point3D ($pt) {
- if (is_string($pt)) {
- $pt = GeoPoint3D::fromString($pt);
- }
- return self::get_sector($pt->x, $pt->y, $pt->z);
- }
-
- /**
- * Gets the base vector for the specified sector
- *
- * Example code:
- *
- * $vector = GeoOctocube::get_base_vector(4);
- * //$vector is a (1, -1, -1) array
- *
- * @param int $sector the sector number (0-8)
- * @return array if the sector is 0, (0, 0, 0) ; otherwise, an array with three signed 1 values.
- */
- static function get_base_vector ($sector) {
- switch ($sector) {
- case 0: return array(0, 0, 0);
- case 1: return array(-1, 1, -1);
- case 2: return array(1, 1, -1);
- case 3: return array(-1, -1, -1);
- case 4: return array(1, -1, -1);
- case 5: return array(-1, 1, 1);
- case 6: return array(1, 1, 1);
- case 7: return array(-1, -1, 1);
- case 8: return array(1, -1, 1);
- default: message_die(GENERAL_ERROR, "Invalid sector: $sector", "GeoOctocube::get_base_vector");
- }
- }
-
-
- /**
- * Gets SQL RLIKE pattern for the specified sector
- *
- * @param int $sector the sector number (0-8)
- * @param int $z if not null, limits the query to the specified z coordinate [optional]
- * @return string a SQL clause like "([0-9]+, -[0,9]+, [0,9]+)"
- */
- static function get_rlike_pattern_from_sector ($sector, $z = null) {
- if ($sector == 0) return "(0, 0, 0)";
-
- $vector = self::get_base_vector($sector);
-
- //x
- if ($vector[0] == 1)
- $query = "([0-9]+, ";
- else
- $query = "(-[0-9]+, ";
-
- //y
- if ($vector[1] == 1)
- $query .= "[0-9]+, ";
- else
- $query .= "-[0-9]+, ";
-
- //z
- if ($z !== null) {
- $query .= "$z)";
- } elseif ($vector[2] == "1") {
- $query .= "[0-9]+)";
- } else {
- $query .= "-[0-9]+)";
- }
-
- return $query;
- }
-}
-
-?>
+<?php
+
+/**
+ * Geo octocube class.
+ *
+ * Zed. The immensity of stars. The HyperShip. The people.
+ *
+ * (c) 2010, Dereckson, some rights reserved.
+ * Released under BSD license.
+ *
+ * @package Zed
+ * @subpackage Geo
+ * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
+ * @copyright 2010 Sébastien Santoro aka Dereckson
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD
+ * @version 0.1
+ * @link http://scherzo.dereckson.be/doc/zed
+ * @link http://zed.dereckson.be/
+ * @filesource
+ */
+
+/**
+ * Geo octocube class
+ *
+ * An octocube is a cube divided in 8 parts (sliced in two in x, y and z)
+ *
+ * The coordinates (0, 0, 0) represents the octocube center.
+ */
+class GeoOctocube {
+ /**
+ * Gets the sector from the (x, y, z) specified coordinates
+ *
+ * Sector will be:
+ * <code>
+ * // _____ _____
+ * // / 5 / 6 /|
+ * // /- - -/- - -/ |
+ * // /_____/____ /| |
+ * // | | | |/|
+ * // | 7 | 8 | / | 2
+ * // |_____|_____|/| |
+ * // | | | |/
+ * // | 3 | 4 | /
+ * // |_____|_____|/
+ * </code>
+ *
+ * @param int $x the x coordinate
+ * @param int $y the y coordinate
+ * @param int $z the z coordinate
+ * @return int the number of the sector (0 if x = y = z = 0 ; otherwise, 1 to 8)
+ */
+ static function get_sector ($x, $y, $z) {
+ //Cube center
+ if ($x == 0 && $y == 0 && $z == 0) return 0;
+
+ //One of the 8 cubes
+ $sector = 1;
+ if ($x >= 0) $sector++; //we're at right
+ if ($y < 0) $sector += 2; //we're at bottom
+ if ($z >= 0) $sector += 4; //we're on the top layer
+
+ return $sector;
+ }
+
+ /**
+ * Gets the sector from the (x, y, z) specified coordinates
+ * @see get_sector
+ *
+ * @param mixed $pt a GeoPoint3D object for the x, y, z coordinates or a parsable string
+ * @return int the number of the sector (0 if x = y = z 0 ; otherwise, 1 to 8)
+ */
+ static function get_sector_from_point3D ($pt) {
+ if (is_string($pt)) {
+ $pt = GeoPoint3D::fromString($pt);
+ }
+ return self::get_sector($pt->x, $pt->y, $pt->z);
+ }
+
+ /**
+ * Gets the base vector for the specified sector
+ *
+ * Example code:
+ *
+ * $vector = GeoOctocube::get_base_vector(4);
+ * //$vector is a (1, -1, -1) array
+ *
+ * @param int $sector the sector number (0-8)
+ * @return array if the sector is 0, (0, 0, 0) ; otherwise, an array with three signed 1 values.
+ */
+ static function get_base_vector ($sector) {
+ switch ($sector) {
+ case 0: return array(0, 0, 0);
+ case 1: return array(-1, 1, -1);
+ case 2: return array(1, 1, -1);
+ case 3: return array(-1, -1, -1);
+ case 4: return array(1, -1, -1);
+ case 5: return array(-1, 1, 1);
+ case 6: return array(1, 1, 1);
+ case 7: return array(-1, -1, 1);
+ case 8: return array(1, -1, 1);
+ default: message_die(GENERAL_ERROR, "Invalid sector: $sector", "GeoOctocube::get_base_vector");
+ }
+ }
+
+
+ /**
+ * Gets SQL RLIKE pattern for the specified sector
+ *
+ * @param int $sector the sector number (0-8)
+ * @param int $z if not null, limits the query to the specified z coordinate [optional]
+ * @return string a SQL clause like "([0-9]+, -[0,9]+, [0,9]+)"
+ */
+ static function get_rlike_pattern_from_sector ($sector, $z = null) {
+ if ($sector == 0) return "(0, 0, 0)";
+
+ $vector = self::get_base_vector($sector);
+
+ //x
+ if ($vector[0] == 1)
+ $query = "([0-9]+, ";
+ else
+ $query = "(-[0-9]+, ";
+
+ //y
+ if ($vector[1] == 1)
+ $query .= "[0-9]+, ";
+ else
+ $query .= "-[0-9]+, ";
+
+ //z
+ if ($z !== null) {
+ $query .= "$z)";
+ } elseif ($vector[2] == "1") {
+ $query .= "[0-9]+)";
+ } else {
+ $query .= "-[0-9]+)";
+ }
+
+ return $query;
+ }
+}
+
+?>
diff --git a/includes/geo/place.php b/includes/geo/place.php
index 34abd8a..18a60f7 100755
--- a/includes/geo/place.php
+++ b/includes/geo/place.php
@@ -1,216 +1,216 @@
-<?php
-
-/**
- * Geo place class.
- *
- * Zed. The immensity of stars. The HyperShip. The people.
- *
- * (c) 2010, Dereckson, some rights reserved.
- * Released under BSD license.
- *
- * 0.1 2010-01-28 01:48 Autogenerated by Pluton Scaffolding
- *
- * @package Zed
- * @subpackage Geo
- * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
- * @copyright 2010 Sébastien Santoro aka Dereckson
- * @license http://www.opensource.org/licenses/bsd-license.php BSD
- * @version 0.1
- * @link http://scherzo.dereckson.be/doc/zed
- * @link http://zed.dereckson.be/
- * @filesource
- */
-
-/**
- * Default local location format
- *
- * The local_location format is a PCRE regular expression
- *
- * By default, local_location format is an (x, y, z) expression
- */
-define('LOCATION_LOCAL_DEFAULT_FORMAT', '/^\([0-9]+( )*,( )*[0-9]+( )*,( )*[0-9]+\)$/');
-
-/**
- * Geo place
- *
- * A place is a city or a hypership district.
- *
- * It's identified by a 9 chars geocode like B0001001.
- * The 5 first chars indicates the body (class GeoBody) where the place is and
- * the 3 last digits is the place number.
- *
- * This class maps the geo_places table.
- */
-class GeoPlace {
-
- public $id;
- public $body_code;
- public $code;
- public $name;
- public $description;
- public $location_local_format;
-
- public $start;
- public $hidden;
-
- /**
- * Initializes a new instance
- *
- * @param int $id the primary key
- */
- function __construct ($id = null) {
- if ($id) {
- $this->id = $id;
- $this->load_from_database();
- }
- }
-
- /**
- * Loads the object place (ie fill the properties) from the $_POST array
- */
- function load_from_form () {
- if (array_key_exists('body_code', $_POST)) $this->body_code = $_POST['body_code'];
- if (array_key_exists('code', $_POST)) $this->code = $_POST['code'];
- if (array_key_exists('name', $_POST)) $this->name = $_POST['name'];
- if (array_key_exists('description', $_POST)) $this->description = $_POST['description'];
- if (array_key_exists('status', $_POST)) $this->status = $_POST['status'];
- if (array_key_exists('location_local_format', $_POST)) $this->location_local_format = $_POST['location_local_format'];
- }
-
- /**
- * Loads the object place (ie fill the properties) from the database
- */
- function load_from_database () {
- global $db;
- $sql = "SELECT * FROM " . TABLE_PLACES . " WHERE place_id = '" . $this->id . "'";
- if ( !($result = $db->sql_query($sql)) ) message_die(SQL_ERROR, "Unable to query geo_places", '', __LINE__, __FILE__, $sql);
- if (!$row = $db->sql_fetchrow($result)) {
- $this->lastError = "place unkwown: " . $this->id;
- return false;
- }
- $this->body_code = $row['body_code'];
- $this->code = $row['place_code'];
- $this->name = $row['place_name'];
- $this->description = $row['place_description'];
- $this->location_local_format = $row['location_local_format'];
-
- //Explodes place_status SET field in boolean variables
- if ($row['place_status']) {
- $flags = explode(',', $row['place_status']);
- foreach ($flags as $flag) {
- $this->$flag = true;
- }
- }
-
- return true;
- }
-
- /**
- * Gets status field value
- *
- * @return string the status field value (e.g. "requiresPTA,default")
- */
- function get_status () {
- $flags = array('start', 'hidden');
- foreach ($flags as $flag) {
- if ($this->$flag == true) {
- $status[] = $flag;
- }
- }
- return implode(',', $status);
- }
-
- /**
- * Saves to database
- */
- function save_to_database () {
- global $db;
-
- $id = $this->id ? "'" . $db->sql_escape($this->id) . "'" : 'NULL';
- $body_code = $db->sql_escape($this->body_code);
- $code = $db->sql_escape($this->code);
- $name = $db->sql_escape($this->name);
- $description = $db->sql_escape($this->description);
- $status = $this->get_status();
- $location_local_format = $db->sql_escape($this->location_local_format);
-
- //Updates or inserts
- $sql = "REPLACE INTO " . TABLE_PLACES . " (`place_id`, `body_code`, `place_code`, `place_name`, `place_description`, `place_status`, `location_local_format`) VALUES ($id, '$body_code', '$code', '$name', '$description', '$status', '$location_local_format')";
- if (!$db->sql_query($sql)) {
- message_die(SQL_ERROR, "Unable to save", '', __LINE__, __FILE__, $sql);
- }
-
- if (!$id) {
- //Gets new record id value
- $this->id = $db->sql_nextid();
- }
- }
-
- /**
- * Determines if the specified local location looks valid
- *
- * @param string $local_location the local location
- * @return boolean true if the specified local location looks valid ; otherwise, false.
- */
- function is_valid_local_location ($local_location) {
- $format = $this->location_local_format ? $this->location_local_format : LOCATION_LOCAL_DEFAULT_FORMAT;
- return preg_match($format, $local_location) > 0;
- }
-
- /**
- * Gets a string representation of the current place
- *
- * @return string A Bxxxxxyyy string like B00001001, which represents the current place.
- */
- function __tostring () {
- return 'B' . $this->body_code . $this->code;
- }
-
- /**
- * Creates a Place instance, from the specified body/place code
- *
- * @param $code the place's code
- * @return GeoPlace the place instance
- */
- static function from_code ($code) {
- global $db;
- $sql = "SELECT * FROM " . TABLE_PLACES . " WHERE CONCAT('B', body_code, place_code) LIKE '$code'";
- if (!$result = $db->sql_query($sql)) message_die(SQL_ERROR, "Unable to query geo_places", '', __LINE__, __FILE__, $sql);
- if (!$row = $db->sql_fetchrow($result)) {
- return null;
- }
-
- $place = new GeoPlace();
- $place->id = $row['place_id'];
- $place->body_code = $row['body_code'];
- $place->code = $row['place_code'];
- $place->name = $row['place_name'];
- $place->description = $row['place_description'];
- $place->location_local_format = $row['location_local_format'];
-
- //Explodes place_status SET field in boolean variables
- if ($row['place_status']) {
- $flags = explode(',', $row['place_status']);
- foreach ($flags as $flag) {
- $place->$flag = true;
- }
- }
-
- return $place;
- }
-
- /**
- * Gets a start location
- *
- * @return string The global location code of a start location
- *
- * @TODO sql optimisation (query contains ORDER BY RAND())
- */
- static function get_start_location () {
- global $db;
- $sql = "SELECT CONCAT('B', body_code, place_code) FROM " . TABLE_PLACES . " WHERE FIND_IN_SET('start', place_status) > 0 ORDER BY rand() LIMIT 1";
- return $db->sql_query_express($sql);
- }
-}
-
+<?php
+
+/**
+ * Geo place class.
+ *
+ * Zed. The immensity of stars. The HyperShip. The people.
+ *
+ * (c) 2010, Dereckson, some rights reserved.
+ * Released under BSD license.
+ *
+ * 0.1 2010-01-28 01:48 Autogenerated by Pluton Scaffolding
+ *
+ * @package Zed
+ * @subpackage Geo
+ * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
+ * @copyright 2010 Sébastien Santoro aka Dereckson
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD
+ * @version 0.1
+ * @link http://scherzo.dereckson.be/doc/zed
+ * @link http://zed.dereckson.be/
+ * @filesource
+ */
+
+/**
+ * Default local location format
+ *
+ * The local_location format is a PCRE regular expression
+ *
+ * By default, local_location format is an (x, y, z) expression
+ */
+define('LOCATION_LOCAL_DEFAULT_FORMAT', '/^\([0-9]+( )*,( )*[0-9]+( )*,( )*[0-9]+\)$/');
+
+/**
+ * Geo place
+ *
+ * A place is a city or a hypership district.
+ *
+ * It's identified by a 9 chars geocode like B0001001.
+ * The 5 first chars indicates the body (class GeoBody) where the place is and
+ * the 3 last digits is the place number.
+ *
+ * This class maps the geo_places table.
+ */
+class GeoPlace {
+
+ public $id;
+ public $body_code;
+ public $code;
+ public $name;
+ public $description;
+ public $location_local_format;
+
+ public $start;
+ public $hidden;
+
+ /**
+ * Initializes a new instance
+ *
+ * @param int $id the primary key
+ */
+ function __construct ($id = null) {
+ if ($id) {
+ $this->id = $id;
+ $this->load_from_database();
+ }
+ }
+
+ /**
+ * Loads the object place (ie fill the properties) from the $_POST array
+ */
+ function load_from_form () {
+ if (array_key_exists('body_code', $_POST)) $this->body_code = $_POST['body_code'];
+ if (array_key_exists('code', $_POST)) $this->code = $_POST['code'];
+ if (array_key_exists('name', $_POST)) $this->name = $_POST['name'];
+ if (array_key_exists('description', $_POST)) $this->description = $_POST['description'];
+ if (array_key_exists('status', $_POST)) $this->status = $_POST['status'];
+ if (array_key_exists('location_local_format', $_POST)) $this->location_local_format = $_POST['location_local_format'];
+ }
+
+ /**
+ * Loads the object place (ie fill the properties) from the database
+ */
+ function load_from_database () {
+ global $db;
+ $sql = "SELECT * FROM " . TABLE_PLACES . " WHERE place_id = '" . $this->id . "'";
+ if ( !($result = $db->sql_query($sql)) ) message_die(SQL_ERROR, "Unable to query geo_places", '', __LINE__, __FILE__, $sql);
+ if (!$row = $db->sql_fetchrow($result)) {
+ $this->lastError = "place unkwown: " . $this->id;
+ return false;
+ }
+ $this->body_code = $row['body_code'];
+ $this->code = $row['place_code'];
+ $this->name = $row['place_name'];
+ $this->description = $row['place_description'];
+ $this->location_local_format = $row['location_local_format'];
+
+ //Explodes place_status SET field in boolean variables
+ if ($row['place_status']) {
+ $flags = explode(',', $row['place_status']);
+ foreach ($flags as $flag) {
+ $this->$flag = true;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Gets status field value
+ *
+ * @return string the status field value (e.g. "requiresPTA,default")
+ */
+ function get_status () {
+ $flags = array('start', 'hidden');
+ foreach ($flags as $flag) {
+ if ($this->$flag == true) {
+ $status[] = $flag;
+ }
+ }
+ return implode(',', $status);
+ }
+
+ /**
+ * Saves to database
+ */
+ function save_to_database () {
+ global $db;
+
+ $id = $this->id ? "'" . $db->sql_escape($this->id) . "'" : 'NULL';
+ $body_code = $db->sql_escape($this->body_code);
+ $code = $db->sql_escape($this->code);
+ $name = $db->sql_escape($this->name);
+ $description = $db->sql_escape($this->description);
+ $status = $this->get_status();
+ $location_local_format = $db->sql_escape($this->location_local_format);
+
+ //Updates or inserts
+ $sql = "REPLACE INTO " . TABLE_PLACES . " (`place_id`, `body_code`, `place_code`, `place_name`, `place_description`, `place_status`, `location_local_format`) VALUES ($id, '$body_code', '$code', '$name', '$description', '$status', '$location_local_format')";
+ if (!$db->sql_query($sql)) {
+ message_die(SQL_ERROR, "Unable to save", '', __LINE__, __FILE__, $sql);
+ }
+
+ if (!$id) {
+ //Gets new record id value
+ $this->id = $db->sql_nextid();
+ }
+ }
+
+ /**
+ * Determines if the specified local location looks valid
+ *
+ * @param string $local_location the local location
+ * @return boolean true if the specified local location looks valid ; otherwise, false.
+ */
+ function is_valid_local_location ($local_location) {
+ $format = $this->location_local_format ? $this->location_local_format : LOCATION_LOCAL_DEFAULT_FORMAT;
+ return preg_match($format, $local_location) > 0;
+ }
+
+ /**
+ * Gets a string representation of the current place
+ *
+ * @return string A Bxxxxxyyy string like B00001001, which represents the current place.
+ */
+ function __tostring () {
+ return 'B' . $this->body_code . $this->code;
+ }
+
+ /**
+ * Creates a Place instance, from the specified body/place code
+ *
+ * @param $code the place's code
+ * @return GeoPlace the place instance
+ */
+ static function from_code ($code) {
+ global $db;
+ $sql = "SELECT * FROM " . TABLE_PLACES . " WHERE CONCAT('B', body_code, place_code) LIKE '$code'";
+ if (!$result = $db->sql_query($sql)) message_die(SQL_ERROR, "Unable to query geo_places", '', __LINE__, __FILE__, $sql);
+ if (!$row = $db->sql_fetchrow($result)) {
+ return null;
+ }
+
+ $place = new GeoPlace();
+ $place->id = $row['place_id'];
+ $place->body_code = $row['body_code'];
+ $place->code = $row['place_code'];
+ $place->name = $row['place_name'];
+ $place->description = $row['place_description'];
+ $place->location_local_format = $row['location_local_format'];
+
+ //Explodes place_status SET field in boolean variables
+ if ($row['place_status']) {
+ $flags = explode(',', $row['place_status']);
+ foreach ($flags as $flag) {
+ $place->$flag = true;
+ }
+ }
+
+ return $place;
+ }
+
+ /**
+ * Gets a start location
+ *
+ * @return string The global location code of a start location
+ *
+ * @TODO sql optimisation (query contains ORDER BY RAND())
+ */
+ static function get_start_location () {
+ global $db;
+ $sql = "SELECT CONCAT('B', body_code, place_code) FROM " . TABLE_PLACES . " WHERE FIND_IN_SET('start', place_status) > 0 ORDER BY rand() LIMIT 1";
+ return $db->sql_query_express($sql);
+ }
+}
+
?>
diff --git a/includes/objects/invite.php b/includes/objects/invite.php
index 07f9075..c92af77 100755
--- a/includes/objects/invite.php
+++ b/includes/objects/invite.php
@@ -1,198 +1,198 @@
-<?php
-
-/**
- * User invite class
- *
- * Zed. The immensity of stars. The HyperShip. The people.
- *
- * (c) 2010, Dereckson, some rights reserved.
- * Released under BSD license.
- *
- * 0.1 2010-06-29 02:13 Initial version [DcK]
- *
- * @package Zed
- * @subpackage Model
- * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
- * @copyright 2010 Sébastien Santoro aka Dereckson
- * @license http://www.opensource.org/licenses/bsd-license.php BSD
- * @version 0.1
- * @link http://scherzo.dereckson.be/doc/zed
- * @link http://zed.dereckson.be/
- * @filesource
- */
-
-/**
- * User invite class
- *
- * This class maps the users_invites table.
- */
-class Invite {
-
- public $code;
- public $date;
- public $from_user_id;
- public $from_perso_id;
-
- /**
- * The user_id who have been claimed the invite
- * Will be NULL as long as the invite haven't been claimed
- *
- * @var int
- */
- public $to_user_id = NULL;
-
- /**
- * Initializes a new instance
- *
- * @param int $code the primary key
- */
- function __construct ($code = NULL) {
- if ($code) {
- $this->code = $code;
- $this->load_from_database();
- } else {
- //New invite code
- $this->generate_code();
- $this->date = time();
- }
- }
-
- /**
- * Generates a unique invite code and sets it in the code property.
- */
- function generate_code () {
- global $db;
-
- do {
- $this->code = generate_random_string("AAA111");
- $sql = "SELECT COUNT(*) FROM " . TABLE_USERS_INVITES . " WHERE invite_code = '$this->code' LOCK IN SHARE MODE;";
- if (!$result = $db->sql_query($sql)) {
- message_die(SQL_ERROR, "Can't access invite users table", '', __LINE__, __FILE__, $sql);
- }
- $row = $db->sql_fetchrow($result);
- } while ($row[0]);
- }
-
- /**
- * Loads the object Invite (ie fill the properties) from the database
- */
- function load_from_database () {
- global $db;
- $code = $db->sql_escape($this->code);
- $sql = "SELECT * FROM " . TABLE_USERS_INVITES . " WHERE invite_code = '" . $code . "'";
- if ( !($result = $db->sql_query($sql)) ) message_die(SQL_ERROR, "Unable to query invite codes", '', __LINE__, __FILE__, $sql);
- if (!$row = $db->sql_fetchrow($result)) {
- $this->lastError = "Invite code unkwown: " . $this->code;
- return false;
- }
- $this->code = $row['invite_code'];
- $this->date = $row['invite_date'];
- $this->from_user_id = $row['invite_from_user_id'];
- $this->from_perso_id = $row['invite_from_perso_id'];
- $this->to_user_id = $row['invite_to_user_id'];
-
- return true;
- }
-
- /**
- * Determines wheter the current invite code have been claimed by an user.
- *
- * @return true if the code have been claimed ; otherwise, false.
- */
- function is_claimed () {
- return (bool)$this->to_user_id;
- }
-
- /**
- * Saves to database
- */
- function save_to_database () {
- global $db;
-
- $code = $db->sql_escape($this->code);
- $date = $db->sql_escape($this->date);
- $from_user_id = $db->sql_escape($this->from_user_id);
- $from_perso_id = $db->sql_escape($this->from_perso_id);
- $to_user_id = $this->to_user_id ? "'" . $db->sql_escape($this->to_user_id) . "'" : 'NULL';
-
- //Updates or inserts
- $sql = "REPLACE INTO " . TABLE_USERS_INVITES . " (`invite_code`, `invite_date`, `invite_from_user_id`, `invite_from_perso_id`, `invite_to_user_id`) VALUES ('$code', '$date', '$from_user_id', '$from_perso_id', $to_user_id)";
- if (!$db->sql_query($sql)) {
- message_die(SQL_ERROR, "Unable to save invite code", '', __LINE__, __FILE__, $sql);
- }
- }
-
- /**
- * Deletes the invite
- */
- function delete () {
- global $db;
- $code = $db->sql_escape($this->code);
- $sql = "DELETE FROM " . TABLE_USERS_INVITES . " WHERE invite_code = '$code'";
- if (!$db->sql_query($sql)) {
- message_die(SQL_ERROR, "Unable to save delete code", '', __LINE__, __FILE__, $sql);
- }
- }
-
- /**
- * Creates an invite code
- *
- * @param int $user_id user id
- * @param int $perso_id perso id
- * @return string the invite code
- */
- static function create ($user_id, $perso_id) {
- $invite = new Invite();
- $invite->from_perso_id = $perso_id;
- $invite->from_user_id = $user_id;
- $invite->save_to_database();
- return $invite->code;
- }
-
- /**
- * Gets invites generated by the specified perso ID
- *
- * @param int $perso_id the perso whom to get the invites
- * @return Array an array of string, each line being an invite code
- */
- static function get_invites_from ($perso_id) {
- global $db;
- $sql = "SELECT invite_code FROM " . TABLE_USERS_INVITES
- . " WHERE invite_from_perso_id = $perso_id AND invite_to_user_id IS NULL ORDER BY invite_date ASC";
- if (!$result = $db->sql_query($sql)) {
- message_die(SQL_ERROR, "Can't access invite users table", '', __LINE__, __FILE__, $sql);
- }
- $codes = array();
- while ($row = $db->sql_fetchrow($result)) {
- $codes[] = $row['invite_code'];
- }
- return $codes;
- }
-
- /**
- * Gets the perso ID who invited the specified perso
- *
- * @param int $perso_id the perso whom to get the invites
- * @return int|null the perso whom to get the invites ; or null, if nobody have invited him
- */
- static function who_invited ($perso_id) {
- global $db;
- $perso = Perso::get($perso_id);
-
- if ($user_id = $perso->user_id) {
- $sql = "SELECT invite_from_perso_id FROM " . TABLE_USERS_INVITES . " WHERE invite_to_user_id = '$user_id'";
- if (!$result = $db->sql_query($sql)) {
- message_die(SQL_ERROR, "Can't access invite users table", '', __LINE__, __FILE__, $sql);
- }
- if ($row = $db->sql_fetchrow($result)) {
- return $row[0];
- }
- }
-
- return null;
- }
-
-}
-
-?>
-
+<?php
+
+/**
+ * User invite class
+ *
+ * Zed. The immensity of stars. The HyperShip. The people.
+ *
+ * (c) 2010, Dereckson, some rights reserved.
+ * Released under BSD license.
+ *
+ * 0.1 2010-06-29 02:13 Initial version [DcK]
+ *
+ * @package Zed
+ * @subpackage Model
+ * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
+ * @copyright 2010 Sébastien Santoro aka Dereckson
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD
+ * @version 0.1
+ * @link http://scherzo.dereckson.be/doc/zed
+ * @link http://zed.dereckson.be/
+ * @filesource
+ */
+
+/**
+ * User invite class
+ *
+ * This class maps the users_invites table.
+ */
+class Invite {
+
+ public $code;
+ public $date;
+ public $from_user_id;
+ public $from_perso_id;
+
+ /**
+ * The user_id who have been claimed the invite
+ * Will be NULL as long as the invite haven't been claimed
+ *
+ * @var int
+ */
+ public $to_user_id = NULL;
+
+ /**
+ * Initializes a new instance
+ *
+ * @param int $code the primary key
+ */
+ function __construct ($code = NULL) {
+ if ($code) {
+ $this->code = $code;
+ $this->load_from_database();
+ } else {
+ //New invite code
+ $this->generate_code();
+ $this->date = time();
+ }
+ }
+
+ /**
+ * Generates a unique invite code and sets it in the code property.
+ */
+ function generate_code () {
+ global $db;
+
+ do {
+ $this->code = generate_random_string("AAA111");
+ $sql = "SELECT COUNT(*) FROM " . TABLE_USERS_INVITES . " WHERE invite_code = '$this->code' LOCK IN SHARE MODE;";
+ if (!$result = $db->sql_query($sql)) {
+ message_die(SQL_ERROR, "Can't access invite users table", '', __LINE__, __FILE__, $sql);
+ }
+ $row = $db->sql_fetchrow($result);
+ } while ($row[0]);
+ }
+
+ /**
+ * Loads the object Invite (ie fill the properties) from the database
+ */
+ function load_from_database () {
+ global $db;
+ $code = $db->sql_escape($this->code);
+ $sql = "SELECT * FROM " . TABLE_USERS_INVITES . " WHERE invite_code = '" . $code . "'";
+ if ( !($result = $db->sql_query($sql)) ) message_die(SQL_ERROR, "Unable to query invite codes", '', __LINE__, __FILE__, $sql);
+ if (!$row = $db->sql_fetchrow($result)) {
+ $this->lastError = "Invite code unkwown: " . $this->code;
+ return false;
+ }
+ $this->code = $row['invite_code'];
+ $this->date = $row['invite_date'];
+ $this->from_user_id = $row['invite_from_user_id'];
+ $this->from_perso_id = $row['invite_from_perso_id'];
+ $this->to_user_id = $row['invite_to_user_id'];
+
+ return true;
+ }
+
+ /**
+ * Determines wheter the current invite code have been claimed by an user.
+ *
+ * @return true if the code have been claimed ; otherwise, false.
+ */
+ function is_claimed () {
+ return (bool)$this->to_user_id;
+ }
+
+ /**
+ * Saves to database
+ */
+ function save_to_database () {
+ global $db;
+
+ $code = $db->sql_escape($this->code);
+ $date = $db->sql_escape($this->date);
+ $from_user_id = $db->sql_escape($this->from_user_id);
+ $from_perso_id = $db->sql_escape($this->from_perso_id);
+ $to_user_id = $this->to_user_id ? "'" . $db->sql_escape($this->to_user_id) . "'" : 'NULL';
+
+ //Updates or inserts
+ $sql = "REPLACE INTO " . TABLE_USERS_INVITES . " (`invite_code`, `invite_date`, `invite_from_user_id`, `invite_from_perso_id`, `invite_to_user_id`) VALUES ('$code', '$date', '$from_user_id', '$from_perso_id', $to_user_id)";
+ if (!$db->sql_query($sql)) {
+ message_die(SQL_ERROR, "Unable to save invite code", '', __LINE__, __FILE__, $sql);
+ }
+ }
+
+ /**
+ * Deletes the invite
+ */
+ function delete () {
+ global $db;
+ $code = $db->sql_escape($this->code);
+ $sql = "DELETE FROM " . TABLE_USERS_INVITES . " WHERE invite_code = '$code'";
+ if (!$db->sql_query($sql)) {
+ message_die(SQL_ERROR, "Unable to save delete code", '', __LINE__, __FILE__, $sql);
+ }
+ }
+
+ /**
+ * Creates an invite code
+ *
+ * @param int $user_id user id
+ * @param int $perso_id perso id
+ * @return string the invite code
+ */
+ static function create ($user_id, $perso_id) {
+ $invite = new Invite();
+ $invite->from_perso_id = $perso_id;
+ $invite->from_user_id = $user_id;
+ $invite->save_to_database();
+ return $invite->code;
+ }
+
+ /**
+ * Gets invites generated by the specified perso ID
+ *
+ * @param int $perso_id the perso whom to get the invites
+ * @return Array an array of string, each line being an invite code
+ */
+ static function get_invites_from ($perso_id) {
+ global $db;
+ $sql = "SELECT invite_code FROM " . TABLE_USERS_INVITES
+ . " WHERE invite_from_perso_id = $perso_id AND invite_to_user_id IS NULL ORDER BY invite_date ASC";
+ if (!$result = $db->sql_query($sql)) {
+ message_die(SQL_ERROR, "Can't access invite users table", '', __LINE__, __FILE__, $sql);
+ }
+ $codes = array();
+ while ($row = $db->sql_fetchrow($result)) {
+ $codes[] = $row['invite_code'];
+ }
+ return $codes;
+ }
+
+ /**
+ * Gets the perso ID who invited the specified perso
+ *
+ * @param int $perso_id the perso whom to get the invites
+ * @return int|null the perso whom to get the invites ; or null, if nobody have invited him
+ */
+ static function who_invited ($perso_id) {
+ global $db;
+ $perso = Perso::get($perso_id);
+
+ if ($user_id = $perso->user_id) {
+ $sql = "SELECT invite_from_perso_id FROM " . TABLE_USERS_INVITES . " WHERE invite_to_user_id = '$user_id'";
+ if (!$result = $db->sql_query($sql)) {
+ message_die(SQL_ERROR, "Can't access invite users table", '', __LINE__, __FILE__, $sql);
+ }
+ if ($row = $db->sql_fetchrow($result)) {
+ return $row[0];
+ }
+ }
+
+ return null;
+ }
+
+}
+
+?>
+
diff --git a/includes/objects/message.php b/includes/objects/message.php
index e399a0f..1ef8004 100755
--- a/includes/objects/message.php
+++ b/includes/objects/message.php
@@ -1,157 +1,157 @@
- <?php
-
-/**
- * Message class
- *
- * Zed. The immensity of stars. The HyperShip. The people.
- *
- * (c) 2010, Dereckson, some rights reserved.
- * Released under BSD license.
- *
- * 0.1 2010-01-28 01:47 Autogenerated by Pluton Scaffolding
- *
- * @package Zed
- * @subpackage Model
- * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
- * @copyright 2010 Sébastien Santoro aka Dereckson
- * @license http://www.opensource.org/licenses/bsd-license.php BSD
- * @version 0.1
- * @link http://scherzo.dereckson.be/doc/zed
- * @link http://zed.dereckson.be/
- * @filesource
- */
-
-/**
- * Message class
- *
- * This class maps the messages table.
- *
- * It also provides a static method to get perso's messages.
- */
-class Message {
-
- public $id;
- public $date;
- public $from;
- public $to;
- public $text;
- public $flag;
-
- /**
- * Initializes a new instance
- *
- * @param int $id the primary key
- */
- function __construct ($id = null) {
- if ($id) {
- $this->id = $id;
- $this->load_from_database();
- } else {
- $this->date = time();
- $this->flag = 0; //unread
- }
- }
-
- /**
- * Loads the object Message (ie fill the properties) from the $_POST array
- */
- function load_from_form () {
- if (array_key_exists('date', $_POST)) $this->date = $_POST['date'];
- if (array_key_exists('from', $_POST)) $this->from = $_POST['from'];
- if (array_key_exists('to', $_POST)) $this->to = $_POST['to'];
- if (array_key_exists('text', $_POST)) $this->text = $_POST['text'];
- if (array_key_exists('flag', $_POST)) $this->flag = $_POST['flag'];
- }
-
- /**
- * Loads the object Message (ie fill the properties) from the database
- */
- function load_from_database () {
- global $db;
- $sql = "SELECT * FROM messages WHERE message_id = '" . $this->id . "'";
- if ( !($result = $db->sql_query($sql)) ) message_die(SQL_ERROR, "Unable to query messages", '', __LINE__, __FILE__, $sql);
- if (!$row = $db->sql_fetchrow($result)) {
- $this->lastError = "Message unkwown: " . $this->id;
- return false;
- }
- $this->date = $row['message_date'];
- $this->from = $row['message_from'];
- $this->to = $row['message_to'];
- $this->text = $row['message_text'];
- $this->flag = $row['message_flag'];
- return true;
- }
-
- /**
- * Saves to database
- */
- function save_to_database () {
- global $db;
-
- $id = $this->id ? "'" . $db->sql_escape($this->id) . "'" : 'NULL';
- $date = $db->sql_escape($this->date);
- $from = $db->sql_escape($this->from);
- $to = $db->sql_escape($this->to);
- $text = $db->sql_escape($this->text);
- $flag = $db->sql_escape($this->flag);
-
- //Updates or inserts
- $sql = "REPLACE INTO messages (`message_id`, `message_date`, `message_from`, `message_to`, `message_text`, `message_flag`) VALUES ($id, '$date', '$from', '$to', '$text', '$flag')";
- if (!$db->sql_query($sql)) {
- message_die(SQL_ERROR, "Unable to save", '', __LINE__, __FILE__, $sql);
- }
-
- if (!$id) {
- //Gets new record id value
- $this->id = $db->sql_nextid();
- }
- }
-
- /**
- * Sends the message
- */
- function send () {
- $this->save_to_database();
- //TODO: triggers new message notifier
- }
-
- /**
- * Deletes the message
- */
- function delete () {
- //A message is deleted if its flag value is 2
- if ($this->flag != 2) {
- $this->flag = 2;
- $this->save_to_database();
- }
- }
-
- /**
- * Gets messages from the specified perso
- */
- static function get_messages ($perso_id, $mark_as_read = true, &$countNewMessages = 0) {
- global $db;
- $sql = "SELECT message_id FROM " . TABLE_MESSAGES . " WHERE message_to = " . $db->sql_escape($perso_id) . " AND message_flag < 2 ORDER BY message_id DESC";
- if (!$result = $db->sql_query($sql)) {
- message_die(SQL_ERROR, "Unable to get messages", '', __LINE__, __FILE__, $sql);
- }
- while ($row = $db->sql_fetchrow($result)) {
- $message = new Message($row[0]);
- $messages[] = $message;
- $ids[] = $message->id;
- if ($message->flag == 0) {
- //New message
- $countNewMessages++;
- }
- }
- if ($mark_as_read && count($ids)) {
- $ids = join($ids, ', ');
- $sql = "UPDATE " . TABLE_MESSAGES . " SET message_flag = '1' WHERE message_id IN ($ids)";
- $db->sql_query($sql);
- }
- return $messages;
- }
-}
-
-?>
-
+ <?php
+
+/**
+ * Message class
+ *
+ * Zed. The immensity of stars. The HyperShip. The people.
+ *
+ * (c) 2010, Dereckson, some rights reserved.
+ * Released under BSD license.
+ *
+ * 0.1 2010-01-28 01:47 Autogenerated by Pluton Scaffolding
+ *
+ * @package Zed
+ * @subpackage Model
+ * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
+ * @copyright 2010 Sébastien Santoro aka Dereckson
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD
+ * @version 0.1
+ * @link http://scherzo.dereckson.be/doc/zed
+ * @link http://zed.dereckson.be/
+ * @filesource
+ */
+
+/**
+ * Message class
+ *
+ * This class maps the messages table.
+ *
+ * It also provides a static method to get perso's messages.
+ */
+class Message {
+
+ public $id;
+ public $date;
+ public $from;
+ public $to;
+ public $text;
+ public $flag;
+
+ /**
+ * Initializes a new instance
+ *
+ * @param int $id the primary key
+ */
+ function __construct ($id = null) {
+ if ($id) {
+ $this->id = $id;
+ $this->load_from_database();
+ } else {
+ $this->date = time();
+ $this->flag = 0; //unread
+ }
+ }
+
+ /**
+ * Loads the object Message (ie fill the properties) from the $_POST array
+ */
+ function load_from_form () {
+ if (array_key_exists('date', $_POST)) $this->date = $_POST['date'];
+ if (array_key_exists('from', $_POST)) $this->from = $_POST['from'];
+ if (array_key_exists('to', $_POST)) $this->to = $_POST['to'];
+ if (array_key_exists('text', $_POST)) $this->text = $_POST['text'];
+ if (array_key_exists('flag', $_POST)) $this->flag = $_POST['flag'];
+ }
+
+ /**
+ * Loads the object Message (ie fill the properties) from the database
+ */
+ function load_from_database () {
+ global $db;
+ $sql = "SELECT * FROM messages WHERE message_id = '" . $this->id . "'";
+ if ( !($result = $db->sql_query($sql)) ) message_die(SQL_ERROR, "Unable to query messages", '', __LINE__, __FILE__, $sql);
+ if (!$row = $db->sql_fetchrow($result)) {
+ $this->lastError = "Message unkwown: " . $this->id;
+ return false;
+ }
+ $this->date = $row['message_date'];
+ $this->from = $row['message_from'];
+ $this->to = $row['message_to'];
+ $this->text = $row['message_text'];
+ $this->flag = $row['message_flag'];
+ return true;
+ }
+
+ /**
+ * Saves to database
+ */
+ function save_to_database () {
+ global $db;
+
+ $id = $this->id ? "'" . $db->sql_escape($this->id) . "'" : 'NULL';
+ $date = $db->sql_escape($this->date);
+ $from = $db->sql_escape($this->from);
+ $to = $db->sql_escape($this->to);
+ $text = $db->sql_escape($this->text);
+ $flag = $db->sql_escape($this->flag);
+
+ //Updates or inserts
+ $sql = "REPLACE INTO messages (`message_id`, `message_date`, `message_from`, `message_to`, `message_text`, `message_flag`) VALUES ($id, '$date', '$from', '$to', '$text', '$flag')";
+ if (!$db->sql_query($sql)) {
+ message_die(SQL_ERROR, "Unable to save", '', __LINE__, __FILE__, $sql);
+ }
+
+ if (!$id) {
+ //Gets new record id value
+ $this->id = $db->sql_nextid();
+ }
+ }
+
+ /**
+ * Sends the message
+ */
+ function send () {
+ $this->save_to_database();
+ //TODO: triggers new message notifier
+ }
+
+ /**
+ * Deletes the message
+ */
+ function delete () {
+ //A message is deleted if its flag value is 2
+ if ($this->flag != 2) {
+ $this->flag = 2;
+ $this->save_to_database();
+ }
+ }
+
+ /**
+ * Gets messages from the specified perso
+ */
+ static function get_messages ($perso_id, $mark_as_read = true, &$countNewMessages = 0) {
+ global $db;
+ $sql = "SELECT message_id FROM " . TABLE_MESSAGES . " WHERE message_to = " . $db->sql_escape($perso_id) . " AND message_flag < 2 ORDER BY message_id DESC";
+ if (!$result = $db->sql_query($sql)) {
+ message_die(SQL_ERROR, "Unable to get messages", '', __LINE__, __FILE__, $sql);
+ }
+ while ($row = $db->sql_fetchrow($result)) {
+ $message = new Message($row[0]);
+ $messages[] = $message;
+ $ids[] = $message->id;
+ if ($message->flag == 0) {
+ //New message
+ $countNewMessages++;
+ }
+ }
+ if ($mark_as_read && count($ids)) {
+ $ids = join($ids, ', ');
+ $sql = "UPDATE " . TABLE_MESSAGES . " SET message_flag = '1' WHERE message_id IN ($ids)";
+ $db->sql_query($sql);
+ }
+ return $messages;
+ }
+}
+
+?>
+
diff --git a/includes/objects/perso.php b/includes/objects/perso.php
index 74a5cb0..7c21556 100755
--- a/includes/objects/perso.php
+++ b/includes/objects/perso.php
@@ -1,581 +1,581 @@
-<?php
-
-/**
- * Perso class
- *
- * Zed. The immensity of stars. The HyperShip. The people.
- *
- * (c) 2010, Dereckson, some rights reserved.
- * Released under BSD license.
- *
- * 0.1 2010-01-27 00:39 Autogenerated by Pluton Scaffolding
- * 0.2 2010-01-29 14:39 Adding flags support
- * 0.3 2010-02-06 17:50 Adding static perso hashtable
- * 0.4 2012-07-04 11:37 Refactoring: moving code from index.php
- *
- * @package Zed
- * @subpackage Model
- * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
- * @copyright 2010, 2012 Sébastien Santoro aka Dereckson
- * @license http://www.opensource.org/licenses/bsd-license.php BSD
- * @version 0.1
- * @link http://scherzo.dereckson.be/doc/zed
- * @link http://zed.dereckson.be/
- * @filesource
- */
-
-require_once("includes/geo/location.php");
-
-/**
- * Perso class
- *
- * This class maps the persos table.
- *
- * The class also provides methods
- * to move or locate a perso,
- * to gets and sets perso's flags and notes (tables persos_flags and persos_notes),
- * to gets user's perso or check if a perso is online,
- * to handle on select and logout events.
- *
- */
-class Perso {
-
- public $id;
- public $user_id;
- public $name;
- public $nickname;
- public $race;
- public $sex;
- public $avatar;
- public $location_global;
- public $location_local;
-
- public $flags;
-
- public $lastError;
-
- public static $hashtable_id = array();
- public static $hashtable_name = array();
-
- /**
- * Initializes a new instance
- *
- * @param mixed $data perso ID or nickname
- */
- function __construct ($data = null) {
- if ($data) {
- if (is_numeric($data)) {
- $this->id = $data;
- } else {
- $this->nickname = $data;
- }
-
- if (!$this->load_from_database()) {
- message_die(GENERAL_ERROR, $this->lastError, "Can't authenticate perso");
- }
- } else {
- $this->generate_id();
- }
- }
-
- /**
- * Initializes a new Perso instance if needed or get already available one.
- *
- * @param mixed $data perso ID or nickname
- * @return Perso the perso instance
- */
- static function get ($data = null) {
- if ($data) {
- //Checks in the hashtables if we already have loaded this instance
- if (is_numeric($data)) {
- if (array_key_exists($data, Perso::$hashtable_id)) {
- return Perso::$hashtable_id[$data];
- }
- } else {
- if (array_key_exists($data, Perso::$hashtable_name)) {
- return Perso::$hashtable_name[$data];
- }
- }
- }
-
- $perso = new Perso($data);
- return $perso;
- }
-
- /**
- * Loads the object Perso (ie fill the properties) from the $_POST array
- */
- function load_from_form () {
- if (array_key_exists('user_id', $_POST)) $this->user_id = $_POST['user_id'];
- if (array_key_exists('name', $_POST)) $this->name = $_POST['name'];
- if (array_key_exists('nickname', $_POST)) $this->nickname = $_POST['nickname'];
- if (array_key_exists('race', $_POST)) $this->race = $_POST['race'];
- if (array_key_exists('sex', $_POST)) $this->sex = $_POST['sex'];
- if (array_key_exists('avatar', $_POST)) $this->avatar = $_POST['avatar'];
- if (array_key_exists('location_global', $_POST)) $this->location_global = $_POST['location_global'];
- if (array_key_exists('location_local', $_POST)) $this->location_local = $_POST['location_local'];
- }
-
- /**
- * Loads the object Perso (ie fill the properties) from the database
- */
- function load_from_database () {
- global $db;
-
- //Gets perso
- $sql = "SELECT * FROM " . TABLE_PERSOS;
- if ($this->id) {
- $id = $db->sql_escape($this->id);
- $sql .= " WHERE perso_id = '" . $id . "'";
- } else {
- $nickname = $db->sql_escape($this->nickname);
- $sql .= " WHERE perso_nickname = '" . $nickname . "'";
- }
- if ( !($result = $db->sql_query($sql)) ) message_die(SQL_ERROR, "Unable to query persos", '', __LINE__, __FILE__, $sql);
- if (!$row = $db->sql_fetchrow($result)) {
- $this->lastError = "Perso unkwown: " . $this->id;
- return false;
- }
-
- $this->id = $row['perso_id'];
- $this->user_id = $row['user_id'];
- $this->name = $row['perso_name'];
- $this->nickname = $row['perso_nickname'];
- $this->race = $row['perso_race'];
- $this->sex = $row['perso_sex'];
- $this->avatar = $row['perso_avatar'];
- $this->location_global = $row['location_global'];
- $this->location_local = $row['location_local'];
-
- //Gets flags
- $sql = "SELECT flag_key, flag_value FROM " . TABLE_PERSOS_FLAGS .
- " WHERE perso_id = $this->id";
- if (!$result = $db->sql_query($sql)) {
- message_die(SQL_ERROR, "Can't get flags", '', __LINE__, __FILE__, $sql);
- }
- while ($row = $db->sql_fetchrow($result)) {
- $this->flags[$row["flag_key"]] = $row["flag_value"];
- }
-
- //Gets location
- $this->location = new GeoLocation(
- $this->location_global,
- $this->location_local
- );
-
- //Puts object in hashtables
- Perso::$hashtable_id[$this->id] = $this;
- Perso::$hashtable_name[$this->nickname] = $this;
-
- return true;
- }
-
- /**
- * Saves to database
- */
- function save_to_database () {
- global $db;
-
- $id = $this->id ? "'" . $db->sql_escape($this->id) . "'" : 'NULL';
- $user_id = $db->sql_escape($this->user_id);
- $name = $db->sql_escape($this->name);
- $nickname = $db->sql_escape($this->nickname);
- $race = $db->sql_escape($this->race);
- $sex = $db->sql_escape($this->sex);
- $avatar = $db->sql_escape($this->avatar);
- $location_global = $this->location_global ? "'" . $db->sql_escape($this->location_global) . "'" : 'NULL';
- $location_local = $this->location_local ? "'" . $db->sql_escape($this->location_local) . "'" : 'NULL';
-
- //Updates or inserts
- $sql = "REPLACE INTO " . TABLE_PERSOS . " (`perso_id`, `user_id`, `perso_name`, `perso_nickname`, `perso_race`, `perso_sex`, `perso_avatar`, `location_global`, `location_local`) VALUES ($id, '$user_id', '$name', '$nickname', '$race', '$sex', '$avatar', $location_global, $location_local)";
- if (!$db->sql_query($sql)) {
- message_die(SQL_ERROR, "Unable to save", '', __LINE__, __FILE__, $sql);
- }
-
- if (!$id) {
- //Gets new record id value
- $this->id = $db->sql_nextid();
- }
- }
-
- /**
- * Updates the specified field in the database record
- *
- * @param string $field The field to save
- */
- function save_field ($field) {
- global $db;
- if (!$this->id) {
- message_die(GENERAL_ERROR, "You're trying to update a perso record not yet saved in the database: $field");
- }
- $id = $db->sql_escape($this->id);
- $value = $db->sql_escape($this->$field);
- $sql = "UPDATE " . TABLE_PERSOS . " SET `$field` = '$value' WHERE perso_id = '$id'";
- if (!$db->sql_query($sql)) {
- message_die(SQL_ERROR, "Unable to save $field field", '', __LINE__, __FILE__, $sql);
- }
- }
-
- /**
- * Gets perso location
- *
- * @return string The location names
- */
- public function where () {
- return $this->location->__toString();
- }
-
- /**
- * Moves the perso to a new location
- *
- * @param string $global the global target location
- * @param string $global the local target location
- */
- public function move_to ($global = null, $local = null) {
-
- //Sets global location
- if ($global != null) {
- $this->location_global = $global;
- }
-
- //Sets local location
- if ($local != null) {
- $this->location_local = $local;
- }
-
- //Updates database record
- if ($global != null && $local != null) {
- global $db;
- $perso_id = $db->sql_escape($this->id);
- $g = $db->sql_escape($this->location_global);
- $l = $db->sql_escape($this->location_local);
- $sql = "UPDATE " . TABLE_PERSOS .
- " SET location_global = '$g', location_local = '$l'" .
- " WHERE perso_id = '$perso_id'";
- if (!$db->sql_query($sql))
- message_die(SQL_ERROR, "Can't save new $global $local location.", '', __LINE__, __FILE__, $sql);
- } elseif ($global != null) {
- $this->save_field('location_global');
- } elseif ($local != null) {
- $this->save_field('location_local');
- }
-
- //Updates location member
- $this->location = new GeoLocation(
- $this->location_global,
- $this->location_local
- );
- }
-
- /**
- * Gets the specified flag value
- *
- * @param string $key flag key
- * @param mixed $defaultValue default value if the flag doesn't exist
- * @return mixed the flag value (string) or null if not existing
- */
- public function get_flag ($key, $defaultValue = null) {
- return $this->flag_exists($key) ? $this->flags[$key] : $defaultValue;
- }
-
- /**
- * Determines if the specified flag exists
- *
- * @param string $key the flag key to check
- * @return boolean true if the specified flag exists ; otherwise, false.
- */
- public function flag_exists ($key) {
- return array_key_exists($key, $this->flags);
- }
-
- /**
- * Sets the specified flag
- *
- * @param string $key flag key
- * @param string $value flag value (optional, default value: 1)
- */
- public function set_flag ($key, $value = 1) {
- //Checks if flag isn't already set at this value
- if ($this->flags != null && array_key_exists($key, $this->flags) && $this->flags[$key] === $value)
- return;
-
- //Saves flag to database
- global $db;
- $id = $db->sql_escape($this->id);
- $key = $db->sql_escape($key);
- $value = $db->sql_escape($value);
- $sql = "REPLACE " . TABLE_PERSOS_FLAGS . " SET perso_id = '$id', flag_key = '$key', flag_value = '$value'";
- if (!$db->sql_query($sql))
- message_die(SQL_ERROR, "Can't save flag", '', __LINE__, __FILE__, $sql);
-
- //Sets flag in this perso instance
- $this->flags[$key] = $value;
- }
-
- /**
- * Deletes the specified flag
- *
- * @param string $key flag key
- */
- public function delete_flag ($key) {
- global $db;
- if (!array_key_exists($key, $this->flags)) return;
-
- $id = $db->sql_escape($this->id);
- $key = $db->sql_escape($key);
- $sql = "DELETE FROM " . TABLE_PERSOS_FLAGS .
- " WHERE flag_key = '$key' AND perso_id = '$id' LIMIT 1";
- if (!$db->sql_query($sql))
- message_die(SQL_ERROR, "Can't delete flag", '', __LINE__, __FILE__, $sql);
- }
-
- /**
- * Ensures the current perso have the specified flag or exits.
- *
- *
- * @param string $flag the flag to assert
- * @param int $threshold value the flasg must stricly be greater than (optional, the default value is 0)
- *
- * Example:
- * <code>
- * $perso->set_flag('quux.foo', 1);
- * //The perso wants to read quux, which we allow with the flag quux.foo
- * $perso->request_flag('quux.foo'); //will be okay
- *
- * //The perso wants also to write quux, which we all allow if quux.foo = 2
- * //The threshold will so be 1, as 2 > 1
- * $perso->request_flag('quux.foo', 1); //Will exits, with a "You don't have quux.foo permission" message
- * </code>
- */
- public function request_flag ($flag, $threshold = 0) {
- if (!array_key_exists($flag, $this->flags) || $this->flags[$flag] <= $threshold) {
- message_die(HACK_ERROR, "You don't have $flag permission.", "Permissions");
- }
- }
-
- /**
- * Gets the specified note
- *
- * @param string $code the note code
- * @return string the note content
- */
- public function get_note ($code) {
- global $db;
- $id = $db->sql_escape($this->id);
- $code = $db->sql_escape($code);
- $sql = "SELECT note_text FROM " . TABLE_PERSOS_NOTES . " WHERE perso_id = '$id' AND note_code LIKE '$code'";
- return $db->sql_query_express($sql);
- }
-
- /**
- * Sets the specified note
- *
- * @param string $code the note code
- * @param string $text the note content
- */
- public function set_note ($code, $text) {
- global $db;
- $id = $db->sql_escape($this->id);
- $code = $db->sql_escape($code);
- $text = $db->sql_escape($text);
- $sql = "REPLACE INTO " . TABLE_PERSOS_NOTES . " (perso_id, note_code, note_text) VALUES ('$id', '$code', '$text')";
- if (!$db->sql_query($sql))
- message_die(SQL_ERROR, "Can't save note", '', __LINE__, __FILE__, $sql);
- }
-
- /**
- * Counts the amount of notes the perso have saved
- *
- * @return int the amount of notes assigned to the this perso
- */
- public function count_notes () {
- global $db;
- $id = $db->sql_escape($this->id);
- $sql = "SELECT COUNT(*) FROM " . TABLE_PERSOS_NOTES . " WHERE perso_id = '$id'";
- return $db->sql_query_express($sql);
- }
-
- /*
- * Determines if the specified ID is available
- *
- * @param integer $id The perso ID to check
- * @return boolean true if the specified ID is available ; otherwise, false
- */
- public static function is_available_id ($id) {
- global $db;
-
- $sql = "SELECT COUNT(*) FROM " . TABLE_PERSOS . " WHERE perso_id = $id LOCK IN SHARE MODE";
- if (!$result = $db->sql_query($sql)) {
- message_die(SQL_ERROR, "Can't access users table", '', __LINE__, __FILE__, $sql);
- }
- $row = $db->sql_fetchrow($result);
- return ($row[0] == 0);
- }
-
- /**
- * Generates a unique ID for the current object
- */
- private function generate_id () {
- do {
- $this->id = rand(2001, 5999);
- } while (!Perso::is_available_id($this->id));
- }
-
- /**
- * Checks if the nickname is available
- *
- * @param string $nickname the nickname to check
- */
- public static function is_available_nickname ($nickname) {
- global $db;
- $nickname = $db->sql_escape($nickname);
- $sql = "SELECT COUNT(*) FROM " . TABLE_PERSOS . " WHERE perso_nickname LIKE '$nickname' LOCK IN SHARE MODE;";
- if (!$result = $db->sql_query($sql)) {
- message_die(SQL_ERROR, "Utilisateurs non parsable", '', __LINE__, __FILE__, $sql);
- }
- $row = $db->sql_fetchrow($result);
- return ($row[0] == 0);
- }
-
- /**
- * Counts the perso a user have
- *
- * @param int user_id the user ID
- * @return the user's perso count
- */
- public static function get_persos_count ($user_id) {
- global $db;
- $sql = "SELECT COUNT(*) FROM " . TABLE_PERSOS . " WHERE user_id = $user_id";
- return $db->sql_query_express($sql);
-
- }
-
- /**
- * Gets an array with all the perso of the specified user
- *
- * @param int $user_id the user ID
- */
- public static function get_persos ($user_id) {
- global $db;
- $user_id = $db->sql_escape($user_id);
- $sql = "SELECT perso_id FROM " . TABLE_PERSOS . " WHERE user_id = $user_id";
- if (!$result = $db->sql_query($sql)) {
- message_die(SQL_ERROR, "Can't get persos", '', __LINE__, __FILE__, $sql);
- }
-
- while ($row = $db->sql_fetchrow($result)) {
- $persos[] = Perso::get($row[perso_id]);
- }
- return $persos;
- }
-
- /**
- * Gets the first perso a user have
- * (typically to be used when get_persos_count returns 1 to autoselect)
- *
- * @param int user_id the user ID
- */
- public static function get_first_perso ($user_id) {
- global $db;
- $sql = "SELECT perso_id FROM " . TABLE_PERSOS ." WHERE user_id = $user_id LIMIT 1";
- if ($perso_id = $db->sql_query_express($sql)) {
- return new Perso($perso_id);
- }
- }
-
- /**
- * Determines wheter the perso is online
- *
- * @return bool true if the perso is online ; otherwise, false.
- */
- public function is_online () {
- global $db;
- $id = $db->sql_escape($this->id);
- $sql = "SELECT MAX(online) FROM " . TABLE_SESSIONS ." WHERE perso_id = $id";
- if (!$result = $db->sql_query($sql)) {
- message_die(SQL_ERROR, "Unable to query the table", '', __LINE__, __FILE__, $sql);
- }
- $row = $db->sql_fetchrow($result);
- return ($row[0] == 1);
- }
-
- /**
- * This event method is called when the user selects a new perso
- */
- public function on_select () {
- //Session
- set_info('perso_id', $this->id);
- $this->set_flag("site.lastlogin", $_SERVER['REQUEST_TIME']);
- define("PersoSelected", true);
- }
-
- /**
- * This event method is called when the user logs off its account or perso
- */
- public function on_logout () {
- //Clears perso information in $_SESSION and session table
- set_info('perso_id', null);
- clean_session();
- }
-
- /**
- * This event method is called when the perso is created
- */
- public function on_create () {
- //Notifies inviter
- $this->notify_inviter();
- }
-
- /**
- * Creates a new perso, from a parameter form
- *
- * @param int $user The user to attach the perso to
- * @param Perso $perso A reference to the created perso (don't initialize it, give it a null value)
- * @param array $errors A reference to the arrays containing errors (should be an empty array, or the method will always return false)
- * @return boolean true if the perso has ben created ; otherwise, false
- */
- public static function create_perso_from_form ($user, &$perso, &$errors) {
- $perso = new Perso();
- $perso->load_from_form();
- $perso->user_id = $user->id;
-
- //Validates forms
- if (!$perso->name) $errors[] = lang_get("NoFullnameSpecified");
- if (!$perso->race) {
- $errors[] = lang_get("NoRaceSpecified");
- $perso->race = "being";
- }
- if (!$perso->sex) $errors[] = lang_get("NoSexSpecified");
- if (!$perso->nickname) {
- $errors[] = lang_get("NoNicknameSpecified");
- } else if (!Perso::is_available_nickname($perso->nickname)) {
- $errors[] = lang_get("UnavailableNickname");
- }
-
- if (count($errors)) return false;
-
- //Creates perso
- $perso->save_to_database();
- $perso->on_create();
- return true;
- }
-
- /**
- * Notifies the person having invited this perso
- */
- public function notify_inviter() {
- require_once('includes/objects/message.php');
- require_once('includes/objects/invite.php');
- $message = new Message();
- $message->from = 0;
- $message->to = invite::who_invited($this->id);
- $message->text = sprintf(
- lang_get('InvitePersoCreated'),
- $this->name,
- get_server_url() . get_url('who', $this->nickname)
- );
- $message->send();
- }
-}
-
-?>
+<?php
+
+/**
+ * Perso class
+ *
+ * Zed. The immensity of stars. The HyperShip. The people.
+ *
+ * (c) 2010, Dereckson, some rights reserved.
+ * Released under BSD license.
+ *
+ * 0.1 2010-01-27 00:39 Autogenerated by Pluton Scaffolding
+ * 0.2 2010-01-29 14:39 Adding flags support
+ * 0.3 2010-02-06 17:50 Adding static perso hashtable
+ * 0.4 2012-07-04 11:37 Refactoring: moving code from index.php
+ *
+ * @package Zed
+ * @subpackage Model
+ * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
+ * @copyright 2010, 2012 Sébastien Santoro aka Dereckson
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD
+ * @version 0.1
+ * @link http://scherzo.dereckson.be/doc/zed
+ * @link http://zed.dereckson.be/
+ * @filesource
+ */
+
+require_once("includes/geo/location.php");
+
+/**
+ * Perso class
+ *
+ * This class maps the persos table.
+ *
+ * The class also provides methods
+ * to move or locate a perso,
+ * to gets and sets perso's flags and notes (tables persos_flags and persos_notes),
+ * to gets user's perso or check if a perso is online,
+ * to handle on select and logout events.
+ *
+ */
+class Perso {
+
+ public $id;
+ public $user_id;
+ public $name;
+ public $nickname;
+ public $race;
+ public $sex;
+ public $avatar;
+ public $location_global;
+ public $location_local;
+
+ public $flags;
+
+ public $lastError;
+
+ public static $hashtable_id = array();
+ public static $hashtable_name = array();
+
+ /**
+ * Initializes a new instance
+ *
+ * @param mixed $data perso ID or nickname
+ */
+ function __construct ($data = null) {
+ if ($data) {
+ if (is_numeric($data)) {
+ $this->id = $data;
+ } else {
+ $this->nickname = $data;
+ }
+
+ if (!$this->load_from_database()) {
+ message_die(GENERAL_ERROR, $this->lastError, "Can't authenticate perso");
+ }
+ } else {
+ $this->generate_id();
+ }
+ }
+
+ /**
+ * Initializes a new Perso instance if needed or get already available one.
+ *
+ * @param mixed $data perso ID or nickname
+ * @return Perso the perso instance
+ */
+ static function get ($data = null) {
+ if ($data) {
+ //Checks in the hashtables if we already have loaded this instance
+ if (is_numeric($data)) {
+ if (array_key_exists($data, Perso::$hashtable_id)) {
+ return Perso::$hashtable_id[$data];
+ }
+ } else {
+ if (array_key_exists($data, Perso::$hashtable_name)) {
+ return Perso::$hashtable_name[$data];
+ }
+ }
+ }
+
+ $perso = new Perso($data);
+ return $perso;
+ }
+
+ /**
+ * Loads the object Perso (ie fill the properties) from the $_POST array
+ */
+ function load_from_form () {
+ if (array_key_exists('user_id', $_POST)) $this->user_id = $_POST['user_id'];
+ if (array_key_exists('name', $_POST)) $this->name = $_POST['name'];
+ if (array_key_exists('nickname', $_POST)) $this->nickname = $_POST['nickname'];
+ if (array_key_exists('race', $_POST)) $this->race = $_POST['race'];
+ if (array_key_exists('sex', $_POST)) $this->sex = $_POST['sex'];
+ if (array_key_exists('avatar', $_POST)) $this->avatar = $_POST['avatar'];
+ if (array_key_exists('location_global', $_POST)) $this->location_global = $_POST['location_global'];
+ if (array_key_exists('location_local', $_POST)) $this->location_local = $_POST['location_local'];
+ }
+
+ /**
+ * Loads the object Perso (ie fill the properties) from the database
+ */
+ function load_from_database () {
+ global $db;
+
+ //Gets perso
+ $sql = "SELECT * FROM " . TABLE_PERSOS;
+ if ($this->id) {
+ $id = $db->sql_escape($this->id);
+ $sql .= " WHERE perso_id = '" . $id . "'";
+ } else {
+ $nickname = $db->sql_escape($this->nickname);
+ $sql .= " WHERE perso_nickname = '" . $nickname . "'";
+ }
+ if ( !($result = $db->sql_query($sql)) ) message_die(SQL_ERROR, "Unable to query persos", '', __LINE__, __FILE__, $sql);
+ if (!$row = $db->sql_fetchrow($result)) {
+ $this->lastError = "Perso unkwown: " . $this->id;
+ return false;
+ }
+
+ $this->id = $row['perso_id'];
+ $this->user_id = $row['user_id'];
+ $this->name = $row['perso_name'];
+ $this->nickname = $row['perso_nickname'];
+ $this->race = $row['perso_race'];
+ $this->sex = $row['perso_sex'];
+ $this->avatar = $row['perso_avatar'];
+ $this->location_global = $row['location_global'];
+ $this->location_local = $row['location_local'];
+
+ //Gets flags
+ $sql = "SELECT flag_key, flag_value FROM " . TABLE_PERSOS_FLAGS .
+ " WHERE perso_id = $this->id";
+ if (!$result = $db->sql_query($sql)) {
+ message_die(SQL_ERROR, "Can't get flags", '', __LINE__, __FILE__, $sql);
+ }
+ while ($row = $db->sql_fetchrow($result)) {
+ $this->flags[$row["flag_key"]] = $row["flag_value"];
+ }
+
+ //Gets location
+ $this->location = new GeoLocation(
+ $this->location_global,
+ $this->location_local
+ );
+
+ //Puts object in hashtables
+ Perso::$hashtable_id[$this->id] = $this;
+ Perso::$hashtable_name[$this->nickname] = $this;
+
+ return true;
+ }
+
+ /**
+ * Saves to database
+ */
+ function save_to_database () {
+ global $db;
+
+ $id = $this->id ? "'" . $db->sql_escape($this->id) . "'" : 'NULL';
+ $user_id = $db->sql_escape($this->user_id);
+ $name = $db->sql_escape($this->name);
+ $nickname = $db->sql_escape($this->nickname);
+ $race = $db->sql_escape($this->race);
+ $sex = $db->sql_escape($this->sex);
+ $avatar = $db->sql_escape($this->avatar);
+ $location_global = $this->location_global ? "'" . $db->sql_escape($this->location_global) . "'" : 'NULL';
+ $location_local = $this->location_local ? "'" . $db->sql_escape($this->location_local) . "'" : 'NULL';
+
+ //Updates or inserts
+ $sql = "REPLACE INTO " . TABLE_PERSOS . " (`perso_id`, `user_id`, `perso_name`, `perso_nickname`, `perso_race`, `perso_sex`, `perso_avatar`, `location_global`, `location_local`) VALUES ($id, '$user_id', '$name', '$nickname', '$race', '$sex', '$avatar', $location_global, $location_local)";
+ if (!$db->sql_query($sql)) {
+ message_die(SQL_ERROR, "Unable to save", '', __LINE__, __FILE__, $sql);
+ }
+
+ if (!$id) {
+ //Gets new record id value
+ $this->id = $db->sql_nextid();
+ }
+ }
+
+ /**
+ * Updates the specified field in the database record
+ *
+ * @param string $field The field to save
+ */
+ function save_field ($field) {
+ global $db;
+ if (!$this->id) {
+ message_die(GENERAL_ERROR, "You're trying to update a perso record not yet saved in the database: $field");
+ }
+ $id = $db->sql_escape($this->id);
+ $value = $db->sql_escape($this->$field);
+ $sql = "UPDATE " . TABLE_PERSOS . " SET `$field` = '$value' WHERE perso_id = '$id'";
+ if (!$db->sql_query($sql)) {
+ message_die(SQL_ERROR, "Unable to save $field field", '', __LINE__, __FILE__, $sql);
+ }
+ }
+
+ /**
+ * Gets perso location
+ *
+ * @return string The location names
+ */
+ public function where () {
+ return $this->location->__toString();
+ }
+
+ /**
+ * Moves the perso to a new location
+ *
+ * @param string $global the global target location
+ * @param string $global the local target location
+ */
+ public function move_to ($global = null, $local = null) {
+
+ //Sets global location
+ if ($global != null) {
+ $this->location_global = $global;
+ }
+
+ //Sets local location
+ if ($local != null) {
+ $this->location_local = $local;
+ }
+
+ //Updates database record
+ if ($global != null && $local != null) {
+ global $db;
+ $perso_id = $db->sql_escape($this->id);
+ $g = $db->sql_escape($this->location_global);
+ $l = $db->sql_escape($this->location_local);
+ $sql = "UPDATE " . TABLE_PERSOS .
+ " SET location_global = '$g', location_local = '$l'" .
+ " WHERE perso_id = '$perso_id'";
+ if (!$db->sql_query($sql))
+ message_die(SQL_ERROR, "Can't save new $global $local location.", '', __LINE__, __FILE__, $sql);
+ } elseif ($global != null) {
+ $this->save_field('location_global');
+ } elseif ($local != null) {
+ $this->save_field('location_local');
+ }
+
+ //Updates location member
+ $this->location = new GeoLocation(
+ $this->location_global,
+ $this->location_local
+ );
+ }
+
+ /**
+ * Gets the specified flag value
+ *
+ * @param string $key flag key
+ * @param mixed $defaultValue default value if the flag doesn't exist
+ * @return mixed the flag value (string) or null if not existing
+ */
+ public function get_flag ($key, $defaultValue = null) {
+ return $this->flag_exists($key) ? $this->flags[$key] : $defaultValue;
+ }
+
+ /**
+ * Determines if the specified flag exists
+ *
+ * @param string $key the flag key to check
+ * @return boolean true if the specified flag exists ; otherwise, false.
+ */
+ public function flag_exists ($key) {
+ return array_key_exists($key, $this->flags);
+ }
+
+ /**
+ * Sets the specified flag
+ *
+ * @param string $key flag key
+ * @param string $value flag value (optional, default value: 1)
+ */
+ public function set_flag ($key, $value = 1) {
+ //Checks if flag isn't already set at this value
+ if ($this->flags != null && array_key_exists($key, $this->flags) && $this->flags[$key] === $value)
+ return;
+
+ //Saves flag to database
+ global $db;
+ $id = $db->sql_escape($this->id);
+ $key = $db->sql_escape($key);
+ $value = $db->sql_escape($value);
+ $sql = "REPLACE " . TABLE_PERSOS_FLAGS . " SET perso_id = '$id', flag_key = '$key', flag_value = '$value'";
+ if (!$db->sql_query($sql))
+ message_die(SQL_ERROR, "Can't save flag", '', __LINE__, __FILE__, $sql);
+
+ //Sets flag in this perso instance
+ $this->flags[$key] = $value;
+ }
+
+ /**
+ * Deletes the specified flag
+ *
+ * @param string $key flag key
+ */
+ public function delete_flag ($key) {
+ global $db;
+ if (!array_key_exists($key, $this->flags)) return;
+
+ $id = $db->sql_escape($this->id);
+ $key = $db->sql_escape($key);
+ $sql = "DELETE FROM " . TABLE_PERSOS_FLAGS .
+ " WHERE flag_key = '$key' AND perso_id = '$id' LIMIT 1";
+ if (!$db->sql_query($sql))
+ message_die(SQL_ERROR, "Can't delete flag", '', __LINE__, __FILE__, $sql);
+ }
+
+ /**
+ * Ensures the current perso have the specified flag or exits.
+ *
+ *
+ * @param string $flag the flag to assert
+ * @param int $threshold value the flasg must stricly be greater than (optional, the default value is 0)
+ *
+ * Example:
+ * <code>
+ * $perso->set_flag('quux.foo', 1);
+ * //The perso wants to read quux, which we allow with the flag quux.foo
+ * $perso->request_flag('quux.foo'); //will be okay
+ *
+ * //The perso wants also to write quux, which we all allow if quux.foo = 2
+ * //The threshold will so be 1, as 2 > 1
+ * $perso->request_flag('quux.foo', 1); //Will exits, with a "You don't have quux.foo permission" message
+ * </code>
+ */
+ public function request_flag ($flag, $threshold = 0) {
+ if (!array_key_exists($flag, $this->flags) || $this->flags[$flag] <= $threshold) {
+ message_die(HACK_ERROR, "You don't have $flag permission.", "Permissions");
+ }
+ }
+
+ /**
+ * Gets the specified note
+ *
+ * @param string $code the note code
+ * @return string the note content
+ */
+ public function get_note ($code) {
+ global $db;
+ $id = $db->sql_escape($this->id);
+ $code = $db->sql_escape($code);
+ $sql = "SELECT note_text FROM " . TABLE_PERSOS_NOTES . " WHERE perso_id = '$id' AND note_code LIKE '$code'";
+ return $db->sql_query_express($sql);
+ }
+
+ /**
+ * Sets the specified note
+ *
+ * @param string $code the note code
+ * @param string $text the note content
+ */
+ public function set_note ($code, $text) {
+ global $db;
+ $id = $db->sql_escape($this->id);
+ $code = $db->sql_escape($code);
+ $text = $db->sql_escape($text);
+ $sql = "REPLACE INTO " . TABLE_PERSOS_NOTES . " (perso_id, note_code, note_text) VALUES ('$id', '$code', '$text')";
+ if (!$db->sql_query($sql))
+ message_die(SQL_ERROR, "Can't save note", '', __LINE__, __FILE__, $sql);
+ }
+
+ /**
+ * Counts the amount of notes the perso have saved
+ *
+ * @return int the amount of notes assigned to the this perso
+ */
+ public function count_notes () {
+ global $db;
+ $id = $db->sql_escape($this->id);
+ $sql = "SELECT COUNT(*) FROM " . TABLE_PERSOS_NOTES . " WHERE perso_id = '$id'";
+ return $db->sql_query_express($sql);
+ }
+
+ /*
+ * Determines if the specified ID is available
+ *
+ * @param integer $id The perso ID to check
+ * @return boolean true if the specified ID is available ; otherwise, false
+ */
+ public static function is_available_id ($id) {
+ global $db;
+
+ $sql = "SELECT COUNT(*) FROM " . TABLE_PERSOS . " WHERE perso_id = $id LOCK IN SHARE MODE";
+ if (!$result = $db->sql_query($sql)) {
+ message_die(SQL_ERROR, "Can't access users table", '', __LINE__, __FILE__, $sql);
+ }
+ $row = $db->sql_fetchrow($result);
+ return ($row[0] == 0);
+ }
+
+ /**
+ * Generates a unique ID for the current object
+ */
+ private function generate_id () {
+ do {
+ $this->id = rand(2001, 5999);
+ } while (!Perso::is_available_id($this->id));
+ }
+
+ /**
+ * Checks if the nickname is available
+ *
+ * @param string $nickname the nickname to check
+ */
+ public static function is_available_nickname ($nickname) {
+ global $db;
+ $nickname = $db->sql_escape($nickname);
+ $sql = "SELECT COUNT(*) FROM " . TABLE_PERSOS . " WHERE perso_nickname LIKE '$nickname' LOCK IN SHARE MODE;";
+ if (!$result = $db->sql_query($sql)) {
+ message_die(SQL_ERROR, "Utilisateurs non parsable", '', __LINE__, __FILE__, $sql);
+ }
+ $row = $db->sql_fetchrow($result);
+ return ($row[0] == 0);
+ }
+
+ /**
+ * Counts the perso a user have
+ *
+ * @param int user_id the user ID
+ * @return the user's perso count
+ */
+ public static function get_persos_count ($user_id) {
+ global $db;
+ $sql = "SELECT COUNT(*) FROM " . TABLE_PERSOS . " WHERE user_id = $user_id";
+ return $db->sql_query_express($sql);
+
+ }
+
+ /**
+ * Gets an array with all the perso of the specified user
+ *
+ * @param int $user_id the user ID
+ */
+ public static function get_persos ($user_id) {
+ global $db;
+ $user_id = $db->sql_escape($user_id);
+ $sql = "SELECT perso_id FROM " . TABLE_PERSOS . " WHERE user_id = $user_id";
+ if (!$result = $db->sql_query($sql)) {
+ message_die(SQL_ERROR, "Can't get persos", '', __LINE__, __FILE__, $sql);
+ }
+
+ while ($row = $db->sql_fetchrow($result)) {
+ $persos[] = Perso::get($row[perso_id]);
+ }
+ return $persos;
+ }
+
+ /**
+ * Gets the first perso a user have
+ * (typically to be used when get_persos_count returns 1 to autoselect)
+ *
+ * @param int user_id the user ID
+ */
+ public static function get_first_perso ($user_id) {
+ global $db;
+ $sql = "SELECT perso_id FROM " . TABLE_PERSOS ." WHERE user_id = $user_id LIMIT 1";
+ if ($perso_id = $db->sql_query_express($sql)) {
+ return new Perso($perso_id);
+ }
+ }
+
+ /**
+ * Determines wheter the perso is online
+ *
+ * @return bool true if the perso is online ; otherwise, false.
+ */
+ public function is_online () {
+ global $db;
+ $id = $db->sql_escape($this->id);
+ $sql = "SELECT MAX(online) FROM " . TABLE_SESSIONS ." WHERE perso_id = $id";
+ if (!$result = $db->sql_query($sql)) {
+ message_die(SQL_ERROR, "Unable to query the table", '', __LINE__, __FILE__, $sql);
+ }
+ $row = $db->sql_fetchrow($result);
+ return ($row[0] == 1);
+ }
+
+ /**
+ * This event method is called when the user selects a new perso
+ */
+ public function on_select () {
+ //Session
+ set_info('perso_id', $this->id);
+ $this->set_flag("site.lastlogin", $_SERVER['REQUEST_TIME']);
+ define("PersoSelected", true);
+ }
+
+ /**
+ * This event method is called when the user logs off its account or perso
+ */
+ public function on_logout () {
+ //Clears perso information in $_SESSION and session table
+ set_info('perso_id', null);
+ clean_session();
+ }
+
+ /**
+ * This event method is called when the perso is created
+ */
+ public function on_create () {
+ //Notifies inviter
+ $this->notify_inviter();
+ }
+
+ /**
+ * Creates a new perso, from a parameter form
+ *
+ * @param int $user The user to attach the perso to
+ * @param Perso $perso A reference to the created perso (don't initialize it, give it a null value)
+ * @param array $errors A reference to the arrays containing errors (should be an empty array, or the method will always return false)
+ * @return boolean true if the perso has ben created ; otherwise, false
+ */
+ public static function create_perso_from_form ($user, &$perso, &$errors) {
+ $perso = new Perso();
+ $perso->load_from_form();
+ $perso->user_id = $user->id;
+
+ //Validates forms
+ if (!$perso->name) $errors[] = lang_get("NoFullnameSpecified");
+ if (!$perso->race) {
+ $errors[] = lang_get("NoRaceSpecified");
+ $perso->race = "being";
+ }
+ if (!$perso->sex) $errors[] = lang_get("NoSexSpecified");
+ if (!$perso->nickname) {
+ $errors[] = lang_get("NoNicknameSpecified");
+ } else if (!Perso::is_available_nickname($perso->nickname)) {
+ $errors[] = lang_get("UnavailableNickname");
+ }
+
+ if (count($errors)) return false;
+
+ //Creates perso
+ $perso->save_to_database();
+ $perso->on_create();
+ return true;
+ }
+
+ /**
+ * Notifies the person having invited this perso
+ */
+ public function notify_inviter() {
+ require_once('includes/objects/message.php');
+ require_once('includes/objects/invite.php');
+ $message = new Message();
+ $message->from = 0;
+ $message->to = invite::who_invited($this->id);
+ $message->text = sprintf(
+ lang_get('InvitePersoCreated'),
+ $this->name,
+ get_server_url() . get_url('who', $this->nickname)
+ );
+ $message->send();
+ }
+}
+
+?>
diff --git a/includes/objects/port.php b/includes/objects/port.php
index 2c09694..f24ac40 100755
--- a/includes/objects/port.php
+++ b/includes/objects/port.php
@@ -1,199 +1,199 @@
-<?php
-
-/**
- * Port class
- *
- * Zed. The immensity of stars. The HyperShip. The people.
- *
- * (c) 2010, Dereckson, some rights reserved.
- * Released under BSD license.
- *
- * 0.1 2010-02-09 19:17 Autogenerated by Pluton Scaffolding
- *
- * @package Zed
- * @subpackage Model
- * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
- * @copyright 2010 Sébastien Santoro aka Dereckson
- * @license http://www.opensource.org/licenses/bsd-license.php BSD
- * @version 0.1
- * @link http://scherzo.dereckson.be/doc/zed
- * @link http://zed.dereckson.be/
- * @filesource
- */
-
-require_once("includes/geo/location.php");
-
-/**
- * Port class
- *
- * This class maps the ports table.
- *
- * The class also provides helper methods to handle ports at specified location.
- */
-class Port {
-
- public $id;
- public $location_global;
- public $location_local;
- public $name;
-
- public $hidden;
- public $requiresPTA;
- public $default;
-
- /**
- * Initializes a new instance
- * @param int $id the primary key
- */
- function __construct ($id = NULL) {
- if ($id) {
- $this->id = $id;
- $this->load_from_database();
- }
- }
-
- /**
- * Loads the object Port (ie fill the properties) from the $_POST array
- */
- function load_from_form () {
- if (array_key_exists('location_global', $_POST)) $this->location_global = $_POST['location_global'];
- if (array_key_exists('location_local', $_POST)) $this->location_local = $_POST['location_local'];
- if (array_key_exists('name', $_POST)) $this->name = $_POST['name'];
-
- if (array_key_exists('hidden', $_POST)) $this->hidden = $_POST['hidden'] ? true : false;
- if (array_key_exists('requiresPTA', $_POST)) $this->requiresPTA = $_POST['requiresPTA'] ? true : false;
- if (array_key_exists('default', $_POST)) $this->hidden = $_POST['default'] ? true : false;
- }
-
- /**
- * Loads the object Port (ie fill the properties) from the database
- */
- function load_from_database () {
- global $db;
- $id = $db->sql_escape($this->id);
- $sql = "SELECT * FROM " . TABLE_PORTS . " WHERE port_id = '" . $id . "'";
- if ( !($result = $db->sql_query($sql)) ) message_die(SQL_ERROR, "Unable to query ports", '', __LINE__, __FILE__, $sql);
- if (!$row = $db->sql_fetchrow($result)) {
- $this->lastError = "Port unkwown: " . $this->id;
- return false;
- }
- $this->location_global = $row['location_global'];
- $this->location_local = $row['location_local'];
- $this->name = $row['port_name'];
-
- //Explodes place_status SET field in boolean variables
- if ($row['place_status']) {
- $flags = explode(',', $row['port_status']);
- foreach ($flags as $flag) {
- $this->$flag = true;
- }
- }
-
- return true;
- }
-
- /**
- * Gets status field value
- *
- * @return string the status field value (e.g. "requiresPTA,default")
- */
- function get_status () {
- $flags = array('hidden', 'requiresPTA', 'default');
- foreach ($flags as $flag) {
- if ($this->$flag) {
- $status[] = $flag;
- }
- }
- return implode(',', $status);
- }
-
- /**
- * Saves to database
- */
- function save_to_database () {
- global $db;
-
- $id = $this->id ? "'" . $db->sql_escape($this->id) . "'" : 'NULL';
- $location_global = $db->sql_escape($this->location_global);
- $location_local = $db->sql_escape($this->location_local);
- $name = $db->sql_escape($this->name);
- $status = $this->get_status();
-
- //Updates or inserts
- $sql = "REPLACE INTO " . TABLE_PORTS . " (`port_id`, `location_global`, `location_local`, `port_name`, `port_status`) VALUES ($id, '$location_global', '$location_local', '$name', '$status')";
- if (!$db->sql_query($sql)) {
- message_die(SQL_ERROR, "Unable to save", '', __LINE__, __FILE__, $sql);
- }
-
- if (!$id) {
- //Gets new record id value
- $this->id = $db->sql_nextid();
- }
- }
-
- /**
- * Determines if the specified location have a port
- *
- * @param string $location_global the global location
- * @return boolean true if there is a spatioport exactly at the specified location ; otherwise, false.
- */
- static function have_port ($location_global) {
- return (get_port_id($location_global) !== NULL);
- }
-
- /**
- * Gets the port situated exactly at the specified global location
- *
- * @param string $location_global the global location
- * @return int the port ID
- */
- static function get_port_id ($location_global) {
- global $db;
- $location_global = $db->sql_escape($location_global);
- $sql = "SELECT port_id FROM " . TABLE_PORTS . " WHERE location_global = '$location_global'";
- if (!$result = $db->sql_query($sql)) {
- message_die(SQL_ERROR, "Unable to get ports", '', __LINE__, __FILE__, $sql);
- }
- if ($row = $db->sql_fetchrow($result)) {
- return $row['port_id'];
- }
- return null;
- }
-
- /**
- * Gets default port, from specified global location
- *
- * @param string $location_global the global location
- * @return Port the port near this location ; null if there isn't port there.
- */
- static function from_location ($location_global) {
- $havePlace = strlen($location_global) == 9;
- $port_id = null;
-
- if ($havePlace) {
- //Checks if there's a port at specified location
- $port_id = self::get_port_id($location_global);
- }
-
- if ($port_id == null) {
- //Nearest default port.
- //If place have been specified (B0001001), we've to found elsewhere
- //==> B00001%
- global $db;
- $loc = $db->sql_escape(substr($location_global, 0, 6));
- $sql = "SELECT port_id FROM " . TABLE_PORTS . " WHERE location_global LIKE '$loc%'";
- if (!$result = $db->sql_query($sql)) {
- message_die(SQL_ERROR, "Can't get port", '', __LINE__, __FILE__, $sql);
- }
- if ($row = $db->sql_fetchrow($result)) {
- $port_id = $row['port_id'];
- } else {
- return null;
- }
- }
-
- return new Port($port_id);
- }
-}
-
+<?php
+
+/**
+ * Port class
+ *
+ * Zed. The immensity of stars. The HyperShip. The people.
+ *
+ * (c) 2010, Dereckson, some rights reserved.
+ * Released under BSD license.
+ *
+ * 0.1 2010-02-09 19:17 Autogenerated by Pluton Scaffolding
+ *
+ * @package Zed
+ * @subpackage Model
+ * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
+ * @copyright 2010 Sébastien Santoro aka Dereckson
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD
+ * @version 0.1
+ * @link http://scherzo.dereckson.be/doc/zed
+ * @link http://zed.dereckson.be/
+ * @filesource
+ */
+
+require_once("includes/geo/location.php");
+
+/**
+ * Port class
+ *
+ * This class maps the ports table.
+ *
+ * The class also provides helper methods to handle ports at specified location.
+ */
+class Port {
+
+ public $id;
+ public $location_global;
+ public $location_local;
+ public $name;
+
+ public $hidden;
+ public $requiresPTA;
+ public $default;
+
+ /**
+ * Initializes a new instance
+ * @param int $id the primary key
+ */
+ function __construct ($id = NULL) {
+ if ($id) {
+ $this->id = $id;
+ $this->load_from_database();
+ }
+ }
+
+ /**
+ * Loads the object Port (ie fill the properties) from the $_POST array
+ */
+ function load_from_form () {
+ if (array_key_exists('location_global', $_POST)) $this->location_global = $_POST['location_global'];
+ if (array_key_exists('location_local', $_POST)) $this->location_local = $_POST['location_local'];
+ if (array_key_exists('name', $_POST)) $this->name = $_POST['name'];
+
+ if (array_key_exists('hidden', $_POST)) $this->hidden = $_POST['hidden'] ? true : false;
+ if (array_key_exists('requiresPTA', $_POST)) $this->requiresPTA = $_POST['requiresPTA'] ? true : false;
+ if (array_key_exists('default', $_POST)) $this->hidden = $_POST['default'] ? true : false;
+ }
+
+ /**
+ * Loads the object Port (ie fill the properties) from the database
+ */
+ function load_from_database () {
+ global $db;
+ $id = $db->sql_escape($this->id);
+ $sql = "SELECT * FROM " . TABLE_PORTS . " WHERE port_id = '" . $id . "'";
+ if ( !($result = $db->sql_query($sql)) ) message_die(SQL_ERROR, "Unable to query ports", '', __LINE__, __FILE__, $sql);
+ if (!$row = $db->sql_fetchrow($result)) {
+ $this->lastError = "Port unkwown: " . $this->id;
+ return false;
+ }
+ $this->location_global = $row['location_global'];
+ $this->location_local = $row['location_local'];
+ $this->name = $row['port_name'];
+
+ //Explodes place_status SET field in boolean variables
+ if ($row['place_status']) {
+ $flags = explode(',', $row['port_status']);
+ foreach ($flags as $flag) {
+ $this->$flag = true;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Gets status field value
+ *
+ * @return string the status field value (e.g. "requiresPTA,default")
+ */
+ function get_status () {
+ $flags = array('hidden', 'requiresPTA', 'default');
+ foreach ($flags as $flag) {
+ if ($this->$flag) {
+ $status[] = $flag;
+ }
+ }
+ return implode(',', $status);
+ }
+
+ /**
+ * Saves to database
+ */
+ function save_to_database () {
+ global $db;
+
+ $id = $this->id ? "'" . $db->sql_escape($this->id) . "'" : 'NULL';
+ $location_global = $db->sql_escape($this->location_global);
+ $location_local = $db->sql_escape($this->location_local);
+ $name = $db->sql_escape($this->name);
+ $status = $this->get_status();
+
+ //Updates or inserts
+ $sql = "REPLACE INTO " . TABLE_PORTS . " (`port_id`, `location_global`, `location_local`, `port_name`, `port_status`) VALUES ($id, '$location_global', '$location_local', '$name', '$status')";
+ if (!$db->sql_query($sql)) {
+ message_die(SQL_ERROR, "Unable to save", '', __LINE__, __FILE__, $sql);
+ }
+
+ if (!$id) {
+ //Gets new record id value
+ $this->id = $db->sql_nextid();
+ }
+ }
+
+ /**
+ * Determines if the specified location have a port
+ *
+ * @param string $location_global the global location
+ * @return boolean true if there is a spatioport exactly at the specified location ; otherwise, false.
+ */
+ static function have_port ($location_global) {
+ return (get_port_id($location_global) !== NULL);
+ }
+
+ /**
+ * Gets the port situated exactly at the specified global location
+ *
+ * @param string $location_global the global location
+ * @return int the port ID
+ */
+ static function get_port_id ($location_global) {
+ global $db;
+ $location_global = $db->sql_escape($location_global);
+ $sql = "SELECT port_id FROM " . TABLE_PORTS . " WHERE location_global = '$location_global'";
+ if (!$result = $db->sql_query($sql)) {
+ message_die(SQL_ERROR, "Unable to get ports", '', __LINE__, __FILE__, $sql);
+ }
+ if ($row = $db->sql_fetchrow($result)) {
+ return $row['port_id'];
+ }
+ return null;
+ }
+
+ /**
+ * Gets default port, from specified global location
+ *
+ * @param string $location_global the global location
+ * @return Port the port near this location ; null if there isn't port there.
+ */
+ static function from_location ($location_global) {
+ $havePlace = strlen($location_global) == 9;
+ $port_id = null;
+
+ if ($havePlace) {
+ //Checks if there's a port at specified location
+ $port_id = self::get_port_id($location_global);
+ }
+
+ if ($port_id == null) {
+ //Nearest default port.
+ //If place have been specified (B0001001), we've to found elsewhere
+ //==> B00001%
+ global $db;
+ $loc = $db->sql_escape(substr($location_global, 0, 6));
+ $sql = "SELECT port_id FROM " . TABLE_PORTS . " WHERE location_global LIKE '$loc%'";
+ if (!$result = $db->sql_query($sql)) {
+ message_die(SQL_ERROR, "Can't get port", '', __LINE__, __FILE__, $sql);
+ }
+ if ($row = $db->sql_fetchrow($result)) {
+ $port_id = $row['port_id'];
+ } else {
+ return null;
+ }
+ }
+
+ return new Port($port_id);
+ }
+}
+
?>
\ No newline at end of file
diff --git a/includes/objects/profile.php b/includes/objects/profile.php
index e751e02..9b8c9b6 100755
--- a/includes/objects/profile.php
+++ b/includes/objects/profile.php
@@ -1,148 +1,148 @@
-<?php
-
-/**
- * Profile class
- *
- * Zed. The immensity of stars. The HyperShip. The people.
- *
- * (c) 2010, Dereckson, some rights reserved.
- * Released under BSD license.
- *
- * 0.1 2010-01-02 16:49 Autogenerated by Pluton Scaffolding
- * Import from Azhàr
- * 0.2 2010-07-05 03:56 Tags
- *
- * @package Zed
- * @subpackage Model
- * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
- * @copyright 2010 Sébastien Santoro aka Dereckson
- * @license http://www.opensource.org/licenses/bsd-license.php BSD
- * @version 0.1
- * @link http://scherzo.dereckson.be/doc/zed
- * @link http://zed.dereckson.be/
- * @filesource
- */
-
-/**
- * Profile class
- *
- * This class maps the profiles table.
- *
- * The class also provides methods to handle and cache tags.
- */
-class Profile {
-
- public $perso_id;
- public $text;
- public $updated;
- public $fixedwidth;
-
- /**
- * Initializes a new instance of the Profile class
- *
- * @param int $perso_id the perso ID
- */
- function __construct ($perso_id) {
- $this->perso_id = $perso_id;
- $this->load_from_database();
- }
-
- /**
- * Loads the object Profile (ie fill the properties) from the $_POST array
- */
- function load_from_form ($read_boolean = true) {
- if (array_key_exists('perso_id', $_POST)) $this->perso_id = $_POST['perso_id'];
- if (array_key_exists('text', $_POST)) $this->text = $_POST['text'];
- if (array_key_exists('updated', $_POST)) $this->updated = $_POST['updated'];
- if ($read_boolean) {
- if (array_key_exists('fixedwidth', $_POST)) $this->fixedwidth = $_POST['fixedwidth'];
- }
- }
-
- /**
- * Loads the object Profile (ie fill the properties) from the database
- */
- function load_from_database () {
- global $db;
- $id = $db->sql_escape($this->perso_id);
- $sql = "SELECT * FROM " . TABLE_PROFILES . " WHERE perso_id = '$id'";
- if ( !($result = $db->sql_query($sql)) ) message_die(SQL_ERROR, "Unable to query azhar_profiles", '', __LINE__, __FILE__, $sql);
- if (!$row = $db->sql_fetchrow($result)) {
- $this->lastError = "Profile unkwown: " . $this->perso_id;
- return false;
- }
-
- $this->text = $row['profile_text'];
- $this->updated = $row['profile_updated'];
- $this->fixedwidth = $row['profile_fixedwidth'];
-
- return true;
- }
-
- /**
- * Saves the object to the database
- */
- function save_to_database () {
- global $db;
-
- $perso_id = $db->sql_escape($this->perso_id);
- $text = $db->sql_escape($this->text);
- $updated = $db->sql_escape($this->updated);
- $fixedwidth = $this->fixedwidth ? 1 : 0;
-
- $sql = "REPLACE INTO " . TABLE_PROFILES . " (`perso_id`, `profile_text`, `profile_updated`, `profile_fixedwidth`) VALUES ('$perso_id', '$text', '$updated', '$fixedwidth')";
- if (!$db->sql_query($sql)) {
- message_die(SQL_ERROR, "Unable to save", '', __LINE__, __FILE__, $sql);
- }
- }
-
- ///
- /// Tags
- ///
-
- /**
- * Gets the profile's tags
- *
- * @return string The profile's tags
- */
- function get_tags () {
- global $db;
- $id = $db->sql_escape($this->perso_id);
- $sql = "SELECT tag_code, tag_class FROM " . TABLE_PROFILES_TAGS
- . " WHERE perso_id = '$id'";
- if (!$result = $db->sql_query($sql)) {
- message_die(SQL_ERROR, "Can't get tags", '', __LINE__, __FILE__, $sql);
- }
- $tags = array();
- while ($row = $db->sql_fetchrow($result)) {
- $tags[$row['tag_class']][] = $row['tag_code'];
- }
- return $tags;
- }
-
- /**
- * Gets the profile's cached tags
- *
- * @return string The profile's tags
- */
- function get_cached_tags () {
- require_once('includes/cache/cache.php');
- $cache = Cache::load();
- $key = 'zed_profile_tags_' . $this->perso_id;
- if (!$tags_html = $cache->get($key)) {
- //Regenerates tags cached html snippet
- global $smarty;
- $tags = $this->get_tags();
- if (count($tags)) {
- $smarty->assign('tags', $tags);
- $tags_html = $smarty->fetch('profile_tags.tpl');
- } else {
- $tags_html = " ";
- }
- $cache->set($key, $tags_html);
- }
- return $tags_html;
- }
-}
-
+<?php
+
+/**
+ * Profile class
+ *
+ * Zed. The immensity of stars. The HyperShip. The people.
+ *
+ * (c) 2010, Dereckson, some rights reserved.
+ * Released under BSD license.
+ *
+ * 0.1 2010-01-02 16:49 Autogenerated by Pluton Scaffolding
+ * Import from Azhàr
+ * 0.2 2010-07-05 03:56 Tags
+ *
+ * @package Zed
+ * @subpackage Model
+ * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
+ * @copyright 2010 Sébastien Santoro aka Dereckson
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD
+ * @version 0.1
+ * @link http://scherzo.dereckson.be/doc/zed
+ * @link http://zed.dereckson.be/
+ * @filesource
+ */
+
+/**
+ * Profile class
+ *
+ * This class maps the profiles table.
+ *
+ * The class also provides methods to handle and cache tags.
+ */
+class Profile {
+
+ public $perso_id;
+ public $text;
+ public $updated;
+ public $fixedwidth;
+
+ /**
+ * Initializes a new instance of the Profile class
+ *
+ * @param int $perso_id the perso ID
+ */
+ function __construct ($perso_id) {
+ $this->perso_id = $perso_id;
+ $this->load_from_database();
+ }
+
+ /**
+ * Loads the object Profile (ie fill the properties) from the $_POST array
+ */
+ function load_from_form ($read_boolean = true) {
+ if (array_key_exists('perso_id', $_POST)) $this->perso_id = $_POST['perso_id'];
+ if (array_key_exists('text', $_POST)) $this->text = $_POST['text'];
+ if (array_key_exists('updated', $_POST)) $this->updated = $_POST['updated'];
+ if ($read_boolean) {
+ if (array_key_exists('fixedwidth', $_POST)) $this->fixedwidth = $_POST['fixedwidth'];
+ }
+ }
+
+ /**
+ * Loads the object Profile (ie fill the properties) from the database
+ */
+ function load_from_database () {
+ global $db;
+ $id = $db->sql_escape($this->perso_id);
+ $sql = "SELECT * FROM " . TABLE_PROFILES . " WHERE perso_id = '$id'";
+ if ( !($result = $db->sql_query($sql)) ) message_die(SQL_ERROR, "Unable to query azhar_profiles", '', __LINE__, __FILE__, $sql);
+ if (!$row = $db->sql_fetchrow($result)) {
+ $this->lastError = "Profile unkwown: " . $this->perso_id;
+ return false;
+ }
+
+ $this->text = $row['profile_text'];
+ $this->updated = $row['profile_updated'];
+ $this->fixedwidth = $row['profile_fixedwidth'];
+
+ return true;
+ }
+
+ /**
+ * Saves the object to the database
+ */
+ function save_to_database () {
+ global $db;
+
+ $perso_id = $db->sql_escape($this->perso_id);
+ $text = $db->sql_escape($this->text);
+ $updated = $db->sql_escape($this->updated);
+ $fixedwidth = $this->fixedwidth ? 1 : 0;
+
+ $sql = "REPLACE INTO " . TABLE_PROFILES . " (`perso_id`, `profile_text`, `profile_updated`, `profile_fixedwidth`) VALUES ('$perso_id', '$text', '$updated', '$fixedwidth')";
+ if (!$db->sql_query($sql)) {
+ message_die(SQL_ERROR, "Unable to save", '', __LINE__, __FILE__, $sql);
+ }
+ }
+
+ ///
+ /// Tags
+ ///
+
+ /**
+ * Gets the profile's tags
+ *
+ * @return string The profile's tags
+ */
+ function get_tags () {
+ global $db;
+ $id = $db->sql_escape($this->perso_id);
+ $sql = "SELECT tag_code, tag_class FROM " . TABLE_PROFILES_TAGS
+ . " WHERE perso_id = '$id'";
+ if (!$result = $db->sql_query($sql)) {
+ message_die(SQL_ERROR, "Can't get tags", '', __LINE__, __FILE__, $sql);
+ }
+ $tags = array();
+ while ($row = $db->sql_fetchrow($result)) {
+ $tags[$row['tag_class']][] = $row['tag_code'];
+ }
+ return $tags;
+ }
+
+ /**
+ * Gets the profile's cached tags
+ *
+ * @return string The profile's tags
+ */
+ function get_cached_tags () {
+ require_once('includes/cache/cache.php');
+ $cache = Cache::load();
+ $key = 'zed_profile_tags_' . $this->perso_id;
+ if (!$tags_html = $cache->get($key)) {
+ //Regenerates tags cached html snippet
+ global $smarty;
+ $tags = $this->get_tags();
+ if (count($tags)) {
+ $smarty->assign('tags', $tags);
+ $tags_html = $smarty->fetch('profile_tags.tpl');
+ } else {
+ $tags_html = " ";
+ }
+ $cache->set($key, $tags_html);
+ }
+ return $tags_html;
+ }
+}
+
?>
\ No newline at end of file
diff --git a/includes/objects/profilecomment.php b/includes/objects/profilecomment.php
index a63db3a..cbf8980 100755
--- a/includes/objects/profilecomment.php
+++ b/includes/objects/profilecomment.php
@@ -1,131 +1,131 @@
-<?php
-
-/**
- * Profile comments class
- *
- * Zed. The immensity of stars. The HyperShip. The people.
- *
- * (c) 2010, Dereckson, some rights reserved.
- * Released under BSD license.
- *
- * 0.1 2010-01-03 01:02 Autogenerated by Pluton Scaffolding
- *
- * @package Zed
- * @subpackage Model
- * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
- * @copyright 2010 Sébastien Santoro aka Dereckson
- * @license http://www.opensource.org/licenses/bsd-license.php BSD
- * @version 0.1
- * @link http://scherzo.dereckson.be/doc/zed
- * @link http://zed.dereckson.be/
- * @filesource
- */
-
-/**
- * Profile comments class
- *
- * This class maps the profiles_comments table.
- */
-class ProfileComment {
-
- public $id;
- public $perso_id;
- public $author;
- public $authorname; //should be read-only
- public $date;
- public $text;
-
- /**
+<?php
+
+/**
+ * Profile comments class
+ *
+ * Zed. The immensity of stars. The HyperShip. The people.
+ *
+ * (c) 2010, Dereckson, some rights reserved.
+ * Released under BSD license.
+ *
+ * 0.1 2010-01-03 01:02 Autogenerated by Pluton Scaffolding
+ *
+ * @package Zed
+ * @subpackage Model
+ * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
+ * @copyright 2010 Sébastien Santoro aka Dereckson
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD
+ * @version 0.1
+ * @link http://scherzo.dereckson.be/doc/zed
+ * @link http://zed.dereckson.be/
+ * @filesource
+ */
+
+/**
+ * Profile comments class
+ *
+ * This class maps the profiles_comments table.
+ */
+class ProfileComment {
+
+ public $id;
+ public $perso_id;
+ public $author;
+ public $authorname; //should be read-only
+ public $date;
+ public $text;
+
+ /**
* Initializes a new instance of the ProfileComment class
*
- * @param int $id the comment ID
- */
- function __construct ($id = '') {
- if ($id) {
- $this->id = $id;
- $this->load_from_database();
- } else {
- $this->date = time();
- }
- }
-
+ * @param int $id the comment ID
+ */
+ function __construct ($id = '') {
+ if ($id) {
+ $this->id = $id;
+ $this->load_from_database();
+ } else {
+ $this->date = time();
+ }
+ }
+
/**
* Loads the object comment (ie fill the properties) from the $_POST array
- */
- function load_from_form () {
- if (array_key_exists('perso_id', $_POST)) $this->perso_id = $_POST['perso_id'];
- if (array_key_exists('author', $_POST)) $this->author = $_POST['author'];
- if (array_key_exists('date', $_POST)) $this->date = $_POST['date'];
- if (array_key_exists('text', $_POST)) $this->text = $_POST['text'];
- }
-
+ */
+ function load_from_form () {
+ if (array_key_exists('perso_id', $_POST)) $this->perso_id = $_POST['perso_id'];
+ if (array_key_exists('author', $_POST)) $this->author = $_POST['author'];
+ if (array_key_exists('date', $_POST)) $this->date = $_POST['date'];
+ if (array_key_exists('text', $_POST)) $this->text = $_POST['text'];
+ }
+
/**
* Loads the object comment (ie fill the properties) from the database
- */
- function load_from_database () {
- global $db;
- $id = $db->sql_escape($this->id);
- $sql = "SELECT c.*, p.perso_name as author FROM " . TABLE_PROFILES_COMMENTS . " c, " . TABLE_PERSOS . " p WHERE c.comment_id = '$id' AND p.perso_id = c.comment_author";
- if ( !($result = $db->sql_query($sql)) ) message_die(SQL_ERROR, "Unable to query azhar_profiles_comments", '', __LINE__, __FILE__, $sql);
- if (!$row = $db->sql_fetchrow($result)) {
- $this->lastError = "comment unkwown: " . $this->id;
- return false;
- }
- $this->perso_id = $row['perso_id'];
- $this->author = $row['comment_author'];
- $this->authorname = $row['author'];
- $this->date = $row['comment_date'];
- $this->text = $row['comment_text'];
- return true;
- }
+ */
+ function load_from_database () {
+ global $db;
+ $id = $db->sql_escape($this->id);
+ $sql = "SELECT c.*, p.perso_name as author FROM " . TABLE_PROFILES_COMMENTS . " c, " . TABLE_PERSOS . " p WHERE c.comment_id = '$id' AND p.perso_id = c.comment_author";
+ if ( !($result = $db->sql_query($sql)) ) message_die(SQL_ERROR, "Unable to query azhar_profiles_comments", '', __LINE__, __FILE__, $sql);
+ if (!$row = $db->sql_fetchrow($result)) {
+ $this->lastError = "comment unkwown: " . $this->id;
+ return false;
+ }
+ $this->perso_id = $row['perso_id'];
+ $this->author = $row['comment_author'];
+ $this->authorname = $row['author'];
+ $this->date = $row['comment_date'];
+ $this->text = $row['comment_text'];
+ return true;
+ }
/**
* Saves the object to the database
- */
- function save_to_database () {
- global $db;
-
- $id = $this->id ? "'" . $db->sql_escape($this->id) . "'" : 'NULL';
- $perso_id = $db->sql_escape($this->perso_id);
- $author = $db->sql_escape($this->author);
- $date = $db->sql_escape($this->date);
- $text = $db->sql_escape($this->text);
-
- $sql = "REPLACE INTO " . TABLE_PROFILES_COMMENTS . " (`comment_id`, `perso_id`, `comment_author`, `comment_date`, `comment_text`) VALUES ($id, '$perso_id', '$author', '$date', '$text')";
- if (!$db->sql_query($sql)) {
- message_die(SQL_ERROR, "Unable to save", '', __LINE__, __FILE__, $sql);
- }
- if (!$id) {
- //Gets new record id value
- $this->id = $db->sql_nextid();
- }
- }
-
+ */
+ function save_to_database () {
+ global $db;
+
+ $id = $this->id ? "'" . $db->sql_escape($this->id) . "'" : 'NULL';
+ $perso_id = $db->sql_escape($this->perso_id);
+ $author = $db->sql_escape($this->author);
+ $date = $db->sql_escape($this->date);
+ $text = $db->sql_escape($this->text);
+
+ $sql = "REPLACE INTO " . TABLE_PROFILES_COMMENTS . " (`comment_id`, `perso_id`, `comment_author`, `comment_date`, `comment_text`) VALUES ($id, '$perso_id', '$author', '$date', '$text')";
+ if (!$db->sql_query($sql)) {
+ message_die(SQL_ERROR, "Unable to save", '', __LINE__, __FILE__, $sql);
+ }
+ if (!$id) {
+ //Gets new record id value
+ $this->id = $db->sql_nextid();
+ }
+ }
+
/**
* Publishes the comment
* @todo Add events on publish
- */
- function publish () {
- $this->save_to_database();
- }
+ */
+ function publish () {
+ $this->save_to_database();
+ }
/**
* Gets comments
*
* @param int $perso_id The Perso ID
- */
- static function get_comments ($perso_id) {
- global $db;
- $sql = "SELECT comment_id FROM " . TABLE_PROFILES_COMMENTS . " WHERE perso_id = " . $db->sql_escape($perso_id);
- if (!$result = $db->sql_query($sql)) {
- message_die(SQL_ERROR, "Unable to get comments", '', __LINE__, __FILE__, $sql);
- }
- while ($row = $db->sql_fetchrow($result)) {
- $comments[] = new ProfileComment($row[0]);
- }
- return $comments;
- }
-}
-
-?>
-
+ */
+ static function get_comments ($perso_id) {
+ global $db;
+ $sql = "SELECT comment_id FROM " . TABLE_PROFILES_COMMENTS . " WHERE perso_id = " . $db->sql_escape($perso_id);
+ if (!$result = $db->sql_query($sql)) {
+ message_die(SQL_ERROR, "Unable to get comments", '', __LINE__, __FILE__, $sql);
+ }
+ while ($row = $db->sql_fetchrow($result)) {
+ $comments[] = new ProfileComment($row[0]);
+ }
+ return $comments;
+ }
+}
+
+?>
+
diff --git a/includes/objects/profilephoto.php b/includes/objects/profilephoto.php
index e6921d1..efba394 100755
--- a/includes/objects/profilephoto.php
+++ b/includes/objects/profilephoto.php
@@ -1,203 +1,203 @@
-<?php
-
-/**
- * Profile photo class
- *
- * Zed. The immensity of stars. The HyperShip. The people.
- *
- * (c) 2010, Dereckson, some rights reserved.
- * Released under BSD license.
- *
- * 0.1 2010-01-03 21:00 Autogenerated by Pluton Scaffolding
- * 0.2 2010-02-02 00:52 Thumbnail ImageMagick generation code
- *
- * @package Zed
- * @subpackage Model
- * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
- * @copyright 2010 Sébastien Santoro aka Dereckson
- * @license http://www.opensource.org/licenses/bsd-license.php BSD
- * @version 0.1
- * @link http://scherzo.dereckson.be/doc/zed
- * @link http://zed.dereckson.be/
- * @filesource
- */
-
-/**
- * Profile photo class
- *
- * This class maps the profile_photos table.
- *
- * It also provides helper methods to handle avatars or get all the photos
- * from a specified perso.
- */
-class ProfilePhoto {
-
- public $id;
- public $perso_id;
- public $name;
- public $description;
- public $avatar;
-
- /**
- * Initializes a new instance of the ProfilePhoto class
- */
- function __construct ($id = '') {
- if ($id) {
- $this->id = $id;
- $this->load_from_database();
- }
- }
-
- /**
- * Loads the object photo (ie fill the properties) from the $_POST array
- *
- * @param bool $readBoolean if false, don't read the bool avatar field to avoid to set by error false if the field weren't in the form.
- */
- function load_from_form ($readBoolean = true) {
- if (array_key_exists('perso_id', $_POST)) $this->perso_id = $_POST['perso_id'];
- if (array_key_exists('name', $_POST)) $this->name = $_POST['name'];
- if (array_key_exists('description', $_POST)) $this->description = $_POST['description'];
- if ($readBoolean) {
- $this->avatar = $_POST['avatar'] ? true : false;
- }
- }
-
- /**
- * Loads the object photo (ie fill the properties) from the database
- */
- function load_from_database () {
- global $db;
- $id = $db->sql_escape($this->id);
- $sql = "SELECT * FROM " . TABLE_PROFILES_PHOTOS . " WHERE photo_id = '" . $id . "'";
- if ( !($result = $db->sql_query($sql)) ) message_die(SQL_ERROR, "Unable to query azhar_profiles_photos", '', __LINE__, __FILE__, $sql);
- if (!$row = $db->sql_fetchrow($result)) {
- $this->lastError = "photo unkwown: " . $this->id;
- return false;
- }
- $this->perso_id = $row['perso_id'];
- $this->name = $row['photo_name'];
- $this->description = $row['photo_description'];
- $this->avatar = $row['photo_avatar'];
- return true;
- }
-
- /**
- * Promotes the photo to avatar
- */
- function promote_to_avatar () {
- global $db;
-
- //1 - locally
- $sql = "UPDATE " . TABLE_PROFILES_PHOTOS . " SET photo_avatar = 0 WHERE perso_id = " . $this->perso_id;
- $db->sql_query_express($sql);
- $this->avatar = true;
-
- //2 - in perso table
- $perso = Perso::get($this->perso_id);
- $perso->avatar = $this->name;
- $perso->saveToDatabase();
- }
-
- /**
- * Saves the object to the database
- */
- function save_to_database () {
- global $db;
-
- //Escapes fields
- $id = $this->id ? "'" . $db->sql_escape($this->id) . "'" : 'NULL';
- $perso_id = $db->sql_escape($this->perso_id);
- $name = $db->sql_escape($this->name);
- $description = $db->sql_escape($this->description);
- $avatar = $this->avatar ? 1 : 0;
-
- //Saves
- $sql = "REPLACE INTO " . TABLE_PROFILES_PHOTOS . " (`photo_id`, `perso_id`, `photo_name`, `photo_description`, `photo_avatar`) VALUES ($id, '$perso_id', '$name', '$description', $avatar)";
- if (!$db->sql_query($sql)) {
- message_die(SQL_ERROR, "Unable to save", '', __LINE__, __FILE__, $sql);
- }
- if (!$id) {
- //Gets new record id value
- $this->id = $db->sql_nextid();
- }
- }
-
- /**
- * Deletes the photo
- */
- function delete () {
- global $db;
-
- //Deletes from disk
- $pic_tn = PHOTOS_DIR . '/' . $this->name;
- $pic_genuine = PHOTOS_DIR . '/tn/' . $this->name;
- unlink($pic_tn);
- unlink($pic_genuine);
-
- //Deletes from database
- $id = $db->sql_escape($this->id);
- $sql = "DELETE FROM " . TABLE_PROFILES_PHOTOS . " WHERE photo_id = '$id' LIMIT 1";
- if (!$db->sql_query($sql)) {
- message_die(SQL_ERROR, "Can't delete photo", '', __LINE__, __FILE__, $sql);
- }
- }
-
- /**
- * Generates a thumbnail using ImageMagick binary
- *
- * @return boolean true if the thumbnail command returns 0 as program exit code ; otherwise, false
- */
- function generate_thumbnail () {
- global $Config;
- $sourceFile = PHOTOS_DIR . DIRECTORY_SEPARATOR . $this->name;
- $thumbnailFile = PHOTOS_DIR . DIRECTORY_SEPARATOR . 'tn' . DIRECTORY_SEPARATOR . $this->name;
- $command = $Config['ImageMagick']['convert'] . " $sourceFile -resize 1000x80 $thumbnailFile";
- @system($command, $code);
- return ($code == 0);
- }
-
- /**
- * Gets photos from the specified perso
- *
- * @param int $perso_id the perso ID
- * @param bool $allowUnsafe if false, don't include not safe for work photos
- */
- static function get_photos ($perso_id, $allowUnsafe = true) {
- global $db;
- $sql = "SELECT photo_id FROM " . TABLE_PROFILES_PHOTOS . " WHERE perso_id = " . $db->sql_escape($perso_id);
- if (!$allowUnsafe) $sql .= " AND photo_safe = 0";
- if (!$result = $db->sql_query($sql)) {
- message_die(SQL_ERROR, "Unable to get photos", '', __LINE__, __FILE__, $sql);
- }
- while ($row = $db->sql_fetchrow($result)) {
- $photos[] = new ProfilePhoto($row[0]);
- }
- return $photos;
- }
-
- /**
- * Gets perso avatar
- *
- * @param integer $perso_id the perso to get the avatar ID
- * @param string $username the username to put in title tag
- */
- static function get_avatar ($perso_id, $username = '') {
- global $db;
-
- $perso_id = $db->sql_escape($perso_id);
-
- $sql = "SELECT photo_description, photo_name FROM " . TABLE_PROFILES_PHOTOS . " WHERE perso_id = '$perso_id' and photo_avatar = 1";
- if (!$result = $db->sql_query($sql)) {
- message_die(SQL_ERROR, "Unable to get avatar", '', __LINE__, __FILE__, $sql);
- }
- if ($row = $db->sql_fetchrow($result)) {
- if (!$username) $username = get_name($perso_id);
- $description = $row['photo_description'] ? "$row[photo_description] ($username's avatar)" : "$username's avatar";
- $url = PHOTOS_URL . '/tn/' . $row['photo_name'];
- return "<img src=\"$url\" title=\"$username\" alt=\"$description\" />";
- } else {
- return null;
- }
- }
-}
+<?php
+
+/**
+ * Profile photo class
+ *
+ * Zed. The immensity of stars. The HyperShip. The people.
+ *
+ * (c) 2010, Dereckson, some rights reserved.
+ * Released under BSD license.
+ *
+ * 0.1 2010-01-03 21:00 Autogenerated by Pluton Scaffolding
+ * 0.2 2010-02-02 00:52 Thumbnail ImageMagick generation code
+ *
+ * @package Zed
+ * @subpackage Model
+ * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
+ * @copyright 2010 Sébastien Santoro aka Dereckson
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD
+ * @version 0.1
+ * @link http://scherzo.dereckson.be/doc/zed
+ * @link http://zed.dereckson.be/
+ * @filesource
+ */
+
+/**
+ * Profile photo class
+ *
+ * This class maps the profile_photos table.
+ *
+ * It also provides helper methods to handle avatars or get all the photos
+ * from a specified perso.
+ */
+class ProfilePhoto {
+
+ public $id;
+ public $perso_id;
+ public $name;
+ public $description;
+ public $avatar;
+
+ /**
+ * Initializes a new instance of the ProfilePhoto class
+ */
+ function __construct ($id = '') {
+ if ($id) {
+ $this->id = $id;
+ $this->load_from_database();
+ }
+ }
+
+ /**
+ * Loads the object photo (ie fill the properties) from the $_POST array
+ *
+ * @param bool $readBoolean if false, don't read the bool avatar field to avoid to set by error false if the field weren't in the form.
+ */
+ function load_from_form ($readBoolean = true) {
+ if (array_key_exists('perso_id', $_POST)) $this->perso_id = $_POST['perso_id'];
+ if (array_key_exists('name', $_POST)) $this->name = $_POST['name'];
+ if (array_key_exists('description', $_POST)) $this->description = $_POST['description'];
+ if ($readBoolean) {
+ $this->avatar = $_POST['avatar'] ? true : false;
+ }
+ }
+
+ /**
+ * Loads the object photo (ie fill the properties) from the database
+ */
+ function load_from_database () {
+ global $db;
+ $id = $db->sql_escape($this->id);
+ $sql = "SELECT * FROM " . TABLE_PROFILES_PHOTOS . " WHERE photo_id = '" . $id . "'";
+ if ( !($result = $db->sql_query($sql)) ) message_die(SQL_ERROR, "Unable to query azhar_profiles_photos", '', __LINE__, __FILE__, $sql);
+ if (!$row = $db->sql_fetchrow($result)) {
+ $this->lastError = "photo unkwown: " . $this->id;
+ return false;
+ }
+ $this->perso_id = $row['perso_id'];
+ $this->name = $row['photo_name'];
+ $this->description = $row['photo_description'];
+ $this->avatar = $row['photo_avatar'];
+ return true;
+ }
+
+ /**
+ * Promotes the photo to avatar
+ */
+ function promote_to_avatar () {
+ global $db;
+
+ //1 - locally
+ $sql = "UPDATE " . TABLE_PROFILES_PHOTOS . " SET photo_avatar = 0 WHERE perso_id = " . $this->perso_id;
+ $db->sql_query_express($sql);
+ $this->avatar = true;
+
+ //2 - in perso table
+ $perso = Perso::get($this->perso_id);
+ $perso->avatar = $this->name;
+ $perso->saveToDatabase();
+ }
+
+ /**
+ * Saves the object to the database
+ */
+ function save_to_database () {
+ global $db;
+
+ //Escapes fields
+ $id = $this->id ? "'" . $db->sql_escape($this->id) . "'" : 'NULL';
+ $perso_id = $db->sql_escape($this->perso_id);
+ $name = $db->sql_escape($this->name);
+ $description = $db->sql_escape($this->description);
+ $avatar = $this->avatar ? 1 : 0;
+
+ //Saves
+ $sql = "REPLACE INTO " . TABLE_PROFILES_PHOTOS . " (`photo_id`, `perso_id`, `photo_name`, `photo_description`, `photo_avatar`) VALUES ($id, '$perso_id', '$name', '$description', $avatar)";
+ if (!$db->sql_query($sql)) {
+ message_die(SQL_ERROR, "Unable to save", '', __LINE__, __FILE__, $sql);
+ }
+ if (!$id) {
+ //Gets new record id value
+ $this->id = $db->sql_nextid();
+ }
+ }
+
+ /**
+ * Deletes the photo
+ */
+ function delete () {
+ global $db;
+
+ //Deletes from disk
+ $pic_tn = PHOTOS_DIR . '/' . $this->name;
+ $pic_genuine = PHOTOS_DIR . '/tn/' . $this->name;
+ unlink($pic_tn);
+ unlink($pic_genuine);
+
+ //Deletes from database
+ $id = $db->sql_escape($this->id);
+ $sql = "DELETE FROM " . TABLE_PROFILES_PHOTOS . " WHERE photo_id = '$id' LIMIT 1";
+ if (!$db->sql_query($sql)) {
+ message_die(SQL_ERROR, "Can't delete photo", '', __LINE__, __FILE__, $sql);
+ }
+ }
+
+ /**
+ * Generates a thumbnail using ImageMagick binary
+ *
+ * @return boolean true if the thumbnail command returns 0 as program exit code ; otherwise, false
+ */
+ function generate_thumbnail () {
+ global $Config;
+ $sourceFile = PHOTOS_DIR . DIRECTORY_SEPARATOR . $this->name;
+ $thumbnailFile = PHOTOS_DIR . DIRECTORY_SEPARATOR . 'tn' . DIRECTORY_SEPARATOR . $this->name;
+ $command = $Config['ImageMagick']['convert'] . " $sourceFile -resize 1000x80 $thumbnailFile";
+ @system($command, $code);
+ return ($code == 0);
+ }
+
+ /**
+ * Gets photos from the specified perso
+ *
+ * @param int $perso_id the perso ID
+ * @param bool $allowUnsafe if false, don't include not safe for work photos
+ */
+ static function get_photos ($perso_id, $allowUnsafe = true) {
+ global $db;
+ $sql = "SELECT photo_id FROM " . TABLE_PROFILES_PHOTOS . " WHERE perso_id = " . $db->sql_escape($perso_id);
+ if (!$allowUnsafe) $sql .= " AND photo_safe = 0";
+ if (!$result = $db->sql_query($sql)) {
+ message_die(SQL_ERROR, "Unable to get photos", '', __LINE__, __FILE__, $sql);
+ }
+ while ($row = $db->sql_fetchrow($result)) {
+ $photos[] = new ProfilePhoto($row[0]);
+ }
+ return $photos;
+ }
+
+ /**
+ * Gets perso avatar
+ *
+ * @param integer $perso_id the perso to get the avatar ID
+ * @param string $username the username to put in title tag
+ */
+ static function get_avatar ($perso_id, $username = '') {
+ global $db;
+
+ $perso_id = $db->sql_escape($perso_id);
+
+ $sql = "SELECT photo_description, photo_name FROM " . TABLE_PROFILES_PHOTOS . " WHERE perso_id = '$perso_id' and photo_avatar = 1";
+ if (!$result = $db->sql_query($sql)) {
+ message_die(SQL_ERROR, "Unable to get avatar", '', __LINE__, __FILE__, $sql);
+ }
+ if ($row = $db->sql_fetchrow($result)) {
+ if (!$username) $username = get_name($perso_id);
+ $description = $row['photo_description'] ? "$row[photo_description] ($username's avatar)" : "$username's avatar";
+ $url = PHOTOS_URL . '/tn/' . $row['photo_name'];
+ return "<img src=\"$url\" title=\"$username\" alt=\"$description\" />";
+ } else {
+ return null;
+ }
+ }
+}
?>
\ No newline at end of file
diff --git a/includes/objects/user.php b/includes/objects/user.php
index 2ff6ae3..30ccb63 100755
--- a/includes/objects/user.php
+++ b/includes/objects/user.php
@@ -1,246 +1,246 @@
-<?php
-
-/**
- * User class
- *
- * Zed. The immensity of stars. The HyperShip. The people.
- *
- * (c) 2010, Dereckson, some rights reserved.
- * Released under BSD license.
- *
- * [DESIGN BY CONTRACT NOTE] No more than one OpenID per user
- *
- * @package Zed
- * @subpackage Model
- * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
- * @copyright 2010 Sébastien Santoro aka Dereckson
- * @license http://www.opensource.org/licenses/bsd-license.php BSD
- * @version 0.1
- * @link http://scherzo.dereckson.be/doc/zed
- * @link http://zed.dereckson.be/
- * @filesource
- */
-
-/**
- * User class
- *
- * This class maps the users and users_openid tables.
- *
- * It also provides helper methods to check if a login is available,
- * or to retrieve a username from e-mail address.
- */
-class User {
-
- public $id;
- public $name;
- public $password;
- public $active = 0;
- public $actkey;
- public $email;
- public $regdate;
-
- public static $hashtable_id = array();
- public static $hashtable_name = array();
-
- /**
- * Initializes a new instance
- *
- * @param int $id the primary key
- */
- function __construct ($id = null) {
- if ($id) {
- $this->id = $id;
- $this->load_from_database();
- }
- }
-
- /**
- * Initializes a new User instance if needed or get already available one.
- *
- * @param mixed $data user ID or name
- * @return User the user instance
- */
- static function get ($data = null) {
- if ($data) {
- //Checks in the hashtables if we already have loaded this instance
- if (is_numeric($data)) {
- if (array_key_exists($data, User::$hashtable_id)) {
- return User::$hashtable_id[$data];
- }
- } else {
- if (array_key_exists($data, User::$hashtable_name)) {
- return User::$hashtable_name[$data];
- }
- }
- }
-
- $user = new User($data);
- return $user;
- }
-
- /**
- * Loads the object User (ie fill the properties) from the $_POST array
- */
- function load_from_form () {
- if (array_key_exists('name', $_POST)) $this->name = $_POST['name'];
- if (array_key_exists('password', $_POST)) $this->password = $_POST['password'];
- if (array_key_exists('active', $_POST)) $this->active = $_POST['active'];
- if (array_key_exists('actkey', $_POST)) $this->actkey = $_POST['actkey'];
- if (array_key_exists('email', $_POST)) $this->email = $_POST['email'];
- if (array_key_exists('regdate', $_POST)) $this->regdate = $_POST['regdate'];
- }
-
- /**
- * Loads the object User (ie fill the properties) from the database
- */
- function load_from_database () {
- global $db;
- $sql = "SELECT * FROM " . TABLE_USERS . " WHERE user_id = '" . $this->id . "'";
- if ( !($result = $db->sql_query($sql)) ) message_die(SQL_ERROR, "Unable to query users", '', __LINE__, __FILE__, $sql);
- if (!$row = $db->sql_fetchrow($result)) {
- $this->lastError = "User unkwown: " . $this->id;
- return false;
- }
- $this->name = $row['username'];
- $this->password = $row['user_password'];
- $this->active = $row['user_active'];
- $this->actkey = $row['user_actkey'];
- $this->email = $row['user_email'];
- $this->regdate = $row['user_regdate'];
-
- //Puts object in hashtables
- Perso::$hashtable_id[$this->id] = $this;
- Perso::$hashtable_name[$this->name] = $this;
-
- return true;
- }
-
- /**
- * Saves to database
- */
- function save_to_database () {
- global $db;
-
- $id = $this->id ? "'" . $db->sql_escape($this->id) . "'" : 'NULL';
- $name = $db->sql_escape($this->name);
- $password = $db->sql_escape($this->password);
- $active = $db->sql_escape($this->active);
- $actkey = $db->sql_escape($this->actkey);
- $email = $db->sql_escape($this->email);
- $regdate = $this->regdate ? "'" . $db->sql_escape($this->regdate) . "'" : 'NULL';
-
- //Updates or inserts
- $sql = "REPLACE INTO " . TABLE_USERS . " (`user_id`, `username`, `user_password`, `user_active`, `user_actkey`, `user_email`, `user_regdate`) VALUES ($id, '$name', '$password', '$active', '$actkey', '$email', $regdate)";
- if (!$db->sql_query($sql)) {
- message_die(SQL_ERROR, "Unable to save", '', __LINE__, __FILE__, $sql);
- }
-
- if (!$id) {
- //Gets new record id value
- $this->id = $db->sql_nextid();
- }
- }
-
- /**
- * Updates the specified field in the database record
- */
- function save_field ($field) {
- global $db;
- if (!$this->id) {
- message_die(GENERAL_ERROR, "You're trying to update a record not yet saved in the database");
- }
- $id = $db->sql_escape($this->id);
- $value = $db->sql_escape($this->$field);
- $sql = "UPDATE " . TABLE_USERS . " SET `$field` = '$value' WHERE user_id = '$id'";
- if (!$db->sql_query($sql)) {
- message_die(SQL_ERROR, "Unable to save $field field", '', __LINE__, __FILE__, $sql);
- }
- }
-
- /**
- * Generates a unique user id
- */
- function generate_id () {
- global $db;
-
- do {
- $this->id = rand(2001, 5999);
- $sql = "SELECT COUNT(*) FROM " . TABLE_USERS . " WHERE user_id = $this->id LOCK IN SHARE MODE;";
- if (!$result = $db->sql_query($sql)) {
- message_die(SQL_ERROR, "Can't access users table", '', __LINE__, __FILE__, $sql);
- }
- $row = $db->sql_fetchrow($result);
- } while ($row[0]);
- }
-
- /**
- * Fills password field with encrypted version of the specified clear password
- *
- * @param string $newpassword The user's new password
- */
- public function set_password ($newpassword) {
- $this->password = md5($newpassword);
- }
-
- /**
- * Deletes OpenID for this user
- */
- public function delete_OpenID () {
- $this->set_OpenID('');
- }
-
- /**
- * Sets OpenID for this user
- *
- * @param string $url OpenID endpoint URL
- */
- public function set_OpenID ($url) {
- global $db;
- if (!$this->id) $this->save_to_database();
- $url = $db->sql_escape($url);
- $sql = "DELETE FROM " . TABLE_USERS_AUTH . " WHERE auth_type = 'OpenID' AND user_id = $this->id";
- if (!$db->sql_query($sql))
- message_die(SQL_ERROR, "Can't delete old OpenID", '', __LINE__, __FILE__, $sql);
- if ($url != '') {
- $sql = "INSERT INTO " . TABLE_USERS_AUTH . " (auth_type, auth_identity, user_id) VALUES ('OpenID', '$url', $this->id)";
- if (!$db->sql_query($sql))
- message_die(SQL_ERROR, "Can't add new OpenID", '', __LINE__, __FILE__, $sql);
- }
- }
-
- /**
- * Checks if a login is available
- *
- * @param string $login the login to check
- * @return bool true if the specified login is available ; otherwise, false.
- */
- public static function is_available_login ($login) {
- global $db;
- $sql = "SELECT COUNT(*) FROM " . TABLE_USERS . " WHERE username LIKE '$login' LOCK IN SHARE MODE;";
- if (!$result = $db->sql_query($sql)) {
- message_die(SQL_ERROR, "Utilisateurs non parsable", '', __LINE__, __FILE__, $sql);
- }
- $row = $db->sql_fetchrow($result);
- return ($row[0] ? false : true);
- }
-
- /**
- * Gets username from specified e-mail
- *
- * @param string $mail the mail to search
- * @return string|bool the username matching the mail if found ; otherwise, false.
- */
- public static function get_username_from_email ($mail) {
- global $db;
- $sql = "SELECT username FROM " . TABLE_USERS . " WHERE user_email LIKE '$mail' LOCK IN SHARE MODE;";
- if (!$result = $db->sql_query($sql)) {
- message_die(SQL_ERROR, "Utilisateurs non parsable", '', __LINE__, __FILE__, $sql);
- }
- if ($row = $db->sql_fetchrow($result)) {
- return $row['username'];
- }
- return false;
- }
-}
-
-?>
+<?php
+
+/**
+ * User class
+ *
+ * Zed. The immensity of stars. The HyperShip. The people.
+ *
+ * (c) 2010, Dereckson, some rights reserved.
+ * Released under BSD license.
+ *
+ * [DESIGN BY CONTRACT NOTE] No more than one OpenID per user
+ *
+ * @package Zed
+ * @subpackage Model
+ * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
+ * @copyright 2010 Sébastien Santoro aka Dereckson
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD
+ * @version 0.1
+ * @link http://scherzo.dereckson.be/doc/zed
+ * @link http://zed.dereckson.be/
+ * @filesource
+ */
+
+/**
+ * User class
+ *
+ * This class maps the users and users_openid tables.
+ *
+ * It also provides helper methods to check if a login is available,
+ * or to retrieve a username from e-mail address.
+ */
+class User {
+
+ public $id;
+ public $name;
+ public $password;
+ public $active = 0;
+ public $actkey;
+ public $email;
+ public $regdate;
+
+ public static $hashtable_id = array();
+ public static $hashtable_name = array();
+
+ /**
+ * Initializes a new instance
+ *
+ * @param int $id the primary key
+ */
+ function __construct ($id = null) {
+ if ($id) {
+ $this->id = $id;
+ $this->load_from_database();
+ }
+ }
+
+ /**
+ * Initializes a new User instance if needed or get already available one.
+ *
+ * @param mixed $data user ID or name
+ * @return User the user instance
+ */
+ static function get ($data = null) {
+ if ($data) {
+ //Checks in the hashtables if we already have loaded this instance
+ if (is_numeric($data)) {
+ if (array_key_exists($data, User::$hashtable_id)) {
+ return User::$hashtable_id[$data];
+ }
+ } else {
+ if (array_key_exists($data, User::$hashtable_name)) {
+ return User::$hashtable_name[$data];
+ }
+ }
+ }
+
+ $user = new User($data);
+ return $user;
+ }
+
+ /**
+ * Loads the object User (ie fill the properties) from the $_POST array
+ */
+ function load_from_form () {
+ if (array_key_exists('name', $_POST)) $this->name = $_POST['name'];
+ if (array_key_exists('password', $_POST)) $this->password = $_POST['password'];
+ if (array_key_exists('active', $_POST)) $this->active = $_POST['active'];
+ if (array_key_exists('actkey', $_POST)) $this->actkey = $_POST['actkey'];
+ if (array_key_exists('email', $_POST)) $this->email = $_POST['email'];
+ if (array_key_exists('regdate', $_POST)) $this->regdate = $_POST['regdate'];
+ }
+
+ /**
+ * Loads the object User (ie fill the properties) from the database
+ */
+ function load_from_database () {
+ global $db;
+ $sql = "SELECT * FROM " . TABLE_USERS . " WHERE user_id = '" . $this->id . "'";
+ if ( !($result = $db->sql_query($sql)) ) message_die(SQL_ERROR, "Unable to query users", '', __LINE__, __FILE__, $sql);
+ if (!$row = $db->sql_fetchrow($result)) {
+ $this->lastError = "User unkwown: " . $this->id;
+ return false;
+ }
+ $this->name = $row['username'];
+ $this->password = $row['user_password'];
+ $this->active = $row['user_active'];
+ $this->actkey = $row['user_actkey'];
+ $this->email = $row['user_email'];
+ $this->regdate = $row['user_regdate'];
+
+ //Puts object in hashtables
+ Perso::$hashtable_id[$this->id] = $this;
+ Perso::$hashtable_name[$this->name] = $this;
+
+ return true;
+ }
+
+ /**
+ * Saves to database
+ */
+ function save_to_database () {
+ global $db;
+
+ $id = $this->id ? "'" . $db->sql_escape($this->id) . "'" : 'NULL';
+ $name = $db->sql_escape($this->name);
+ $password = $db->sql_escape($this->password);
+ $active = $db->sql_escape($this->active);
+ $actkey = $db->sql_escape($this->actkey);
+ $email = $db->sql_escape($this->email);
+ $regdate = $this->regdate ? "'" . $db->sql_escape($this->regdate) . "'" : 'NULL';
+
+ //Updates or inserts
+ $sql = "REPLACE INTO " . TABLE_USERS . " (`user_id`, `username`, `user_password`, `user_active`, `user_actkey`, `user_email`, `user_regdate`) VALUES ($id, '$name', '$password', '$active', '$actkey', '$email', $regdate)";
+ if (!$db->sql_query($sql)) {
+ message_die(SQL_ERROR, "Unable to save", '', __LINE__, __FILE__, $sql);
+ }
+
+ if (!$id) {
+ //Gets new record id value
+ $this->id = $db->sql_nextid();
+ }
+ }
+
+ /**
+ * Updates the specified field in the database record
+ */
+ function save_field ($field) {
+ global $db;
+ if (!$this->id) {
+ message_die(GENERAL_ERROR, "You're trying to update a record not yet saved in the database");
+ }
+ $id = $db->sql_escape($this->id);
+ $value = $db->sql_escape($this->$field);
+ $sql = "UPDATE " . TABLE_USERS . " SET `$field` = '$value' WHERE user_id = '$id'";
+ if (!$db->sql_query($sql)) {
+ message_die(SQL_ERROR, "Unable to save $field field", '', __LINE__, __FILE__, $sql);
+ }
+ }
+
+ /**
+ * Generates a unique user id
+ */
+ function generate_id () {
+ global $db;
+
+ do {
+ $this->id = rand(2001, 5999);
+ $sql = "SELECT COUNT(*) FROM " . TABLE_USERS . " WHERE user_id = $this->id LOCK IN SHARE MODE;";
+ if (!$result = $db->sql_query($sql)) {
+ message_die(SQL_ERROR, "Can't access users table", '', __LINE__, __FILE__, $sql);
+ }
+ $row = $db->sql_fetchrow($result);
+ } while ($row[0]);
+ }
+
+ /**
+ * Fills password field with encrypted version of the specified clear password
+ *
+ * @param string $newpassword The user's new password
+ */
+ public function set_password ($newpassword) {
+ $this->password = md5($newpassword);
+ }
+
+ /**
+ * Deletes OpenID for this user
+ */
+ public function delete_OpenID () {
+ $this->set_OpenID('');
+ }
+
+ /**
+ * Sets OpenID for this user
+ *
+ * @param string $url OpenID endpoint URL
+ */
+ public function set_OpenID ($url) {
+ global $db;
+ if (!$this->id) $this->save_to_database();
+ $url = $db->sql_escape($url);
+ $sql = "DELETE FROM " . TABLE_USERS_AUTH . " WHERE auth_type = 'OpenID' AND user_id = $this->id";
+ if (!$db->sql_query($sql))
+ message_die(SQL_ERROR, "Can't delete old OpenID", '', __LINE__, __FILE__, $sql);
+ if ($url != '') {
+ $sql = "INSERT INTO " . TABLE_USERS_AUTH . " (auth_type, auth_identity, user_id) VALUES ('OpenID', '$url', $this->id)";
+ if (!$db->sql_query($sql))
+ message_die(SQL_ERROR, "Can't add new OpenID", '', __LINE__, __FILE__, $sql);
+ }
+ }
+
+ /**
+ * Checks if a login is available
+ *
+ * @param string $login the login to check
+ * @return bool true if the specified login is available ; otherwise, false.
+ */
+ public static function is_available_login ($login) {
+ global $db;
+ $sql = "SELECT COUNT(*) FROM " . TABLE_USERS . " WHERE username LIKE '$login' LOCK IN SHARE MODE;";
+ if (!$result = $db->sql_query($sql)) {
+ message_die(SQL_ERROR, "Utilisateurs non parsable", '', __LINE__, __FILE__, $sql);
+ }
+ $row = $db->sql_fetchrow($result);
+ return ($row[0] ? false : true);
+ }
+
+ /**
+ * Gets username from specified e-mail
+ *
+ * @param string $mail the mail to search
+ * @return string|bool the username matching the mail if found ; otherwise, false.
+ */
+ public static function get_username_from_email ($mail) {
+ global $db;
+ $sql = "SELECT username FROM " . TABLE_USERS . " WHERE user_email LIKE '$mail' LOCK IN SHARE MODE;";
+ if (!$result = $db->sql_query($sql)) {
+ message_die(SQL_ERROR, "Utilisateurs non parsable", '', __LINE__, __FILE__, $sql);
+ }
+ if ($row = $db->sql_fetchrow($result)) {
+ return $row['username'];
+ }
+ return false;
+ }
+}
+
+?>
diff --git a/includes/settings/page.php b/includes/settings/page.php
index 7cc0f77..9640e8f 100755
--- a/includes/settings/page.php
+++ b/includes/settings/page.php
@@ -1,156 +1,156 @@
-<?php
-
-/**
- * Settings: a settings page class
- *
- * Zed. The immensity of stars. The HyperShip. The people.
- *
- * (c) 2010, Dereckson, some rights reserved.
- * Released under BSD license.
- *
- * @package Zed
- * @subpackage Settings
- * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
- * @copyright 2010 Sébastien Santoro aka Dereckson
- * @license http://www.opensource.org/licenses/bsd-license.php BSD
- * @version 0.1
- * @link http://scherzo.dereckson.be/doc/zed
- * @link http://zed.dereckson.be/
- * @filesource
- */
-
-require_once("setting.php");
-
-/**
- * This class maps the page XML element, from our Settings XML schema
- *
- * <page id="account" title="Account">
- * <setting ...>
- * ...
- * </setting>
- * <setting ...>
- * ...
- * </setting>
- * <page>
- *
- * It provides method to print a form built from this page and to handle form.
- */
-class SettingsPage {
- /**
- * The page ID
- *
- * This property maps the id attribute from the page XML tag
- *
- * @var string the page ID
- */
- public $id;
-
- /**
- * The page's title
- *
- * This property maps the title attribute from the page XML tag
- *
- * @var string the page title
- */
- public $title;
-
- /**
- * The settings
- *
- * This property is an array of Setting items and maps the <setting> tags
- * @var Array
- */
- public $settings = array();
-
- /**
- * Initializes a new instance of SettingsPage class
- *
- * @param string $id the page ID
- */
- function __construct ($id) {
- $this->id = $id;
- }
-
- /**
- * Initializes a settings page from an SimpleXMLElement XML fragment
- *
- * @param SimpleXMLElement $xml the XML fragment
- * @return SettingsPage the section instance
- */
- static function from_xml ($xml) {
- //Reads attributes
- $id = ''; $title = '';
- foreach ($xml->attributes() as $key => $value) {
- switch ($key) {
- case 'title':
- case 'id':
- $$key = (string)$value;
- break;
-
- default:
- message_die(GENERAL_ERROR, "Unknown attribute: $key = \"$value\"", "Settings error");
- }
- }
-
- //id attribute is mandatory
- if (!$id) {
- message_die(GENERAL_ERROR, "Section without id. Please add id='' in <section> tag", "Story error");
- }
-
- //Initializes new SettingsPage instance
- $page = new SettingsPage($id);
- $page->title = $title;
-
- //Gets settings
- if ($xml->setting) {
- foreach ($xml->setting as $settingXml) {
- $setting = Setting::from_xml($settingXml);
- $page->settings[$setting->key] = $setting;
- }
- }
-
- return $page;
- }
-
- /**
- * Handles form reading $_POST array, set new settings values and saves.
- *
- * @param Array $errors an array where the errors will be filled
- * @return boolean true if there isn't error ; otherwise, false.
- */
- function handle_form (&$errors = array()) {
- $objects = array();
-
- //Sets new settings values
- foreach ($this->settings as $setting) {
- $value = $_POST[$setting->key];
-
- if ($setting->field == "password" && !$value) {
- //We don't erase passwords if not set
- continue;
- }
-
- //If the setting value is different of current one, we update it
- $currentValue = $setting->get();
- if ($setting->field == "checkbox" || $currentValue != $value) {
- if (!$setting->set($value)) {
- $errors[] = $setting->lastError ? $setting->lastError : "An error have occured in $setting->key field.";
- }
- if ($setting->object) $objects[] = $setting->object;
- }
- }
-
- //Saves object (when the SETTINGS_SAVE_METHOD save method exists)
- if (count($objects)) {
- $objects = array_unique($objects);
- foreach ($objects as $object) {
- $object = $GLOBALS[$object];
- if (method_exists($object, SETTINGS_SAVE_METHOD)) {
- call_user_func(array($object, SETTINGS_SAVE_METHOD));
- }
- }
- }
-
- }
-
+<?php
+
+/**
+ * Settings: a settings page class
+ *
+ * Zed. The immensity of stars. The HyperShip. The people.
+ *
+ * (c) 2010, Dereckson, some rights reserved.
+ * Released under BSD license.
+ *
+ * @package Zed
+ * @subpackage Settings
+ * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
+ * @copyright 2010 Sébastien Santoro aka Dereckson
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD
+ * @version 0.1
+ * @link http://scherzo.dereckson.be/doc/zed
+ * @link http://zed.dereckson.be/
+ * @filesource
+ */
+
+require_once("setting.php");
+
+/**
+ * This class maps the page XML element, from our Settings XML schema
+ *
+ * <page id="account" title="Account">
+ * <setting ...>
+ * ...
+ * </setting>
+ * <setting ...>
+ * ...
+ * </setting>
+ * <page>
+ *
+ * It provides method to print a form built from this page and to handle form.
+ */
+class SettingsPage {
+ /**
+ * The page ID
+ *
+ * This property maps the id attribute from the page XML tag
+ *
+ * @var string the page ID
+ */
+ public $id;
+
+ /**
+ * The page's title
+ *
+ * This property maps the title attribute from the page XML tag
+ *
+ * @var string the page title
+ */
+ public $title;
+
+ /**
+ * The settings
+ *
+ * This property is an array of Setting items and maps the <setting> tags
+ * @var Array
+ */
+ public $settings = array();
+
+ /**
+ * Initializes a new instance of SettingsPage class
+ *
+ * @param string $id the page ID
+ */
+ function __construct ($id) {
+ $this->id = $id;
+ }
+
+ /**
+ * Initializes a settings page from an SimpleXMLElement XML fragment
+ *
+ * @param SimpleXMLElement $xml the XML fragment
+ * @return SettingsPage the section instance
+ */
+ static function from_xml ($xml) {
+ //Reads attributes
+ $id = ''; $title = '';
+ foreach ($xml->attributes() as $key => $value) {
+ switch ($key) {
+ case 'title':
+ case 'id':
+ $$key = (string)$value;
+ break;
+
+ default:
+ message_die(GENERAL_ERROR, "Unknown attribute: $key = \"$value\"", "Settings error");
+ }
+ }
+
+ //id attribute is mandatory
+ if (!$id) {
+ message_die(GENERAL_ERROR, "Section without id. Please add id='' in <section> tag", "Story error");
+ }
+
+ //Initializes new SettingsPage instance
+ $page = new SettingsPage($id);
+ $page->title = $title;
+
+ //Gets settings
+ if ($xml->setting) {
+ foreach ($xml->setting as $settingXml) {
+ $setting = Setting::from_xml($settingXml);
+ $page->settings[$setting->key] = $setting;
+ }
+ }
+
+ return $page;
+ }
+
+ /**
+ * Handles form reading $_POST array, set new settings values and saves.
+ *
+ * @param Array $errors an array where the errors will be filled
+ * @return boolean true if there isn't error ; otherwise, false.
+ */
+ function handle_form (&$errors = array()) {
+ $objects = array();
+
+ //Sets new settings values
+ foreach ($this->settings as $setting) {
+ $value = $_POST[$setting->key];
+
+ if ($setting->field == "password" && !$value) {
+ //We don't erase passwords if not set
+ continue;
+ }
+
+ //If the setting value is different of current one, we update it
+ $currentValue = $setting->get();
+ if ($setting->field == "checkbox" || $currentValue != $value) {
+ if (!$setting->set($value)) {
+ $errors[] = $setting->lastError ? $setting->lastError : "An error have occured in $setting->key field.";
+ }
+ if ($setting->object) $objects[] = $setting->object;
+ }
+ }
+
+ //Saves object (when the SETTINGS_SAVE_METHOD save method exists)
+ if (count($objects)) {
+ $objects = array_unique($objects);
+ foreach ($objects as $object) {
+ $object = $GLOBALS[$object];
+ if (method_exists($object, SETTINGS_SAVE_METHOD)) {
+ call_user_func(array($object, SETTINGS_SAVE_METHOD));
+ }
+ }
+ }
+
+ }
+
}
\ No newline at end of file
diff --git a/includes/settings/preferences.xml b/includes/settings/preferences.xml
index b22c206..acad745 100644
--- a/includes/settings/preferences.xml
+++ b/includes/settings/preferences.xml
@@ -1,148 +1,148 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<settings>
- <page id="account" title="Account">
- <setting id="username">
- <key>Username</key>
- <field>text</field>
- <object>CurrentUser</object>
- <property>name</property>
- </setting>
- <setting id="password">
- <key>Password</key>
- <field>password</field>
- <object>CurrentUser</object>
- <handler>
- <get>
- return "";
- </get>
- <set>
-<![CDATA[
-if ($value) {
- global $CurrentUser;
- $CurrentUser->set_password($value);
- return true;
-}
-]]>
- </set>
- </handler>
- </setting>
- <setting id="email">
- <key>Email</key>
- <field>text</field>
- <object>CurrentUser</object>
- <property>email</property>
- </setting>
- <setting id="OpenID">
- <key>OpenID</key>
- <field>text</field>
- <handler>
- <get>
-<![CDATA[
-global $db, $CurrentUser;
-$sql = "SELECT auth_identity FROM " . TABLE_USERS_AUTH . " WHERE auth_type = 'OpenID' AND user_id = $CurrentUser->id LIMIT 1";
-return $db->sql_query_express($sql);
-]]>
- </get>
- <set>
-<![CDATA[
-global $db, $CurrentUser, $smarty;
-$openid = $db->sql_escape($value);
-$sql = "SELECT user_id FROM users_auth WHERE auth_type = 'OpenID' AND auth_identity LIKE '$openid'";
-if ($user_id = $db->sql_query_express($sql)) {
- if ($user_id == $CurrentUser->id) {
- $smarty->assign('WAP', "This OpenID is already linked to your account.");
- } else {
- $smarty->assign('WAP', "This OpenID is currently linked to another account.");
- supralog('security', "User tried to add OpenID $openid which belongs to $user_id", "preferences");
- }
- return false;
-}
-$CurrentUser->set_OpenID($value);
-return true;
-]]>
- </set>
- </handler>
- </setting>
- </page>
-
- <page id="perso" title="Information">
- <setting id="longname">
- <key>Name</key>
- <field>text</field>
- <object>CurrentPerso</object>
- <property>name</property>
- </setting>
- <setting id="nickname">
- <key>Nickname</key>
- <field>validationtext</field>
- <regExp>[a-z][a-z0-9 ]+</regExp>
- <object>CurrentPerso</object>
- <property>nickname</property>
- </setting>
- <setting id="race">
- <key>Race</key>
- <field>text</field>
- <object>CurrentPerso</object>
- <property>race</property>
- </setting>
- <setting id="sex">
- <key>Sex</key>
- <field>filteredlist</field>
- <object>CurrentPerso</object>
- <property>sex</property>
- <choices>
- <choice>
- <key>male</key>
- <value>M</value>
- </choice>
- <choice>
- <key>female</key>
- <value>F</value>
- </choice>
- <choice>
- <key>neutral</key>
- <value>N</value>
- </choice>
- <choice>
- <key>both</key>
- <value>2</value>
- </choice>
- </choices>
- </setting>
- </page>
-
- <page id="smartline" title="SmartLine">
- <setting id="show">
- <key>SmartlineShow</key>
- <field>checkbox</field>
- <handler>
- <set><![CDATA[
-global $CurrentPerso;
-$flag_value = $value ? 1 : 0;
-$CurrentPerso->set_flag('site.smartline.show', $flag_value);
-return true;
- ]]></set>
- <get><![CDATA[
-global $CurrentPerso;
-return (bool)$CurrentPerso->get_flag('site.smartline.show', true);
- ]]></get>
- </handler>
- </setting>
- <setting id="method">
- <key>SmartlineMethod</key>
- <field>checkbox</field>
- <handler>
- <set><![CDATA[
-global $CurrentPerso;
-$CurrentPerso->set_flag('site.smartline.method', $value ? 'post' : 'get');
-return true;
- ]]></set>
- <get><![CDATA[
-global $CurrentPerso;
-$flag = $CurrentPerso->get_flag('site.smartline.method', 'post');
-return $flag != "get";
- ]]></get>
- </handler>
- </setting>
- </page>
+<?xml version="1.0" encoding="UTF-8"?>
+<settings>
+ <page id="account" title="Account">
+ <setting id="username">
+ <key>Username</key>
+ <field>text</field>
+ <object>CurrentUser</object>
+ <property>name</property>
+ </setting>
+ <setting id="password">
+ <key>Password</key>
+ <field>password</field>
+ <object>CurrentUser</object>
+ <handler>
+ <get>
+ return "";
+ </get>
+ <set>
+<![CDATA[
+if ($value) {
+ global $CurrentUser;
+ $CurrentUser->set_password($value);
+ return true;
+}
+]]>
+ </set>
+ </handler>
+ </setting>
+ <setting id="email">
+ <key>Email</key>
+ <field>text</field>
+ <object>CurrentUser</object>
+ <property>email</property>
+ </setting>
+ <setting id="OpenID">
+ <key>OpenID</key>
+ <field>text</field>
+ <handler>
+ <get>
+<![CDATA[
+global $db, $CurrentUser;
+$sql = "SELECT auth_identity FROM " . TABLE_USERS_AUTH . " WHERE auth_type = 'OpenID' AND user_id = $CurrentUser->id LIMIT 1";
+return $db->sql_query_express($sql);
+]]>
+ </get>
+ <set>
+<![CDATA[
+global $db, $CurrentUser, $smarty;
+$openid = $db->sql_escape($value);
+$sql = "SELECT user_id FROM users_auth WHERE auth_type = 'OpenID' AND auth_identity LIKE '$openid'";
+if ($user_id = $db->sql_query_express($sql)) {
+ if ($user_id == $CurrentUser->id) {
+ $smarty->assign('WAP', "This OpenID is already linked to your account.");
+ } else {
+ $smarty->assign('WAP', "This OpenID is currently linked to another account.");
+ supralog('security', "User tried to add OpenID $openid which belongs to $user_id", "preferences");
+ }
+ return false;
+}
+$CurrentUser->set_OpenID($value);
+return true;
+]]>
+ </set>
+ </handler>
+ </setting>
+ </page>
+
+ <page id="perso" title="Information">
+ <setting id="longname">
+ <key>Name</key>
+ <field>text</field>
+ <object>CurrentPerso</object>
+ <property>name</property>
+ </setting>
+ <setting id="nickname">
+ <key>Nickname</key>
+ <field>validationtext</field>
+ <regExp>[a-z][a-z0-9 ]+</regExp>
+ <object>CurrentPerso</object>
+ <property>nickname</property>
+ </setting>
+ <setting id="race">
+ <key>Race</key>
+ <field>text</field>
+ <object>CurrentPerso</object>
+ <property>race</property>
+ </setting>
+ <setting id="sex">
+ <key>Sex</key>
+ <field>filteredlist</field>
+ <object>CurrentPerso</object>
+ <property>sex</property>
+ <choices>
+ <choice>
+ <key>male</key>
+ <value>M</value>
+ </choice>
+ <choice>
+ <key>female</key>
+ <value>F</value>
+ </choice>
+ <choice>
+ <key>neutral</key>
+ <value>N</value>
+ </choice>
+ <choice>
+ <key>both</key>
+ <value>2</value>
+ </choice>
+ </choices>
+ </setting>
+ </page>
+
+ <page id="smartline" title="SmartLine">
+ <setting id="show">
+ <key>SmartlineShow</key>
+ <field>checkbox</field>
+ <handler>
+ <set><![CDATA[
+global $CurrentPerso;
+$flag_value = $value ? 1 : 0;
+$CurrentPerso->set_flag('site.smartline.show', $flag_value);
+return true;
+ ]]></set>
+ <get><![CDATA[
+global $CurrentPerso;
+return (bool)$CurrentPerso->get_flag('site.smartline.show', true);
+ ]]></get>
+ </handler>
+ </setting>
+ <setting id="method">
+ <key>SmartlineMethod</key>
+ <field>checkbox</field>
+ <handler>
+ <set><![CDATA[
+global $CurrentPerso;
+$CurrentPerso->set_flag('site.smartline.method', $value ? 'post' : 'get');
+return true;
+ ]]></set>
+ <get><![CDATA[
+global $CurrentPerso;
+$flag = $CurrentPerso->get_flag('site.smartline.method', 'post');
+return $flag != "get";
+ ]]></get>
+ </handler>
+ </setting>
+ </page>
</settings>
\ No newline at end of file
diff --git a/includes/settings/setting.php b/includes/settings/setting.php
index ef4f3d4..05adca2 100755
--- a/includes/settings/setting.php
+++ b/includes/settings/setting.php
@@ -1,175 +1,175 @@
-<?php
-
-/**
- * Settings: an individual setting class
- *
- * Zed. The immensity of stars. The HyperShip. The people.
- *
- * (c) 2010, Dereckson, some rights reserved.
- * Released under BSD license.
- *
- * @package Zed
- * @subpackage Settings
- * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
- * @copyright 2010 Sébastien Santoro aka Dereckson
- * @license http://www.opensource.org/licenses/bsd-license.php BSD
- * @version 0.1
- * @link http://scherzo.dereckson.be/doc/zed
- * @link http://zed.dereckson.be/
- * @filesource
- */
-
-/**
- * Setting class
- *
- * This class map the <setting> XML block, from our settings XML format
- */
-class Setting {
-
- public $key;
-
- //Rendering variables
- public $field;
- public $regExp;
- public $choices;
-
- //get/set variables
- public $object;
- private $property;
- private $method;
- private $handler;
-
- //error variable
- public $lastError;
-
- /**
- * Gets the current setting value
- *
- * @return string the setting value
- */
- function get () {
- //1 - Evaluates custom handler
- if (array_key_exists('get', $this->handler)) {
- return eval($this->handler['get']);
- }
-
- //2 - Gets object property
- if ($this->object && $property = $this->property) {
- return $GLOBALS[$this->object]->$property;
- }
-
- if ($this->field == "password") {
- //Okay not to have a value for password fields
- return;
- }
-
- message_die(GENERAL_ERROR, "Setting $this->key haven't any get indication. Please set <object> and <property> / or a custom <handler><get></get></handler> block.", "Settings error");
- }
-
- /**
- * Sets a new value
- *
- * @param $value the setting new value
- * @return boolean true if the setting have been successfully set ; otherwise, false.
- */
- function set ($value) {
- //Validates data
- if ($this->regExp) {
- if (!preg_match('/^' . $this->regExp . '$/', $value)) {
- $this->lastError = "Invalid format for $this->key setting";
- return false;
- }
- }
-
- //Tries to set value
-
- //1 - Evaluates custom handler
- if (array_key_exists('set', $this->handler)) {
- return eval($this->handler['set']);
- }
-
- //2 - Calls object method
- //3 - Sets object property
- if ($this->object) {
- $object = $GLOBALS[$this->object];
- if ($this->method) {
- return call_user_func(array($object, $this->method), $value);
- } elseif ($property = $this->property) {
- $object->$property = $value;
- return true;
- }
- }
-
- message_die(GENERAL_ERROR, "Setting $this->key haven't any set indication. Please set <object> (and wheter <method>, whether <property>) or a custom <handler><set></set></handler> block.", "Settings error");
- }
-
- /**
- * Saves setting
- *
- * @return mixed the SETTINGS_SAVE_METHOD method value, or false if there's no method call;
- */
- function save () {
- if ($this->object) {
- $object = $GLOBALS[$this->object];
- if (method_exists($object, SETTINGS_SAVE_METHOD)) {
- return call_user_func(array($object, SETTINGS_SAVE_METHOD));
- }
- }
-
- return false;
- }
-
- /**
- * Initializes a new instance of Setting class from a XML element
- *
- * @param SimpleXMLElement the xml element to parse
- * @return Setting the setting class
- */
- static function from_xml ($xml) {
- //Reads attributes
- $id = '';
- foreach ($xml->attributes() as $key => $value) {
- switch ($key) {
- case 'id':
- $id = (string)$value;
- break;
-
- default:
- message_die(GENERAL_ERROR, "Unknown attribute: $key = \"$value\"", "Settings error");
- }
- }
-
- //id attribute is mandatory
- if (!$id) {
- message_die(GENERAL_ERROR, "Setting without id. Please add id='' in <setting> tag", "Settings error");
- }
-
- //Initializes new Setting instance
- $setting = new Setting($id);
-
- //Parses simple <tag>value</tag>
- $properties = array('key', 'field', 'object', 'property', 'method', 'regExp');
- foreach ($properties as $property) {
- if ($xml->$property)
- $setting->$property = (string)$xml->$property;
- }
-
- //Parses <handler>
- $setting->handler = array();
- if ($xml->handler) {
- if ($xml->handler->get) $setting->handler['get'] = (string)$xml->handler->get;
- if ($xml->handler->set) $setting->handler['set'] = (string)$xml->handler->set;
- }
-
- //Parses <choices>
- if ($xml->choices) {
- foreach ($xml->choices->choice as $choiceXml) {
- $setting->choices[(string)$choiceXml->key] = (string)$choiceXml->value;
-
- }
- }
-
- return $setting;
- }
-}
-?>
+<?php
+
+/**
+ * Settings: an individual setting class
+ *
+ * Zed. The immensity of stars. The HyperShip. The people.
+ *
+ * (c) 2010, Dereckson, some rights reserved.
+ * Released under BSD license.
+ *
+ * @package Zed
+ * @subpackage Settings
+ * @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
+ * @copyright 2010 Sébastien Santoro aka Dereckson
+ * @license http://www.opensource.org/licenses/bsd-license.php BSD
+ * @version 0.1
+ * @link http://scherzo.dereckson.be/doc/zed
+ * @link http://zed.dereckson.be/
+ * @filesource
+ */
+
+/**
+ * Setting class
+ *
+ * This class map the <setting> XML block, from our settings XML format
+ */
+class Setting {
+
+ public $key;
+
+ //Rendering variables
+ public $field;
+ public $regExp;
+ public $choices;
+
+ //get/set variables
+ public $object;
+ private $property;
+ private $method;
+ private $handler;
+
+ //error variable
+ public $lastError;
+
+ /**
+ * Gets the current setting value
+ *
+ * @return string the setting value
+ */
+ function get () {
+ //1 - Evaluates custom handler
+ if (array_key_exists('get', $this->handler)) {
+ return eval($this->handler['get']);
+ }
+
+ //2 - Gets object property
+ if ($this->object && $property = $this->property) {
+ return $GLOBALS[$this->object]->$property;
+ }
+
+ if ($this->field == "password") {
+ //Okay not to have a value for password fields
+ return;
+ }
+
+ message_die(GENERAL_ERROR, "Setting $this->key haven't any get indication. Please set <object> and <property> / or a custom <handler><get></get></handler> block.", "Settings error");
+ }
+
+ /**
+ * Sets a new value
+ *
+ * @param $value the setting new value
+ * @return boolean true if the setting have been successfully set ; otherwise, false.
+ */
+ function set ($value) {
+ //Validates data
+ if ($this->regExp) {
+ if (!preg_match('/^' . $this->regExp . '$/', $value)) {
+ $this->lastError = "Invalid format for $this->key setting";
+ return false;
+ }
+ }
+
+ //Tries to set value
+
+ //1 - Evaluates custom handler
+ if (array_key_exists('set', $this->handler)) {
+ return eval($this->handler['set']);
+ }
+
+ //2 - Calls object method
+ //3 - Sets object property
+ if ($this->object) {
+ $object = $GLOBALS[$this->object];
+ if ($this->method) {
+ return call_user_func(array($object, $this->method), $value);
+ } elseif ($property = $this->property) {
+ $object->$property = $value;
+ return true;
+ }
+ }
+
+ message_die(GENERAL_ERROR, "Setting $this->key haven't any set indication. Please set <object> (and wheter <method>, whether <property>) or a custom <handler><set></set></handler> block.", "Settings error");
+ }
+
+ /**
+ * Saves setting
+ *
+ * @return mixed the SETTINGS_SAVE_METHOD method value, or false if there's no method call;
+ */
+ function save () {
+ if ($this->object) {
+ $object = $GLOBALS[$this->object];
+ if (method_exists($object, SETTINGS_SAVE_METHOD)) {
+ return call_user_func(array($object, SETTINGS_SAVE_METHOD));
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Initializes a new instance of Setting class from a XML element
+ *
+ * @param SimpleXMLElement the xml element to parse
+ * @return Setting the setting class
+ */
+ static function from_xml ($xml) {
+ //Reads attributes
+ $id = '';
+ foreach ($xml->attributes() as $key => $value) {
+ switch ($key) {
+ case 'id':
+ $id = (string)$value;
+ break;
+
+ default:
+ message_die(GENERAL_ERROR, "Unknown attribute: $key = \"$value\"", "Settings error");
+ }
+ }
+
+ //id attribute is mandatory
+ if (!$id) {
+ message_die(GENERAL_ERROR, "Setting without id. Please add id='' in <setting> tag", "Settings error");
+ }
+
+ //Initializes new Setting instance
+ $setting = new Setting($id);
+
+ //Parses simple <tag>value</tag>
+ $properties = array('key', 'field', 'object', 'property', 'method', 'regExp');
+ foreach ($properties as $property) {
+ if ($xml->$property)
+ $setting->$property = (string)$xml->$property;
+ }
+
+ //Parses <handler>
+ $setting->handler = array();
+ if ($xml->handler) {
+ if ($xml->handler->get) $setting->handler['get'] = (string)$xml->handler->get;
+ if ($xml->handler->set) $setting->handler['set'] = (string)$xml->handler->set;
+ }
+
+ //Parses <choices>
+ if ($xml->choices) {
+ foreach ($xml->choices->choice as $choiceXml) {
+ $setting->choices[(string)$choiceXml->key] = (string)$choiceXml->value;
+
+ }
+ }
+
+ return $setting;
+ }
+}
+?>
diff --git a/js/builder/map.js b/js/builder/map.js
index c35a961..05b2c0c 100644
--- a/js/builder/map.js
+++ b/js/builder/map.js
@@ -1,103 +1,103 @@
-/* -------------------------------------------------------------
- Zed
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Author: Dereckson
- Tags: map
- Filename: map.js
- Version: 1.0
- Created: 2010-12-23
- Updated: 2010-12-23
- Licence: Dual licensed: BSD and Creative Commons BY 3.0.
- Dependencies: dojo
- ------------------------------------------------------------- */
-/**
- * Map
- */
-var map = {
- id: null,
- zones: null,
- bounds: null,
-
- init: function (id, zones) {
- map.id = id;
- map.zones = zones;
- map.render();
- },
-
- /**
- * Get coordinates
- *
- * @returns An array [x, y, z]
- */
- get_coordinates: function (expr) {
- var coordinates = expr.substring(1, expr.length - 1).split(', ');
- return [parseInt(coordinates[0]), parseInt(coordinates[1]), parseInt(coordinates[2])];
- },
-
- /**
- * Calculates the zones bounds and stores the result in bounds property
- */
- calculate_bounds: function () {
- var start = map.get_coordinates(map.zones[0][0]);
- map.bounds = [
- [start[0], start[0]],
- [start[1], start[1]],
- [start[2], start[2]]
- ];
- for (i = 1 ; i < map.zones.length ; i++) {
- point = map.get_coordinates(map.zones[i][0]);
- if (point[0] < map.bounds[0][0]) map.bounds[0][0] = point[0];
- if (point[1] < map.bounds[1][0]) map.bounds[1][0] = point[1];
- if (point[2] < map.bounds[2][0]) map.bounds[2][0] = point[2];
- if (point[0] > map.bounds[0][1]) map.bounds[0][1] = point[0];
- if (point[1] > map.bounds[1][1]) map.bounds[1][1] = point[1];
- if (point[2] > map.bounds[2][1]) map.bounds[2][1] = point[2];
- }
- },
-
- render_zone: function (x, y, z) {
- var location = "(" + x + ", " + y + ", " + z + ")";
- for (i = 0 ; i < map.zones.length ; i++) {
- if (location == map.zones[i][0]) {
- return '<span class="zone zone-edit" id="zone-' + map.zones[i][1] + '" onMouseOut="map.reset_info()" onMouseOver="map.set_info(\'' + location + '\')" onClick="map.menu_edit(\'' + location + '\', ' + map.zones[i][1] + ');"><img src="/img/map/map-kub-top.png" alt="Built" /></span>';
- }
- }
- return '<span class="zone zone-build" onMouseOut="map.reset_info()" onMouseOver="map.set_info(\'' + location + '\')" onClick="map.menu_build(\'' + location + '\');"><img src="/img/map/map-kub-top-build.png" alt="Build" /></span>';
- },
-
- render: function () {
- map.calculate_bounds();
- var html = "";
- z = map.bounds[2][0];
- for (y = map.bounds[1][1] ; y >= map.bounds[1][0] ; y--) {
- for (x = map.bounds[0][0] ; x <= map.bounds[0][1] ; x++) {
- html += '<div class="grid_1">' + map.render_zone(x, y, z) + "</div>";
- }
- html += '</div><div class="clear fixclear"></div>';
- dojo.byId(map.id).innerHTML = html;
- }
- },
-
- menu_edit: function (local_location, zone_id) {
- //alert("Goto or edit #" + zone_id);
- //map/zone-edit.png
- //map/zone-goto.png
- window.location = "/do.php/set_local_location/" + local_location + "?redirectTo=/";
- },
-
- menu_build: function (local_location) {
- //alert("Build at " + local_location);
- //map/zone-build.png
- //window.location = "/do.php/set_local_location/" + escape(local_location) + "?redirectTo=/builder";
- window.location = "/do.php/set_local_location/" + local_location + "?redirectTo=/";
- },
-
- set_info: function (local_location) {
- coord = map.get_coordinates(local_location);
- dojo.byId("info_area").innerHTML = 'Zone <span id="area">' + Math.abs(coord[0]) + '-' + Math.abs(coord[1]) + '</span>';
- },
-
- reset_info: function () {
- dojo.byId("info_area").innerHTML = "&nbsp;";
- }
-}
+/* -------------------------------------------------------------
+ Zed
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ Author: Dereckson
+ Tags: map
+ Filename: map.js
+ Version: 1.0
+ Created: 2010-12-23
+ Updated: 2010-12-23
+ Licence: Dual licensed: BSD and Creative Commons BY 3.0.
+ Dependencies: dojo
+ ------------------------------------------------------------- */
+/**
+ * Map
+ */
+var map = {
+ id: null,
+ zones: null,
+ bounds: null,
+
+ init: function (id, zones) {
+ map.id = id;
+ map.zones = zones;
+ map.render();
+ },
+
+ /**
+ * Get coordinates
+ *
+ * @returns An array [x, y, z]
+ */
+ get_coordinates: function (expr) {
+ var coordinates = expr.substring(1, expr.length - 1).split(', ');
+ return [parseInt(coordinates[0]), parseInt(coordinates[1]), parseInt(coordinates[2])];
+ },
+
+ /**
+ * Calculates the zones bounds and stores the result in bounds property
+ */
+ calculate_bounds: function () {
+ var start = map.get_coordinates(map.zones[0][0]);
+ map.bounds = [
+ [start[0], start[0]],
+ [start[1], start[1]],
+ [start[2], start[2]]
+ ];
+ for (i = 1 ; i < map.zones.length ; i++) {
+ point = map.get_coordinates(map.zones[i][0]);
+ if (point[0] < map.bounds[0][0]) map.bounds[0][0] = point[0];
+ if (point[1] < map.bounds[1][0]) map.bounds[1][0] = point[1];
+ if (point[2] < map.bounds[2][0]) map.bounds[2][0] = point[2];
+ if (point[0] > map.bounds[0][1]) map.bounds[0][1] = point[0];
+ if (point[1] > map.bounds[1][1]) map.bounds[1][1] = point[1];
+ if (point[2] > map.bounds[2][1]) map.bounds[2][1] = point[2];
+ }
+ },
+
+ render_zone: function (x, y, z) {
+ var location = "(" + x + ", " + y + ", " + z + ")";
+ for (i = 0 ; i < map.zones.length ; i++) {
+ if (location == map.zones[i][0]) {
+ return '<span class="zone zone-edit" id="zone-' + map.zones[i][1] + '" onMouseOut="map.reset_info()" onMouseOver="map.set_info(\'' + location + '\')" onClick="map.menu_edit(\'' + location + '\', ' + map.zones[i][1] + ');"><img src="/img/map/map-kub-top.png" alt="Built" /></span>';
+ }
+ }
+ return '<span class="zone zone-build" onMouseOut="map.reset_info()" onMouseOver="map.set_info(\'' + location + '\')" onClick="map.menu_build(\'' + location + '\');"><img src="/img/map/map-kub-top-build.png" alt="Build" /></span>';
+ },
+
+ render: function () {
+ map.calculate_bounds();
+ var html = "";
+ z = map.bounds[2][0];
+ for (y = map.bounds[1][1] ; y >= map.bounds[1][0] ; y--) {
+ for (x = map.bounds[0][0] ; x <= map.bounds[0][1] ; x++) {
+ html += '<div class="grid_1">' + map.render_zone(x, y, z) + "</div>";
+ }
+ html += '</div><div class="clear fixclear"></div>';
+ dojo.byId(map.id).innerHTML = html;
+ }
+ },
+
+ menu_edit: function (local_location, zone_id) {
+ //alert("Goto or edit #" + zone_id);
+ //map/zone-edit.png
+ //map/zone-goto.png
+ window.location = "/do.php/set_local_location/" + local_location + "?redirectTo=/";
+ },
+
+ menu_build: function (local_location) {
+ //alert("Build at " + local_location);
+ //map/zone-build.png
+ //window.location = "/do.php/set_local_location/" + escape(local_location) + "?redirectTo=/builder";
+ window.location = "/do.php/set_local_location/" + local_location + "?redirectTo=/";
+ },
+
+ set_info: function (local_location) {
+ coord = map.get_coordinates(local_location);
+ dojo.byId("info_area").innerHTML = 'Zone <span id="area">' + Math.abs(coord[0]) + '-' + Math.abs(coord[1]) + '</span>';
+ },
+
+ reset_info: function () {
+ dojo.byId("info_area").innerHTML = "&nbsp;";
+ }
+}
diff --git a/js/login.js b/js/login.js
index 4cfeecc..605952a 100644
--- a/js/login.js
+++ b/js/login.js
@@ -1,115 +1,115 @@
-/* -------------------------------------------------------------
- Zed
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Author: Dereckson
- Tags: animation
- Filename: login.js
- Version: 1.0
- Created: 2010-02-08
- Updated: 2010-02-08
- Licence: Dual licensed: BSD and Creative Commons BY 3.0.
- Dependencies: Prototype (for .setStyle method)
- Scriptaculous + effects (not required for slide)
- ------------------------------------------------------------- */
-
-/*
- * Slides an item from top to bottom
- */
-var slide = {
- //The element to slide
- element: null,
-
- //The slider height
- height: 120,
-
- //Let's track where we are
- currentHeight: null,
-
- //Down step pixels each iteration
- step: 5,
-
- //Time in ms between 2 iteration
- interval: 1,
-
- //Time before to start
- startDelay: 250,
-
- //Moves the element at current iteration
- move: function () {
- //Get current slider height
- if (this.currentHeight > 0) {
- //- step px (but we don't down after 0)
- this.currentHeight -= this.step;
- if (this.currentHeight < 0) {
- this.currentHeight = 0;
- }
- }
-
- //Sets the margin
- $(this.element).setStyle("margin-top: -" + this.currentHeight + "px;");
-
- //Next move
- if (this.currentHeight > 0) {
- setTimeout('slide.move()', this.interval);
- } else {
- slide.end();
- }
-
- },
-
- //When we've finished the move, what to do?
- end: function () {
- //Er... nothing for now.
- var errorElement = document.getElementById("error");
- if (errorElement != null)
- Effect.Pulsate(errorElement);
- },
-
- //Start position, timer setup
- initialize: function (elementId) {
- this.element = document.getElementById(elementId);
- if (this.element != null) {
- this.currentHeight = this.height;
- $(this.element).setStyle("margin-top: -" + this.height + "px;");
- setTimeout('slide.move()', this.startDelay);
- } else {
- throw "null element"
- }
- }
-}
-
-/*
- * Checks if fields are filled.
- * If so, hides error and ok button (useful as OpenID takes some time)
- * If not, highlight the missing fields
- */
-function OnLoginSubmit (submitButton) {
- //Checks all fields are completed
- if (document.getElementById("openid").value != "") {
- //OpenID is prefered login way, so we're okay.
- } else {
- haveUsername = document.getElementById("username").value != "";
- havePassword = document.getElementById("password").value != "";
- haveBoth = haveUsername && havePassword;
- if (!haveBoth) {
- if (!haveUsername) {
- Effect.Pulsate(document.getElementById("username"));
- }
- if (!havePassword) {
- Effect.Pulsate(document.getElementById("password"));
- }
- return false;
- }
- //If both are filled, we're okay and can proceed.
- }
-
- //Hides error and ok item
- var errorElement = document.getElementById('error');
- if (errorElement != null) {
- Effect.Puff(errorElement);
- }
- Effect.Puff(submitButton);
-
- //We can submit
- return true;
+/* -------------------------------------------------------------
+ Zed
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ Author: Dereckson
+ Tags: animation
+ Filename: login.js
+ Version: 1.0
+ Created: 2010-02-08
+ Updated: 2010-02-08
+ Licence: Dual licensed: BSD and Creative Commons BY 3.0.
+ Dependencies: Prototype (for .setStyle method)
+ Scriptaculous + effects (not required for slide)
+ ------------------------------------------------------------- */
+
+/*
+ * Slides an item from top to bottom
+ */
+var slide = {
+ //The element to slide
+ element: null,
+
+ //The slider height
+ height: 120,
+
+ //Let's track where we are
+ currentHeight: null,
+
+ //Down step pixels each iteration
+ step: 5,
+
+ //Time in ms between 2 iteration
+ interval: 1,
+
+ //Time before to start
+ startDelay: 250,
+
+ //Moves the element at current iteration
+ move: function () {
+ //Get current slider height
+ if (this.currentHeight > 0) {
+ //- step px (but we don't down after 0)
+ this.currentHeight -= this.step;
+ if (this.currentHeight < 0) {
+ this.currentHeight = 0;
+ }
+ }
+
+ //Sets the margin
+ $(this.element).setStyle("margin-top: -" + this.currentHeight + "px;");
+
+ //Next move
+ if (this.currentHeight > 0) {
+ setTimeout('slide.move()', this.interval);
+ } else {
+ slide.end();
+ }
+
+ },
+
+ //When we've finished the move, what to do?
+ end: function () {
+ //Er... nothing for now.
+ var errorElement = document.getElementById("error");
+ if (errorElement != null)
+ Effect.Pulsate(errorElement);
+ },
+
+ //Start position, timer setup
+ initialize: function (elementId) {
+ this.element = document.getElementById(elementId);
+ if (this.element != null) {
+ this.currentHeight = this.height;
+ $(this.element).setStyle("margin-top: -" + this.height + "px;");
+ setTimeout('slide.move()', this.startDelay);
+ } else {
+ throw "null element"
+ }
+ }
+}
+
+/*
+ * Checks if fields are filled.
+ * If so, hides error and ok button (useful as OpenID takes some time)
+ * If not, highlight the missing fields
+ */
+function OnLoginSubmit (submitButton) {
+ //Checks all fields are completed
+ if (document.getElementById("openid").value != "") {
+ //OpenID is prefered login way, so we're okay.
+ } else {
+ haveUsername = document.getElementById("username").value != "";
+ havePassword = document.getElementById("password").value != "";
+ haveBoth = haveUsername && havePassword;
+ if (!haveBoth) {
+ if (!haveUsername) {
+ Effect.Pulsate(document.getElementById("username"));
+ }
+ if (!havePassword) {
+ Effect.Pulsate(document.getElementById("password"));
+ }
+ return false;
+ }
+ //If both are filled, we're okay and can proceed.
+ }
+
+ //Hides error and ok item
+ var errorElement = document.getElementById('error');
+ if (errorElement != null) {
+ Effect.Puff(errorElement);
+ }
+ Effect.Puff(submitButton);
+
+ //We can submit
+ return true;
}
\ No newline at end of file
diff --git a/js/misc.js b/js/misc.js
index 9c1494b..13d7224 100644
--- a/js/misc.js
+++ b/js/misc.js
@@ -1,159 +1,159 @@
-/* Updates SmartLine */
-function UpdateSmartLine() {
- document.forms.SmartLine.C.value = document.forms.SmartLine.SmartLineHistory.value;
- document.forms.SmartLine.C.focus();
-}
-
-/* Hypership time */
-function get_hypership_time () {
- //Gets time
- date = new Date();
- unixtime = Math.floor(date.getTime() / 1000);
- seconds = unixtime - 1278115200;
- days = Math.floor(seconds / 86400);
- fraction = Math.floor((seconds % 86400) / 86.4);
-
- //Zerofills fraction
- switch (new String(fraction).length) {
- case 1: return days + "." + "00" + fraction;
- case 2: return days + "." + "0" + fraction;
- default: return days + "." + fraction;
- }
-}
-
-/* We need to trigger an update in ... ms */
-function next_hypership_increase_in () {
- date = new Date();
- unixtime = Math.floor(date.getTime() / 1000);
- seconds = unixtime - 1278115200;
- days = Math.floor(seconds / 86400);
- fraction1 = (seconds % 86400) / 86.4;
- fraction2 = Math.ceil(fraction1);
- return (fraction2 - fraction1) * 86400;
-}
-
-//Autoupdates every 20 seconds
-//(should be every 86.4 seconds, after first timed call)
-function update_hypership_time () {
- var item = document.getElementById("HypershipTime");
- if (item != undefined) {
- item.innerHTML = get_hypership_time();
- setTimeout('update_hypership_time()', 86400);
- }
-}
-
-setTimeout('update_hypership_time()', next_hypership_increase_in());
-
-/* Dumps a variable */
-
-function dump(arr,level) {
- var dumped_text = "";
- if(!level) level = 0;
-
- //The padding given at the beginning of the line.
- var level_padding = "";
- for(var j=0;j<level+1;j++) level_padding += " ";
-
- if(typeof(arr) == 'object') { //Array/Hashes/Objects
- for(var item in arr) {
- var value = arr[item];
-
- if(typeof(value) == 'object') { //If it is an array,
- dumped_text += level_padding + "'" + item + "' ...\n";
- //dumped_text += dump(value,level+1);
- } else {
- dumped_text += level_padding + "'" + item + "' => \"" + value + "\"\n";
- }
- }
- } else { //Stings/Chars/Numbers etc.
- dumped_text = "===>"+arr+"<===("+typeof(arr)+")";
- }
- return dumped_text;
-}
-
-/* A code for an hidden function */
-
-var ar2215 = {
- input: "",
- pattern: "38384040373937396665",
- clear: setTimeout('ar2215.clear_input()', 2000),
- load: function () {
- window.document.onkeydown = function (e) {
- ar2215.input += e ? e.keyCode : event.keyCode;
- if (ar2215.input == ar2215.pattern) {
- ar2215.code("/push");
- clearTimeout(ar2215.clear);
- return;
- }
- clearTimeout(ar2215.clear);
- ar2215.clear = setTimeout("ar2215.clear_input()", 2000);
- }
- this.iphone.load("/index.php/push");
- },
- code: function (link) {
- window.location = link;
- },
- clear_input: function () {
- ar2215.input = "";
- clearTimeout(ar2215.clear);
- },
- iphone:{
- start_x: 0,
- start_y: 0,
- stop_x: 0,
- stop_y: 0,
- tap: false,
- capture: false,
- keys: ["UP","UP","DOWN","DOWN","LEFT","RIGHT","LEFT","RIGHT","TAP","TAP"],
- code: function (link) { window.location = link },
- load: function (link) {
- document.ontouchmove = function (e) {
- if (e.touches.length == 1 && ar2215.iphone.capture == true) {
- var touch = e.touches[0];
- ar2215.iphone.stop_x = touch.pageX;
- ar2215.iphone.stop_y = touch.pageY;
- ar2215.iphone.tap = false;
- ar2215.iphone.capture = false;
- ar2215.iphone.check_direction();
- }
- }
- document.ontouchend = function (evt) {
- if (ar2215.iphone.tap == true)
- ar2215.iphone.check_direction();
- }
- document.ontouchstart = function(evt) {
- ar2215.iphone.start_x = evt.changedTouches[0].pageX;
- ar2215.iphone.start_y = evt.changedTouches[0].pageY;
- ar2215.iphone.tap = true;
- ar2215.iphone.capture = true;
- }
- },
- check_direction: function () {
- x_magnitude = Math.abs(this.start_x - this.stop_x);
- y_magnitude = Math.abs(this.start_y - this.stop_y);
- x = ((this.start_x - this.stop_x) < 0) ? "RIGHT": "LEFT";
- y = ((this.start_y - this.stop_y) < 0) ? "DOWN" : "UP";
- result = (x_magnitude > y_magnitude) ? x : y;
- result = (this.tap == true) ? "TAP" : result;
- if (result == this.keys[0])
- this.keys = this.keys.slice(1, this.keys.length);
- if (this.keys.length == 0)
- this.code(this.link)
- }
- }
-}
-
-ar2215.load();
-
-/* Visual effects */
-function set_opacity (id, opacity) {
- element = document.getElementById(id);
- if (element != null) {
- if (opacity == 0) {
- element.style.backgroundImage = 'inherit';
- } else {
- property = 'url("/img/zed/opaque_' + opacity + '.png")';
- element.style.backgroundImage = property;
- }
- }
-}
+/* Updates SmartLine */
+function UpdateSmartLine() {
+ document.forms.SmartLine.C.value = document.forms.SmartLine.SmartLineHistory.value;
+ document.forms.SmartLine.C.focus();
+}
+
+/* Hypership time */
+function get_hypership_time () {
+ //Gets time
+ date = new Date();
+ unixtime = Math.floor(date.getTime() / 1000);
+ seconds = unixtime - 1278115200;
+ days = Math.floor(seconds / 86400);
+ fraction = Math.floor((seconds % 86400) / 86.4);
+
+ //Zerofills fraction
+ switch (new String(fraction).length) {
+ case 1: return days + "." + "00" + fraction;
+ case 2: return days + "." + "0" + fraction;
+ default: return days + "." + fraction;
+ }
+}
+
+/* We need to trigger an update in ... ms */
+function next_hypership_increase_in () {
+ date = new Date();
+ unixtime = Math.floor(date.getTime() / 1000);
+ seconds = unixtime - 1278115200;
+ days = Math.floor(seconds / 86400);
+ fraction1 = (seconds % 86400) / 86.4;
+ fraction2 = Math.ceil(fraction1);
+ return (fraction2 - fraction1) * 86400;
+}
+
+//Autoupdates every 20 seconds
+//(should be every 86.4 seconds, after first timed call)
+function update_hypership_time () {
+ var item = document.getElementById("HypershipTime");
+ if (item != undefined) {
+ item.innerHTML = get_hypership_time();
+ setTimeout('update_hypership_time()', 86400);
+ }
+}
+
+setTimeout('update_hypership_time()', next_hypership_increase_in());
+
+/* Dumps a variable */
+
+function dump(arr,level) {
+ var dumped_text = "";
+ if(!level) level = 0;
+
+ //The padding given at the beginning of the line.
+ var level_padding = "";
+ for(var j=0;j<level+1;j++) level_padding += " ";
+
+ if(typeof(arr) == 'object') { //Array/Hashes/Objects
+ for(var item in arr) {
+ var value = arr[item];
+
+ if(typeof(value) == 'object') { //If it is an array,
+ dumped_text += level_padding + "'" + item + "' ...\n";
+ //dumped_text += dump(value,level+1);
+ } else {
+ dumped_text += level_padding + "'" + item + "' => \"" + value + "\"\n";
+ }
+ }
+ } else { //Stings/Chars/Numbers etc.
+ dumped_text = "===>"+arr+"<===("+typeof(arr)+")";
+ }
+ return dumped_text;
+}
+
+/* A code for an hidden function */
+
+var ar2215 = {
+ input: "",
+ pattern: "38384040373937396665",
+ clear: setTimeout('ar2215.clear_input()', 2000),
+ load: function () {
+ window.document.onkeydown = function (e) {
+ ar2215.input += e ? e.keyCode : event.keyCode;
+ if (ar2215.input == ar2215.pattern) {
+ ar2215.code("/push");
+ clearTimeout(ar2215.clear);
+ return;
+ }
+ clearTimeout(ar2215.clear);
+ ar2215.clear = setTimeout("ar2215.clear_input()", 2000);
+ }
+ this.iphone.load("/index.php/push");
+ },
+ code: function (link) {
+ window.location = link;
+ },
+ clear_input: function () {
+ ar2215.input = "";
+ clearTimeout(ar2215.clear);
+ },
+ iphone:{
+ start_x: 0,
+ start_y: 0,
+ stop_x: 0,
+ stop_y: 0,
+ tap: false,
+ capture: false,
+ keys: ["UP","UP","DOWN","DOWN","LEFT","RIGHT","LEFT","RIGHT","TAP","TAP"],
+ code: function (link) { window.location = link },
+ load: function (link) {
+ document.ontouchmove = function (e) {
+ if (e.touches.length == 1 && ar2215.iphone.capture == true) {
+ var touch = e.touches[0];
+ ar2215.iphone.stop_x = touch.pageX;
+ ar2215.iphone.stop_y = touch.pageY;
+ ar2215.iphone.tap = false;
+ ar2215.iphone.capture = false;
+ ar2215.iphone.check_direction();
+ }
+ }
+ document.ontouchend = function (evt) {
+ if (ar2215.iphone.tap == true)
+ ar2215.iphone.check_direction();
+ }
+ document.ontouchstart = function(evt) {
+ ar2215.iphone.start_x = evt.changedTouches[0].pageX;
+ ar2215.iphone.start_y = evt.changedTouches[0].pageY;
+ ar2215.iphone.tap = true;
+ ar2215.iphone.capture = true;
+ }
+ },
+ check_direction: function () {
+ x_magnitude = Math.abs(this.start_x - this.stop_x);
+ y_magnitude = Math.abs(this.start_y - this.stop_y);
+ x = ((this.start_x - this.stop_x) < 0) ? "RIGHT": "LEFT";
+ y = ((this.start_y - this.stop_y) < 0) ? "DOWN" : "UP";
+ result = (x_magnitude > y_magnitude) ? x : y;
+ result = (this.tap == true) ? "TAP" : result;
+ if (result == this.keys[0])
+ this.keys = this.keys.slice(1, this.keys.length);
+ if (this.keys.length == 0)
+ this.code(this.link)
+ }
+ }
+}
+
+ar2215.load();
+
+/* Visual effects */
+function set_opacity (id, opacity) {
+ element = document.getElementById(id);
+ if (element != null) {
+ if (opacity == 0) {
+ element.style.backgroundImage = 'inherit';
+ } else {
+ property = 'url("/img/zed/opaque_' + opacity + '.png")';
+ element.style.backgroundImage = property;
+ }
+ }
+}
diff --git a/js/tour2.js b/js/tour2.js
index 5515864..029a4f0 100644
--- a/js/tour2.js
+++ b/js/tour2.js
@@ -1,148 +1,148 @@
-/* -------------------------------------------------------------
- Zed
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Author: Dereckson
- Tags: animation jquery l10n
- Filename: tour.js
- Version: 1.0
- Created: 2010-01-25
- Updated: 2010-02-03
- Licence: Dual licensed: BSD and Creative Commons BY 3.0.
- Dependencies: jQuery (for dom elements selection and dimensions.js)
- dimensions.js
- ------------------------------------------------------------- */
-
-var tour = {
- //Default language
- lang: "en",
-
- //Translated in
- langs: "en,fr",
-
- //Current highlight showed
- current: -1,
-
- //File extension
- extension: "png",
-
- //Highlights files and position
- //File: /img/tour/{filename}.{extension}
- highlights: [
- ["create", 13, 18],
- ["lounge", 339, 107],
- ["play", 22, 345],
- ["explore", 325, 373]
- ],
-
- //The center x, y coordinate
- //It's used to determinate what highlight to print
- center: [368, 390],
-
- //Gets the highlight index, from position
- where: function(x, y) {
- if (x < this.center[0]) {
- //We're at left from center point
- return (y < this.center[1]) ? 0 : 2;
- } else {
- //We're at right from center point
- return (y < this.center[1]) ? 1 : 3;
- }
- },
-
- //Determines if we're inside the #Tour id
- isInside: function (pageX, pageY) {
- var tourOffset = $("#Tour").offset();
- return pageX >= tourOffset.left && pageY >= tourOffset.top
- && pageX <= tourOffset.left + $("#Tour").width()
- && pageY <= tourOffset.top + $("#Tour").height();
- },
-
- //Shows the highlight at specified the page position
- showAt: function (pageX, pageY) {
- var tourOffset = $("#Tour").offset();
- this.show(
- this.where(pageX - tourOffset.left , pageY - tourOffset.top)
- );
- },
-
- //Shows the specified highlight
- show: function (i) {
- if (this.current != i) {
- var filename = this.highlights[i][0] + "_" + this.lang + "." + this.extension;
- var code = '<img src="http://zed.espace-win.org.nyud.net/img/tour/' + filename + '" alt="' + this.highlights[i][0] + '" />';
- $('#TourHighlight').empty().html(code);
- var o = document.getElementById("TourHighlight");
- o.style.left = this.highlights[i][1] + "px";
- o.style.top = this.highlights[i][2] + "px";
- this.current = i;
- }
- },
-
- //Hides highlight
- hideall: function () {
- if (this.current > -1) {
- this.current = -1;
- $('#TourHighlight').empty();
- }
- },
-
- //Runs the animation
- run: function (delay) {
- //Highlight order
- //[0, 1, 3, 2] is a counterwise move
- var order = [0, 1, 3, 2];
-
- //Prints first hightlight
- this.show(order[0]);
-
- //Prints next highlights
- n = this.highlights.length;
- for (i = 1 ; i < n ; i++) {
- setTimeout('tour.show(' + order[i] + ')', delay * i);
- }
-
- //Prints back the first, and enables rollover
- setTimeout('tour.show(' + order[0] + ')', delay * n);
- setTimeout('tour.enableRollover()', delay * n);
- },
-
- //Enables rollovers
- enableRollover: function () {
- //Enables panel on click
- $('#Tour').bind("mousemove mouseout", function(e) {
- if (tour.isInside(e.pageX, e.pageY)) {
- tour.showAt(e.pageX, e.pageY);
- } else {
- tour.hideall();
- }
- });
- },
-
- //Gets client language (Firefox) or preferences content language (IE)
- getLanguage: function () {
- var lang = navigator.language;
- if (lang == undefined) lang = navigator.userLanguage;
- if (lang == undefined) return "";
-
- //fr-be -> fr
- var pos = lang.indexOf('-');
- if (pos > -1) lang = lang.substring(0, pos);
-
- return lang.toLowerCase();
- },
-
- //Initializes tour
- init: function () {
- //Tries to localize
- var lang = this.getLanguage();
- if (this.langs.indexOf(lang) > -1) this.lang = lang;
-
- //Runs tour animation
- //The rollover will be enabled at anim end
- this.run(900);
- }
-}
-
-$(document).ready(function() {
- tour.init();
+/* -------------------------------------------------------------
+ Zed
+ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ Author: Dereckson
+ Tags: animation jquery l10n
+ Filename: tour.js
+ Version: 1.0
+ Created: 2010-01-25
+ Updated: 2010-02-03
+ Licence: Dual licensed: BSD and Creative Commons BY 3.0.
+ Dependencies: jQuery (for dom elements selection and dimensions.js)
+ dimensions.js
+ ------------------------------------------------------------- */
+
+var tour = {
+ //Default language
+ lang: "en",
+
+ //Translated in
+ langs: "en,fr",
+
+ //Current highlight showed
+ current: -1,
+
+ //File extension
+ extension: "png",
+
+ //Highlights files and position
+ //File: /img/tour/{filename}.{extension}
+ highlights: [
+ ["create", 13, 18],
+ ["lounge", 339, 107],
+ ["play", 22, 345],
+ ["explore", 325, 373]
+ ],
+
+ //The center x, y coordinate
+ //It's used to determinate what highlight to print
+ center: [368, 390],
+
+ //Gets the highlight index, from position
+ where: function(x, y) {
+ if (x < this.center[0]) {
+ //We're at left from center point
+ return (y < this.center[1]) ? 0 : 2;
+ } else {
+ //We're at right from center point
+ return (y < this.center[1]) ? 1 : 3;
+ }
+ },
+
+ //Determines if we're inside the #Tour id
+ isInside: function (pageX, pageY) {
+ var tourOffset = $("#Tour").offset();
+ return pageX >= tourOffset.left && pageY >= tourOffset.top
+ && pageX <= tourOffset.left + $("#Tour").width()
+ && pageY <= tourOffset.top + $("#Tour").height();
+ },
+
+ //Shows the highlight at specified the page position
+ showAt: function (pageX, pageY) {
+ var tourOffset = $("#Tour").offset();
+ this.show(
+ this.where(pageX - tourOffset.left , pageY - tourOffset.top)
+ );
+ },
+
+ //Shows the specified highlight
+ show: function (i) {
+ if (this.current != i) {
+ var filename = this.highlights[i][0] + "_" + this.lang + "." + this.extension;
+ var code = '<img src="http://zed.espace-win.org.nyud.net/img/tour/' + filename + '" alt="' + this.highlights[i][0] + '" />';
+ $('#TourHighlight').empty().html(code);
+ var o = document.getElementById("TourHighlight");
+ o.style.left = this.highlights[i][1] + "px";
+ o.style.top = this.highlights[i][2] + "px";
+ this.current = i;
+ }
+ },
+
+ //Hides highlight
+ hideall: function () {
+ if (this.current > -1) {
+ this.current = -1;
+ $('#TourHighlight').empty();
+ }
+ },
+
+ //Runs the animation
+ run: function (delay) {
+ //Highlight order
+ //[0, 1, 3, 2] is a counterwise move
+ var order = [0, 1, 3, 2];
+
+ //Prints first hightlight
+ this.show(order[0]);
+
+ //Prints next highlights
+ n = this.highlights.length;
+ for (i = 1 ; i < n ; i++) {
+ setTimeout('tour.show(' + order[i] + ')', delay * i);
+ }
+
+ //Prints back the first, and enables rollover
+ setTimeout('tour.show(' + order[0] + ')', delay * n);
+ setTimeout('tour.enableRollover()', delay * n);
+ },
+
+ //Enables rollovers
+ enableRollover: function () {
+ //Enables panel on click
+ $('#Tour').bind("mousemove mouseout", function(e) {
+ if (tour.isInside(e.pageX, e.pageY)) {
+ tour.showAt(e.pageX, e.pageY);
+ } else {
+ tour.hideall();
+ }
+ });
+ },
+
+ //Gets client language (Firefox) or preferences content language (IE)
+ getLanguage: function () {
+ var lang = navigator.language;
+ if (lang == undefined) lang = navigator.userLanguage;
+ if (lang == undefined) return "";
+
+ //fr-be -> fr
+ var pos = lang.indexOf('-');
+ if (pos > -1) lang = lang.substring(0, pos);
+
+ return lang.toLowerCase();
+ },
+
+ //Initializes tour
+ init: function () {
+ //Tries to localize
+ var lang = this.getLanguage();
+ if (this.langs.indexOf(lang) > -1) this.lang = lang;
+
+ //Runs tour animation
+ //The rollover will be enabled at anim end
+ this.run(900);
+ }
+}
+
+$(document).ready(function() {
+ tour.init();
});
\ No newline at end of file
diff --git a/lang/en/core.conf b/lang/en/core.conf
index 937f3c8..90b47e5 100644
--- a/lang/en/core.conf
+++ b/lang/en/core.conf
@@ -1,195 +1,195 @@
-#Zed language config file
-#Language: English
-#Code: en
-#Author: Dereckson
-
-###
-### Site configuration
-###
-
-SiteTitle = Zed
-Product = "<strong>Zed 0.1</strong>, alpha technical preview"
-
-###
-### General stuff
-###
-
-_t = ":"
-Save = Save
-
-###
-### Login
-###
-
-Login = Login
-Password = Password
-OK = OK
-
-LoginNotFound = Login not found.
-IncorrectPassword = Incorrect password.
-
-JaMata = Ja mata!
-WelcomeBack = Welcome back.
-
-OpenID = OpenID
-
-Logout = Logout
-
-###
-### Errors
-###
-
-UnauthorizedAccess = "Unauthorized access"
-SQLError = "SQL Error"
-line = line
-Error = Error
-BackToHome = "Back to homepage"
-
-GeneralError = General error
-PageNotFound = "Page not found"
-
-#Keep those two lines in English, to help to identify error screens in any lang
-FatalErrorScreen = Fatal error screen
-FatalErrorInterrupt = Fatal error breaking screen
-
-###
-### Homepage
-###
-
-Welcome = Welcome
-WelcomeText = "<p>Welcome to the Zed alpha technical preview. Zed, it's a mix between a gallery, a place to meet new and existing friends, with some RPG inspiration.<br />
-The concept is to have each information stored at physical places in a virtual world, like the 80s cyberspace vision. Another goal is to build a community sharing values like cooperation, freedom, ethic.</p>"
-
-###
-### Homepage - messages
-###
-
-#NOTIFY if new messages
-NewMessages = "You've got %d new message%s"
-
-#messages.tpl, Reply
-Reply = Reply
-
-#messages.tpl, the X link title
-DeleteThisMessage = Delete this message
-
-#messages.tpl, the expression identifying a message sent by the site itself
-SystemNotice = System Notice
-
-#home.php, messages error
-MessageDeleted = Message deleted.
-NotYourMessage = This message is not one of yours.
-MessageAlreadyDeleted = Message already deleted.
-
-###
-### Account create
-###
-
-CreateAccountTitle = Create an account
-CreateAccountIntro = "<p>Welcome to Zed.<br />To get an account, you need an invite code. To get an invite code, ask who tell you about Zed.</p>"
-
-YourLogin = The login you want
-InviteCode = Your invite code
-YourEmail = Your e-mail
-
-EnterInviteCodePromptMessage = "Your invite code is something like ABC123."
-EnterUsernamePromptMessage = "Enter your username, in lowercase (11 characters max.).<br />It's your usual username, not your character name."
-EnterEmailPromptMessage = "Enter your e-mail. It will used (1) as password recovery method (2) to send you notification of new messages or events you've configured.<br />We don't like spam, so we take all the measures to protect your mail."
-
-IncorrectInviteCode = "Your invite code's format isn't valid. It's something like ABC123."
-InviteCodeAlreadyClaimed = "This invite code were valid. But it have already been claimed."
-
-CreateAccountImageTitle = "Zed is for human being. But it's also for people defining themselves like other beings than humans."
-CreateAccountImageAlt = "A strange-looking white picture. An half circle from top right to bottom right, then the brush come back in spirale to create a big white spot. Some brushes effects add fringes at start and end. Grayscale spots have been added in main circle."
-
-MissingUsername = "You need to provide a login."
-LoginUnavailable = "This login is already taken."
-MissingPassword = "You need to provide a password."
-InviteHaveBeenClaimed = "Your invite %s have just been claimed."
-AccountCreated = "Your account is created. Welcome to Zed."
-
-###
-### Perso create/select
-###
-
-NewCharacterCreated = New character created
-CreateCharacter = Create a character
-EditCharacter = Edit %s information
-
-FullName = Full name
-Nickname = Nickname
-
-Sex = Sex
-Male = Male
-Female = Female
-Neutral = Neutral
-Hermaphrodit = Hermaphrodit
-Race = Race
-
-NoSexSpecified = "Pick a sex, or '<em>Neutral</em>' if you don't want to tell it."
-NoNicknameSpecified = "You must pick a nickname, it's like your login to identify your character."
-NoFullnameSpecified = "All beings must have a name."
-NoRaceSpecified = "You've to specify a race: '<em>humanoid</em>' for human and co.<br />If you don't want to specify a race, use the generic '<em>being</em>'."
-UnavailableNickname = "This nickname is already used.<br />Choose a more original one."
-
-PickPerso = Pick your perso
-SwapPerso = "Swap perso (%s's logout)"
-
-NewLocationNotify = "You're slowly awaking in a place you don't recognize."
-
-InvitePersoCreated = "Good news! %s you invited is in our galaxy.
-%s"
-
-###
-### Places
-###
-
-CurrentLocation = "Current location"
-
-UnknownBody = "Unknown asteroid"
-UnknownPlace = "Unknown place"
-WherePlace = "%s @ %s"
-SpaceAround = "Space around %s"
-
-hypership = hypership
-asteroid = asteroid
-moon = moon
-planet = planet
-star = star
-orbital = orbital
-place = place
-ship = ship
-
-###
-### Stories
-###
-
-InvalidStoryGUID = "In story mode, you can't use previous/back URL."
-ExpiredStorySession = "Story choices URL are temporary.<br />You can't bookmark them or use in another session."
-
-###
-### Requests
-###
-
-Communicator = Communicator
-SendRequestToHyperShip = Send a request to the hypership
-Request = Request
-Title = Title
-Message = Message
-Warning = "Warning:"
-RequestHandledByHumans = Your request will be sent to and handled by humans.
-Send = Send
-RequestSent = Your request have been sent.
-
-###
-### MOTD
-###
-
-PushMessage = Push a message to the header
-TextToAdd = Text to add
-TextToAddWarning = Warning: once published, it can't be (easily) removed.
-Rendering = How it will be printed?
-RenderingWhere = "At the top right header corner:"
-DummyPlaceholder = Here your message.
-Push = Push
+#Zed language config file
+#Language: English
+#Code: en
+#Author: Dereckson
+
+###
+### Site configuration
+###
+
+SiteTitle = Zed
+Product = "<strong>Zed 0.1</strong>, alpha technical preview"
+
+###
+### General stuff
+###
+
+_t = ":"
+Save = Save
+
+###
+### Login
+###
+
+Login = Login
+Password = Password
+OK = OK
+
+LoginNotFound = Login not found.
+IncorrectPassword = Incorrect password.
+
+JaMata = Ja mata!
+WelcomeBack = Welcome back.
+
+OpenID = OpenID
+
+Logout = Logout
+
+###
+### Errors
+###
+
+UnauthorizedAccess = "Unauthorized access"
+SQLError = "SQL Error"
+line = line
+Error = Error
+BackToHome = "Back to homepage"
+
+GeneralError = General error
+PageNotFound = "Page not found"
+
+#Keep those two lines in English, to help to identify error screens in any lang
+FatalErrorScreen = Fatal error screen
+FatalErrorInterrupt = Fatal error breaking screen
+
+###
+### Homepage
+###
+
+Welcome = Welcome
+WelcomeText = "<p>Welcome to the Zed alpha technical preview. Zed, it's a mix between a gallery, a place to meet new and existing friends, with some RPG inspiration.<br />
+The concept is to have each information stored at physical places in a virtual world, like the 80s cyberspace vision. Another goal is to build a community sharing values like cooperation, freedom, ethic.</p>"
+
+###
+### Homepage - messages
+###
+
+#NOTIFY if new messages
+NewMessages = "You've got %d new message%s"
+
+#messages.tpl, Reply
+Reply = Reply
+
+#messages.tpl, the X link title
+DeleteThisMessage = Delete this message
+
+#messages.tpl, the expression identifying a message sent by the site itself
+SystemNotice = System Notice
+
+#home.php, messages error
+MessageDeleted = Message deleted.
+NotYourMessage = This message is not one of yours.
+MessageAlreadyDeleted = Message already deleted.
+
+###
+### Account create
+###
+
+CreateAccountTitle = Create an account
+CreateAccountIntro = "<p>Welcome to Zed.<br />To get an account, you need an invite code. To get an invite code, ask who tell you about Zed.</p>"
+
+YourLogin = The login you want
+InviteCode = Your invite code
+YourEmail = Your e-mail
+
+EnterInviteCodePromptMessage = "Your invite code is something like ABC123."
+EnterUsernamePromptMessage = "Enter your username, in lowercase (11 characters max.).<br />It's your usual username, not your character name."
+EnterEmailPromptMessage = "Enter your e-mail. It will used (1) as password recovery method (2) to send you notification of new messages or events you've configured.<br />We don't like spam, so we take all the measures to protect your mail."
+
+IncorrectInviteCode = "Your invite code's format isn't valid. It's something like ABC123."
+InviteCodeAlreadyClaimed = "This invite code were valid. But it have already been claimed."
+
+CreateAccountImageTitle = "Zed is for human being. But it's also for people defining themselves like other beings than humans."
+CreateAccountImageAlt = "A strange-looking white picture. An half circle from top right to bottom right, then the brush come back in spirale to create a big white spot. Some brushes effects add fringes at start and end. Grayscale spots have been added in main circle."
+
+MissingUsername = "You need to provide a login."
+LoginUnavailable = "This login is already taken."
+MissingPassword = "You need to provide a password."
+InviteHaveBeenClaimed = "Your invite %s have just been claimed."
+AccountCreated = "Your account is created. Welcome to Zed."
+
+###
+### Perso create/select
+###
+
+NewCharacterCreated = New character created
+CreateCharacter = Create a character
+EditCharacter = Edit %s information
+
+FullName = Full name
+Nickname = Nickname
+
+Sex = Sex
+Male = Male
+Female = Female
+Neutral = Neutral
+Hermaphrodit = Hermaphrodit
+Race = Race
+
+NoSexSpecified = "Pick a sex, or '<em>Neutral</em>' if you don't want to tell it."
+NoNicknameSpecified = "You must pick a nickname, it's like your login to identify your character."
+NoFullnameSpecified = "All beings must have a name."
+NoRaceSpecified = "You've to specify a race: '<em>humanoid</em>' for human and co.<br />If you don't want to specify a race, use the generic '<em>being</em>'."
+UnavailableNickname = "This nickname is already used.<br />Choose a more original one."
+
+PickPerso = Pick your perso
+SwapPerso = "Swap perso (%s's logout)"
+
+NewLocationNotify = "You're slowly awaking in a place you don't recognize."
+
+InvitePersoCreated = "Good news! %s you invited is in our galaxy.
+%s"
+
+###
+### Places
+###
+
+CurrentLocation = "Current location"
+
+UnknownBody = "Unknown asteroid"
+UnknownPlace = "Unknown place"
+WherePlace = "%s @ %s"
+SpaceAround = "Space around %s"
+
+hypership = hypership
+asteroid = asteroid
+moon = moon
+planet = planet
+star = star
+orbital = orbital
+place = place
+ship = ship
+
+###
+### Stories
+###
+
+InvalidStoryGUID = "In story mode, you can't use previous/back URL."
+ExpiredStorySession = "Story choices URL are temporary.<br />You can't bookmark them or use in another session."
+
+###
+### Requests
+###
+
+Communicator = Communicator
+SendRequestToHyperShip = Send a request to the hypership
+Request = Request
+Title = Title
+Message = Message
+Warning = "Warning:"
+RequestHandledByHumans = Your request will be sent to and handled by humans.
+Send = Send
+RequestSent = Your request have been sent.
+
+###
+### MOTD
+###
+
+PushMessage = Push a message to the header
+TextToAdd = Text to add
+TextToAddWarning = Warning: once published, it can't be (easily) removed.
+Rendering = How it will be printed?
+RenderingWhere = "At the top right header corner:"
+DummyPlaceholder = Here your message.
+Push = Push
Published = Published :)
\ No newline at end of file
diff --git a/lang/en/footer.conf b/lang/en/footer.conf
index 9ef4df4..d36a5a9 100644
--- a/lang/en/footer.conf
+++ b/lang/en/footer.conf
@@ -1,10 +1,10 @@
-#Zed language config file - Footer
-#Language: English
-#Code: en
-#Author: Dereckson
-
-###
-### SmartLine
-###
-
+#Zed language config file - Footer
+#Language: English
+#Code: en
+#Author: Dereckson
+
+###
+### SmartLine
+###
+
SmartLineHistory = SmartLine History
\ No newline at end of file
diff --git a/lang/en/persorequest.conf b/lang/en/persorequest.conf
index 3f0d789..229ebe8 100644
--- a/lang/en/persorequest.conf
+++ b/lang/en/persorequest.conf
@@ -1,40 +1,40 @@
-#Zed language config file - Perso requests
-#Language: English
-#Code: en
-#Author: Dereckson
-
-###
-### Generalities
-###
-
-#Page title
-PersoRequests = Requests
-
-#Page H1
-Requests = Requests
-
-#Button allow, to allow a request
-Allow = allow
-
-#Button deny, to deny a request
-Deny = deny
-
-#Link ignore all, user can click here to continue normal site operations
-IgnoreAll = "Ignore all requests"
-
-###
-### Callbacks messages
-###
-
-CallbackError = "An error have occured processing your request reply."
-CallbackDone = "All requests have been processed."
-
-###
-### Ship API
-###
-
-#When a ship initiates a auth request, the perso is prompted the following message:
-RequestShipAPIAuthenticate = "The ship %s asks you to authenticate your identity."
-
-#When a ship initiates a session, the perso is prompted the following message:
+#Zed language config file - Perso requests
+#Language: English
+#Code: en
+#Author: Dereckson
+
+###
+### Generalities
+###
+
+#Page title
+PersoRequests = Requests
+
+#Page H1
+Requests = Requests
+
+#Button allow, to allow a request
+Allow = allow
+
+#Button deny, to deny a request
+Deny = deny
+
+#Link ignore all, user can click here to continue normal site operations
+IgnoreAll = "Ignore all requests"
+
+###
+### Callbacks messages
+###
+
+CallbackError = "An error have occured processing your request reply."
+CallbackDone = "All requests have been processed."
+
+###
+### Ship API
+###
+
+#When a ship initiates a auth request, the perso is prompted the following message:
+RequestShipAPIAuthenticate = "The ship %s asks you to authenticate your identity."
+
+#When a ship initiates a session, the perso is prompted the following message:
RequestShipAPISessionConfirm = "The ship %s asks you to confirm the link initialization. Thus, you'll be able to communicate with it."
\ No newline at end of file
diff --git a/lang/en/profile.conf b/lang/en/profile.conf
index 3b346c4..4f04ede 100644
--- a/lang/en/profile.conf
+++ b/lang/en/profile.conf
@@ -1,103 +1,103 @@
-#Zed language config file - Profiles
-#Language: English
-#Code: en
-#Author: Dereckson
-
-###
-### profile.tpl - main profile
-###
-
-#<img src=".../mail.png" title="E-mail" alt="@"... />
-Mail = E-mail
-MailAlt = @
-Online = Online
-
-###
-### profile.tpl - communication area
-###
-
-DropMessage = Drop a message
-SendMessage = Send a message to %s
-AddComment = "Add a comment to %s's profile"
-
-Send = Send
-Publish = Publish
-
-###
-### profile.tpl - sidebar - Edit account preferences and profile content
-###
-
-EditMyPage = Edit my page
-EditProfile = Edit my text
-EditAccount = Edit my information
-ManagePhotos = Manage photos
-AddPhoto = Add a photo
-
-###
-### profile_edit.tpl - edit
-###
-
-ProfileTextTitle = My best words to express myself
-SaveProfile = Save profile
-ProfileFont = Profile fontz
-Calibri = Calibri (regular font)
-FixedSys = FixedSys (fixed width)
-
-###
-### user_account.tpl - edit my information
-###
-
-Login = Login
-LongName = Full character name
-UpdateAccountInfo = Update account information
-
-###
-### profile_photo.tpl - photo manager - add a photo to my profile
-###
-
-AddPhoto = Add a photo to my profile
-AddPhotoExplanations = You can upload here a personal photo with you as main subject.<br />Note you can also host any kind of pictures in various Zed places, like in the HyperShip's tower.
-ShortDescription = Short description
-SafeForWorkLabel = Check this box if the picture is "<strong>safe for work</strong>", you can view it without problem from any public computer.
-
-###
-### profile_photo.tpl - photo manager - manage current photos
-###
-
-ManageCurrentPhotos = Manage current photos
-PictureProperties = Picture properties
-EditPictureProperties = Edit this picture description or safe status
-Delete = Delete
-DeleteThisPicture = Delete this picture
-
-###
-### profile_photo_edit.tpl - edit individual photo properties
-###
-
-EditPhoto = Edit photo
-PhotoInfo = Photo information
-Description = Description
-SafeForWork = Safe for work
-UseAsAvatar = Use as avatar
-OtherActions = Other actions
-DeletePicture = Delete this picture
-BackToPhotoManager = Back to photo manager
-
-###
-### profile.php
-###
-
-UnknownUser = Unknown being
-Who = Who?
-WhoIsUser = Who is %s?
-
-MessageSent = Message sent.
-MessageSentSelf = Message sent to yourself.
-
-CommentPublished = Comment published.
-
-PhotoUploaded = Photo uploaded.
-NotYourPic = Hey, this photo is not one of yours.
-PictureDeleted = Picture deleted.
-
-InactivatedUser = "This being's account isn't active yet."
+#Zed language config file - Profiles
+#Language: English
+#Code: en
+#Author: Dereckson
+
+###
+### profile.tpl - main profile
+###
+
+#<img src=".../mail.png" title="E-mail" alt="@"... />
+Mail = E-mail
+MailAlt = @
+Online = Online
+
+###
+### profile.tpl - communication area
+###
+
+DropMessage = Drop a message
+SendMessage = Send a message to %s
+AddComment = "Add a comment to %s's profile"
+
+Send = Send
+Publish = Publish
+
+###
+### profile.tpl - sidebar - Edit account preferences and profile content
+###
+
+EditMyPage = Edit my page
+EditProfile = Edit my text
+EditAccount = Edit my information
+ManagePhotos = Manage photos
+AddPhoto = Add a photo
+
+###
+### profile_edit.tpl - edit
+###
+
+ProfileTextTitle = My best words to express myself
+SaveProfile = Save profile
+ProfileFont = Profile fontz
+Calibri = Calibri (regular font)
+FixedSys = FixedSys (fixed width)
+
+###
+### user_account.tpl - edit my information
+###
+
+Login = Login
+LongName = Full character name
+UpdateAccountInfo = Update account information
+
+###
+### profile_photo.tpl - photo manager - add a photo to my profile
+###
+
+AddPhoto = Add a photo to my profile
+AddPhotoExplanations = You can upload here a personal photo with you as main subject.<br />Note you can also host any kind of pictures in various Zed places, like in the HyperShip's tower.
+ShortDescription = Short description
+SafeForWorkLabel = Check this box if the picture is "<strong>safe for work</strong>", you can view it without problem from any public computer.
+
+###
+### profile_photo.tpl - photo manager - manage current photos
+###
+
+ManageCurrentPhotos = Manage current photos
+PictureProperties = Picture properties
+EditPictureProperties = Edit this picture description or safe status
+Delete = Delete
+DeleteThisPicture = Delete this picture
+
+###
+### profile_photo_edit.tpl - edit individual photo properties
+###
+
+EditPhoto = Edit photo
+PhotoInfo = Photo information
+Description = Description
+SafeForWork = Safe for work
+UseAsAvatar = Use as avatar
+OtherActions = Other actions
+DeletePicture = Delete this picture
+BackToPhotoManager = Back to photo manager
+
+###
+### profile.php
+###
+
+UnknownUser = Unknown being
+Who = Who?
+WhoIsUser = Who is %s?
+
+MessageSent = Message sent.
+MessageSentSelf = Message sent to yourself.
+
+CommentPublished = Comment published.
+
+PhotoUploaded = Photo uploaded.
+NotYourPic = Hey, this photo is not one of yours.
+PictureDeleted = Picture deleted.
+
+InactivatedUser = "This being's account isn't active yet."
diff --git a/lang/en/scenes.conf b/lang/en/scenes.conf
index f6edb32..d7abc5b 100644
--- a/lang/en/scenes.conf
+++ b/lang/en/scenes.conf
@@ -1,51 +1,51 @@
-#Zed language config file - scenes
-#Language: English
-#Code: en
-#Author: Dereckson
-
-###
-### Hypership tower
-###
-
-[B00001001]
-Tower = Tour
-Floor = Floor
-Sector = Sector
-Couloir = Couloir
-GoUp = Climb up
-GoDown = Climb down
-
-UploadNewArtwork = "Upload new artwork"
-UploadNewArtworkDescription = "This frame is free. You can display here your artwork or any other artwork you like."
-UploadNewArtworkPicture = "Picture"
-UploadNewArtworkTitle = "Title"
-
-FreeDomain = "These sleeping quarters are free."
-ClaimDomain = 'You can <a href="%s">claim</a> them.'
-
-[B00001002]
-Sector = Sector
-Zone = Zone
-Level = Niveau
-
-Builder = HyperShip builder
-BuildInfo = <h2>This area is buildable.</h2><p>You can take over this part of the ship, transform it and design it as you want.</p><p>To start, you can:</p><ul> <li>Create a 960px wide picture with your scene background.</li><li>Define which parts of your picture are exits to another zone or level.</li></ul><p>If you want, you will also able to:</p><ul><li>Add descriptions to part of the area (like in the 90s adventure games)</li><li>Create a textual scenario (like in 80s choose your own adventure books)</li><li>Enhance the area with javascript or HTML5 (like in 2010)</li></ul>
-
-StartBuild = Start to build
-GoNorth = Go north
-GoEast = Go east
-GoSouth = Go south
-GoWest = Go west
-GoUp = Climb up
-GoDown = Climb down
-ViewMap = Print the level map
-GoTower = Go to the tower
-
-CantRender = Unable to render this zone:
-
-Core = HyperShip core
-YouAreInCore = You're in the HyperShip core.
-CoreInfo = <p>This area is the real center of the HyperShip.</p>
-
-ShipNavigationControl = Ship navigation control
-CurrentLocation = Current location
+#Zed language config file - scenes
+#Language: English
+#Code: en
+#Author: Dereckson
+
+###
+### Hypership tower
+###
+
+[B00001001]
+Tower = Tour
+Floor = Floor
+Sector = Sector
+Couloir = Couloir
+GoUp = Climb up
+GoDown = Climb down
+
+UploadNewArtwork = "Upload new artwork"
+UploadNewArtworkDescription = "This frame is free. You can display here your artwork or any other artwork you like."
+UploadNewArtworkPicture = "Picture"
+UploadNewArtworkTitle = "Title"
+
+FreeDomain = "These sleeping quarters are free."
+ClaimDomain = 'You can <a href="%s">claim</a> them.'
+
+[B00001002]
+Sector = Sector
+Zone = Zone
+Level = Niveau
+
+Builder = HyperShip builder
+BuildInfo = <h2>This area is buildable.</h2><p>You can take over this part of the ship, transform it and design it as you want.</p><p>To start, you can:</p><ul> <li>Create a 960px wide picture with your scene background.</li><li>Define which parts of your picture are exits to another zone or level.</li></ul><p>If you want, you will also able to:</p><ul><li>Add descriptions to part of the area (like in the 90s adventure games)</li><li>Create a textual scenario (like in 80s choose your own adventure books)</li><li>Enhance the area with javascript or HTML5 (like in 2010)</li></ul>
+
+StartBuild = Start to build
+GoNorth = Go north
+GoEast = Go east
+GoSouth = Go south
+GoWest = Go west
+GoUp = Climb up
+GoDown = Climb down
+ViewMap = Print the level map
+GoTower = Go to the tower
+
+CantRender = Unable to render this zone:
+
+Core = HyperShip core
+YouAreInCore = You're in the HyperShip core.
+CoreInfo = <p>This area is the real center of the HyperShip.</p>
+
+ShipNavigationControl = Ship navigation control
+CurrentLocation = Current location
diff --git a/lang/en/settings.conf b/lang/en/settings.conf
index 0130317..77ca11d 100644
--- a/lang/en/settings.conf
+++ b/lang/en/settings.conf
@@ -1,47 +1,47 @@
-#Zed language config file - Settings
-#Language: English
-#Code: en
-#Author: Dereckson
-
-###
-### Generalities
-###
-Settings = Settings
-SaveSettings = Save settings
-
-###
-### Account information
-###
-
-Account = Account information
-Username = Login
-Email = Mail
-PasswordConfirm = one more time
-
-###
-### Perso information
-###
-
-Information = "Your information"
-Name = Name
-Nickname = "Username (lowercase)"
-Race = Species
-Sex = Sex
-male = male
-female = female
-neutral = "neutral or asexual"
-both = "hermaphrodite"
-
-###
-### SmartLine
-###
-
-SmartLine = SmartLine
-SmartlineShow = "Shows the SmartLine at the bottom of the screen"
-SmartlineMethod = "Sends a HTTP POST request instead a HTTP GET submitting SmartLine form"
-
-###
-### Other settings
-###
-
+#Zed language config file - Settings
+#Language: English
+#Code: en
+#Author: Dereckson
+
+###
+### Generalities
+###
+Settings = Settings
+SaveSettings = Save settings
+
+###
+### Account information
+###
+
+Account = Account information
+Username = Login
+Email = Mail
+PasswordConfirm = one more time
+
+###
+### Perso information
+###
+
+Information = "Your information"
+Name = Name
+Nickname = "Username (lowercase)"
+Race = Species
+Sex = Sex
+male = male
+female = female
+neutral = "neutral or asexual"
+both = "hermaphrodite"
+
+###
+### SmartLine
+###
+
+SmartLine = SmartLine
+SmartlineShow = "Shows the SmartLine at the bottom of the screen"
+SmartlineMethod = "Sends a HTTP POST request instead a HTTP GET submitting SmartLine form"
+
+###
+### Other settings
+###
+
EditProfile = Edit my text
\ No newline at end of file
diff --git a/lang/en/ships.conf b/lang/en/ships.conf
index e8bbb6d..32b7da5 100644
--- a/lang/en/ships.conf
+++ b/lang/en/ships.conf
@@ -1,11 +1,11 @@
-#Zed language config file - Footer
-#Language: English
-#Code: en
-#Author: Dereckson
-
-###
-### Ships
-###
-
-PersonalNotes = Your notes about this ship
+#Zed language config file - Footer
+#Language: English
+#Code: en
+#Author: Dereckson
+
+###
+### Ships
+###
+
+PersonalNotes = Your notes about this ship
SaveNote = Save notes
\ No newline at end of file
diff --git a/lang/en/tutorials.conf b/lang/en/tutorials.conf
index d50d215..5042308 100644
--- a/lang/en/tutorials.conf
+++ b/lang/en/tutorials.conf
@@ -1,17 +1,17 @@
-#Zed language config file - Tutorials
-#Language: English
-#Code: en
-#Author: Dereckson
-
-###
-### Tutorial I - reach the hypership
-###
-
-[ReachHypership]
-JoinHypership = Join the hypership
-WhereYouAre = You're on %1$s, a desolate %2$s in the galaxy.
-WhereTheHypershipIs = After some investigation, you learn the hypership is in a far galaxy spiral.
-HowToJoinIt = """<p>To reach it, you can:</p><ul><li>hitchhike, if there are other people around going to the hypership.</li>
- <li>try to <a href=\"request/B00001/aid.reach\">contact the hypership and ask a shuttle</a></li>
- <li><a href=\"/explore\">explore the place</a> and find a ship to hire</li>
-</ul>"""
+#Zed language config file - Tutorials
+#Language: English
+#Code: en
+#Author: Dereckson
+
+###
+### Tutorial I - reach the hypership
+###
+
+[ReachHypership]
+JoinHypership = Join the hypership
+WhereYouAre = You're on %1$s, a desolate %2$s in the galaxy.
+WhereTheHypershipIs = After some investigation, you learn the hypership is in a far galaxy spiral.
+HowToJoinIt = """<p>To reach it, you can:</p><ul><li>hitchhike, if there are other people around going to the hypership.</li>
+ <li>try to <a href=\"request/B00001/aid.reach\">contact the hypership and ask a shuttle</a></li>
+ <li><a href=\"/explore\">explore the place</a> and find a ship to hire</li>
+</ul>"""
diff --git a/lang/fr/core.conf b/lang/fr/core.conf
index 37d2804..dae1e91 100644
--- a/lang/fr/core.conf
+++ b/lang/fr/core.conf
@@ -1,195 +1,195 @@
-#Zed language config file
-#Language: English
-#Code: fr
-#Author: Dereckson
-
-###
-### Site configuration
-###
-
-SiteTitle = Zed
-Product = "<strong>Zed 0.1</strong>, alpha technical preview"
-
-###
-### General stuff
-###
-
-_t = " :"
-Save = Enregistrer
-
-###
-### Login
-###
-
-Login = Login
-Password = Password
-OK = OK
-
-LoginNotFound = Login introuvable.
-IncorrectPassword = Mot de passe incorrect.
-
-JaMata = Ja mata!
-WelcomeBack = Welcome back.
-
-OpenID = OpenID
-
-Logout = Déconnexion
-
-###
-### Erreurs
-###
-
-UnauthorizedAccess = "Accès non autorisé"
-SQLError = "Erreur SQL"
-line = ligne
-Error = Erreur
-BackToHome = "Retourner à la page d'accueil"
-
-GeneralError = "Erreur générale"
-PageNotFound = "Cette page n'existe pas."
-
-#Veuillez laisser en anglais, pour identifier plus clairement les erreurs.
-FatalErrorScreen = Fatal error screen
-FatalErrorInterrupt = Fatal error breaking screen
-
-###
-### Homepage
-###
-
-Welcome = Bienvenue
-WelcomeText = "<p>Bienvenue sur la version alpha de Zed, un hybride un peu étrange entre une galerie, un endroit où rencontrer ses amis ou s'en faire de nouveaux, avec une légère inspiration RPG, dans un environnement galactique inspiré des romans de la Culture de Iain M. Banks.</p>
- <p>Le concept est d'expérimenter ce qui se passe lorsque chaque information est dans un espace précis, un peu comme la vision cyberpunk des années 80 du cyberespace. Un autre but est de créer une communauté partagant des valeurs de respect, de coopération, de liberté et d'éthique.</p>"
-
-###
-### Homepage - Messages
-###
-
-#NOTIFY if new messages
-NewMessages = "Vous avez reçu %d message%s"
-
-#messages.tpl, Reply
-Reply = Répondre
-
-#messages.tpl, the X link title
-DeleteThisMessage = Effacer ce message
-
-#messages.tpl, the expression identifying a message sent by the site itself
-SystemNotice = Note système
-
-#home.php, messages error
-MessageDeleted = Message effacé.
-NotYourMessage = Hey, ce message appartient à autrui !
-MessageAlreadyDeleted = Message déjà effacé
-
-###
-### Account create
-###
-
-CreateAccountTitle = Créer un compte
-CreateAccountIntro = "<p>Bienvenue sur Zed.<br />Zed est un site privé uniquement accessible suite à l'invitation d'un membre.</p>"
-
-YourLogin = Le login de votre choix
-InviteCode = "Votre code d'invitation"
-YourEmail = Votre adresse e-mail
-
-EnterInviteCodePromptMessage = "Votre code d'invitation ressemble à ABC123."
-EnterUsernamePromptMessage = "Votre login sera en minuscule et d'au plus onze caractères.<br />Il sera uniquement utilisé pour vous identifier, votre login NE sera PAS le nom de votre perso."
-EnterEmailPromptMessage = "Votre adresse sera utilisée pour vous permettre de modifier votre mot de passe en cas d'oubli. Vous pourrez également configurer des notifications en cas de nouveau message & co, mais par défaut c'est désactivé."
-
-IncorrectInviteCode = "Format invalide du code d'invitation,<br />recherchez quelque chose ressemblant à ABC123."
-InviteCodeAlreadyClaimed = "Ce code d'invitation était certes valide mais a déjà été utilisé par autrui."
-
-CreateAccountImageTitle = "Zed est un site pour les êtres humains. Mais aussi pour tous ceux qui se définissent autrement que comme humain."
-CreateAccountImageAlt = "Une étrange créature blanche. Un demi cercle allant d'en haut à droite vers le bas à droite ; la brosse poursuit ensuite en spirale pour créer une grosse tâche blanche. Les effets de la brosse ajoutent au début et à la fin des franges. Des tâches grises ont été rajoutées au centre."
-
-MissingUsername = "Vous avez oublié de spécifier le login."
-LoginUnavailable = "Ce login est déjà utilisé."
-MissingPassword = "Vous avez oublié de spécifier le mot de passe."
-InviteHaveBeenClaimed = "Votre invitation %s a été acceptée."
-AccountCreated = "Votre compte a été créé. Bienvenue sur Zed."
-
-###
-### Perso create/select
-###
-
-NewCharacterCreated = Nouveau perso créé.
-CreateCharacter = Nouveau perso
-EditCharacter = Éditer les infos de %s
-
-FullName = Prénom et nom
-Nickname = Pseudonyme
-
-Sex = Sexe
-Male = Masculin
-Female = Féminin
-Neutral = Neutre
-Hermaphrodit = Hermaphrodite
-Race = Race
-
-NoSexSpecified = "Quel est votre sexe ? Si vous ne souhaitez pas le dévoiler, vous pouvez toujours utiliser '<em>Neutral</em>'."
-NoNicknameSpecified = "Vous devez choisir un pseudo. C'est comme un login, pour votre perso."
-NoFullnameSpecified = "Tous les êtres doivent avoir un nom."
-NoRaceSpecified = "Spécifiez une race: '<em>humanoid</em>' pour les humains et humanoïdes.<br />Si vous ne souhaitez pas spécifier de race, vous pouvez utiliser '<em>being</em>'."
-UnavailableNickname = "Ce pseudo est déjà utilisé.<br />Veuillez en choisir un plus original."
-
-PickPerso = "Sélectionnez votre perso"
-SwapPerso = "Changer de perso (déco %s)"
-
-NewLocationNotify = "Vous vous réveillez lentement dans un endroit inconnu"
-
-InvitePersoCreated = "Bonne nouvelle ! %s vient d'arriver dans notre galaxie.
-%s"
-
-###
-### Places
-###
-
-CurrentLocation = "Localisateur"
-
-UnknownBody = "Astéroïde inconnu"
-UnknownPlace = "Endroit inconnu"
-WherePlace = "%2$s, %1$s."
-SpaceAround = "%s et l'espace aux alentours"
-
-hypership = hypership
-asteroid = astéroïde
-moon = lune
-planet = planète
-star = étoile
-orbital = orbitale
-place = endroit
-ship = vaisseau
-
-###
-### Stories
-###
-
-InvalidStoryGUID = "En mode récit, il n'est pas possible <br />d'utiliser les boutons précédents et suivants."
-ExpiredStorySession = "Les URL de choix sont temporaires.<br />Il n'est pas possible de les bookmark pour y revenir."
-
-###
-### Requests
-###
-
-Communicator = Communicator
-SendRequestToHyperShip = "Envoyer une requête à l'HyperShip"
-Request = Requête
-Title = Titre
-Message = Message
-Warning = "Attention :"
-RequestHandledByHumans = "Votre requête sera envoyée à et traitées par des humains."
-Send = Envoyer
-RequestSent = Votre requête a bien été envoyée.
-
-###
-### MOTD
-###
-
-PushMessage = Publier un message tout en haut
-TextToAdd = Texte à ajouter
-TextToAddWarning = "Une fois publié, ne peut être facilement enlevé."
-Rendering = Aperçu
-RenderingWhere = "Coin supérieur droit de la page :"
-DummyPlaceholder = Lorem ipsum dolor.
-Push = Publier
+#Zed language config file
+#Language: English
+#Code: fr
+#Author: Dereckson
+
+###
+### Site configuration
+###
+
+SiteTitle = Zed
+Product = "<strong>Zed 0.1</strong>, alpha technical preview"
+
+###
+### General stuff
+###
+
+_t = " :"
+Save = Enregistrer
+
+###
+### Login
+###
+
+Login = Login
+Password = Password
+OK = OK
+
+LoginNotFound = Login introuvable.
+IncorrectPassword = Mot de passe incorrect.
+
+JaMata = Ja mata!
+WelcomeBack = Welcome back.
+
+OpenID = OpenID
+
+Logout = Déconnexion
+
+###
+### Erreurs
+###
+
+UnauthorizedAccess = "Accès non autorisé"
+SQLError = "Erreur SQL"
+line = ligne
+Error = Erreur
+BackToHome = "Retourner à la page d'accueil"
+
+GeneralError = "Erreur générale"
+PageNotFound = "Cette page n'existe pas."
+
+#Veuillez laisser en anglais, pour identifier plus clairement les erreurs.
+FatalErrorScreen = Fatal error screen
+FatalErrorInterrupt = Fatal error breaking screen
+
+###
+### Homepage
+###
+
+Welcome = Bienvenue
+WelcomeText = "<p>Bienvenue sur la version alpha de Zed, un hybride un peu étrange entre une galerie, un endroit où rencontrer ses amis ou s'en faire de nouveaux, avec une légère inspiration RPG, dans un environnement galactique inspiré des romans de la Culture de Iain M. Banks.</p>
+ <p>Le concept est d'expérimenter ce qui se passe lorsque chaque information est dans un espace précis, un peu comme la vision cyberpunk des années 80 du cyberespace. Un autre but est de créer une communauté partagant des valeurs de respect, de coopération, de liberté et d'éthique.</p>"
+
+###
+### Homepage - Messages
+###
+
+#NOTIFY if new messages
+NewMessages = "Vous avez reçu %d message%s"
+
+#messages.tpl, Reply
+Reply = Répondre
+
+#messages.tpl, the X link title
+DeleteThisMessage = Effacer ce message
+
+#messages.tpl, the expression identifying a message sent by the site itself
+SystemNotice = Note système
+
+#home.php, messages error
+MessageDeleted = Message effacé.
+NotYourMessage = Hey, ce message appartient à autrui !
+MessageAlreadyDeleted = Message déjà effacé
+
+###
+### Account create
+###
+
+CreateAccountTitle = Créer un compte
+CreateAccountIntro = "<p>Bienvenue sur Zed.<br />Zed est un site privé uniquement accessible suite à l'invitation d'un membre.</p>"
+
+YourLogin = Le login de votre choix
+InviteCode = "Votre code d'invitation"
+YourEmail = Votre adresse e-mail
+
+EnterInviteCodePromptMessage = "Votre code d'invitation ressemble à ABC123."
+EnterUsernamePromptMessage = "Votre login sera en minuscule et d'au plus onze caractères.<br />Il sera uniquement utilisé pour vous identifier, votre login NE sera PAS le nom de votre perso."
+EnterEmailPromptMessage = "Votre adresse sera utilisée pour vous permettre de modifier votre mot de passe en cas d'oubli. Vous pourrez également configurer des notifications en cas de nouveau message & co, mais par défaut c'est désactivé."
+
+IncorrectInviteCode = "Format invalide du code d'invitation,<br />recherchez quelque chose ressemblant à ABC123."
+InviteCodeAlreadyClaimed = "Ce code d'invitation était certes valide mais a déjà été utilisé par autrui."
+
+CreateAccountImageTitle = "Zed est un site pour les êtres humains. Mais aussi pour tous ceux qui se définissent autrement que comme humain."
+CreateAccountImageAlt = "Une étrange créature blanche. Un demi cercle allant d'en haut à droite vers le bas à droite ; la brosse poursuit ensuite en spirale pour créer une grosse tâche blanche. Les effets de la brosse ajoutent au début et à la fin des franges. Des tâches grises ont été rajoutées au centre."
+
+MissingUsername = "Vous avez oublié de spécifier le login."
+LoginUnavailable = "Ce login est déjà utilisé."
+MissingPassword = "Vous avez oublié de spécifier le mot de passe."
+InviteHaveBeenClaimed = "Votre invitation %s a été acceptée."
+AccountCreated = "Votre compte a été créé. Bienvenue sur Zed."
+
+###
+### Perso create/select
+###
+
+NewCharacterCreated = Nouveau perso créé.
+CreateCharacter = Nouveau perso
+EditCharacter = Éditer les infos de %s
+
+FullName = Prénom et nom
+Nickname = Pseudonyme
+
+Sex = Sexe
+Male = Masculin
+Female = Féminin
+Neutral = Neutre
+Hermaphrodit = Hermaphrodite
+Race = Race
+
+NoSexSpecified = "Quel est votre sexe ? Si vous ne souhaitez pas le dévoiler, vous pouvez toujours utiliser '<em>Neutral</em>'."
+NoNicknameSpecified = "Vous devez choisir un pseudo. C'est comme un login, pour votre perso."
+NoFullnameSpecified = "Tous les êtres doivent avoir un nom."
+NoRaceSpecified = "Spécifiez une race: '<em>humanoid</em>' pour les humains et humanoïdes.<br />Si vous ne souhaitez pas spécifier de race, vous pouvez utiliser '<em>being</em>'."
+UnavailableNickname = "Ce pseudo est déjà utilisé.<br />Veuillez en choisir un plus original."
+
+PickPerso = "Sélectionnez votre perso"
+SwapPerso = "Changer de perso (déco %s)"
+
+NewLocationNotify = "Vous vous réveillez lentement dans un endroit inconnu"
+
+InvitePersoCreated = "Bonne nouvelle ! %s vient d'arriver dans notre galaxie.
+%s"
+
+###
+### Places
+###
+
+CurrentLocation = "Localisateur"
+
+UnknownBody = "Astéroïde inconnu"
+UnknownPlace = "Endroit inconnu"
+WherePlace = "%2$s, %1$s."
+SpaceAround = "%s et l'espace aux alentours"
+
+hypership = hypership
+asteroid = astéroïde
+moon = lune
+planet = planète
+star = étoile
+orbital = orbitale
+place = endroit
+ship = vaisseau
+
+###
+### Stories
+###
+
+InvalidStoryGUID = "En mode récit, il n'est pas possible <br />d'utiliser les boutons précédents et suivants."
+ExpiredStorySession = "Les URL de choix sont temporaires.<br />Il n'est pas possible de les bookmark pour y revenir."
+
+###
+### Requests
+###
+
+Communicator = Communicator
+SendRequestToHyperShip = "Envoyer une requête à l'HyperShip"
+Request = Requête
+Title = Titre
+Message = Message
+Warning = "Attention :"
+RequestHandledByHumans = "Votre requête sera envoyée à et traitées par des humains."
+Send = Envoyer
+RequestSent = Votre requête a bien été envoyée.
+
+###
+### MOTD
+###
+
+PushMessage = Publier un message tout en haut
+TextToAdd = Texte à ajouter
+TextToAddWarning = "Une fois publié, ne peut être facilement enlevé."
+Rendering = Aperçu
+RenderingWhere = "Coin supérieur droit de la page :"
+DummyPlaceholder = Lorem ipsum dolor.
+Push = Publier
Published = Publié :)
\ No newline at end of file
diff --git a/lang/fr/persorequest.conf b/lang/fr/persorequest.conf
index 9ab5886..7d04536 100644
--- a/lang/fr/persorequest.conf
+++ b/lang/fr/persorequest.conf
@@ -1,40 +1,40 @@
-#Zed language config file - Perso requests
-#Language: French
-#Code: fr
-#Author: Dereckson
-
-###
-### Generalities
-###
-
-#Page title
-PersoRequests = Requêtes
-
-#Page H1
-Requests = Requêtes
-
-#Button allow, to allow a request
-Allow = confirmer
-
-#Button deny, to deny a request
-Deny = refuser
-
-#Link ignore all, user can click here to continue normal site operations
-IgnoreAll = "Tout ignorer pour l'instant"
-
-###
-### Callbacks messages
-###
-
-CallbackError = "Une erreur est survenue lors du traitement de la requête."
-CallbackDone = "Une réponse à chaque requête. Terminé la bureaucratie :)"
-
-###
-### Ship API
-###
-
-#When a ship initiates a auth request, the perso is prompted the following message:
-RequestShipAPIAuthenticate = "Le vaisseau %s vous demande de confirmer votre identité."
-
-#When a ship initiates a session, the perso is prompted the following message:
+#Zed language config file - Perso requests
+#Language: French
+#Code: fr
+#Author: Dereckson
+
+###
+### Generalities
+###
+
+#Page title
+PersoRequests = Requêtes
+
+#Page H1
+Requests = Requêtes
+
+#Button allow, to allow a request
+Allow = confirmer
+
+#Button deny, to deny a request
+Deny = refuser
+
+#Link ignore all, user can click here to continue normal site operations
+IgnoreAll = "Tout ignorer pour l'instant"
+
+###
+### Callbacks messages
+###
+
+CallbackError = "Une erreur est survenue lors du traitement de la requête."
+CallbackDone = "Une réponse à chaque requête. Terminé la bureaucratie :)"
+
+###
+### Ship API
+###
+
+#When a ship initiates a auth request, the perso is prompted the following message:
+RequestShipAPIAuthenticate = "Le vaisseau %s vous demande de confirmer votre identité."
+
+#When a ship initiates a session, the perso is prompted the following message:
RequestShipAPISessionConfirm = "Le vaisseau %s vous demande de confirmer le lancement d'un lien vous permettant de communiquer avec lui."
\ No newline at end of file
diff --git a/lang/fr/profile.conf b/lang/fr/profile.conf
index 1279bca..477caa6 100644
--- a/lang/fr/profile.conf
+++ b/lang/fr/profile.conf
@@ -1,104 +1,104 @@
-#Zed language config file - Profiles
-#Language: French
-#Code: fr
-#Author: Dereckson
-
-###
-### profile.tpl - main profile
-###
-
-#<img src=".../mail.png" title="E-mail" alt="@"... />
-Mail = Courriel
-MailAlt = @
-Online = Online
-
-###
-### profile.tpl - communication area
-###
-
-DropMessage = Laisser un message
-SendMessage = "Envoyer un message privé <!-- %s -->"
-AddComment = "Publier un commentaire sur ce profil <!--%s-->"
-
-Send = Envoyer
-Publish = Publier
-
-###
-### profile.tpl - sidebar - Edit account preferences and profile content
-###
-
-EditMyPage = Éditer ma page
-EditProfile = Éditer mon texte
-EditAccount = Éditer mes infos
-ManagePhotos = Gérer mes photos
-AddPhoto = Upload une photo
-
-###
-### profile_edit.tpl - edit my text
-###
-
-ProfileTextTitle = Texte
-SaveProfile = Enregistrer mon texte
-ProfileFont = Police
-Calibri = Calibri (police à chasse variable)
-FixedSys = FixedSys (police à chasse fixe)
-
-###
-### user_account.tpl - edit my information
-###
-
-Login = Login
-LongName = Nom complet
-UpdateAccountInfo = Mettre à jour mon compte
-
-###
-### profile_photo.tpl - photo manager - add a photo to my profile
-###
-
-AddPhotoToProfile = Ajouter une photo à mon profil
-AddPhotoExplanations = Vous pouvez upload ici toute photo dont vous êtes le sujet principal. Celles-ci seront affichées sur votre profil.<br />Pour partager toute autre photo, placez là quelque part dans la galaxie, comme par exemple dans la tour de Zed.
-ShortDescription = Courte description
-SafeForWorkLabel = Cochez la case "<strong>safe for work</strong>", si la photo peut être regardée sans problème par tout en chacun depuis tout lieu public.
-
-###
-### profile_photo.tpl - photo manager - manage current photos
-###
-
-ManageCurrentPhotos = Gérer les photos
-PictureProperties = Propriétés de la photo
-EditPictureProperties = Modifier les propriétés
-Delete = Effacer
-DeleteThisPicture = Effacer cette image
-
-###
-### profile_photo_edit.tpl - edit individual photo properties
-###
-
-EditPhoto = Photo — Propriétés
-PhotoInfo = Info sur cette photo
-Description = Description
-SafeForWork = Safe for work
-UseAsAvatar = Avatar
-OtherActions = Autres actions
-DeletePicture = Effacer cette photo
-BackToPhotoManager = < Retourner au gestionnaire de photos
-
-###
-### profile.php
-###
-
-UnknownUser = Inconnu au bataillon.
-Who = Qui ?
-WhoIsUser = Qui est %s?
-
-MessageSent = Message envoyé.
-MessageSentSelf = Message personnel envoyé.
-
-CommentPublished = Commentaire publié.
-
-PhotoUploaded = Photo enregistrée.
-NotYourPic = Same player, try again.
-PictureDeleted = Photo effacée.
-PromotedToAvatar = Hop, un nouvel avatar.
-
-InactivatedUser = "Attention, ce compte n'est pas encore actif."
+#Zed language config file - Profiles
+#Language: French
+#Code: fr
+#Author: Dereckson
+
+###
+### profile.tpl - main profile
+###
+
+#<img src=".../mail.png" title="E-mail" alt="@"... />
+Mail = Courriel
+MailAlt = @
+Online = Online
+
+###
+### profile.tpl - communication area
+###
+
+DropMessage = Laisser un message
+SendMessage = "Envoyer un message privé <!-- %s -->"
+AddComment = "Publier un commentaire sur ce profil <!--%s-->"
+
+Send = Envoyer
+Publish = Publier
+
+###
+### profile.tpl - sidebar - Edit account preferences and profile content
+###
+
+EditMyPage = Éditer ma page
+EditProfile = Éditer mon texte
+EditAccount = Éditer mes infos
+ManagePhotos = Gérer mes photos
+AddPhoto = Upload une photo
+
+###
+### profile_edit.tpl - edit my text
+###
+
+ProfileTextTitle = Texte
+SaveProfile = Enregistrer mon texte
+ProfileFont = Police
+Calibri = Calibri (police à chasse variable)
+FixedSys = FixedSys (police à chasse fixe)
+
+###
+### user_account.tpl - edit my information
+###
+
+Login = Login
+LongName = Nom complet
+UpdateAccountInfo = Mettre à jour mon compte
+
+###
+### profile_photo.tpl - photo manager - add a photo to my profile
+###
+
+AddPhotoToProfile = Ajouter une photo à mon profil
+AddPhotoExplanations = Vous pouvez upload ici toute photo dont vous êtes le sujet principal. Celles-ci seront affichées sur votre profil.<br />Pour partager toute autre photo, placez là quelque part dans la galaxie, comme par exemple dans la tour de Zed.
+ShortDescription = Courte description
+SafeForWorkLabel = Cochez la case "<strong>safe for work</strong>", si la photo peut être regardée sans problème par tout en chacun depuis tout lieu public.
+
+###
+### profile_photo.tpl - photo manager - manage current photos
+###
+
+ManageCurrentPhotos = Gérer les photos
+PictureProperties = Propriétés de la photo
+EditPictureProperties = Modifier les propriétés
+Delete = Effacer
+DeleteThisPicture = Effacer cette image
+
+###
+### profile_photo_edit.tpl - edit individual photo properties
+###
+
+EditPhoto = Photo — Propriétés
+PhotoInfo = Info sur cette photo
+Description = Description
+SafeForWork = Safe for work
+UseAsAvatar = Avatar
+OtherActions = Autres actions
+DeletePicture = Effacer cette photo
+BackToPhotoManager = < Retourner au gestionnaire de photos
+
+###
+### profile.php
+###
+
+UnknownUser = Inconnu au bataillon.
+Who = Qui ?
+WhoIsUser = Qui est %s?
+
+MessageSent = Message envoyé.
+MessageSentSelf = Message personnel envoyé.
+
+CommentPublished = Commentaire publié.
+
+PhotoUploaded = Photo enregistrée.
+NotYourPic = Same player, try again.
+PictureDeleted = Photo effacée.
+PromotedToAvatar = Hop, un nouvel avatar.
+
+InactivatedUser = "Attention, ce compte n'est pas encore actif."
diff --git a/lang/fr/scenes.conf b/lang/fr/scenes.conf
index 03ecbbf..91f6c42 100644
--- a/lang/fr/scenes.conf
+++ b/lang/fr/scenes.conf
@@ -1,21 +1,21 @@
-#Zed language config file - scenes
-#Language: French
-#Code: fr
-#Author: Dereckson
-
-###
-### Hypership tower
-###
-
-[B00001001]
-Tower = Tour
-Floor = Étage
-Sector = Secteur
-Couloir = Couloir
-GoUp = Monter
-GoDown = Descendre
-
-UploadNewArtwork = "Téléverser une œuvre"
-UploadNewArtworkDescription = "Ce cadre est libre. Vous pouvez exposer ici l'un de vos travaux ou tout autre que vous appréciez."
-UploadNewArtworkPicture = "Œuvre"
+#Zed language config file - scenes
+#Language: French
+#Code: fr
+#Author: Dereckson
+
+###
+### Hypership tower
+###
+
+[B00001001]
+Tower = Tour
+Floor = Étage
+Sector = Secteur
+Couloir = Couloir
+GoUp = Monter
+GoDown = Descendre
+
+UploadNewArtwork = "Téléverser une œuvre"
+UploadNewArtworkDescription = "Ce cadre est libre. Vous pouvez exposer ici l'un de vos travaux ou tout autre que vous appréciez."
+UploadNewArtworkPicture = "Œuvre"
UploadNewArtworkTitle = "Titre"
\ No newline at end of file
diff --git a/lang/fr/ships.conf b/lang/fr/ships.conf
index b0e2509..96e8167 100644
--- a/lang/fr/ships.conf
+++ b/lang/fr/ships.conf
@@ -1,11 +1,11 @@
-#Zed language config file - Footer
-#Language: French
-#Code: fr
-#Author: Dereckson
-
-###
-### Ships
-###
-
-PersonalNotes = Vos notes à propos de ce vaisseau
+#Zed language config file - Footer
+#Language: French
+#Code: fr
+#Author: Dereckson
+
+###
+### Ships
+###
+
+PersonalNotes = Vos notes à propos de ce vaisseau
SaveNote = Mettre à jour ces notes
\ No newline at end of file
diff --git a/lang/fr/tutorials.conf b/lang/fr/tutorials.conf
index 9d2e850..2644cdc 100644
--- a/lang/fr/tutorials.conf
+++ b/lang/fr/tutorials.conf
@@ -1,17 +1,17 @@
-#Zed language config file - Tutorials
-#Language: French
-#Code: fr
-#Author: Dereckson
-
-###
-### Tutorial I - reach the hypership
-###
-
-[ReachHypership]
-JoinHypership = "Rejoindre l'HyperShip"
-WhereYouAre = "Vous êtes sur %1$s, apparemment un %2$s, un endroit perdu et désolé dans la galaxie."
-WhereTheHypershipIs = "Après quelques recherches, vous apprenez que l'HyperShip serait dans une spirale relativement éloignée."
-HowToJoinIt = """Pour l'atteindre, plusieurs options s'offrent à vous : <ul><li>faire du vaisseau-stop, s'il y a autour de vous d'autres êtres voulant rejoindre l'HyperShip.</li>
- <li>essayer de <a href=\"/request/B00001/aid.reach\">contacter l'HyperShip et demander une navette</a></li>
- <li><a href=\"/explore\">explorer l'endroit où vous êtes</a> et tenter d'y trouver un vaisseau</li>
-</ul>"""
+#Zed language config file - Tutorials
+#Language: French
+#Code: fr
+#Author: Dereckson
+
+###
+### Tutorial I - reach the hypership
+###
+
+[ReachHypership]
+JoinHypership = "Rejoindre l'HyperShip"
+WhereYouAre = "Vous êtes sur %1$s, apparemment un %2$s, un endroit perdu et désolé dans la galaxie."
+WhereTheHypershipIs = "Après quelques recherches, vous apprenez que l'HyperShip serait dans une spirale relativement éloignée."
+HowToJoinIt = """Pour l'atteindre, plusieurs options s'offrent à vous : <ul><li>faire du vaisseau-stop, s'il y a autour de vous d'autres êtres voulant rejoindre l'HyperShip.</li>
+ <li>essayer de <a href=\"/request/B00001/aid.reach\">contacter l'HyperShip et demander une navette</a></li>
+ <li><a href=\"/explore\">explorer l'endroit où vous êtes</a> et tenter d'y trouver un vaisseau</li>
+</ul>"""
diff --git a/skins/zed/account_create.tpl b/skins/zed/account_create.tpl
index fc70d99..84f7c3b 100644
--- a/skins/zed/account_create.tpl
+++ b/skins/zed/account_create.tpl
@@ -1,51 +1,51 @@
-{include file="perso_header.tpl"}
-
-<div class="grid_16">
- <img src="{#StaticContentURL#}/img/login/invite.png" title="{#CreateAccountImageTitle#}" alt="{#CreateAccountImageAlt#}" align="right" />
- <h2>{#CreateAccountTitle#}</h2>
- <p><em>{#CreateAccountIntro#}</em></p>
- <!-- Edit Perso form -->
- <form dojoType="dijit.form.Form" id="AccountForm" method="post" execute="document.getElementById('AccountForm').submit()">
- <input type="hidden" name="form" value="account.create" />
- <div class="row">
- <label class="firstLabel" for="username">{#YourLogin#}</label>
- <input type="text" id="username" name="username" maxlength="11"
- value="{$username}" dojoType="dijit.form.ValidationTextBox"
- required="true" trim="true" lowercase="true" class="medium"
- promptMessage="{#EnterUsernamePromptMessage#}"
- />
- </div>
- <div class="row">
- <label class="firstLabel" for="invite_code">{#InviteCode#}</label>
- <input type="text" id="invite_code" name="invite_code" maxlength="6"
- value="{$invite_code}" class="small"
- dojoType="dijit.form.ValidationTextBox" uppercase="true"
- regExp="{literal}[a-zA-Z]{3}[0-9]{3}{/literal}"
- promptMessage="{#EnterInviteCodePromptMessage#}"
- invalidMessage="{#IncorrectInviteCode#}"
- />
- </div>
- <div class="row">
- <label class="firstLabel" for="email">{#YourEmail#}</label>
- <input type="text" id="email" name="email" maxlength="63"
- value="{$email}" class="long" required="true" trim="true"
- regExpGen="dojox.validate.regexp.emailAddress"
- dojoType="dijit.form.ValidationTextBox"
- promptMessage="{#EnterEmailPromptMessage#}"
- />
- </div>
- <div class="row" dojoType="dojox.form.PasswordValidator" name="passwd">
- <label class="firstLabel">{#Password#}</label>
- <input type="password" pwType="new" />
- <br />
- <label class="firstLabel">{#Password#}</label>
- <input type="password" pwType="verify" />
- </div>
- <div class="row">
- <button dojoType="dijit.form.Button" type="submit" value="Save"
- iconClass="dijitEditorIcon dijitEditorIconSave"
- />{#Save#}</button>
- </div>
- </form>
-</div>
+{include file="perso_header.tpl"}
+
+<div class="grid_16">
+ <img src="{#StaticContentURL#}/img/login/invite.png" title="{#CreateAccountImageTitle#}" alt="{#CreateAccountImageAlt#}" align="right" />
+ <h2>{#CreateAccountTitle#}</h2>
+ <p><em>{#CreateAccountIntro#}</em></p>
+ <!-- Edit Perso form -->
+ <form dojoType="dijit.form.Form" id="AccountForm" method="post" execute="document.getElementById('AccountForm').submit()">
+ <input type="hidden" name="form" value="account.create" />
+ <div class="row">
+ <label class="firstLabel" for="username">{#YourLogin#}</label>
+ <input type="text" id="username" name="username" maxlength="11"
+ value="{$username}" dojoType="dijit.form.ValidationTextBox"
+ required="true" trim="true" lowercase="true" class="medium"
+ promptMessage="{#EnterUsernamePromptMessage#}"
+ />
+ </div>
+ <div class="row">
+ <label class="firstLabel" for="invite_code">{#InviteCode#}</label>
+ <input type="text" id="invite_code" name="invite_code" maxlength="6"
+ value="{$invite_code}" class="small"
+ dojoType="dijit.form.ValidationTextBox" uppercase="true"
+ regExp="{literal}[a-zA-Z]{3}[0-9]{3}{/literal}"
+ promptMessage="{#EnterInviteCodePromptMessage#}"
+ invalidMessage="{#IncorrectInviteCode#}"
+ />
+ </div>
+ <div class="row">
+ <label class="firstLabel" for="email">{#YourEmail#}</label>
+ <input type="text" id="email" name="email" maxlength="63"
+ value="{$email}" class="long" required="true" trim="true"
+ regExpGen="dojox.validate.regexp.emailAddress"
+ dojoType="dijit.form.ValidationTextBox"
+ promptMessage="{#EnterEmailPromptMessage#}"
+ />
+ </div>
+ <div class="row" dojoType="dojox.form.PasswordValidator" name="passwd">
+ <label class="firstLabel">{#Password#}</label>
+ <input type="password" pwType="new" />
+ <br />
+ <label class="firstLabel">{#Password#}</label>
+ <input type="password" pwType="verify" />
+ </div>
+ <div class="row">
+ <button dojoType="dijit.form.Button" type="submit" value="Save"
+ iconClass="dijitEditorIcon dijitEditorIconSave"
+ />{#Save#}</button>
+ </div>
+ </form>
+</div>
{include file="perso_footer.tpl"}
\ No newline at end of file
diff --git a/skins/zed/builder_hotglue.tpl b/skins/zed/builder_hotglue.tpl
index 3905308..a3fad7a 100644
--- a/skins/zed/builder_hotglue.tpl
+++ b/skins/zed/builder_hotglue.tpl
@@ -1,9 +1,9 @@
-<div class="content_wrapper">
- <h1>HyperShip builder</h1>
- <div class="content">
- <p style="width: 40%; float: left;">{$location}<br />{$location->global} {$location->local}</p>
- <p style="width: 40%; float: right; text-align: right;">Zone {$zone->id}</p>
- <div class="clear"></div>
- </div>
-</div>
-{include file="iframe.tpl"}
+<div class="content_wrapper">
+ <h1>HyperShip builder</h1>
+ <div class="content">
+ <p style="width: 40%; float: left;">{$location}<br />{$location->global} {$location->local}</p>
+ <p style="width: 40%; float: right; text-align: right;">Zone {$zone->id}</p>
+ <div class="clear"></div>
+ </div>
+</div>
+{include file="iframe.tpl"}
diff --git a/skins/zed/builder_map.tpl b/skins/zed/builder_map.tpl
index ab0c6ff..211e6f3 100644
--- a/skins/zed/builder_map.tpl
+++ b/skins/zed/builder_map.tpl
@@ -1,49 +1,49 @@
- <div class="grid_7 alpha">
-{$xyz = explode(',', substr($CurrentPerso->location_local, 1, -1))}
-{$x = $xyz[0]}{$y = $xyz[1]}{$z = $xyz[2]}
- Sector C<span id="sector">{GeoOctocube::get_sector($x, $y, $z)}</span>
- </div>
- <div class="grid_2" style="text-align: center;" id="info_area">
- Zone <span id="area">{abs($x)}-{abs($y)}</span>
- </div>
- <div class="grid_7 omega" style="text-align: right; margin-bottom: 1em;">
- Niveau <span id="level">{abs($z)}</span>
- </div>
-
- <div class="clear"></div>
-
- <!-- Map -->
-{if $zones}
- <div id="map"></div>
- <style>
- .zone-build img {
- opacity: 0.10;
- }
- </style>
- <script type="text/javascript" src="/js/builder/map.js"></script>
- <script>
- var zones = [
-{foreach from=$zones item=zone name=zones}
- ['{$zone->location_local}', {$zone->id}, '{$zone->type}', '{$zone->params}']{if !$smarty.foreach.zones.last},{/if}
-
-{/foreach}
- ];
- dojo.ready(function() {
- map.init('map', zones);
- });
- </script>
- <noscript>
- <p>You've zones at:</p>
- <ul>
-{foreach from=$zones item=zone}
- <li>{$zone->location_local}</li>
-{/foreach}
- </ul>
- <p>A patch for a pure HTML renderer to print a map without javascript is welcome.</p>
- </noscript>
-{else}
- <div class="grid_16 alpha omega">
- <div class="notify">This area is empty.</div>
- </div>
- <div class="clear"></div>
-{/if}
+ <div class="grid_7 alpha">
+{$xyz = explode(',', substr($CurrentPerso->location_local, 1, -1))}
+{$x = $xyz[0]}{$y = $xyz[1]}{$z = $xyz[2]}
+ Sector C<span id="sector">{GeoOctocube::get_sector($x, $y, $z)}</span>
+ </div>
+ <div class="grid_2" style="text-align: center;" id="info_area">
+ Zone <span id="area">{abs($x)}-{abs($y)}</span>
+ </div>
+ <div class="grid_7 omega" style="text-align: right; margin-bottom: 1em;">
+ Niveau <span id="level">{abs($z)}</span>
+ </div>
+
+ <div class="clear"></div>
+
+ <!-- Map -->
+{if $zones}
+ <div id="map"></div>
+ <style>
+ .zone-build img {
+ opacity: 0.10;
+ }
+ </style>
+ <script type="text/javascript" src="/js/builder/map.js"></script>
+ <script>
+ var zones = [
+{foreach from=$zones item=zone name=zones}
+ ['{$zone->location_local}', {$zone->id}, '{$zone->type}', '{$zone->params}']{if !$smarty.foreach.zones.last},{/if}
+
+{/foreach}
+ ];
+ dojo.ready(function() {
+ map.init('map', zones);
+ });
+ </script>
+ <noscript>
+ <p>You've zones at:</p>
+ <ul>
+{foreach from=$zones item=zone}
+ <li>{$zone->location_local}</li>
+{/foreach}
+ </ul>
+ <p>A patch for a pure HTML renderer to print a map without javascript is welcome.</p>
+ </noscript>
+{else}
+ <div class="grid_16 alpha omega">
+ <div class="notify">This area is empty.</div>
+ </div>
+ <div class="clear"></div>
+{/if}
diff --git a/skins/zed/error.tpl b/skins/zed/error.tpl
index e6beb80..f6420b5 100644
--- a/skins/zed/error.tpl
+++ b/skins/zed/error.tpl
@@ -1,60 +1,60 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
- <title>{#SiteTitle#}</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <link rel="stylesheet" type="text/css" href="{#StaticContentURL#}/css/960.css" media="screen" />
- <link rel="stylesheet" href="{#StaticContentURL#}/css/zed/theme.css" />
-</head>
-<body>
-<!-- Header -->
-<div id="header">
- <div id="header_content">
- <div class="container_16">
- <div class="grid_9">
- <div id="HypershipTime">{get_hypership_time()}</div>
- </div>
- <div class="grid_7">
- <a href="{get_url()}"><img src="{#StaticContentURL#}/img/zed/logo.png" src="Zed logo" border="0" /></a>
- </div>
- </div>
- </div>
-</div>
-<div class="clear"></div>
-<div class="container_16">
-{if $WAP}
-
- <!-- WAP -->
- <div class="grid_16 alpha omega">
- <div class="wap">{$WAP}</div>
- </div>
-{/if}
-{if $NOTIFY}
-
- <!-- Notify -->
- <div class="grid_16 alpha omega">
- <div class="notify">{$NOTIFY}</div>
- </div>
-{/if}
-
- <!-- Error -->
- <div class="content_wrapper">
- <h1>{$TITLE}</h1>
- <div class="content">
- <p>{$ERROR_TEXT}</p>
- <p><a href="{get_url()}">{#BackToHome#}</a></p>
- </div>
- </div>
- <div class="clear"></div>
- <hr />
- <div id="footer">
- <div class="grid_12 alpha">
- <p>[ {#Product#} / {#FatalErrorScreen#} ]</p>
- </div>
- <div class="grid_4 omega">
- <p style="text-align: right">[ <a href="{get_url()}?action=user.logout">{#Logout#}</a> ]</p>
- </div>
- </div>
-</div>
-</body>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title>{#SiteTitle#}</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <link rel="stylesheet" type="text/css" href="{#StaticContentURL#}/css/960.css" media="screen" />
+ <link rel="stylesheet" href="{#StaticContentURL#}/css/zed/theme.css" />
+</head>
+<body>
+<!-- Header -->
+<div id="header">
+ <div id="header_content">
+ <div class="container_16">
+ <div class="grid_9">
+ <div id="HypershipTime">{get_hypership_time()}</div>
+ </div>
+ <div class="grid_7">
+ <a href="{get_url()}"><img src="{#StaticContentURL#}/img/zed/logo.png" src="Zed logo" border="0" /></a>
+ </div>
+ </div>
+ </div>
+</div>
+<div class="clear"></div>
+<div class="container_16">
+{if $WAP}
+
+ <!-- WAP -->
+ <div class="grid_16 alpha omega">
+ <div class="wap">{$WAP}</div>
+ </div>
+{/if}
+{if $NOTIFY}
+
+ <!-- Notify -->
+ <div class="grid_16 alpha omega">
+ <div class="notify">{$NOTIFY}</div>
+ </div>
+{/if}
+
+ <!-- Error -->
+ <div class="content_wrapper">
+ <h1>{$TITLE}</h1>
+ <div class="content">
+ <p>{$ERROR_TEXT}</p>
+ <p><a href="{get_url()}">{#BackToHome#}</a></p>
+ </div>
+ </div>
+ <div class="clear"></div>
+ <hr />
+ <div id="footer">
+ <div class="grid_12 alpha">
+ <p>[ {#Product#} / {#FatalErrorScreen#} ]</p>
+ </div>
+ <div class="grid_4 omega">
+ <p style="text-align: right">[ <a href="{get_url()}?action=user.logout">{#Logout#}</a> ]</p>
+ </div>
+ </div>
+</div>
+</body>
</html>
\ No newline at end of file
diff --git a/skins/zed/error_block.tpl b/skins/zed/error_block.tpl
index 413c588..2c7addf 100644
--- a/skins/zed/error_block.tpl
+++ b/skins/zed/error_block.tpl
@@ -1,17 +1,17 @@
- <div class="clear clearfix"></div>
- <div class="grid_16 alpha omega">
- <h1>{$TITLE}</h1>
- <p>{$ERROR_TEXT}</p>
- <p><a href="{get_url()}">{#BackToHome#}</a></p>
- </div>
- <div class="clear"></div>
- <hr />
- <div class="grid_12 alpha">
- <p>[ {#Product#} / {#FatalErrorInterrupt#} ]</p>
- </div>
- <div class="grid_4 omega">
- <p style="text-align: right">[ <a href="{get_url()}?action=user.logout">{#Logout#}</a> ]</p>
- </div>
-</div>
-</body>
+ <div class="clear clearfix"></div>
+ <div class="grid_16 alpha omega">
+ <h1>{$TITLE}</h1>
+ <p>{$ERROR_TEXT}</p>
+ <p><a href="{get_url()}">{#BackToHome#}</a></p>
+ </div>
+ <div class="clear"></div>
+ <hr />
+ <div class="grid_12 alpha">
+ <p>[ {#Product#} / {#FatalErrorInterrupt#} ]</p>
+ </div>
+ <div class="grid_4 omega">
+ <p style="text-align: right">[ <a href="{get_url()}?action=user.logout">{#Logout#}</a> ]</p>
+ </div>
+</div>
+</body>
</html>
\ No newline at end of file
diff --git a/skins/zed/footer.tpl b/skins/zed/footer.tpl
index 1dac527..e8eaf40 100644
--- a/skins/zed/footer.tpl
+++ b/skins/zed/footer.tpl
@@ -1,20 +1,20 @@
-
-
- <div class="clear"></div>
-{if $SmartLinePrint}
-{include file="smartline.tpl"}
-{/if}
-
- <!-- Footer -->
- <hr />
- <div id="footer">
- <div class="grid_8 alpha">
- <p>[ {#Product#} / {$CurrentPerso->location_global} {$CurrentPerso->location_local} / {if $screen}{$screen}{else}Untitled screen{/if} ]</p>
- </div>
- <div class="grid_8 omega" style="float: right">
- <p style="text-align: right">[ {if $MultiPerso}<a href="{get_url()}?action=perso.logout">{sprintf(#SwapPerso#, $CurrentPerso->name)}</a> | {/if}<a href="{get_url()}?action=user.logout">{#Logout#}</a> ]</p>
- </div>
- </div>
-</div>
-</body>
+
+
+ <div class="clear"></div>
+{if $SmartLinePrint}
+{include file="smartline.tpl"}
+{/if}
+
+ <!-- Footer -->
+ <hr />
+ <div id="footer">
+ <div class="grid_8 alpha">
+ <p>[ {#Product#} / {$CurrentPerso->location_global} {$CurrentPerso->location_local} / {if $screen}{$screen}{else}Untitled screen{/if} ]</p>
+ </div>
+ <div class="grid_8 omega" style="float: right">
+ <p style="text-align: right">[ {if $MultiPerso}<a href="{get_url()}?action=perso.logout">{sprintf(#SwapPerso#, $CurrentPerso->name)}</a> | {/if}<a href="{get_url()}?action=user.logout">{#Logout#}</a> ]</p>
+ </div>
+ </div>
+</div>
+</body>
</html>
\ No newline at end of file
diff --git a/skins/zed/header.tpl b/skins/zed/header.tpl
index 88df43b..2c1a9c2 100644
--- a/skins/zed/header.tpl
+++ b/skins/zed/header.tpl
@@ -1,69 +1,69 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
- <title>{$PAGE_TITLE} - {#SiteTitle#}</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <link rel="stylesheet" type="text/css" href="{#StaticContentURL#}/css/960.css" media="screen" />
- <link rel="stylesheet" href="{#StaticContentURL#}/css/zed/theme.css" />
- <script type="text/javascript" src="{#StaticContentURL#}/js/misc.js"></script>
-{foreach from=$PAGE_CSS item=css}
- <link rel="stylesheet" href="{#StaticContentURL#}/css/{$css}" />
-{/foreach}
-{foreach from=$PAGE_JS item=js}
- <script src="{#StaticContentURL#}/js/{$js}"></script>
-{/foreach}
-{if $DOJO}
-
- <!-- DOJO -->
- <script type="text/javascript" src="{#StaticContentURL#}/js/dojo/dojo/dojo.js" djConfig="isDebug:false, parseOnLoad: true" ></script>
-{if $DIJIT}
- <link rel="stylesheet" type="text/css" href="{#StaticContentURL#}/css/zed/forms.css" />
-{/if}
-{/if}
-</head>
-<body{if $DIJIT} class="tundra"{/if}>
-<!-- Header -->
-<div id="header">
- <div id="header_content">
- <div class="container_16">
- <div class="grid_9">
- <div class="wall" id="header_wall">
- {$WALL_TEXT}
- <br />
- <span class="wall_info">- - <a href="{$WALL_USER_URL}">{$WALL_USER}</a></span>
- </div>
- <div class="clear"></div>
- <div id="HypershipTime">{get_hypership_time()}</div>
- </div>
- <div class="grid_7">
- <a href="{get_url()}"><img src="{#StaticContentURL#}/img/zed/logo.png" alt="Zed logo" border="0" /></a>
- </div>
- <div class="clear"></div>
- </div>
- </div>
-</div>
-<div class="clear"></div>
-
-<!-- Content -->
-<div class="container_16">
-{if $WAP}
-
- <!-- WAP -->
- <div class="grid_16 alpha omega">
- <div class="wap">{$WAP}</div>
- </div>
- <div class="clear"></div>
-{/if}
-{if $NOTIFY}
-
- <!-- Notify -->
- <div class="grid_16 alpha omega">
- <div class="notify">{$NOTIFY}</div>
- </div>
- <div class="clear"></div>
-{/if}
-
-{if $SmartLine_STDOUT || $SmartLine_STDERR}
-{include file="smartline_results.tpl"}
-{/if}
-
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title>{$PAGE_TITLE} - {#SiteTitle#}</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <link rel="stylesheet" type="text/css" href="{#StaticContentURL#}/css/960.css" media="screen" />
+ <link rel="stylesheet" href="{#StaticContentURL#}/css/zed/theme.css" />
+ <script type="text/javascript" src="{#StaticContentURL#}/js/misc.js"></script>
+{foreach from=$PAGE_CSS item=css}
+ <link rel="stylesheet" href="{#StaticContentURL#}/css/{$css}" />
+{/foreach}
+{foreach from=$PAGE_JS item=js}
+ <script src="{#StaticContentURL#}/js/{$js}"></script>
+{/foreach}
+{if $DOJO}
+
+ <!-- DOJO -->
+ <script type="text/javascript" src="{#StaticContentURL#}/js/dojo/dojo/dojo.js" djConfig="isDebug:false, parseOnLoad: true" ></script>
+{if $DIJIT}
+ <link rel="stylesheet" type="text/css" href="{#StaticContentURL#}/css/zed/forms.css" />
+{/if}
+{/if}
+</head>
+<body{if $DIJIT} class="tundra"{/if}>
+<!-- Header -->
+<div id="header">
+ <div id="header_content">
+ <div class="container_16">
+ <div class="grid_9">
+ <div class="wall" id="header_wall">
+ {$WALL_TEXT}
+ <br />
+ <span class="wall_info">- - <a href="{$WALL_USER_URL}">{$WALL_USER}</a></span>
+ </div>
+ <div class="clear"></div>
+ <div id="HypershipTime">{get_hypership_time()}</div>
+ </div>
+ <div class="grid_7">
+ <a href="{get_url()}"><img src="{#StaticContentURL#}/img/zed/logo.png" alt="Zed logo" border="0" /></a>
+ </div>
+ <div class="clear"></div>
+ </div>
+ </div>
+</div>
+<div class="clear"></div>
+
+<!-- Content -->
+<div class="container_16">
+{if $WAP}
+
+ <!-- WAP -->
+ <div class="grid_16 alpha omega">
+ <div class="wap">{$WAP}</div>
+ </div>
+ <div class="clear"></div>
+{/if}
+{if $NOTIFY}
+
+ <!-- Notify -->
+ <div class="grid_16 alpha omega">
+ <div class="notify">{$NOTIFY}</div>
+ </div>
+ <div class="clear"></div>
+{/if}
+
+{if $SmartLine_STDOUT || $SmartLine_STDERR}
+{include file="smartline_results.tpl"}
+{/if}
+
diff --git a/skins/zed/home.tpl b/skins/zed/home.tpl
index 414a2e9..4aefa2c 100644
--- a/skins/zed/home.tpl
+++ b/skins/zed/home.tpl
@@ -1,5 +1,5 @@
- <!-- Welcome -->
- <h1>{#Welcome#}</h1>
- <div style="text-align: justify; text-indent: 2em;">
- {#WelcomeText#}
+ <!-- Welcome -->
+ <h1>{#Welcome#}</h1>
+ <div style="text-align: justify; text-indent: 2em;">
+ {#WelcomeText#}
</div>
\ No newline at end of file
diff --git a/skins/zed/iframe.tpl b/skins/zed/iframe.tpl
index fd2171f..37a59f8 100644
--- a/skins/zed/iframe.tpl
+++ b/skins/zed/iframe.tpl
@@ -1,2 +1,2 @@
- <!-- Content iframe -->
- <iframe src="{$IFRAME_SRC}" width="960" height="600" id="content_iframe" frameborder="0" scrolling="no" style="margin-bottom: 1em"></iframe>
+ <!-- Content iframe -->
+ <iframe src="{$IFRAME_SRC}" width="960" height="600" id="content_iframe" frameborder="0" scrolling="no" style="margin-bottom: 1em"></iframe>
diff --git a/skins/zed/login.tpl b/skins/zed/login.tpl
index 15b1344..1272be8 100644
--- a/skins/zed/login.tpl
+++ b/skins/zed/login.tpl
@@ -1,78 +1,78 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
- <title>{#SiteTitle#}</title>
- <link rel="Stylesheet" href="{#StaticContentURL#}/css/zed/login.css" type="text/css" />
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <script type="text/javascript" src="js/login.js"></script>
- <script type="text/javascript" src="js/misc.js"></script>
- <script type="text/javascript" src="js/prototype.js"></script>
- <script type="text/javascript" src="js/effects.js"></script>
-</head>
-<body>
-
-<!-- Login form -->
-<div id="LoginBox">
- <form method="post" action="{get_url()}">
- <div class="row">
- <label for="username">{#Login#}{#_t#}</label>
- <input type="text" id="username" name="username" value="{$username}" />
- </div>
- <div class="row">
- <label for="password">{#Password#}{#_t#}</label>
- <input type="password" id="password" name="password" />
- </div>
- <div class="row">
- <label for="openid">{#OpenID#}{#_t#}</label>
- <input type="text" id="openid" name="openid" value="{$OpenID}" />
- </div>
- <div class="row">
- <input type="submit" id="submit" name="LogIn" value="{#OK#}" onclick="return OnLoginSubmit(this);" />
- </div>
- </form>
-{if $LoginError}
- <!-- Ooops, something wrong -->
- <div class=row>
- <p id="error" class="error">&nbsp;&nbsp;&nbsp;&nbsp;{$LoginError}</p>
- </div>
-{/if}
-</div>
-
-<!-- Links -->
-<div id="link_tour"><a href="/tour.html"></a></div>
-<div id="link_blog"><a href="/blog"></a></div>
-
-{$code = generate_random_string('AAA111')}
-<!--
-
- XXXXXXX XX
- X X X
- X X Invitation code:
- X XXXXX XXXXX {$code}
- X X X X X
- X XXXXXXX X X
- X X X X
- X X X X X X
- XXXXXXX XXXXX XXXXXX
-
-Welcome to the Zed beta. We're happy you're reading the source :)
-
-If you want to know what we're building, check http://zed.dereckson.be/tour.html
-
-If you wish an access, send a mail to zedinvite (alt+64) dereckson.be
-and specify the following code: {$code}
-
- * * * *
-
-Bienvenue dans la version bêta de Zed. Heureux que vous consultiez la source.
-
-Un petit aperçu de ce que l'on crée est sur http://zed.dereckson.be/tour.html
-
-Pour obtenir un accès, envoyez un mail à zedinvite (alt+64) dereckson.be
-en spécifiant le code suivant : {$code}
--->
-<script type="text/javascript">
- slide.initialize('LoginBox');
-</script>
-</body>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title>{#SiteTitle#}</title>
+ <link rel="Stylesheet" href="{#StaticContentURL#}/css/zed/login.css" type="text/css" />
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <script type="text/javascript" src="js/login.js"></script>
+ <script type="text/javascript" src="js/misc.js"></script>
+ <script type="text/javascript" src="js/prototype.js"></script>
+ <script type="text/javascript" src="js/effects.js"></script>
+</head>
+<body>
+
+<!-- Login form -->
+<div id="LoginBox">
+ <form method="post" action="{get_url()}">
+ <div class="row">
+ <label for="username">{#Login#}{#_t#}</label>
+ <input type="text" id="username" name="username" value="{$username}" />
+ </div>
+ <div class="row">
+ <label for="password">{#Password#}{#_t#}</label>
+ <input type="password" id="password" name="password" />
+ </div>
+ <div class="row">
+ <label for="openid">{#OpenID#}{#_t#}</label>
+ <input type="text" id="openid" name="openid" value="{$OpenID}" />
+ </div>
+ <div class="row">
+ <input type="submit" id="submit" name="LogIn" value="{#OK#}" onclick="return OnLoginSubmit(this);" />
+ </div>
+ </form>
+{if $LoginError}
+ <!-- Ooops, something wrong -->
+ <div class=row>
+ <p id="error" class="error">&nbsp;&nbsp;&nbsp;&nbsp;{$LoginError}</p>
+ </div>
+{/if}
+</div>
+
+<!-- Links -->
+<div id="link_tour"><a href="/tour.html"></a></div>
+<div id="link_blog"><a href="/blog"></a></div>
+
+{$code = generate_random_string('AAA111')}
+<!--
+
+ XXXXXXX XX
+ X X X
+ X X Invitation code:
+ X XXXXX XXXXX {$code}
+ X X X X X
+ X XXXXXXX X X
+ X X X X
+ X X X X X X
+ XXXXXXX XXXXX XXXXXX
+
+Welcome to the Zed beta. We're happy you're reading the source :)
+
+If you want to know what we're building, check http://zed.dereckson.be/tour.html
+
+If you wish an access, send a mail to zedinvite (alt+64) dereckson.be
+and specify the following code: {$code}
+
+ * * * *
+
+Bienvenue dans la version bêta de Zed. Heureux que vous consultiez la source.
+
+Un petit aperçu de ce que l'on crée est sur http://zed.dereckson.be/tour.html
+
+Pour obtenir un accès, envoyez un mail à zedinvite (alt+64) dereckson.be
+en spécifiant le code suivant : {$code}
+-->
+<script type="text/javascript">
+ slide.initialize('LoginBox');
+</script>
+</body>
</html>
\ No newline at end of file
diff --git a/skins/zed/messages.tpl b/skins/zed/messages.tpl
index 5c58e2f..7826221 100644
--- a/skins/zed/messages.tpl
+++ b/skins/zed/messages.tpl
@@ -1,21 +1,21 @@
-
-
- <!-- Messages -->
- <div class="grid_16 alpha omega">
-{foreach from=$MESSAGES item=message}
-{if $message->from == 0}
- <div class="message red">
- <div class="message_info">{#SystemNotice#} | {get_hypership_time($message->date)} | <a href="?action=msg_delete&id={$message->id}" title="{#DeleteThisMessage#}">X</a></div>
- <div class="message_text">{$message->text|text2html}</div>
- </div>
-{else}
-{$perso = Perso::get($message->from)}
-{$who = $perso->name}
-{$url = get_url('who', $perso->nickname)}
- <div class="message {cycle values="light,dark"}">
- <div class="message_info"><a href="{$url}">{$who}</a> | {get_hypership_time($message->date)} | <a href="{$url}#Message">{#Reply#}</a> | <a href="?action=msg_delete&id={$message->id}" title="{#DeleteThisMessage#}">X</a></div>
- <div class="message_text">{$message->text|text2html}</div>
- </div>
-{/if}
-{/foreach}
+
+
+ <!-- Messages -->
+ <div class="grid_16 alpha omega">
+{foreach from=$MESSAGES item=message}
+{if $message->from == 0}
+ <div class="message red">
+ <div class="message_info">{#SystemNotice#} | {get_hypership_time($message->date)} | <a href="?action=msg_delete&id={$message->id}" title="{#DeleteThisMessage#}">X</a></div>
+ <div class="message_text">{$message->text|text2html}</div>
+ </div>
+{else}
+{$perso = Perso::get($message->from)}
+{$who = $perso->name}
+{$url = get_url('who', $perso->nickname)}
+ <div class="message {cycle values="light,dark"}">
+ <div class="message_info"><a href="{$url}">{$who}</a> | {get_hypership_time($message->date)} | <a href="{$url}#Message">{#Reply#}</a> | <a href="?action=msg_delete&id={$message->id}" title="{#DeleteThisMessage#}">X</a></div>
+ <div class="message_text">{$message->text|text2html}</div>
+ </div>
+{/if}
+{/foreach}
</div>
\ No newline at end of file
diff --git a/skins/zed/motd_add.tpl b/skins/zed/motd_add.tpl
index e3266ae..7a5574c 100644
--- a/skins/zed/motd_add.tpl
+++ b/skins/zed/motd_add.tpl
@@ -1,26 +1,26 @@
-<!-- MOTD preview code -->
-<script>
- function updateWall () {
- wallTextValue = document.getElementById("WallText").value;
- wallText = wallTextValue ? wallTextValue : "{#DummyPlaceholder#}";
- document.getElementById("wall_message").innerHTML = wallText;
- }
-</script>
-
-<!-- Add something on the MOTD -->
-<h1>{#PushMessage#}</h1>
-<form method="post">
- <label for="WallAddText">{#TextToAdd#}{#_t#}</label><br />
- <input type="text" maxlength="90" size="100" id="WallText" name="text" onblur="updateWall();" onkeyup="updateWall();" onchange="updateWall();" />
- <input type="submit" value="{#Push#}" />
-</form>
-<em>{#TextToAddWarning#}</em>
-
-<!-- Preview -->
-<h2>{#Rendering#}</h2>
-<div class="wall">
- <span id="wall_message">{#DummyPlaceholder#}</span>
- <br /><span class="wall_info">-- <a href="{get_url('who', $CurrentPerso->nickname)}">{$CurrentPerso->name}</a></span>
- <div class="clear"></div>
-</div>
+<!-- MOTD preview code -->
+<script>
+ function updateWall () {
+ wallTextValue = document.getElementById("WallText").value;
+ wallText = wallTextValue ? wallTextValue : "{#DummyPlaceholder#}";
+ document.getElementById("wall_message").innerHTML = wallText;
+ }
+</script>
+
+<!-- Add something on the MOTD -->
+<h1>{#PushMessage#}</h1>
+<form method="post">
+ <label for="WallAddText">{#TextToAdd#}{#_t#}</label><br />
+ <input type="text" maxlength="90" size="100" id="WallText" name="text" onblur="updateWall();" onkeyup="updateWall();" onchange="updateWall();" />
+ <input type="submit" value="{#Push#}" />
+</form>
+<em>{#TextToAddWarning#}</em>
+
+<!-- Preview -->
+<h2>{#Rendering#}</h2>
+<div class="wall">
+ <span id="wall_message">{#DummyPlaceholder#}</span>
+ <br /><span class="wall_info">-- <a href="{get_url('who', $CurrentPerso->nickname)}">{$CurrentPerso->name}</a></span>
+ <div class="clear"></div>
+</div>
<div class="clear"></div>
\ No newline at end of file
diff --git a/skins/zed/page_edit.tpl b/skins/zed/page_edit.tpl
index 9cf93f5..f5a8799 100644
--- a/skins/zed/page_edit.tpl
+++ b/skins/zed/page_edit.tpl
@@ -1,26 +1,26 @@
- <div class="content_wrapper">
- <h1>Page editor</h1>
-
- <!-- Page editor form -->
- <form method="post" action="{get_url('page', $page['page_code'])}">
- <p><input id="title" type="text" size="80" maxsize="255" name="title" value="{$page['page_title']}" /> ◄ <label for="title">Page title</label>
- <br />
- <input id="edit_reason" type=text size="80" maxsize="255" name="edit_reason" /> ◄ <label for="edit_reason">Edit summary</label></p>
- <textarea id="PageEditorContent" name="content" style="width: 100%" rows=20>{$page['page_content']}</textarea>
- <br />
- <input type=hidden name="code" value='{$page['page_code']}' />
- <input type=submit value='Enregistrer' />
-
- </form>
- </div>
-
- <!-- Loads FCKeditor -->
- <script>
- var oFCKeditor = new FCKeditor('content');
- oFCKeditor.BasePath = '/js/FCKeditor/';
- oFCKeditor.Config['SkinPath'] = oFCKeditor.BasePath + 'editor/skins/silver/';
- oFCKeditor.Config['BaseHref'] = 'http://zed.dereckson.be/page/';
- oFCKeditor.Height = 480;
- oFCKeditor.ReplaceTextarea();
- </script>
+ <div class="content_wrapper">
+ <h1>Page editor</h1>
+
+ <!-- Page editor form -->
+ <form method="post" action="{get_url('page', $page['page_code'])}">
+ <p><input id="title" type="text" size="80" maxsize="255" name="title" value="{$page['page_title']}" /> ◄ <label for="title">Page title</label>
+ <br />
+ <input id="edit_reason" type=text size="80" maxsize="255" name="edit_reason" /> ◄ <label for="edit_reason">Edit summary</label></p>
+ <textarea id="PageEditorContent" name="content" style="width: 100%" rows=20>{$page['page_content']}</textarea>
+ <br />
+ <input type=hidden name="code" value='{$page['page_code']}' />
+ <input type=submit value='Enregistrer' />
+
+ </form>
+ </div>
+
+ <!-- Loads FCKeditor -->
+ <script>
+ var oFCKeditor = new FCKeditor('content');
+ oFCKeditor.BasePath = '/js/FCKeditor/';
+ oFCKeditor.Config['SkinPath'] = oFCKeditor.BasePath + 'editor/skins/silver/';
+ oFCKeditor.Config['BaseHref'] = 'http://zed.dereckson.be/page/';
+ oFCKeditor.Height = 480;
+ oFCKeditor.ReplaceTextarea();
+ </script>
\ No newline at end of file
diff --git a/skins/zed/perso_create.tpl b/skins/zed/perso_create.tpl
index e724fa0..438f51c 100644
--- a/skins/zed/perso_create.tpl
+++ b/skins/zed/perso_create.tpl
@@ -1,36 +1,36 @@
-{include file="perso_header.tpl"}
-<div class="grid_16">
- <h2>{if $perso->nickname}{sprintf(#EditCharacter#, $perso->nickname)}{else}{#CreateCharacter#}{/if}</h2>
- <!-- Edit Perso form -->
- <form dojoType="dijit.form.Form" id="PersoForm" method="post" execute="document.getElementById('PersoForm').submit()">
- <input type="hidden" name="form" value="perso.create" />
-{if 0}
- <input type="hidden" name="id" value="{$perso->id}" />
-{/if}
- <div class="row">
- <label class="firstLabel" for="name">{#FullName#}</label>
- <input type="text" id="name" name="name" maxlength="255" value="{$perso->name}" dojoType="dijit.form.TextBox" class="long" />
- </div>
- <div class="row">
- <label class="firstLabel" for="nickname">{#Nickname#}</label>
- <input type="text" id="nickname" name="nickname" maxlength="31" value="{$perso->nickname}" dojoType="dijit.form.TextBox" class="medium" />
- </div>
- <div class="row">
- <label class="firstLabel" for="race">{#Race#}</label>
- <input type="text" id="race" name="race" maxlength="31" value="{if $perso->race}{$perso->race}{else}humanoid{/if}" dojoType="dijit.form.TextBox" class="medium" />
- </div>
- <div class="row">
- <label class="firstLabel" for="sex">{#Sex#}</label>
- <select id="sex" name="sex" dojoType="dijit.form.FilteringSelect" class="medium">
- <option value="M">{#Male#}</option>
- <option value="F">{#Female#}</option>
- <option value="N">{#Neutral#}</option>
- <option value="2">{#Hermaphrodit#}</option>
- </select>
- </div>
- <div class="row">
- <button dojoType="dijit.form.Button" iconClass="dijitEditorIcon dijitEditorIconSave" type="submit" value="Save" />{#Save#}</button>
- </div>
- </form>
-</div>
+{include file="perso_header.tpl"}
+<div class="grid_16">
+ <h2>{if $perso->nickname}{sprintf(#EditCharacter#, $perso->nickname)}{else}{#CreateCharacter#}{/if}</h2>
+ <!-- Edit Perso form -->
+ <form dojoType="dijit.form.Form" id="PersoForm" method="post" execute="document.getElementById('PersoForm').submit()">
+ <input type="hidden" name="form" value="perso.create" />
+{if 0}
+ <input type="hidden" name="id" value="{$perso->id}" />
+{/if}
+ <div class="row">
+ <label class="firstLabel" for="name">{#FullName#}</label>
+ <input type="text" id="name" name="name" maxlength="255" value="{$perso->name}" dojoType="dijit.form.TextBox" class="long" />
+ </div>
+ <div class="row">
+ <label class="firstLabel" for="nickname">{#Nickname#}</label>
+ <input type="text" id="nickname" name="nickname" maxlength="31" value="{$perso->nickname}" dojoType="dijit.form.TextBox" class="medium" />
+ </div>
+ <div class="row">
+ <label class="firstLabel" for="race">{#Race#}</label>
+ <input type="text" id="race" name="race" maxlength="31" value="{if $perso->race}{$perso->race}{else}humanoid{/if}" dojoType="dijit.form.TextBox" class="medium" />
+ </div>
+ <div class="row">
+ <label class="firstLabel" for="sex">{#Sex#}</label>
+ <select id="sex" name="sex" dojoType="dijit.form.FilteringSelect" class="medium">
+ <option value="M">{#Male#}</option>
+ <option value="F">{#Female#}</option>
+ <option value="N">{#Neutral#}</option>
+ <option value="2">{#Hermaphrodit#}</option>
+ </select>
+ </div>
+ <div class="row">
+ <button dojoType="dijit.form.Button" iconClass="dijitEditorIcon dijitEditorIconSave" type="submit" value="Save" />{#Save#}</button>
+ </div>
+ </form>
+</div>
{include file="perso_footer.tpl"}
\ No newline at end of file
diff --git a/skins/zed/perso_footer.tpl b/skins/zed/perso_footer.tpl
index f41683f..fcfa0cd 100644
--- a/skins/zed/perso_footer.tpl
+++ b/skins/zed/perso_footer.tpl
@@ -1,13 +1,13 @@
- <div class="clear"></div>
- <hr />
- <div id="footer">
- <div class="grid_12 alpha">
- <p>[ {#Product#} ]</p>
- </div>
- <div class="grid_4 omega">
- <p style="text-align: right">[ <a href="{get_url()}?action=user.logout">{#Logout#}</a> ]</p>
- </div>
- </div>
-</div>
-</body>
-</html>
+ <div class="clear"></div>
+ <hr />
+ <div id="footer">
+ <div class="grid_12 alpha">
+ <p>[ {#Product#} ]</p>
+ </div>
+ <div class="grid_4 omega">
+ <p style="text-align: right">[ <a href="{get_url()}?action=user.logout">{#Logout#}</a> ]</p>
+ </div>
+ </div>
+</div>
+</body>
+</html>
diff --git a/skins/zed/perso_header.tpl b/skins/zed/perso_header.tpl
index 3f7dbab..c09a11c 100644
--- a/skins/zed/perso_header.tpl
+++ b/skins/zed/perso_header.tpl
@@ -1,56 +1,56 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
- <title>{#SiteTitle#}</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <link rel="stylesheet" type="text/css" href="{#StaticContentURL#}/css/960.css" media="screen" />
- <link rel="stylesheet" href="{#StaticContentURL#}/css/zed/theme.css" />
-
- <!-- Calls dojo -->
- <script src="/{#StaticContentURL#}js/dojo/dojo/dojo.js" type="text/javascript"
- djConfig="isDebug: false, parseOnLoad: true"></script>
- <link rel="stylesheet" href="{#StaticContentURL#}/css/zed/forms.css" />
- <script type="text/javascript">
- dojo.require("dijit.form.Form");
-
- dojo.require("dijit.form.ValidationTextBox");
- dojo.require("dijit.form.TextBox");
- dojo.require("dijit.form.FilteringSelect");
- dojo.require("dijit.form.Button");
-
- dojo.require("dojox.validate.regexp");
- dojo.require("dojox.form.PasswordValidator");
-
- dojo.require("dojo.parser");
- </script>
-</head>
-<body class="tundra">
-<!-- Header -->
-<div id="header">
- <div id="header_content">
- <div class="container_16">
- <div class="grid_4 alpha omega suffix_8">
- <a href="{get_url()}"><img src="{#StaticContentURL#}/img/zed/logo.png" src="Zed logo" border="0" /></a>
- </div>
- <div class="clear"></div>
- </div>
- </div>
-</div>
-<div class="clear"></div>
-
-<!-- Content -->
-<div class="container_16">
-{if $WAP}
-
- <!-- WAP -->
- <div class="grid_16 alpha omega">
- <div class="wap">{$WAP}</div>
- </div>
-{/if}
-{if $NOTIFY}
-
- <!-- Notify -->
- <div class="grid_16 alpha omega">
- <div class="notify">{$NOTIFY}</div>
- </div>
-{/if}
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title>{#SiteTitle#}</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <link rel="stylesheet" type="text/css" href="{#StaticContentURL#}/css/960.css" media="screen" />
+ <link rel="stylesheet" href="{#StaticContentURL#}/css/zed/theme.css" />
+
+ <!-- Calls dojo -->
+ <script src="/{#StaticContentURL#}js/dojo/dojo/dojo.js" type="text/javascript"
+ djConfig="isDebug: false, parseOnLoad: true"></script>
+ <link rel="stylesheet" href="{#StaticContentURL#}/css/zed/forms.css" />
+ <script type="text/javascript">
+ dojo.require("dijit.form.Form");
+
+ dojo.require("dijit.form.ValidationTextBox");
+ dojo.require("dijit.form.TextBox");
+ dojo.require("dijit.form.FilteringSelect");
+ dojo.require("dijit.form.Button");
+
+ dojo.require("dojox.validate.regexp");
+ dojo.require("dojox.form.PasswordValidator");
+
+ dojo.require("dojo.parser");
+ </script>
+</head>
+<body class="tundra">
+<!-- Header -->
+<div id="header">
+ <div id="header_content">
+ <div class="container_16">
+ <div class="grid_4 alpha omega suffix_8">
+ <a href="{get_url()}"><img src="{#StaticContentURL#}/img/zed/logo.png" src="Zed logo" border="0" /></a>
+ </div>
+ <div class="clear"></div>
+ </div>
+ </div>
+</div>
+<div class="clear"></div>
+
+<!-- Content -->
+<div class="container_16">
+{if $WAP}
+
+ <!-- WAP -->
+ <div class="grid_16 alpha omega">
+ <div class="wap">{$WAP}</div>
+ </div>
+{/if}
+{if $NOTIFY}
+
+ <!-- Notify -->
+ <div class="grid_16 alpha omega">
+ <div class="notify">{$NOTIFY}</div>
+ </div>
+{/if}
diff --git a/skins/zed/perso_select.tpl b/skins/zed/perso_select.tpl
index aae6c0d..e07d6ba 100644
--- a/skins/zed/perso_select.tpl
+++ b/skins/zed/perso_select.tpl
@@ -1,18 +1,18 @@
-{include file="perso_header.tpl"}
-<div class="grid_16">
- <h2>{#PickPerso#}</h2>
-{foreach from=$PERSOS item=perso}
- <!-- {$perso->name} -->
- <div class="avatar">
- <a href="{get_url()}?action=perso.select&perso_id={$perso->id}">
-{if $perso->avatar}
- <img src="{#StaticContentURL#}/content/users/_avatars/{$perso->avatar}" />
-{else}
- <img src="{#StaticContentURL#}/img/misc/NoAvatar.png" alt="{#NoAvatar#}" />
-{/if}
- </a>
- <span class="avatar_name"><a href="{get_url()}?action=perso.select&perso_id={$perso->id}">{$perso->name}</a></span>
- </div>
-
-{/foreach}
+{include file="perso_header.tpl"}
+<div class="grid_16">
+ <h2>{#PickPerso#}</h2>
+{foreach from=$PERSOS item=perso}
+ <!-- {$perso->name} -->
+ <div class="avatar">
+ <a href="{get_url()}?action=perso.select&perso_id={$perso->id}">
+{if $perso->avatar}
+ <img src="{#StaticContentURL#}/content/users/_avatars/{$perso->avatar}" />
+{else}
+ <img src="{#StaticContentURL#}/img/misc/NoAvatar.png" alt="{#NoAvatar#}" />
+{/if}
+ </a>
+ <span class="avatar_name"><a href="{get_url()}?action=perso.select&perso_id={$perso->id}">{$perso->name}</a></span>
+ </div>
+
+{/foreach}
{include file="perso_footer.tpl"}
\ No newline at end of file
diff --git a/skins/zed/persorequests.tpl b/skins/zed/persorequests.tpl
index e1b894b..b52d26a 100644
--- a/skins/zed/persorequests.tpl
+++ b/skins/zed/persorequests.tpl
@@ -1,89 +1,89 @@
- <!-- Javascript bits for request handling -->
- <script type="text/javascript">
-
- //The amount of requests printed on the page.
- //When it falls to 0, request_reply_callback will print a temporary exit
- //message and then redirects to the homepage.
- var requestsQuantity = {count($requests)};
-
- //Performs an AJAX call
- // id the request DOM element id
- // url the URL to query
- //
- //The reply will be handled by request_reply_callback function.
- function request_reply (id, url) {
- dojo.xhrGet({
- handleAs: "json",
- url: url,
- preventCache: true,
- handle: function (response, ioArgs) {
- request_reply_callback(response, id);
- }
- });
- }
-
- //Prints a wap message
- // message the error message to print
- function wap (message) {
- var html = '<div class="wap">' + message + '</div><div class="clear"></div>';
- document.getElementById('RequestsWap').innerHTML = html;
- }
-
- //Prints a notify message
- // message the warning message to print
- function notify (message) {
- var html = '<div class="notify">' + message + '</div><div class="clear"></div>';
- document.getElementById('RequestsNotify').innerHTML = html;
- }
-
- //This function is called when there isn't requests anymore.
- //It prints a close message, clears the site.requests flag and redirects to
- //Zed homepage.
- function no_more_site_requests () {
- document.getElementById('RequestsBody').style.display = 'none';
- notify("{#CallbackDone#}");
- setTimeout('document.location = "{get_url()}";', 3000);
- dojo.xhrGet({
- url: '{get_request_url(0, 'perso' , 'site.requests', 0)}',
- preventCache: true
- });
- }
-
- //Handles the reply
- // reply ajax reply ; a boolean is expected, so true or false.
- // id the request DOM element id
- //
- //If the reply is true hides request id.
- //If the reply is false outputs a WAP error.
- function request_reply_callback (reply, id) {
- if (reply == true) {
- document.getElementById(id).style.display = 'none';
- requestsQuantity--;
- if (requestsQuantity == 0) {
- no_more_site_requests();
- }
- } else {
- wap("{#CallbackError#}");
- }
- }
- </script>
-
- <!-- Perso requests -->
- <div id="RequestsWap"></div>
- <div id="RequestsNotify"></div>
- <div id="RequestsBody">
- <h1>{#Requests#}</h1>
- <div class="grid_16 alpha omega">
-{foreach from=$requests item=request}
-{$i = {counter}}
- <div id="request{$i}" class="request message {cycle values="dark,light"}">
- <p>{$request->message}</p>
- <ul>
- <li><a onclick="request_reply('request{$i}', '{get_request_allow_url($request)}'); return false;" href="{get_request_allow_url($request)}?redirectTo={get_url()}">{#Allow#}</li>
- <li><a onclick="request_reply('request{$i}', '{get_request_deny_url($request)}'); return false;" href="{get_request_deny_url($request)}?redirectTo={get_url()}">{#Deny#}</a></li>
- </ul>
- </div>
-{/foreach}
- </div>
- <p><a href="{get_request_url(0, 'perso', 'site.requests', 0)}?redirectTo={get_url()}">{#IgnoreAll#}</a></p>
+ <!-- Javascript bits for request handling -->
+ <script type="text/javascript">
+
+ //The amount of requests printed on the page.
+ //When it falls to 0, request_reply_callback will print a temporary exit
+ //message and then redirects to the homepage.
+ var requestsQuantity = {count($requests)};
+
+ //Performs an AJAX call
+ // id the request DOM element id
+ // url the URL to query
+ //
+ //The reply will be handled by request_reply_callback function.
+ function request_reply (id, url) {
+ dojo.xhrGet({
+ handleAs: "json",
+ url: url,
+ preventCache: true,
+ handle: function (response, ioArgs) {
+ request_reply_callback(response, id);
+ }
+ });
+ }
+
+ //Prints a wap message
+ // message the error message to print
+ function wap (message) {
+ var html = '<div class="wap">' + message + '</div><div class="clear"></div>';
+ document.getElementById('RequestsWap').innerHTML = html;
+ }
+
+ //Prints a notify message
+ // message the warning message to print
+ function notify (message) {
+ var html = '<div class="notify">' + message + '</div><div class="clear"></div>';
+ document.getElementById('RequestsNotify').innerHTML = html;
+ }
+
+ //This function is called when there isn't requests anymore.
+ //It prints a close message, clears the site.requests flag and redirects to
+ //Zed homepage.
+ function no_more_site_requests () {
+ document.getElementById('RequestsBody').style.display = 'none';
+ notify("{#CallbackDone#}");
+ setTimeout('document.location = "{get_url()}";', 3000);
+ dojo.xhrGet({
+ url: '{get_request_url(0, 'perso' , 'site.requests', 0)}',
+ preventCache: true
+ });
+ }
+
+ //Handles the reply
+ // reply ajax reply ; a boolean is expected, so true or false.
+ // id the request DOM element id
+ //
+ //If the reply is true hides request id.
+ //If the reply is false outputs a WAP error.
+ function request_reply_callback (reply, id) {
+ if (reply == true) {
+ document.getElementById(id).style.display = 'none';
+ requestsQuantity--;
+ if (requestsQuantity == 0) {
+ no_more_site_requests();
+ }
+ } else {
+ wap("{#CallbackError#}");
+ }
+ }
+ </script>
+
+ <!-- Perso requests -->
+ <div id="RequestsWap"></div>
+ <div id="RequestsNotify"></div>
+ <div id="RequestsBody">
+ <h1>{#Requests#}</h1>
+ <div class="grid_16 alpha omega">
+{foreach from=$requests item=request}
+{$i = {counter}}
+ <div id="request{$i}" class="request message {cycle values="dark,light"}">
+ <p>{$request->message}</p>
+ <ul>
+ <li><a onclick="request_reply('request{$i}', '{get_request_allow_url($request)}'); return false;" href="{get_request_allow_url($request)}?redirectTo={get_url()}">{#Allow#}</li>
+ <li><a onclick="request_reply('request{$i}', '{get_request_deny_url($request)}'); return false;" href="{get_request_deny_url($request)}?redirectTo={get_url()}">{#Deny#}</a></li>
+ </ul>
+ </div>
+{/foreach}
+ </div>
+ <p><a href="{get_request_url(0, 'perso', 'site.requests', 0)}?redirectTo={get_url()}">{#IgnoreAll#}</a></p>
</div>
\ No newline at end of file
diff --git a/skins/zed/profile.tpl b/skins/zed/profile.tpl
index b83a799..2c500ea 100644
--- a/skins/zed/profile.tpl
+++ b/skins/zed/profile.tpl
@@ -1,80 +1,80 @@
- <!-- Profile -->
- <div class="clear">&nbsp;</div>
- <div class="grid_11 alpha">
- <!-- Profile header -->
- <div class="profile_id clearfix">
- <h1 class="profile_nick">{$perso->name}</h1>
- <div class="profile_info">
- {$perso->location}&nbsp;<br />
- {if $perso->is_online()}{#Online#}{/if}
- </div>
- </div>
- <div class="clear">&nbsp;</div>
- <div class="profile">
-{if $PICS}
- <!-- Photos -->
- <div class="profile_photos">
-{foreach from=$PICS item=photo}
- <a rel="lightbox" href="{$URL_PICS}/{$photo->name}" title="{$photo->description}"><img src="{$URL_PICS}/tn/{$photo->name}" alt="{$photo->description}" /></a>
-{/foreach}
- </div>
-{/if}
- <!-- Text -->
- <div class="profile_text{if $PROFILE_FIXEDWIDTH} fixedwidth{/if}">{if $PROFILE_TEXT != ""}{if $PROFILE_FIXEDWIDTH}{$PROFILE_TEXT}{else}{$PROFILE_TEXT|nl2br}{/if}{else}{if $PROFILE_SELF}<a href="{get_url('who')}/edit/profile">{/if}<img src="{#StaticContentURL#}/img/zed/empty_profile.png" width="642" height="392" alt="Be creative ! Fill this space with your best words." />{if $PROFILE_SELF}</a>{/if}{/if}</div>
-
-{$PROFILE_TAGS}
-
- <!-- Leave a message -->
- <div class="profile_separator_light"></div>
- <div class="profile_message">
- <h2 id="Message">{#DropMessage#}</h2>
- <form method="post" action="{get_url('who')}/{$perso->nickname}">
- <div class="grid_4 alpha">
- <input type="radio" name="message_type" value="private_message" checked onclick="document.getElementById('MessageSubmit').value = '{#Send#}';">{sprintf(#SendMessage#, $NAME)}
- </div>
- <div class="grid_6 omega">
- <input type="radio" name="message_type" value="profile_comment" onclick="document.getElementById('MessageSubmit').value = '{#Publish#}';">{sprintf(#AddComment#, $NAME)}
- </div>
- <p><textarea rows="7" cols="64" name="message"></textarea></p>
- <p><input id="MessageSubmit" type="submit" name="MessageSubmit" value="{#Send#}" /></p>
- </form>
- </div>
- </div>
- </div>
-
- <!-- User content -->
- <div class="grid_5 omega">
- <div class="sidebar_border"></div>
- <div id="sidebar">
- <div class="border_top"></div>
- <div class="sidebar_content">
-
-{if $PROFILE_SELF}
- <!-- {{counter name=section}|romanize}. edit profile, account, photos -->
- <h2>{#EditMyPage#}</h2>
- <ul>
- <li><a href="{get_url('who','edit','profile')}">{#EditProfile#}</a></li>
- <li><a href="{get_url('settings','perso')}">{#EditAccount#}</a></li>
- <li><a href="{get_url('who','edit','photos')}">{if $PICS}{#ManagePhotos#}{else}{#AddPhoto#}{/if}</a></li>
- </ul>
-{/if}
- <!-- {{counter name=section}|romanize}. sidebar placeholder/explanation -->
- <h2>Sidebar</h2>
- <p>Here will be published new art submission, request/offers post it, external content imported, etc.</p>
-
- </div>
- <div class="border_bottom"></div>
- </div>
- </div>
-
-{if $PROFILE_COMMENTS}
- <!-- Profile comments -->
- <div class="grid_16 alpha omega profile_comments" id="comments" style="margin-bottom: 1em;">
-{foreach from=$PROFILE_COMMENTS item=comment}
- <div class="comment black">
- <div class="profile_comments_text"><p>{$comment->text|nl2br}</p></div>
- <div class="profile_comments_info">-- <a href="{get_url('who')}/{$comment->author}">{$comment->authorname}</a>, {get_hypership_time($comment->date)}</div>
- </div>
-{/foreach}
- </div>
-{/if}
+ <!-- Profile -->
+ <div class="clear">&nbsp;</div>
+ <div class="grid_11 alpha">
+ <!-- Profile header -->
+ <div class="profile_id clearfix">
+ <h1 class="profile_nick">{$perso->name}</h1>
+ <div class="profile_info">
+ {$perso->location}&nbsp;<br />
+ {if $perso->is_online()}{#Online#}{/if}
+ </div>
+ </div>
+ <div class="clear">&nbsp;</div>
+ <div class="profile">
+{if $PICS}
+ <!-- Photos -->
+ <div class="profile_photos">
+{foreach from=$PICS item=photo}
+ <a rel="lightbox" href="{$URL_PICS}/{$photo->name}" title="{$photo->description}"><img src="{$URL_PICS}/tn/{$photo->name}" alt="{$photo->description}" /></a>
+{/foreach}
+ </div>
+{/if}
+ <!-- Text -->
+ <div class="profile_text{if $PROFILE_FIXEDWIDTH} fixedwidth{/if}">{if $PROFILE_TEXT != ""}{if $PROFILE_FIXEDWIDTH}{$PROFILE_TEXT}{else}{$PROFILE_TEXT|nl2br}{/if}{else}{if $PROFILE_SELF}<a href="{get_url('who')}/edit/profile">{/if}<img src="{#StaticContentURL#}/img/zed/empty_profile.png" width="642" height="392" alt="Be creative ! Fill this space with your best words." />{if $PROFILE_SELF}</a>{/if}{/if}</div>
+
+{$PROFILE_TAGS}
+
+ <!-- Leave a message -->
+ <div class="profile_separator_light"></div>
+ <div class="profile_message">
+ <h2 id="Message">{#DropMessage#}</h2>
+ <form method="post" action="{get_url('who')}/{$perso->nickname}">
+ <div class="grid_4 alpha">
+ <input type="radio" name="message_type" value="private_message" checked onclick="document.getElementById('MessageSubmit').value = '{#Send#}';">{sprintf(#SendMessage#, $NAME)}
+ </div>
+ <div class="grid_6 omega">
+ <input type="radio" name="message_type" value="profile_comment" onclick="document.getElementById('MessageSubmit').value = '{#Publish#}';">{sprintf(#AddComment#, $NAME)}
+ </div>
+ <p><textarea rows="7" cols="64" name="message"></textarea></p>
+ <p><input id="MessageSubmit" type="submit" name="MessageSubmit" value="{#Send#}" /></p>
+ </form>
+ </div>
+ </div>
+ </div>
+
+ <!-- User content -->
+ <div class="grid_5 omega">
+ <div class="sidebar_border"></div>
+ <div id="sidebar">
+ <div class="border_top"></div>
+ <div class="sidebar_content">
+
+{if $PROFILE_SELF}
+ <!-- {{counter name=section}|romanize}. edit profile, account, photos -->
+ <h2>{#EditMyPage#}</h2>
+ <ul>
+ <li><a href="{get_url('who','edit','profile')}">{#EditProfile#}</a></li>
+ <li><a href="{get_url('settings','perso')}">{#EditAccount#}</a></li>
+ <li><a href="{get_url('who','edit','photos')}">{if $PICS}{#ManagePhotos#}{else}{#AddPhoto#}{/if}</a></li>
+ </ul>
+{/if}
+ <!-- {{counter name=section}|romanize}. sidebar placeholder/explanation -->
+ <h2>Sidebar</h2>
+ <p>Here will be published new art submission, request/offers post it, external content imported, etc.</p>
+
+ </div>
+ <div class="border_bottom"></div>
+ </div>
+ </div>
+
+{if $PROFILE_COMMENTS}
+ <!-- Profile comments -->
+ <div class="grid_16 alpha omega profile_comments" id="comments" style="margin-bottom: 1em;">
+{foreach from=$PROFILE_COMMENTS item=comment}
+ <div class="comment black">
+ <div class="profile_comments_text"><p>{$comment->text|nl2br}</p></div>
+ <div class="profile_comments_info">-- <a href="{get_url('who')}/{$comment->author}">{$comment->authorname}</a>, {get_hypership_time($comment->date)}</div>
+ </div>
+{/foreach}
+ </div>
+{/if}
diff --git a/skins/zed/profile_edit.tpl b/skins/zed/profile_edit.tpl
index 57e97fe..8c49243 100644
--- a/skins/zed/profile_edit.tpl
+++ b/skins/zed/profile_edit.tpl
@@ -1,59 +1,59 @@
- <!-- Calls dojo -->
- <script src="/js/dojo/dojo/dojo.js" type="text/javascript"
- djConfig="isDebug: false, parseOnLoad: true"></script>
- <script type="text/javascript">
- dojo.require("dijit.form.Form");
- dojo.require("dijit.form.CheckBox");
- dojo.require("dijit.form.Button");
-
- function SetWidgetFont(id, font) {
- //TODO: document.getElementById(id).style.font = font;
- }
- </script>
-
- <!-- Edit profile -->
- <div class="grid_11 alpha profile">
- <div class="profile_id clearfix">
- <h1 class="profile_nick" id="UserLongname">{$USERNAME}</h1>
- </div>
- <div class="profile_separator"></div>
- <div class="profile_text">
- <form action="" method="post">
- <input type="hidden" name="EditProfile" value="1" />
- <h2>{#ProfileTextTitle#}</h2>
- <textarea style="font-family: Calibri" id="ProfileText" rows="16" cols="72" name="text" class="text">{$PROFILE_TEXT}</textarea><br />
- <div class="row" style="background-color: white; color: black;">
- <span>{#ProfileFont#}{#_t#}</span>
- <input type="radio" name="fixedwidth" id="fixedwidthNo" value="0" dojoType="dijit.form.RadioButton" {if !$PROFILE_FIXEDWIDTH}checked{/if} onclick="SetWidgetFont('ProfileText', 'Calibri')" />
- <label for="fixedwidthNo"><span style="font-family: Calibri, Arial; font-weight: 100; font-size: 1.25em; color: black;">{#Calibri#}</span></label>
- <input type="radio" name="fixedwidth" id="fixedwidthYes" value="1" dojoType="dijit.form.RadioButton" {if $PROFILE_FIXEDWIDTH}checked={/if} onclick="SetWidgetFont('ProfileText', 'FixedSys')" />
- <label for="fixedwidthYes"><span style='font-family: "Fixedsys Excelsior 3.01", Fixedsys, Fixed; font-weight: 100; color: black;'>{#FixedSys#}</span></label>
- </div>
- <div class="row">
- <button dojoType="dijit.form.Button" iconClass="dijitEditorIcon dijitEditorIconSave" type=submit onclick="document.forms[0].submit()">
- {#SaveProfile#}
- </button>
- <noscript>
- <input type="submit" value="{#SaveProfile#} {#JavaScriptSafeMessage#}" />
- </noscript>
- </div>
- </form>
- </div>
- </div>
-
- <!-- Faerie content -->
- <div class="grid_5 omega">
- <div class="sidebar_border"></div>
- <div id="sidebar">
- <div class="border_top"></div>
- <div class="sidebar_content">
- <h2>{#EditMyPage#}</h2>
- <ul>
- <li>{#EditProfile#}</li>
- <li><a href="{get_url('settings','perso')}">{#EditAccount#}</a></li>
- <li><a href="{get_url('who')}/edit/photos">{if $PICS}{#ManagePhotos#}{else}{#AddPhoto#}{/if}</a></li>
- </ul>
- </div>
- <div class="border_bottom"></div>
- </div>
+ <!-- Calls dojo -->
+ <script src="/js/dojo/dojo/dojo.js" type="text/javascript"
+ djConfig="isDebug: false, parseOnLoad: true"></script>
+ <script type="text/javascript">
+ dojo.require("dijit.form.Form");
+ dojo.require("dijit.form.CheckBox");
+ dojo.require("dijit.form.Button");
+
+ function SetWidgetFont(id, font) {
+ //TODO: document.getElementById(id).style.font = font;
+ }
+ </script>
+
+ <!-- Edit profile -->
+ <div class="grid_11 alpha profile">
+ <div class="profile_id clearfix">
+ <h1 class="profile_nick" id="UserLongname">{$USERNAME}</h1>
+ </div>
+ <div class="profile_separator"></div>
+ <div class="profile_text">
+ <form action="" method="post">
+ <input type="hidden" name="EditProfile" value="1" />
+ <h2>{#ProfileTextTitle#}</h2>
+ <textarea style="font-family: Calibri" id="ProfileText" rows="16" cols="72" name="text" class="text">{$PROFILE_TEXT}</textarea><br />
+ <div class="row" style="background-color: white; color: black;">
+ <span>{#ProfileFont#}{#_t#}</span>
+ <input type="radio" name="fixedwidth" id="fixedwidthNo" value="0" dojoType="dijit.form.RadioButton" {if !$PROFILE_FIXEDWIDTH}checked{/if} onclick="SetWidgetFont('ProfileText', 'Calibri')" />
+ <label for="fixedwidthNo"><span style="font-family: Calibri, Arial; font-weight: 100; font-size: 1.25em; color: black;">{#Calibri#}</span></label>
+ <input type="radio" name="fixedwidth" id="fixedwidthYes" value="1" dojoType="dijit.form.RadioButton" {if $PROFILE_FIXEDWIDTH}checked={/if} onclick="SetWidgetFont('ProfileText', 'FixedSys')" />
+ <label for="fixedwidthYes"><span style='font-family: "Fixedsys Excelsior 3.01", Fixedsys, Fixed; font-weight: 100; color: black;'>{#FixedSys#}</span></label>
+ </div>
+ <div class="row">
+ <button dojoType="dijit.form.Button" iconClass="dijitEditorIcon dijitEditorIconSave" type=submit onclick="document.forms[0].submit()">
+ {#SaveProfile#}
+ </button>
+ <noscript>
+ <input type="submit" value="{#SaveProfile#} {#JavaScriptSafeMessage#}" />
+ </noscript>
+ </div>
+ </form>
+ </div>
+ </div>
+
+ <!-- Faerie content -->
+ <div class="grid_5 omega">
+ <div class="sidebar_border"></div>
+ <div id="sidebar">
+ <div class="border_top"></div>
+ <div class="sidebar_content">
+ <h2>{#EditMyPage#}</h2>
+ <ul>
+ <li>{#EditProfile#}</li>
+ <li><a href="{get_url('settings','perso')}">{#EditAccount#}</a></li>
+ <li><a href="{get_url('who')}/edit/photos">{if $PICS}{#ManagePhotos#}{else}{#AddPhoto#}{/if}</a></li>
+ </ul>
+ </div>
+ <div class="border_bottom"></div>
+ </div>
</div>
\ No newline at end of file
diff --git a/skins/zed/profile_photo.tpl b/skins/zed/profile_photo.tpl
index c109e01..e39f09d 100644
--- a/skins/zed/profile_photo.tpl
+++ b/skins/zed/profile_photo.tpl
@@ -1,50 +1,50 @@
- <!-- Add a photo -->
- <div class="grid_11 alpha profile">
- <div class="profile_id clearfix">
- <h1 class="profile_nick" id="UserLongname">{$USERNAME}</h1>
- </div>
- <div class="profile_separator"></div>
- <div class="profile_text">
- <h2>{#AddPhotoToProfile#}</h2>
- <form name="PhotoUpload" method="post" enctype="multipart/form-data">
- <p>{#AddPhotoExplanations#}</p>
- <p><label>Photo{#_t#}</label> <input type="file" name="photo" /></p>
- <p><label>{#ShortDescription#}{#_t#}</label> <input type="text" maxlength="63" size="32" name="description" /></p>
- <p><input type="checkbox" name="SafeForWork" id="SafeForWork" value="0" /> <label for="SafeForWork">{#SafeForWorkLabel#}</label></p>
- <p><input type="submit" value="{#Upload#}" /></p>
- </form>
- </div>
- </div>
-
- <div class="grid_5 omega">
- <div class="sidebar_border"></div>
- <div id="sidebar" style="min-height: inherit;">
- <div class="border_top"></div>
- <div class="sidebar_content">
- <h2>{#EditMyPage#}</h2>
- <ul>
- <li><a href="{get_url('who')}/edit/profile">{#EditProfile#}</a></li>
- <li><a href="{get_url('settings','perso')}">{#EditAccount#}</a></li>
- <li>{if $PICS}{#ManagePhotos#}{else}{#AddPhoto#}{/if}</li>
- </ul>
- </div>
- <div class="border_bottom"></div>
- </div>
- </div>
-
-{if $PICS}
-<!-- Manage current photos -->
-<div class="grid_16 alpha omega profile_comments">
- <h2>{#ManageCurrentPhotos#}</h2>
- <div class="photos">
-{foreach from=$PICS item=photo}
- <div class="photo" style="float: left">
- <a rel="lightbox" href="{$URL_PICS}/{$photo->name}" title="{$photo->description}"><img src="{$URL_PICS}/tn/{$photo->name}" alt="{$photo->description}" /></a>
- <br />
- <a href="{get_url('who')}/edit/photos/edit/{$photo->id}" title="{#EditPictureProperties#}"><img src="/skins/VacuumCleanerBridge/images/open.gif" alt="{#PictureProperties#}"></a>
- <a href="{get_url('who')}/edit/photos/delete/{$photo->id}" title="{#DeleteThisPicture#}"><img src="/skins/VacuumCleanerBridge/images/del.gif" alt="{#Delete#}"></a>
- </div>
-{/foreach}
- </div>
-{/if}
+ <!-- Add a photo -->
+ <div class="grid_11 alpha profile">
+ <div class="profile_id clearfix">
+ <h1 class="profile_nick" id="UserLongname">{$USERNAME}</h1>
+ </div>
+ <div class="profile_separator"></div>
+ <div class="profile_text">
+ <h2>{#AddPhotoToProfile#}</h2>
+ <form name="PhotoUpload" method="post" enctype="multipart/form-data">
+ <p>{#AddPhotoExplanations#}</p>
+ <p><label>Photo{#_t#}</label> <input type="file" name="photo" /></p>
+ <p><label>{#ShortDescription#}{#_t#}</label> <input type="text" maxlength="63" size="32" name="description" /></p>
+ <p><input type="checkbox" name="SafeForWork" id="SafeForWork" value="0" /> <label for="SafeForWork">{#SafeForWorkLabel#}</label></p>
+ <p><input type="submit" value="{#Upload#}" /></p>
+ </form>
+ </div>
+ </div>
+
+ <div class="grid_5 omega">
+ <div class="sidebar_border"></div>
+ <div id="sidebar" style="min-height: inherit;">
+ <div class="border_top"></div>
+ <div class="sidebar_content">
+ <h2>{#EditMyPage#}</h2>
+ <ul>
+ <li><a href="{get_url('who')}/edit/profile">{#EditProfile#}</a></li>
+ <li><a href="{get_url('settings','perso')}">{#EditAccount#}</a></li>
+ <li>{if $PICS}{#ManagePhotos#}{else}{#AddPhoto#}{/if}</li>
+ </ul>
+ </div>
+ <div class="border_bottom"></div>
+ </div>
+ </div>
+
+{if $PICS}
+<!-- Manage current photos -->
+<div class="grid_16 alpha omega profile_comments">
+ <h2>{#ManageCurrentPhotos#}</h2>
+ <div class="photos">
+{foreach from=$PICS item=photo}
+ <div class="photo" style="float: left">
+ <a rel="lightbox" href="{$URL_PICS}/{$photo->name}" title="{$photo->description}"><img src="{$URL_PICS}/tn/{$photo->name}" alt="{$photo->description}" /></a>
+ <br />
+ <a href="{get_url('who')}/edit/photos/edit/{$photo->id}" title="{#EditPictureProperties#}"><img src="/skins/VacuumCleanerBridge/images/open.gif" alt="{#PictureProperties#}"></a>
+ <a href="{get_url('who')}/edit/photos/delete/{$photo->id}" title="{#DeleteThisPicture#}"><img src="/skins/VacuumCleanerBridge/images/del.gif" alt="{#Delete#}"></a>
+ </div>
+{/foreach}
+ </div>
+{/if}
</div>
\ No newline at end of file
diff --git a/skins/zed/profile_photo_edit.tpl b/skins/zed/profile_photo_edit.tpl
index 745ca1b..9a02a51 100644
--- a/skins/zed/profile_photo_edit.tpl
+++ b/skins/zed/profile_photo_edit.tpl
@@ -1,36 +1,36 @@
- <div class="grid_11 alpha">
- <h1>{#EditPhoto#}</h1>
- <a rel="lightbox" href="{$URL_PICS}/{$photo->name}" title="{$photo->description}"><img src="{$URL_PICS}/tn/{$photo->name}" alt="{$photo->description}" /></a>
- <h2>{#PhotoInfo#}</h2>
- <form method=post><input type="hidden" name="id" value="{$photo->id}" />
- <blockquote>
- <table>
- <tr><td><strong><label for="description">{#Description#}</label></strong></td><td><input type='text' id='description' name='description' maxlength=63 value="{$photo->description}" /></td></tr>
- <tr><td><strong><label for="safe">{#SafeForWork#}</label></strong></td><td><input type='checkbox' id='safe' name='safe' maxlength=3 size=5 value=1{if $photo->safe} checked{/if} /></td></tr>
- <tr><td><strong><label for="avatar">{#UseAsAvatar#}</label></strong></td><td><input type='checkbox' id='avatar' name='avatar' maxlength=3 size=5 value=1{if $photo->avatar} checked{/if} /></td></tr>
- <tr><td>&nbsp;</td><td><input type="submit" value="{#Save#}" /></td></tr>
- </table>
- </blockquote>
- </form>
- <h2>{#OtherActions#}</h2>
- <ul>
- <li><a href="{get_url('who')}/edit/photos/delete/{$photo->id}" title="{#DeletePicture#}">{#DeletePicture#}</a></li>
- <li><a href="{get_url('who')}/edit/photos">{#BackToPhotoManager#}</a></li>
- </ul>
- </div>
-
- <div class="grid_5 omega">
- <div class="sidebar_border"></div>
- <div id="sidebar" style="min-height: inherit;">
- <div class="border_top"></div>
- <div class="sidebar_content">
- <h2>{#EditMyPage#}</h2>
- <ul>
- <li><a href="{get_url('who')}/edit/profile">{#EditProfile#}</a></li>
- <li><a href="{get_url('settings','perso')}">{#EditAccount#}</a></li>
- <li>{if $PICS}{#ManagePhotos#}{else}{#AddPhoto#}{/if}</a></li>
- </ul>
- </div>
- <div class="border_bottom"></div>
- </div>
+ <div class="grid_11 alpha">
+ <h1>{#EditPhoto#}</h1>
+ <a rel="lightbox" href="{$URL_PICS}/{$photo->name}" title="{$photo->description}"><img src="{$URL_PICS}/tn/{$photo->name}" alt="{$photo->description}" /></a>
+ <h2>{#PhotoInfo#}</h2>
+ <form method=post><input type="hidden" name="id" value="{$photo->id}" />
+ <blockquote>
+ <table>
+ <tr><td><strong><label for="description">{#Description#}</label></strong></td><td><input type='text' id='description' name='description' maxlength=63 value="{$photo->description}" /></td></tr>
+ <tr><td><strong><label for="safe">{#SafeForWork#}</label></strong></td><td><input type='checkbox' id='safe' name='safe' maxlength=3 size=5 value=1{if $photo->safe} checked{/if} /></td></tr>
+ <tr><td><strong><label for="avatar">{#UseAsAvatar#}</label></strong></td><td><input type='checkbox' id='avatar' name='avatar' maxlength=3 size=5 value=1{if $photo->avatar} checked{/if} /></td></tr>
+ <tr><td>&nbsp;</td><td><input type="submit" value="{#Save#}" /></td></tr>
+ </table>
+ </blockquote>
+ </form>
+ <h2>{#OtherActions#}</h2>
+ <ul>
+ <li><a href="{get_url('who')}/edit/photos/delete/{$photo->id}" title="{#DeletePicture#}">{#DeletePicture#}</a></li>
+ <li><a href="{get_url('who')}/edit/photos">{#BackToPhotoManager#}</a></li>
+ </ul>
+ </div>
+
+ <div class="grid_5 omega">
+ <div class="sidebar_border"></div>
+ <div id="sidebar" style="min-height: inherit;">
+ <div class="border_top"></div>
+ <div class="sidebar_content">
+ <h2>{#EditMyPage#}</h2>
+ <ul>
+ <li><a href="{get_url('who')}/edit/profile">{#EditProfile#}</a></li>
+ <li><a href="{get_url('settings','perso')}">{#EditAccount#}</a></li>
+ <li>{if $PICS}{#ManagePhotos#}{else}{#AddPhoto#}{/if}</a></li>
+ </ul>
+ </div>
+ <div class="border_bottom"></div>
+ </div>
</div>
\ No newline at end of file
diff --git a/skins/zed/raw.tpl b/skins/zed/raw.tpl
index dcaebd0..71ff47a 100644
--- a/skins/zed/raw.tpl
+++ b/skins/zed/raw.tpl
@@ -1,8 +1,8 @@
-<div class="content_wrapper">
-{if $PAGE_TITLE}
- <h1>{$PAGE_TITLE}</h1>
-{/if}
- <div class="content">
-{$CONTENT}
- </div>
-</div>
+<div class="content_wrapper">
+{if $PAGE_TITLE}
+ <h1>{$PAGE_TITLE}</h1>
+{/if}
+ <div class="content">
+{$CONTENT}
+ </div>
+</div>
diff --git a/skins/zed/requests/aid.reach.tpl b/skins/zed/requests/aid.reach.tpl
index ed590fc..8de64c3 100644
--- a/skins/zed/requests/aid.reach.tpl
+++ b/skins/zed/requests/aid.reach.tpl
@@ -1,24 +1,24 @@
- <!-- DIJIT -->
- <script type="text/javascript">
- dojo.require("dijit.form.Form");
- dojo.require("dijit.form.ValidationTextBox");
- dojo.require("dijit.form.Button");
- </script>
-
- <!-- Request form: aid.reach -->
- <h1>{#Communicator#}</h1>
- <h2>{#SendRequestToHyperShip#}</h2>
- <form dojoType="dijit.form.Form" name="aid.reach" method="post">
- <div class="row">
- <label class="firstLabel" for="PostTitle">{#Title#}</label>
- <input dojoType="dijit.form.ValidationTextBox" value="{$request->title}" type="text" id="PostTitle" name="title" class="long" required="true" />
- </div>
- <div class="row">
- <label class="firstLabel" for="PostMessage">{#Message#}</label>
- <textarea id="PostMessage" name="message" cols="80" rows="8"></textarea>
- </div>
- <div class="row">
- <button dojoType="dijit.form.Button" iconClass="dijitEditorIcon dijitEditorIconSave" type="submit" value="Save" />{#Send#}</button>
- </div>
- <p><strong>{#Warning#}</strong> {#RequestHandledByHumans#}</p>
+ <!-- DIJIT -->
+ <script type="text/javascript">
+ dojo.require("dijit.form.Form");
+ dojo.require("dijit.form.ValidationTextBox");
+ dojo.require("dijit.form.Button");
+ </script>
+
+ <!-- Request form: aid.reach -->
+ <h1>{#Communicator#}</h1>
+ <h2>{#SendRequestToHyperShip#}</h2>
+ <form dojoType="dijit.form.Form" name="aid.reach" method="post">
+ <div class="row">
+ <label class="firstLabel" for="PostTitle">{#Title#}</label>
+ <input dojoType="dijit.form.ValidationTextBox" value="{$request->title}" type="text" id="PostTitle" name="title" class="long" required="true" />
+ </div>
+ <div class="row">
+ <label class="firstLabel" for="PostMessage">{#Message#}</label>
+ <textarea id="PostMessage" name="message" cols="80" rows="8"></textarea>
+ </div>
+ <div class="row">
+ <button dojoType="dijit.form.Button" iconClass="dijitEditorIcon dijitEditorIconSave" type="submit" value="Save" />{#Send#}</button>
+ </div>
+ <p><strong>{#Warning#}</strong> {#RequestHandledByHumans#}</p>
</form>
\ No newline at end of file
diff --git a/skins/zed/requests/confirm.tpl b/skins/zed/requests/confirm.tpl
index 9749061..aa5992b 100644
--- a/skins/zed/requests/confirm.tpl
+++ b/skins/zed/requests/confirm.tpl
@@ -1,6 +1,6 @@
-<div class="content_wrapper">
- <h1>{#Communicator#}</h1>
- <div class="content">
- <p>{#RequestSent#}</p>
- </div>
+<div class="content_wrapper">
+ <h1>{#Communicator#}</h1>
+ <div class="content">
+ <p>{#RequestSent#}</p>
+ </div>
</div>
\ No newline at end of file
diff --git a/skins/zed/settings_page.tpl b/skins/zed/settings_page.tpl
index f8e1b0a..b4bcb5c 100644
--- a/skins/zed/settings_page.tpl
+++ b/skins/zed/settings_page.tpl
@@ -1,67 +1,67 @@
- <!-- DIJIT -->
- <script type="text/javascript">
- dojo.require("dijit.form.Form");
- dojo.require("dijit.form.TextBox");
- dojo.require("dijit.form.ValidationTextBox");
- dojo.require("dijit.form.Button");
- dojo.require("dijit.form.FilteringSelect");
- dojo.require("dijit.form.CheckBox");
-
- dojo.require("dojox.form.PasswordValidator");
- </script>
-
- <!-- Settings - #{$page->id} -->
- <div class="grid_12 alpha">
- <h2>{#$page->title#}</h2>
- <form method="post">
- <input type="hidden" name="settings.page" value="{$page->id}" />
-{foreach from=$page->settings item=setting}
- <div class="row">
-{if $setting->field == "validationtext"}
- <label for="{$setting->key}" class="firstLabel ">{#$setting->key#}</label>
- <input dojoType="dijit.form.ValidationTextBox" regExp="{$setting->regExp}" id="{$setting->key}" name="{$setting->key}" type="text" value="{$setting->get()}" class="long" />
-{elseif $setting->field == "text"}
- <label for="{$setting->key}" class="firstLabel ">{#$setting->key#}</label>
- <input dojoType="dijit.form.TextBox" id="{$setting->key}" name="{$setting->key}" type="text" value="{$setting->get()}" class="long" />
-{elseif $setting->field == "password"}
- <div dojoType="dojox.form.PasswordValidator" name="{$setting->key}">
- <label for="{$setting->key}" class="firstLabel ">{#$setting->key#}</label>
- <input type="password" pwType="new" id="{$setting->key}" name="{$setting->key}" value="{$setting->get()}" class="long" />
- <br />
- <label for="{$setting->key}_confirm" class="firstLabel">{#$setting->key#} {#PasswordConfirm#}</label>
- <input type="password" pwType="verify" id="{$setting->key}_confirm" name="{$setting->key}_confirm" value="{$setting->get()}" class="long" />
- </div>
-{elseif $setting->field == "filteredlist"}
- <label for="{$setting->key}" class="firstLabel ">{#$setting->key#}</label>
- <select id="{$setting->key}" name="{$setting->key}" dojoType="dijit.form.FilteringSelect" class="long">
-{foreach from=$setting->choices item=value key=key}
- <option value="{$value}">{#$key#}</option>
-{/foreach}
- </select>
-{elseif $setting->field == "checkbox"}
- <input type="checkbox" dojoType="dijit.form.CheckBox" id="{$setting->key}" name="{$setting->key}" value="1" {if $setting->get()}checked="true" {/if}/> <label for="{$setting->key}">{#$setting->key#}</label>
-{else}{dprint_r($setting)}
-{/if}
- </div>
-{/foreach}
- <div class="row">
- <button dojoType="dijit.form.Button" iconClass="dijitEditorIcon dijitEditorIconSave" type="submit" value="Save" />{#SaveSettings#}</button>
- </div>
- </form>
- </div>
-
- <div class="grid_4 omega">
- <h2>Settings</h2>
- <ul style="list-style-type: cjk-ideographic; line-height: 2em;">
-{foreach from=$pages item=value key=key}
-{if $key == $page->id}
- <li>{$value}</li>
-{else}
- <li><a href="{get_url('settings', $key)}">{$value}</a></li>
-{/if}
-{/foreach}
- <li><a href="{get_url('who', 'edit', 'profile')}">{#EditProfile#}</a></li>
- </ul>
- </div>
-
+ <!-- DIJIT -->
+ <script type="text/javascript">
+ dojo.require("dijit.form.Form");
+ dojo.require("dijit.form.TextBox");
+ dojo.require("dijit.form.ValidationTextBox");
+ dojo.require("dijit.form.Button");
+ dojo.require("dijit.form.FilteringSelect");
+ dojo.require("dijit.form.CheckBox");
+
+ dojo.require("dojox.form.PasswordValidator");
+ </script>
+
+ <!-- Settings - #{$page->id} -->
+ <div class="grid_12 alpha">
+ <h2>{#$page->title#}</h2>
+ <form method="post">
+ <input type="hidden" name="settings.page" value="{$page->id}" />
+{foreach from=$page->settings item=setting}
+ <div class="row">
+{if $setting->field == "validationtext"}
+ <label for="{$setting->key}" class="firstLabel ">{#$setting->key#}</label>
+ <input dojoType="dijit.form.ValidationTextBox" regExp="{$setting->regExp}" id="{$setting->key}" name="{$setting->key}" type="text" value="{$setting->get()}" class="long" />
+{elseif $setting->field == "text"}
+ <label for="{$setting->key}" class="firstLabel ">{#$setting->key#}</label>
+ <input dojoType="dijit.form.TextBox" id="{$setting->key}" name="{$setting->key}" type="text" value="{$setting->get()}" class="long" />
+{elseif $setting->field == "password"}
+ <div dojoType="dojox.form.PasswordValidator" name="{$setting->key}">
+ <label for="{$setting->key}" class="firstLabel ">{#$setting->key#}</label>
+ <input type="password" pwType="new" id="{$setting->key}" name="{$setting->key}" value="{$setting->get()}" class="long" />
+ <br />
+ <label for="{$setting->key}_confirm" class="firstLabel">{#$setting->key#} {#PasswordConfirm#}</label>
+ <input type="password" pwType="verify" id="{$setting->key}_confirm" name="{$setting->key}_confirm" value="{$setting->get()}" class="long" />
+ </div>
+{elseif $setting->field == "filteredlist"}
+ <label for="{$setting->key}" class="firstLabel ">{#$setting->key#}</label>
+ <select id="{$setting->key}" name="{$setting->key}" dojoType="dijit.form.FilteringSelect" class="long">
+{foreach from=$setting->choices item=value key=key}
+ <option value="{$value}">{#$key#}</option>
+{/foreach}
+ </select>
+{elseif $setting->field == "checkbox"}
+ <input type="checkbox" dojoType="dijit.form.CheckBox" id="{$setting->key}" name="{$setting->key}" value="1" {if $setting->get()}checked="true" {/if}/> <label for="{$setting->key}">{#$setting->key#}</label>
+{else}{dprint_r($setting)}
+{/if}
+ </div>
+{/foreach}
+ <div class="row">
+ <button dojoType="dijit.form.Button" iconClass="dijitEditorIcon dijitEditorIconSave" type="submit" value="Save" />{#SaveSettings#}</button>
+ </div>
+ </form>
+ </div>
+
+ <div class="grid_4 omega">
+ <h2>Settings</h2>
+ <ul style="list-style-type: cjk-ideographic; line-height: 2em;">
+{foreach from=$pages item=value key=key}
+{if $key == $page->id}
+ <li>{$value}</li>
+{else}
+ <li><a href="{get_url('settings', $key)}">{$value}</a></li>
+{/if}
+{/foreach}
+ <li><a href="{get_url('who', 'edit', 'profile')}">{#EditProfile#}</a></li>
+ </ul>
+ </div>
+
<div class="clear"></div>
\ No newline at end of file
diff --git a/skins/zed/ship.tpl b/skins/zed/ship.tpl
index 4f2e460..3aaaab1 100644
--- a/skins/zed/ship.tpl
+++ b/skins/zed/ship.tpl
@@ -1,30 +1,30 @@
- <!-- Ship CSS -->
- <style>
- .content textarea {
- background-color: inherit;
- color: white;
- border: dashed #343434 2px;
- width: 100%;
- background-image: url("/img/zed/opaque_20.png");
- }
- </style>
-
- <!-- Ship content -->
- <div class="content_wrapper">
- <h1>{$ship->name}</h1>
- <div class="content">
- <p>Lorem ipsum dolor</p>
- <h2>{#PersonalNotes#}</h2>
- <form method="POST">
- <input type="hidden" name="action" value="ship.setnote">
- <textarea id="ShipNote" name="note" rows="8" onfocus="set_opacity(this.id, 20)" onBlur="set_opacity(this.id, 0)">{$note}</textarea>
- <br />
- <input type="submit" value="{#SaveNote#}" />
- </form>
- </div>
- </div>
-
- <script>
- //Sets the focus on note textarea
- document.getElementById('ShipNote').focus();
+ <!-- Ship CSS -->
+ <style>
+ .content textarea {
+ background-color: inherit;
+ color: white;
+ border: dashed #343434 2px;
+ width: 100%;
+ background-image: url("/img/zed/opaque_20.png");
+ }
+ </style>
+
+ <!-- Ship content -->
+ <div class="content_wrapper">
+ <h1>{$ship->name}</h1>
+ <div class="content">
+ <p>Lorem ipsum dolor</p>
+ <h2>{#PersonalNotes#}</h2>
+ <form method="POST">
+ <input type="hidden" name="action" value="ship.setnote">
+ <textarea id="ShipNote" name="note" rows="8" onfocus="set_opacity(this.id, 20)" onBlur="set_opacity(this.id, 0)">{$note}</textarea>
+ <br />
+ <input type="submit" value="{#SaveNote#}" />
+ </form>
+ </div>
+ </div>
+
+ <script>
+ //Sets the focus on note textarea
+ document.getElementById('ShipNote').focus();
</script>
\ No newline at end of file
diff --git a/skins/zed/smartline.tpl b/skins/zed/smartline.tpl
index 3736346..b41fb94 100644
--- a/skins/zed/smartline.tpl
+++ b/skins/zed/smartline.tpl
@@ -1,26 +1,26 @@
-
- <!-- SmartLine -->
- <div class="grid_16 alpha omega" id="SmartLine">
- <form name="SmartLine" method="{if $SmartLineFormMethod}{$SmartLineFormMethod}{else}post{/if}" action="{get_current_url()}">
-{if $SmartLineHistory}
- <!-- SmartLine history -->
- <div class="grid_4 left alpha">
- <select id="SmartLineHistory" class="black" onchange="UpdateSmartLine()">
- <option value="">[ {#SmartLineHistory#} ]</option>
-{foreach from=$SmartLineHistory item=command}
- <option value="{$command.text|escape}">{$command.time} | {$command.text|escape}</option>
-{/foreach}
- </select>
- </div>
- <!-- SmartLine line -->
- <div class="grid_12 right omega">
-{else}
- <!-- SmartLine line -->
- <div class="grid_16 alpha omega left" style="width: 100.2%">
-{/if}
- <input name="C" type="text" id="SmartLineBar" maxlength="255" class="black" style="text-align: left;" />
- </div>
- </form>
- </div>
-
- <div class="clear"></div>
+
+ <!-- SmartLine -->
+ <div class="grid_16 alpha omega" id="SmartLine">
+ <form name="SmartLine" method="{if $SmartLineFormMethod}{$SmartLineFormMethod}{else}post{/if}" action="{get_current_url()}">
+{if $SmartLineHistory}
+ <!-- SmartLine history -->
+ <div class="grid_4 left alpha">
+ <select id="SmartLineHistory" class="black" onchange="UpdateSmartLine()">
+ <option value="">[ {#SmartLineHistory#} ]</option>
+{foreach from=$SmartLineHistory item=command}
+ <option value="{$command.text|escape}">{$command.time} | {$command.text|escape}</option>
+{/foreach}
+ </select>
+ </div>
+ <!-- SmartLine line -->
+ <div class="grid_12 right omega">
+{else}
+ <!-- SmartLine line -->
+ <div class="grid_16 alpha omega left" style="width: 100.2%">
+{/if}
+ <input name="C" type="text" id="SmartLineBar" maxlength="255" class="black" style="text-align: left;" />
+ </div>
+ </form>
+ </div>
+
+ <div class="clear"></div>
diff --git a/skins/zed/smartline_results.tpl b/skins/zed/smartline_results.tpl
index 6274af5..d230e2e 100644
--- a/skins/zed/smartline_results.tpl
+++ b/skins/zed/smartline_results.tpl
@@ -1,14 +1,14 @@
- <!-- SmartLine output -->
- <div id="SmartLineResults" class="black">
-{if $SmartLine_STDOUT}
- <p>{$SmartLine_STDOUT}</p>
-{/if}
-{if $SmartLine_STDERR}
- <p class="error">{$SmartLine_STDERR}</p>
-{/if}
-
- </div>
-
- <p class="clear"></p>
-
+ <!-- SmartLine output -->
+ <div id="SmartLineResults" class="black">
+{if $SmartLine_STDOUT}
+ <p>{$SmartLine_STDOUT}</p>
+{/if}
+{if $SmartLine_STDERR}
+ <p class="error">{$SmartLine_STDERR}</p>
+{/if}
+
+ </div>
+
+ <p class="clear"></p>
+
\ No newline at end of file
diff --git a/skins/zed/story.tpl b/skins/zed/story.tpl
index f7b0b44..b5a5cab 100644
--- a/skins/zed/story.tpl
+++ b/skins/zed/story.tpl
@@ -1,30 +1,30 @@
-{$description = $section->description|trim}
-{foreach from=$section->hooks item=hook}
-{$hook->update_description($description)}
-{/foreach}
- <!-- Story -->
- <div class="content_wrapper">
- <h1>{$PAGE_TITLE}</h1>
- <div class="content">
- <h2>{$section->title}</h2>
- <p>{$description|text2html}</p>
- <ul>
-{if $section->choices}
-{foreach from=$section->choices item=choice}
- <li><a href="{get_url('explore', $choice->guid)}">{$choice->text}</a></li>{/foreach}{/if}
-{$links = array()}
-{foreach from=$section->hooks item=hook}
-{$hook->get_choices_links($links)}
-{/foreach}
-{foreach from=$links item=link}
- <li><a href="{$link[1]}">{$link[0]}</a></li>{/foreach}
- </ul>
-{foreach from=$section->hooks item=hook}
-{$hook->add_content()}
-{/foreach}
- </div>
- </div>
-
-{foreach from=$section->hooks item=hook}
-{$hook->add_html()}
+{$description = $section->description|trim}
+{foreach from=$section->hooks item=hook}
+{$hook->update_description($description)}
+{/foreach}
+ <!-- Story -->
+ <div class="content_wrapper">
+ <h1>{$PAGE_TITLE}</h1>
+ <div class="content">
+ <h2>{$section->title}</h2>
+ <p>{$description|text2html}</p>
+ <ul>
+{if $section->choices}
+{foreach from=$section->choices item=choice}
+ <li><a href="{get_url('explore', $choice->guid)}">{$choice->text}</a></li>{/foreach}{/if}
+{$links = array()}
+{foreach from=$section->hooks item=hook}
+{$hook->get_choices_links($links)}
+{/foreach}
+{foreach from=$links item=link}
+ <li><a href="{$link[1]}">{$link[0]}</a></li>{/foreach}
+ </ul>
+{foreach from=$section->hooks item=hook}
+{$hook->add_content()}
+{/foreach}
+ </div>
+ </div>
+
+{foreach from=$section->hooks item=hook}
+{$hook->add_html()}
{/foreach}
\ No newline at end of file
diff --git a/skins/zed/tutorial/dojo.tpl b/skins/zed/tutorial/dojo.tpl
index 35932d5..52d884a 100644
--- a/skins/zed/tutorial/dojo.tpl
+++ b/skins/zed/tutorial/dojo.tpl
@@ -1,4 +1,4 @@
-
-
- <!-- DOJO -->
+
+
+ <!-- DOJO -->
<script type="text/javascript" src="{#StaticContentURL#}/js/dojo/dojo/dojo.js" djConfig="isDebug:false, parseOnLoad: true" ></script>
\ No newline at end of file
diff --git a/skins/zed/tutorial/hypership_reach.tpl b/skins/zed/tutorial/hypership_reach.tpl
index 845a23a..0d22111 100644
--- a/skins/zed/tutorial/hypership_reach.tpl
+++ b/skins/zed/tutorial/hypership_reach.tpl
@@ -1,29 +1,29 @@
-
- <!-- Floating panes -->
- <script type="text/javascript" src="{#StaticContentURL#}/js/dojo/dojox/layout/FloatingPane.js"></script>
- <link rel="stylesheet" type="text/css" href="{#StaticContentURL#}/js/dojo/dojox/layout/resources/FloatingPane.css" />
- <link rel="stylesheet" type="text/css" href="{#StaticContentURL#}/js/dojo/dojox/layout/resources/ResizeHandle.css" />
-
- <!-- Dock -->
- <style type="text/css">
- @import "{#StaticContentURL#}/js/dojo/dijit/themes/dijit.css";
- </style>
-
-
- <!-- Help to reach the hypership -->
- <div dojoType="dojox.layout.FloatingPane" title="{#JoinHypership#}" resizable="true" id="floaterHypershipReach" class="floatingPaneTutorial" duration="300">
-{if $CurrentPerso->location_global[0] == "S"}
- <p>Congratulations! You found a ship.</p>
- <p>You're aboard the {$CurrentPerso->location->ship->name}.</p>
-{if $controller == "ship"}
- <p>In the future, you will able to explore the ship, but this is not yet implemented yet in this alpha preview.</p>
-{if $note == ""}
- <p>Your notes is the only information generally available about ships. For reference, you should note something like "Took the {$CurrentPerso->location->ship->name} at {get_hypership_time()} from ... to the hypership."</p>
-{/if}
-{/if}
-{else}
- <p>{sprintf(#WhereYouAre#, $CurrentPerso->where(), lang_get($CurrentPerso->location->body_kind))}</p>
- <p>{#WhereTheHypershipIs#}</p>
- {#HowToJoinIt#}
-{/if}
- </div>
+
+ <!-- Floating panes -->
+ <script type="text/javascript" src="{#StaticContentURL#}/js/dojo/dojox/layout/FloatingPane.js"></script>
+ <link rel="stylesheet" type="text/css" href="{#StaticContentURL#}/js/dojo/dojox/layout/resources/FloatingPane.css" />
+ <link rel="stylesheet" type="text/css" href="{#StaticContentURL#}/js/dojo/dojox/layout/resources/ResizeHandle.css" />
+
+ <!-- Dock -->
+ <style type="text/css">
+ @import "{#StaticContentURL#}/js/dojo/dijit/themes/dijit.css";
+ </style>
+
+
+ <!-- Help to reach the hypership -->
+ <div dojoType="dojox.layout.FloatingPane" title="{#JoinHypership#}" resizable="true" id="floaterHypershipReach" class="floatingPaneTutorial" duration="300">
+{if $CurrentPerso->location_global[0] == "S"}
+ <p>Congratulations! You found a ship.</p>
+ <p>You're aboard the {$CurrentPerso->location->ship->name}.</p>
+{if $controller == "ship"}
+ <p>In the future, you will able to explore the ship, but this is not yet implemented yet in this alpha preview.</p>
+{if $note == ""}
+ <p>Your notes is the only information generally available about ships. For reference, you should note something like "Took the {$CurrentPerso->location->ship->name} at {get_hypership_time()} from ... to the hypership."</p>
+{/if}
+{/if}
+{else}
+ <p>{sprintf(#WhereYouAre#, $CurrentPerso->where(), lang_get($CurrentPerso->location->body_kind))}</p>
+ <p>{#WhereTheHypershipIs#}</p>
+ {#HowToJoinIt#}
+{/if}
+ </div>
diff --git a/skins/zed/user_account.tpl b/skins/zed/user_account.tpl
index 842329e..6772398 100644
--- a/skins/zed/user_account.tpl
+++ b/skins/zed/user_account.tpl
@@ -1,88 +1,88 @@
- <!-- Calls dojo -->
- <script src="/js/dojo/dojo/dojo.js" type="text/javascript"
- djConfig="isDebug: false, parseOnLoad: true"></script>
- <script type="text/javascript">
- dojo.require("dijit.form.Form");
- dojo.require("dijit.form.ValidationTextBox");
- dojo.require("dijit.form.CheckBox");
- dojo.require("dijit.form.Button");
-
- function updateMail (mail) {
- document.getElementById('UserEmail').innerHTML =
- '<a href="mailto:' + mail + '">' + mail + '</a>';
- }
- </script>
-
- <!-- Edit user account form -->
- <div class="grid_11 alpha profile">
- <div class="profile_id clearfix">
- <h1 class="profile_nick" id="UserLongname">{$user->longname}</h1>
- <div class="profile_info">
- <br />
- <img src="/skins/VacuumCleanerBridge/images/mail.png" title="{#Mail#}" alt="{#MailAlt#}" align="top" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span id="UserEmail">{mailto address=$user->email}</span>&nbsp;
- </div>
- </div>
- <div class="profile_separator"></div>
- <div class="profile_text">
- <br />
- <form dojoType="dijit.form.Form" name="UserAccount" method="POST">
- <input type="hidden" name="UserAccount" value="1" />
- <div class="row">
- <span class="firstLabel">{#Login#}</span>
- {$user->username}
- </div>
- <div class="row">
- <label class="firstLabel" for="longname">{#LongName#}</label>
- <input type="text" id="longname" name="longname" class="long"
- value="{$user->longname}"
- dojoType="dijit.form.ValidationTextBox"
- required="false"
- onchange="document.getElementById('UserLongname').innerHTML = document.getElementById('longname').value;";
- />
- </div>
- <div class="row">
- <label class="firstLabel" for="realname">{#RealName#}</label>
- <input type="text" id="realname" name="realname" class="long"
- value="{$user->realname}"
- dojoType="dijit.form.ValidationTextBox"
- required="false"
- />
- <span class="dojotooltip" dojoType="dijit.Tooltip" connectId="realname">{#RealNameToolTip#}</span>
- </div>
- <div class="row">
- <label class="firstLabel" for="email">{#Mail#}</label>
- <input type="text" id="email" name="email" class="long"
- value="{$user->email}"
- dojoType="dijit.form.ValidationTextBox"
- required="false"
- onchange="javascript:updateMail(arguments[0]);"
- />
- </div>
- <div class="row">
- <button dojoType="dijit.form.Button" iconClass="dijitEditorIcon dijitEditorIconSave" type="submit" onclick="document.forms[0].submit()">
- {#UpdateAccountInfo#}
- </button>
- <noscript>
- <input type="submit" value="{#UpdateAccountInfo#} {#JavaScriptSafeMessage#}" />
- </noscript>
- </div>
- </form>
- </div>
- </div>
-
- <!-- Faerie content -->
- <div class="grid_5 omega">
- <div class="sidebar_border"></div>
- <div id="sidebar">
- <div class="border_top"></div>
- <div class="sidebar_content">
- <h2>{#EditMyPage#}</h2>
- <ul>
- <li><a href="{get_url('who')}/edit/profile">{#EditProfile#}</a></li>
- <li>{#EditAccount#}</li>
- <li><a href="{get_url('who')}/edit/photos">{if $PICS}{#ManagePhotos#}{else}{#AddPhoto#}{/if}</a></li>
- </ul>
- </div>
- <div class="border_bottom"></div>
- </div>
+ <!-- Calls dojo -->
+ <script src="/js/dojo/dojo/dojo.js" type="text/javascript"
+ djConfig="isDebug: false, parseOnLoad: true"></script>
+ <script type="text/javascript">
+ dojo.require("dijit.form.Form");
+ dojo.require("dijit.form.ValidationTextBox");
+ dojo.require("dijit.form.CheckBox");
+ dojo.require("dijit.form.Button");
+
+ function updateMail (mail) {
+ document.getElementById('UserEmail').innerHTML =
+ '<a href="mailto:' + mail + '">' + mail + '</a>';
+ }
+ </script>
+
+ <!-- Edit user account form -->
+ <div class="grid_11 alpha profile">
+ <div class="profile_id clearfix">
+ <h1 class="profile_nick" id="UserLongname">{$user->longname}</h1>
+ <div class="profile_info">
+ <br />
+ <img src="/skins/VacuumCleanerBridge/images/mail.png" title="{#Mail#}" alt="{#MailAlt#}" align="top" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span id="UserEmail">{mailto address=$user->email}</span>&nbsp;
+ </div>
+ </div>
+ <div class="profile_separator"></div>
+ <div class="profile_text">
+ <br />
+ <form dojoType="dijit.form.Form" name="UserAccount" method="POST">
+ <input type="hidden" name="UserAccount" value="1" />
+ <div class="row">
+ <span class="firstLabel">{#Login#}</span>
+ {$user->username}
+ </div>
+ <div class="row">
+ <label class="firstLabel" for="longname">{#LongName#}</label>
+ <input type="text" id="longname" name="longname" class="long"
+ value="{$user->longname}"
+ dojoType="dijit.form.ValidationTextBox"
+ required="false"
+ onchange="document.getElementById('UserLongname').innerHTML = document.getElementById('longname').value;";
+ />
+ </div>
+ <div class="row">
+ <label class="firstLabel" for="realname">{#RealName#}</label>
+ <input type="text" id="realname" name="realname" class="long"
+ value="{$user->realname}"
+ dojoType="dijit.form.ValidationTextBox"
+ required="false"
+ />
+ <span class="dojotooltip" dojoType="dijit.Tooltip" connectId="realname">{#RealNameToolTip#}</span>
+ </div>
+ <div class="row">
+ <label class="firstLabel" for="email">{#Mail#}</label>
+ <input type="text" id="email" name="email" class="long"
+ value="{$user->email}"
+ dojoType="dijit.form.ValidationTextBox"
+ required="false"
+ onchange="javascript:updateMail(arguments[0]);"
+ />
+ </div>
+ <div class="row">
+ <button dojoType="dijit.form.Button" iconClass="dijitEditorIcon dijitEditorIconSave" type="submit" onclick="document.forms[0].submit()">
+ {#UpdateAccountInfo#}
+ </button>
+ <noscript>
+ <input type="submit" value="{#UpdateAccountInfo#} {#JavaScriptSafeMessage#}" />
+ </noscript>
+ </div>
+ </form>
+ </div>
+ </div>
+
+ <!-- Faerie content -->
+ <div class="grid_5 omega">
+ <div class="sidebar_border"></div>
+ <div id="sidebar">
+ <div class="border_top"></div>
+ <div class="sidebar_content">
+ <h2>{#EditMyPage#}</h2>
+ <ul>
+ <li><a href="{get_url('who')}/edit/profile">{#EditProfile#}</a></li>
+ <li>{#EditAccount#}</li>
+ <li><a href="{get_url('who')}/edit/photos">{if $PICS}{#ManagePhotos#}{else}{#AddPhoto#}{/if}</a></li>
+ </ul>
+ </div>
+ <div class="border_bottom"></div>
+ </div>
</div>
\ No newline at end of file
diff --git a/start.html b/start.html
index f6b7cc3..6badb10 100644
--- a/start.html
+++ b/start.html
@@ -1,30 +1,30 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
- "http://www.w3.org/TR/html4/strict.dtd"
- >
-<html lang="en">
-<head>
- <title>Zed. The future is our dreams.</title>
- <style>
- body {
- background-color: #303030;
- margin: 0 0 0 0;
- overflow: hidden;
- }
-
- #start {
- margin: auto;
- width: 960px;
- height: 4000px;
- background-color: #343434;
- background-image: url(img/misc/start.png);
- background-position: top left;
- background-repeat: no-repeat;
- border-left: dashed 3px white;
- border-right: dashed 3px white;
- }
- </style>
-</head>
-<body>
- <div id="start"></div>
-</body>
-</html>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd"
+ >
+<html lang="en">
+<head>
+ <title>Zed. The future is our dreams.</title>
+ <style>
+ body {
+ background-color: #303030;
+ margin: 0 0 0 0;
+ overflow: hidden;
+ }
+
+ #start {
+ margin: auto;
+ width: 960px;
+ height: 4000px;
+ background-color: #343434;
+ background-image: url(img/misc/start.png);
+ background-position: top left;
+ background-repeat: no-repeat;
+ border-left: dashed 3px white;
+ border-right: dashed 3px white;
+ }
+ </style>
+</head>
+<body>
+ <div id="start"></div>
+</body>
+</html>

File Metadata

Mime Type
text/x-diff
Expires
Sat, Nov 23, 15:27 (1 d, 18 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
20783
Default Alt Text
(672 KB)

Event Timeline