Page MenuHomeCode

No OneTemporary

This document is not UTF8. It was detected as ISO-8859-1 (Latin 1) and converted to UTF8 for display.
diff --git a/content/stories/B00003001.xml b/content/stories/B00003001.xml
--- a/content/stories/B00003001.xml
+++ b/content/stories/B00003001.xml
@@ -1,63 +1,171 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Zeta, Kaos
-Dereckson, 2010-01-31
+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="spatioport.entry"></section>
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, ceinturant le sud de la ville.
+À la surface travaillent d'honnêtes mineur de cobalt et de davyrium, les mines ceinturant le sud de la ville.
-Au nord de la ville, the hole, une ancienne mine dont les mineurs évitent de parler.
+Au nord, The Hole, une ancienne mine dont les mineurs évitent de parler.
À l'est, un petit spatioport.
</description>
<choices>
- <choice goto="hole.entry">Se diriger vers le hole</choice>
+ <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>
- <section id="hole.entry">
- <title>The hole</title>
+
+ <!--
+ Le centre ville
+
+ Sa bibliothèque. Son bar.
+ -->
+
+
+ <!--
+ Le spatioport
+ -->
+ <section id="spatioport.entry">
+ <title>Spatioport</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.
+ 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 jeunes armés de laser et de fouet neuroniques en garde l'entrée, deux vous regardant d'un œil plutôt menaçant.
+ 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="spatioport.entry">
- <title>Spatioport</title>
+ <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>
- 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.
+ 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>
- <hooks>
- <hook type="spatioport" />
- </hooks>
+ <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">Retourner en ville</choice>
+ <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>
- <local>3</local>
+ </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/controllers/ship.php b/controllers/ship.php
--- a/controllers/ship.php
+++ b/controllers/ship.php
@@ -1,64 +1,64 @@
<?php
/*
* Zed
* (c) 2010, Dereckson, some rights reserved
* Released under BSD license
*
* Raw text or HTML content
*/
//
// 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 (!ereg("^S[0-9]{5}$", $code)) {
+ 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/void.php b/controllers/void.php
--- a/controllers/void.php
+++ b/controllers/void.php
@@ -1,24 +1,24 @@
<?php
/*
- * Azhàr, faeries intranet
- * (c) 2009-2010, Wolfæym, some rights reserved
+ * Zed
+ * (c) 2010, Dereckson, some rights reserved
* Released under BSD license
*
* void content
*/
//
// 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/zed/profile.css b/css/zed/profile.css
--- a/css/zed/profile.css
+++ b/css/zed/profile.css
@@ -1,168 +1,116 @@
@charset "utf-8";
/* -------------------------------------------------------------
Zed
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Author: Dereckson
Tags: space retro futurist
Filename: profile.css
Version: 1.0
Created: 2010-01-27
Updated: 2010-02-11
Licence: Creative Commons BY 3.0
------------------------------------------------------------- */
/* -------------------------------------------------------------
Profile header
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
.profile_id {
height: 40px;
line-height: 1.2em;
background-color: black;
color: white;
}
.profile_id H1 {
color: #04acf8;
}
.profile_info {
float: right;
font-size: 0.90em;
padding-right: 1em;
}
.profile_info a {
color: white;
}
.profile_info a:hover {
color: white;
font-weight: bold;
}
.profile_nick {
float: left;
margin-top: 0;
height: 30px;
padding-left: 12px;
padding-top: 10px;
font-size: 1.25em;
font-weight: 500;
border-left: solid #04acf8 6px;
}
/* -------------------------------------------------------------
Profile
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
.profile {
background-color: black;
color: white;
margin-bottom: 20px;
border: 2px solid #04acf8;
}
.profile_text {
margin-left: 10px;
margin-right: 10px;
padding-top: 1em;
font-size: 1em;
text-align: justify;
}
.profile_text img {
border: 0px;
}
.profile_text.fixedwidth {
font-family: Fixedsys, Fixed;
white-space: pre;
}
/* -------------------------------------------------------------
- Profile CSS I wrote for faeries.folleterre.org
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
-/*
-.profile a {
- color: white;
- text-decoration: none;
-}
-
-.profile a:hover {
- font-weight: 900;
-}
-
-.profile h1 {
- color: white;
-}
-
-.profile h2 {
- color: white;
-}
-
-.profile_separator {
- height: 2px;
- margin-top:2px;
- background-color: black;
-}
-
-.profile_separator_light {
- height: 1px;
- margin-top:8px;
- background-color: black;
-}
-
-.profile_photos {
- border-bottom: solid 1px black;
-}
-
-.profile_photos img {
- margin: 8px 0px 12px 20px;
- border: 0px;
-}
-
-.profile_message {
- margin-left: 10px;
- margin-right: 10px;
-}
-
-.profile_message h2 {
- font-size: 1.25em;
-}
-*/
-
-/* -------------------------------------------------------------
Profile comments
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
.profile_comments {
background-color: #fafafa;
border: solid 1px #dedede;
}
.profile_comments_info {
font-style: italic;
}
.profile_comments_text {
font-size: 1.25em;
}
/* -------------------------------------------------------------
Profile editor
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
.photos {
}
.photo img {
margin: 8px 0px 12px 20px;
border: 0;
}
.photo {
float: left;
}
\ No newline at end of file
diff --git a/includes/SmartLine/ZedCommands.php b/includes/SmartLine/ZedCommands.php
--- a/includes/SmartLine/ZedCommands.php
+++ b/includes/SmartLine/ZedCommands.php
@@ -1,209 +1,234 @@
<?php
/*
* Zed
* (c) 2010, Dereckson, some rights reserved
* Released under BSD license
*
* SmartLine
*
*/
///
/// Register commands
///
$smartLine->register_object('goto', 'GotoSmartLineCommand');
$smartLine->register_object('guid', 'GUIDSmartLineCommand');
$smartLine->register_object('list', 'ListSmartLineCommand');
$smartLine->register_object('unixtime', 'UnixTimeSmartLineCommand');
$smartLine->register_object('requests', 'RequestsSmartLineCommand');
$smartLine->register_object('whereami', 'WhereAmISmartLineCommand');
///
/// Help (todo: move $lang array in lang folder)
///
$lang['Help']['goto'] = "Go to a location";
$lang['Help']['guid'] = "Generate a GUID";
$lang['Help']['list'] = "Lists specified objects (bodies, locations or places)";
$lang['Help']['requests'] = "Checks if there are waiting requests";
$lang['Help']['unixtime'] = "Prints current unixtime (seconds elapsed since 1970-01-01 00:00, UTC) or the specified unixtime date.";
$lang['Help']['whereami'] = "Where am I?";
///
/// whereami
///
class WhereAmISmartLineCommand extends SmartLineCommand {
public function run ($argv, $argc) {
global $CurrentPerso;
require_once("includes/geo/location.php");
$place = new GeoLocation($CurrentPerso->location_global);
$this->SmartLine->puts($CurrentPerso->location_global . ' - ' . $place);
}
}
///
/// GUID
///
class GUIDSmartLineCommand extends SmartLineCommand {
public function run ($argv, $argc) {
if ($argc > 1 && is_numeric($argv[1])) {
for ($i = 0 ; $i < $argv[1] ; $i++) {
$this->SmartLine->puts(new_guid());
}
return;
}
$this->SmartLine->puts(new_guid());
}
}
///
/// Requests
///
class RequestsSmartLineCommand extends SmartLineCommand {
public function run ($argv, $argc) {
global $CurrentPerso;
$force = ($argc > 1) && ($argv[1] == "-f" || $argv[1] == "--force");
if ($force || (array_key_exists('site.requests', $CurrentPerso->flags) && $CurrentPerso->flags['site.requests'])) {
global $controller;
$controller = 'controllers/persorequest.php';
} else {
$this->SmartLine->puts("No request waiting.");
}
}
}
///
/// goto
///
class GotoSmartLineCommand extends SmartLineCommand {
public function run ($argv, $argc) {
global $CurrentPerso;
if ($argc == 1) {
$this->SmartLine->puts("Where do you want to go?", STDERR);
return;
}
require_once("includes/geo/location.php");
try {
$place = new GeoLocation($argv[1]);
} catch (Exception $ex) {
$this->SmartLine->puts($ex->getMessage(), STDERR);
return;
}
if ($place->equals($CurrentPerso->location_global)) {
$this->SmartLine->puts("You're already there.");
return;
}
if (!$place->exists()) {
$this->SmartLine->puts("This place doesn't seem to exist.");
return;
}
$this->SmartLine->puts("TODO: code travel assistant");
}
}
///
/// list
///
class ListSmartLineCommand extends SmartLineCommand {
public function run ($argv, $argc) {
if ($argc == 1) {
$this->SmartLine->puts("Available lists: bodies, locations, places");
return;
}
switch ($objects = $argv[1]) {
case 'bodies':
$list = $this->get_list(TABLE_BODIES, "CONCAT('B', body_code)", "body_name");
$this->SmartLine->puts($list);
break;
case 'locations':
$list = $this->get_list(TABLE_LOCATIONS, "location_code", "location_name");
$this->SmartLine->puts($list);
break;
case 'places':
if ($argv[2] == "-a" || $argv[2] == "--all") {
//Global bodies places list
$list = $this->get_list(TABLE_PLACES, "CONCAT('B', body_code, place_code)", "place_name");
} else {
//Local places (or equivalent) list
global $CurrentPerso;
switch ($CurrentPerso->location_global[0]) {
case 'B':
$body_code = substr($CurrentPerso->location_global, 1, 5);
$list = $this->get_list(TABLE_PLACES, "CONCAT('B', body_code, place_code)", "place_name", "body_code = $body_code");
break;
case 'S':
$this->SmartLine->puts("I don't have a map of the spaceship.", STDERR);
return;
default:
$this->SmartLine->puts("Unknown location type. Can only handle B or S.", STDERR);
return;
}
}
$this->SmartLine->puts($list);
break;
default:
$this->SmartLine->puts("Unknown objects to list: $objects", STDERR);
}
}
public function get_list ($table, $key, $value, $where = null) {
global $db;
$sql = "SELECT $key as `key`, $value as value FROM $table ";
if ($where) $sql .= "WHERE $where ";
$sql .= "ORDER BY `key` ASC";
if (!$result = $db->sql_query($sql)) {
message_die(SQL_ERROR, "Unable to fetch list", '', __LINE__, __FILE__, $sql);
}
while ($row = $db->sql_fetchrow($result)) {
$rows .= "<tr><td>$row[key]</td><td>$row[value]</td></tr>";
}
$this->SmartLine->truncate(STDERR);
return "<table cellspacing=\"8\"><thead style=\"color: white\" scope=\"row\"><tr><th>Key</th><th>Value</th></thead><tbody>$rows</tbody></table>";
}
}
///
/// unixtime
///
class UnixTimeSmartLineCommand extends SmartLineCommand {
public function run ($argv, $argc) {
date_default_timezone_set('UTC');
if ($argc == 1) {
$this->SmartLine->puts(time());
} elseif ($argc == 2 && is_numeric($argv[1])) {
$this->SmartLine->puts(strftime("%Y-%m-%d %X", $argv[1]));
} else {
array_shift($argv);
$date = implode(' ', $argv);
if ($time = strtotime($date) !== false) {
$this->SmartLine->puts("Unixtime from $date: <span class=\"highlight\">$time</span>");
} else {
$this->SmartLine->puts("$date isn't a unixtime nor a valid date strtotime is able to parse.", STDERR);
}
}
}
}
+///
+/// invite
+///
+
+class InviteSmartLineCommand extends SmartLineCommand {
+ public function run ($argv, $argc) {
+ require_once
+ //Checks if we could invite
+ date_default_timezone_set('UTC');
+ if ($argc == 1) {
+ $this->SmartLine->puts(time());
+ } elseif ($argc == 2 && is_numeric($argv[1])) {
+ $this->SmartLine->puts(strftime("%Y-%m-%d %X", $argv[1]));
+ } else {
+ array_shift($argv);
+ $date = implode(' ', $argv);
+ if ($time = strtotime($date) !== false) {
+ $this->SmartLine->puts("Unixtime from $date: <span class=\"highlight\">$time</span>");
+ } else {
+ $this->SmartLine->puts("$date isn't a unixtime nor a valid date strtotime is able to parse.", STDERR);
+ }
+ }
+ }
+}
+
?>
\ No newline at end of file
diff --git a/includes/objects/perso.php b/includes/objects/perso.php
--- a/includes/objects/perso.php
+++ b/includes/objects/perso.php
@@ -1,453 +1,464 @@
<?php
/*
* Perso class
*
* 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
*
* @package Zed
* @copyright Copyright (c) 2010, Dereckson
* @license Released under BSD license
* @version 0.3
*
*/
require_once("includes/geo/location.php");
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 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;
}
$this->load_from_database();
} else {
$this->generate_id();
}
}
/*
* Initializes a new Perso instance if needed or get already available one.
* @param mixed $data perso ID or nickname
* @eturn 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
*/
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
*/
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 (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 flag or dies.
* @param string $flag XXXX
* @param string $$threshold YYYY
*/
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
*/
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 boolean 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();
}
}
?>
\ No newline at end of file
diff --git a/includes/objects/profile.php b/includes/objects/profile.php
--- a/includes/objects/profile.php
+++ b/includes/objects/profile.php
@@ -1,70 +1,71 @@
<?php
/*
- * Azhàr, faeries intranet
- * (c) 2010, Wolfæym, some rights reserved
+ * Zed
+ * (c) 2010, Dereckson, some rights reserved
* Released under BSD license
*
* Profile class.
*
* 0.1 2010-01-02 16:49 Autogenerated by Pluton Scaffolding
+ Import from Azhàr
*
*/
class Profile {
public $perso_id;
public $text;
public $updated;
public $fixedwidth;
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);
}
}
}
?>
\ No newline at end of file
diff --git a/includes/objects/profilecomment.php b/includes/objects/profilecomment.php
--- a/includes/objects/profilecomment.php
+++ b/includes/objects/profilecomment.php
@@ -1,98 +1,97 @@
<?php
/*
- * Azhàr, faeries intranet
- * (c) 2010, Wolfæym, some rights reserved
+ * Zed
+ * (c) 2010, Dereckson, some rights reserved
* Released under BSD license
- *
- * ProfileComment class.
+ * * ProfileComment class.
*
* 0.1 2010-01-03 01:02 Autogenerated by Pluton Scaffolding
*
*/
class ProfileComment {
public $id;
public $perso_id;
public $author;
public $authorname; //should be read-only
public $date;
public $text;
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'];
}
//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;
}
//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();
}
}
//Publishes the comment
function publish () {
$this->save_to_database();
//TODO: triggers new profile comment notifier
}
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/ship.php b/includes/objects/ship.php
--- a/includes/objects/ship.php
+++ b/includes/objects/ship.php
@@ -1,280 +1,281 @@
<?php
/*
* Ship class
*
* 0.1 2010-02-05 18:51 Autogenerated by Pluton Scaffolding
* 0.2 2010-02-06 17:30 Ship API
*
* @package Zed
* @copyright Copyright (c) 2010, Dereckson
* @license Released under BSD license
* @version 0.1
*
*/
require_once("perso.php");
require_once("includes/geo/location.php");
class Ship {
/*
* ----------------------------------------------------------------------- *
* Ship class definition
* ----------------------------------------------------------------------- *
*/
public $id;
public $name;
public $location_global;
public $location_local;
public $api_key;
public $description;
private static $hashtable = array();
/*
* Initializes a new instance
* @param int $id the primary key
*/
function __construct ($id = null) {
if ($id) {
- if (ereg("^S[0-9]{5}$", $id)) {
+ if (preg_match("/^S[0-9]{5}$/", $id)) {
$id = substr($id, 1);
}
$this->id = $id;
$this->load_from_database();
}
}
/*
* Initializes a new Ship instance if needed or gets already available one.
* @param mixed $data ship ID
* @eturn Ship the ship instance
*/
static function get ($data = null) {
if ($data !== null) {
//Checks in the hashtable if we already have loaded this instance
if (array_key_exists($data, self::$hashtable)) {
return self::$hashtable[$data];
}
}
$ship = new Ship($data);
return $ship;
}
/*
* Loads the object Ship (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('location_global', $_POST)) $this->location = $_POST['location_global'];
if (array_key_exists('location_local', $_POST)) $this->location = $_POST['location_local'];
if (array_key_exists('api_key', $_POST)) $this->api_key = $_POST['api_key'];
if (array_key_exists('description', $_POST)) $this->description = $_POST['description'];
}
/*
* Loads the object Ship (ie fill the properties) from the database
*/
function load_from_database () {
global $db;
$id = $db->sql_escape($this->id);
$sql = "SELECT * FROM ships WHERE ship_id = '" . $id . "'";
if ( !($result = $db->sql_query($sql)) ) message_die(SQL_ERROR, "Unable to query Ships", '', __LINE__, __FILE__, $sql);
if (!$row = $db->sql_fetchrow($result)) {
$this->lastError = "Ship unkwown: " . $this->id;
return false;
}
$this->name = $row['ship_name'];
$this->location_global = $row['location_global'];
$this->location_local = $row['location_local'];
$this->api_key = $row['api_key'];
$this->description = $row['ship_description'];
//Puts object in hashtables
self::$hashtable[$this->id] = $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);
- $location = $db->sql_escape($this->location);
+ $location_global = $db->sql_escape($this->location_global);
+ $location_local = $db->sql_escape($this->location_local);
$api_key = $db->sql_escape($this->api_key);
$description = $db->sql_escape($this->description);
//Updates or inserts
- $sql = "REPLACE INTO ships (`ship_id`, `ship_name`, `ship_location`, `api_key`, `ship_description`) VALUES ($id, '$name', '$location', '$api_key', '$description')";
+ $sql = "REPLACE INTO ships (`ship_id`, `ship_name`, `location_global`, `location_local`, `api_key`, `ship_description`) VALUES ($id, '$name', '$location_global', '$location_location', '$api_key', '$description')";
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 __toString () {
return $this->get_code();
}
/*
* Get ships at specified location
* @param string $location_global global location
* @param string $location_local local location
*/
static function get_ships_at ($location_global, $location_local = null) {
global $db;
//Gets ships
$sql = "SELECT ship_id, location_global, location_local FROM " . TABLE_SHIPS . " WHERE location_global IS NOT NULL";
if (!$result = $db->sql_query($sql)) {
message_die(SQL_ERROR, "Can't get ships", '', __LINE__, __FILE__, $sql);
}
$ships = array();
$location = new GeoLocation($location_global, $location_local);
while ($row = $db->sql_fetchrow($result)) {
$shipLocation = new GeoLocation($row['location_global'], $row['location_local']);
if ($location->equals($shipLocation)) {
$ships[] = self::get($row['ship_id']);
}
}
return $ships;
}
/*
* ----------------------------------------------------------------------- *
* Helper methods
* ----------------------------------------------------------------------- *
*/
/*
* Gets ship code, e.g. S00001
* @return string the ship code
*/
function get_code () {
return sprintf("S%05d", $this->id);
}
/*
* Determines if the ship is at a spatioport (or assimilated)
* @return boolean true if the ship is at a spatioport ; false if the ship is in space
*/
function in_spatioport () {
return $this->location_local !== null;
}
/*
*
* @param string $location_local the spatioport location
*/
function fly_in ($location_local = null) {
//TODO: completes location global e.g. B00001 -> B00001003
$this->location_local = ($location_local == null) ? 0 : $location_local;
}
function fly_out () {
$this->location_local = null;
}
/*
* ----------------------------------------------------------------------- *
* Ship API methods
* ----------------------------------------------------------------------- *
*/
/*
* Requests the specified perso to authenticate to this ship
* @param mixed $perso_data the perso id or name
*/
function request_perso_authenticate ($perso_data) {
$perso = Perso::get($perso_data);
$flag = sprintf("request.api.ship.auth.%s", $this->get_code());
$perso->set_flag($flag);
$perso->set_flag("site.requests");
}
/*
* Determines if a perso is authenticated to this ship
* @param mixed $perso_data the perso id or name
* @return boolean true if the specified perso name is authenticated to this ship ; otherwise, false.
*/
function is_perso_authenticated ($perso_data) {
$flag = sprintf("api.ship.auth.%s", $this->get_code());
return Perso::get($perso_data)->flags[$flag] == 1;
}
/*
* Requests the specified perso to confirm the ship API session
* @param string $session_id a session ID provided by calling application
* @param mixed $perso_data the perso id or name
*/
function request_perso_confirm_session ($session_id, $perso_data) {
$perso = Perso::get($perso_data);
$flag = sprintf("request.api.ship.session.%s.%s", $this->get_code(), $session_id);
$perso->set_flag($flag);
$perso->set_flag("site.requests");
}
/*
* Cleans ship API temporary sessions
*/
static function clean_ship_sessions () {
//Cleans old sessions
global $db;
$sql = "DELETE FROM " . TABLE_REGISTRY . " WHERE registry_key LIKE 'api.ship.session.%' AND registry_updated < NOW() - 7200";
if (!$db->sql_query($sql))
message_die(SQL_ERROR, "Can't delete old ship API sessions", '', __LINE__, __FILE__, $sql);
}
/*
* Gets perso id from specified session
* @param string $session_id a session ID provided by calling application
* @return mixed the session
*/
function get_perso_from_session ($session_id) {
//Cleands old session
self::clean_ship_sessions();
//Reads api.ship.session.S00001.$session_id
//This registry key contains perso_id if it exists and valid
$key = sprintf("api.ship.session.%s.%s", $this->get_code(), $session_id);
return registry_get($key);
}
/*
* Loads a Ship object from its API key
* @param string $key API key GUID
* @return Ship the ship matching the API key
*/
static function from_api_key ($key) {
global $db;
$key = $db->sql_escape($key);
$sql = "SELECT * FROM ships WHERE api_key = '" . $key . "'";
if ( !($result = $db->sql_query($sql)) ) message_die(SQL_ERROR, "Unable to query ships", '', __LINE__, __FILE__, $sql);
if (!$row = $db->sql_fetchrow($result))
return null;
//Fills ship information
$ship = new Ship();
$ship->id = $row['ship_id'];
$ship->name = $row['ship_name'];
$ship->location = $row['ship_location'];
$ship->api_key = $row['api_key'];
$ship->description = $row['ship_description'];
return $ship;
}
}
-?>
\ No newline at end of file
+?>
diff --git a/lang/en/profile.conf b/lang/en/profile.conf
--- a/lang/en/profile.conf
+++ b/lang/en/profile.conf
@@ -1,121 +1,99 @@
#Zed language config file - Profiles
#Language: English
#Code: en
#Author: Dereckson
###
### profile.tpl - main profile
###
-#<img src=".../tel.png" title="Phone number" alt="Tel"... />
-PhoneNumber = Phone number
-PhoneNumberAlt = Tel
-
#<img src=".../mail.png" title="E-mail" alt="@"... />
Mail = E-mail
MailAlt = @
###
### profile.tpl - communication area
###
DropMessage = Drop a message
SendMessage = Send a message to %s
AddComment = Add a comment to %s's profile
###
### 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.tpl - sidebar - content from http://photos.folleterre.org
-###
-
-LastSharedPhotos = Last shared photos on photos.folleterre.org
-ViewRecentUploads = View all recent uploads
-
-###
-### profile.tpl - sidebar - post-it
-###
-
-#TODO: {$NAME} needs a pickup for {$lift->event->name}
-IdealDate = Ideal date
-From = From
-OfferLift = Offer a lift
-
-###
### 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 = Faerie name
-RealName = <em>Mundanes</em> name
-RealNameToolTip = Your first and last names (optional).
+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 <a href="http://photos.folleterre.org/albmgr.php">photo albums</a>.
+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. That will allow some faeries to be more comfortable browsing the site from any location.
+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
###
-UnknownFaerie = Unknown faerie
+UnknownUser = Unknown being
Who = Who?
-WhoIsFaerie = Who is %s?
+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 faerie have not activated its intranet account yet.
\ No newline at end of file
+InactivatedUser = This being's account isn't active yet.
\ No newline at end of file
diff --git a/lang/en/scenes.conf b/lang/en/scenes.conf
--- a/lang/en/scenes.conf
+++ b/lang/en/scenes.conf
@@ -1,12 +1,12 @@
#Zed language config file - scenes
#Language: English
-#Code: en
+#Code: fr
#Author: Dereckson
###
### Hypership tower
###
[B00001001]
-UploadNewArtwork = "Upload new artwork"
-UploadNewArtworkDescription = "This frame is free. You can display here your artwork or any other artwork you like."
+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."
diff --git a/lang/fr/profile.conf b/lang/fr/profile.conf
--- a/lang/fr/profile.conf
+++ b/lang/fr/profile.conf
@@ -1,122 +1,104 @@
-#Azhàr language config file - Profiles
+#Zed language config file - Profiles
#Language: French
#Code: fr
-#Author: Wolfaeym
+#Author: Dereckson
###
### profile.tpl - main profile
###
#<img src=".../tel.png" title="Phone number" alt="Tel"... />
PhoneNumber = Téléphone
PhoneNumberAlt = Tel
#<img src=".../mail.png" title="E-mail" alt="@"... />
Mail = Courriel
MailAlt = @
###
### profile.tpl - communication area
###
DropMessage = Laisser un message
SendMessage = Message privé pour %s
AddComment = Publier un commentaire sur ce profil <!--%s-->
###
### 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.tpl - sidebar - content from http://photos.folleterre.org
-###
-
-LastSharedPhotos = Photos publiées sur photos.folleterre.org
-ViewRecentUploads = Voir toutes les photos récentes
-
-###
-### profile.tpl - sidebar - post-it
-###
-
-#TODO: {$NAME} needs a pickup for {$lift->event->name}
-IdealDate = Date idéale
-From = À partir de
-OfferLift = Proposer
-
-###
### 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 de <em>faerie</em>
-RealName = <em>Mundanes nomen</em>
-RealNameToolTip = Nom et prénom (facultatif).
+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, vous pouvez également <a href="http://photos.folleterre.org/albmgr.php">créer un album sur photos.folleterre.org</a>.
+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 = Check this box if the picture is "<strong>safe for work</strong>", you can view it without problem from any public computer. That will allow some faeries to be more comfortable browsing the site from any location.
+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 = 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 = 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
###
-UnknownFaerie = Inconnu au bataillon.
+UnknownUser = Inconnu au bataillon.
Who = Qui ?
-WhoIsFaerie = Qui est %s?
+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 est encore inactif.
\ No newline at end of file
+InactivatedUser = Attention, ce compte est encore inactif.

File Metadata

Mime Type
text/x-diff
Expires
Sun, Nov 10, 15:36 (2 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
20860
Default Alt Text
(64 KB)

Event Timeline