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/scenes/B00002.jpg b/content/scenes/B00002.jpg
deleted file mode 100644
index 2c604f5..0000000
Binary files a/content/scenes/B00002.jpg and /dev/null differ
diff --git a/content/scenes/B00002.png b/content/scenes/B00002.png
index 860f525..677e115 100644
Binary files a/content/scenes/B00002.png and b/content/scenes/B00002.png differ
diff --git a/content/scenes/B00002.tpl b/content/scenes/B00002.tpl
index 7710b14..d702d27 100644
--- a/content/scenes/B00002.tpl
+++ b/content/scenes/B00002.tpl
@@ -1,6 +1,6 @@
{$code = substr($CurrentPerso->location_global, 0, 6)}
<!-- {$code} -->
- <img src="{$SCENE_URL}/{$code}.png" alt="{sprintf(#SpaceAround#, $CurrentPerso->location->body->name)}" border="0" usemap="#SceneMap" />
+ <img class="SpaceScene" src="{$SCENE_URL}/{$code}.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.jpg b/content/scenes/B00003.jpg
index 5234bb5..d002d4f 100644
Binary files a/content/scenes/B00003.jpg and b/content/scenes/B00003.jpg differ
diff --git a/content/scenes/B00003.tpl b/content/scenes/B00003.tpl
index b292850..91c6a34 100644
--- a/content/scenes/B00003.tpl
+++ b/content/scenes/B00003.tpl
@@ -1,6 +1,6 @@
{$code = substr($CurrentPerso->location_global, 0, 6)}
<!-- {$code} -->
- <img src="{$SCENE_URL}/{$code}.jpg" alt="{sprintf(#SpaceAround#, $CurrentPerso->location->body->name)}" border="0" usemap="#SceneMap" />
+ <img class="SpaceScene" src="{$SCENE_URL}/{$code}.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/controllers/explore.php b/controllers/explore.php
index 064e819..1c5403f 100644
--- a/controllers/explore.php
+++ b/controllers/explore.php
@@ -1,104 +1,109 @@
<?php
/*
* Zed
* (c) 2010, Dereckson, some rights reserved
* Released under BSD license
*
* Explore current location
* For now, it's a storytelling engine like in livres dont vous êtes le héro
*/
//
// 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];
- if (!$choice = $_SESSION['Story']->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");
+ //Ensures we've a StorySection object in the Story variable
+ if (!array_key_exists('Story', $_SESSION)) {
+ $smarty->assign('WAP', lang_get('ExpiredStorySession'));
+ } else {
+ //Gets StoryChoice matching the guid
+ if (!$choice = $_SESSION['Story']->get_choice($guid)) {
+ $smarty->assign('WAP', lang_get('InvalidStoryGUID'));
}
- return $story->sections[$section_id];
+ //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
//
-if (!defined(STORIES_DIR)) define('STORIES_DIR', "content/stories");
-
$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['Story'] = $section;
//
// 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/header.php b/controllers/header.php
index e85a9a3..eb19d28 100644
--- a/controllers/header.php
+++ b/controllers/header.php
@@ -1,36 +1,36 @@
<?php
/*
* Zed
* (c) 2010, Dereckson, some rights reserved
* Released under BSD license
*
* Header
*/
//
// Graffiti wall
//
//TODO: this is a potentially very intensive SQL query
$sql = 'SELECT p.perso_nickname as username, 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['username']);
-$smarty->assign('WALL_USER_URL', get_url('user', $row['username']));
+$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')) define('DOJO', defined('DIJIT'));
if (defined('DIJIT')) $smarty->assign('DIJIT', true);
$smarty->assign('DOJO', DOJO);
//Prints the template
$smarty->display('header.tpl');
define('HEADER_PRINTED', true);
?>
\ No newline at end of file
diff --git a/controllers/profile.php b/controllers/profile.php
index 2371c17..5d7d15f 100644
--- a/controllers/profile.php
+++ b/controllers/profile.php
@@ -1,345 +1,307 @@
<?php
/*
- * Azhàr, faeries intranet
- * (c) 2009-2010, Wolfæym, some rights reserved
+ * Zed
+ * (c) 2010, Dereckson, some rights reserved
* Released under BSD license
*
- * Homepage
+ * This code is maintained in // with Azhàr
+ *
+ * User profile
*/
//Loads language file
lang_load('profile.conf');
-//Gets username from URL
-$username = $url[1];
+//Gets perso nickname from URL
+$who = $url[1];
-switch ($username) {
+switch ($who) {
case 'edit':
- $mode = 'edit';
- $username = $CurrentUser->username;
- break;
+ $mode = 'edit';
+ $who = $CurrentPerso->nickname;
+ break;
case 'random':
- $mode = 'view';
- $username = $db->sql_query_express("SELECT user_id FROM azhar_profiles ORDER BY rand() LIMIT 1");
- break;
+ $mode = 'view';
+ $who = $db->sql_query_express("SELECT perso_id FROM " . TABLE_PROFILES . " ORDER BY rand() LIMIT 1");
+ break;
default:
- $mode = 'view';
+ $mode = 'view';
}
-if (!$username) {
- $title = lang_get('UnknownFaerie');
- $smarty->assign('CONTENT', lang_get('Who'));
- include('raw.php');
- die();
+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');
-require_once('includes/objects/phone.php');
-require_once('includes/objects/resources.php');
-//Gets user information
-require_once('includes/objects/user.php');
-$user = new User($username);
-if ($user->lastError) {
- $title = lang_get('UnknownFaerie');
- $smarty->assign('CONTENT', sprintf(lang_get('WhoIsFaerie'), $username));
- include('raw.php');
- die();
+//Gets perso information
+require_once('includes/objects/perso.php');
+$perso = new Perso($who);
+if ($perso->lastError) {
+ message_die(GENERAL_ERROR, $perso->lastError, "Error");
}
//Gets profile
-$profile = new Profile($user->id);
+$profile = new Profile($perso->id);
//Handles form
if ($_POST['EditProfile']) {
- $profile->loadFromForm();
+ $profile->load_from_form();
$profile->updated = time();
- $profile->saveToDatabase();
+ $profile->save_to_database();
$mode = 'view';
} elseif ($_POST['UserAccount']) {
- $user->loadFromForm(false);
+ $smarty->assign('WAP', "Your form haven't been handled. Remember Dereckson to code this, profile.php line 59.");
+ //$perso->load_from_form(false);
$mode = 'view';
} elseif ($_POST['message_type'] == 'private_message') {
//Sends a message
require_once('includes/objects/message.php');
$msg = new Message();
- $msg->from = $CurrentUser->id;
- $msg->to = $user->id;
+ $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 = $CurrentUser->id;
- $comment->user_id = $user->id;
+ $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 = $CurrentUser->id . '_' . $hash . '.' . $extension;
+ $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'], DIR_PHOTOS . '/' . $filename)) {
+ 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->user_id = $CurrentUser->id;
+ $photo->perso_id = $CurrentPerso->id;
$photo->description = $_POST['description'];
- $photo->safe = $_POST['SafeForWork'];
- if ($photo->avatar) $photo->promoteToAvatar();
- $photo->saveToDatabase();
+ if ($photo->avatar) $photo->promote_to_avatar();
+ $photo->save_to_database();
//Generates thumbnail
- @exec('c:\WebServer\wwwroot\folleterre.org\faeries\pics\tn\c.bat');
+ 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->user_id != $CurrentUser->id) {
+ } elseif ($photo->perso_id != $CurrentPerso->id) {
$smarty->assign('WAP', lang_get('NotYourPic'));
$mode = 'view';
} else {
//OK
- $wereAvatar = $photo->avatar;
- $photo->loadFromForm();
- if (!$wereAvatar && $photo->avatar) {
- //Promote to avatar
- $photo->promoteToAvatar();
- }
- $photo->saveToDatabase();
+ $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 = $CurrentUser->id == $profile->user_id;
+ $self = $CurrentPerso->id == $profile->perso_id;
//Gets profiles comments, photos
- $comments = ProfileComment::get_comments($profile->user_id);
- $photos = ProfilePhoto::get_photos($profile->user_id);
-
- //Gets phone
- $ids = Resources::getChildIds('User', $profile->user_id, 'Phone');
- if (count($ids)) {
- foreach ($ids as $id) {
- $phone = new Phone($id);
- //We avoid faxes or private numbers
- if (!$phone->isPrivate && $phone->isVoice) {
- $smarty->assign('PHONE', $phone->number);
- break;
- }
- }
- }
+ $comments = ProfileComment::get_comments($profile->perso_id);
+ $photos = ProfilePhoto::get_photos($profile->perso_id);
//Records timestamp, to be able to track new comments
- if ($self) record_timestamp('profile');
-
- //Warning for new accounts
- if (!$user->active)
- $smarty->assign('NOTIFY', lang_get('InactivatedUser'));
-
- //TODO: move to sidebar manager
- //Sidebar content - gets photos.folleterre.org most recent upload
- $sql = "SELECT CONCAT(filepath, 'thumb_', filename) AS url FROM cpg14x_pictures WHERE owner_id = $profile->user_id ORDER BY ctime DESC LIMIT 2";
- if (!$result = $db->sql_query($sql)) {
- message_die(SQL_ERROR, "Unable to query the table", '', __LINE__, __FILE__, $sql);
- }
- $i = 0;
- while ($row = $db->sql_fetchrow($result)) {
- $lastpics[$i]->link = "http://photos.folleterre.org/displayimage.php?album=lastupby&amp;cat=0&amp;pos=$i&amp;uid=";
- $lastpics[$i]->link .= $profile->user_id;
- $lastpics[$i]->url = "http://photos.folleterre.org/albums/" . $row['url'];
- $i++;
- }
- $smarty->assign('SIDEBAR_LASTPICS_URL', 'http://photos.folleterre.org/thumbnails.php?album=lastupby&uid=' . $profile->user_id);
- $smarty->assign('SIDEBAR_LASTPICS', $lastpics);
-
+ if ($self) $CurrentPerso->setflag('profile.lastvisit', time());
+
//Template
$smarty->assign('PROFILE_COMMENTS', $comments);
$smarty->assign('PROFILE_SELF', $self);
- $smarty->assign('USERNAME', $user->username);
- $smarty->assign('NAME', $user->longname ? $user->longname : $user->username);
- $smarty->assign('MAIL', $user->email);
+ $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', $user->longname);
- $smarty->assign('DIJIT', true);
- $css[] = 'forms.css';
- $template = 'profile_edit.tpl';
+ $smarty->assign('USERNAME', $perso->name);
+ $smarty->assign('DIJIT', true);
+ $css[] = 'forms.css';
+ $template = 'profile_edit.tpl';
break;
case 'account':
- $smarty->assign('user', $user);
- $smarty->assign('DIJIT', true);
- $css[] = 'forms.css';
+ $smarty->assign('user', $CurrentUser);
+ $smarty->assign('DIJIT', true);
+ $css[] = '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', $user->longname);
- switch ($action = $url[3]) {
+ $smarty->assign('USERNAME', $perso->name);
+ switch ($action = $url[3]) {
case '':
- //Nothing to do
- break;
+ //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->user_id != $CurrentUser->id) {
- $smarty->assign('WAP', lang_get('NotYourPic'));
+ //Deletes a picture
+ if (!$id = $url[4]) {
+ $smarty->assign('WAP', "URL error. Parameter missing: picture id.");
} else {
- //OK we can delete it
- $photo->delete();
- $smarty->assign('NOTIFY', lang_get('PictureDeleted'));
+ $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;
+ 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->user_id != $CurrentUser->id) {
- $smarty->assign('WAP', lang_get('NotYourPic'));
+ if (!$id = $url[4]) {
+ $smarty->assign('WAP', "URL error. Parameter missing: picture id.");
} else {
- //Photo information edit form
- $smarty->assign('photo', $photo);
- $template = 'profile_photo_edit.tpl';
+ $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;
+ break;
- case 'avatar':
- //Deletes a picture
- 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->user_id != $CurrentUser->id) {
- $smarty->assign('WAP', lang_get('NotYourPic'));
+ case 'avatar':
+ //Promotes a picture to avatar
+ if (!$id = $url[4]) {
+ $smarty->assign('WAP', "URL error. Parameter missing: picture id.");
} else {
- //OK, promote it to avatar
- $photo->promoteToAvatar();
- $photo->saveToDatabase();
- $smarty->assign('NOTIFY', lang_get('PromotedToAvatar'));
+ $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;
+ break;
default:
- $smarty->assign('WAP', "Unknown URL. To delete a picture it's /delete/<picture id>. To edit it /edit/<picture id>");
- break;
+ $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->user_id);
+ $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', '/' . DIR_PHOTOS);
+ $smarty->assign('URL_PICS', PHOTOS_URL);
$css[] = 'lightbox.css';
$smarty->assign('PAGE_JS', array('prototype.js', 'scriptaculous.js?load=effects', 'lightbox.js'));
$smarty->assign('PICS', $photos);
}
//Serves header
$css[] = "profile.css";
$smarty->assign('PAGE_CSS', $css);
-$smarty->assign('PAGE_TITLE', $user->longname);
-include('header.php');
+$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/css/zed/theme.css b/css/zed/theme.css
index 62b2921..c1bc2ab 100644
--- a/css/zed/theme.css
+++ b/css/zed/theme.css
@@ -1,334 +1,334 @@
@charset "utf-8";
/* -------------------------------------------------------------
Zed
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Author: Dereckson
Tags: space retro futurist
Filename: forms.css
Version: 1.0
Created: 2010-01-27
Updated: 2010-01-27
Licence: Creative Commons BY 3.0
------------------------------------------------------------- */
/* -------------------------------------------------------------
Page settings
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
body {
margin: 28px 0 0 0;
background-color: #343434;
background-image: url("../../img/zed/topborder.png");
background-position: top;
background-repeat: repeat-x;
font-family: "Calibri", "Lucida Sans Unicode", "Trebuchet MS", "Helvetica", "Arial", sans-serif;
color: white;
}
h1, h2, h3, h4, h5, h6 {
color: black;
}
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;
}
/* -------------------------------------------------------------
Wall
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
.wall {
text-align: left;
float: right;
font-size: 80%;
}
.wall_info {
display: block;
text-align: right;
}
/* -------------------------------------------------------------
Info
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
.info {
font-size: 90%;
}
.info strong {
display: inline-block;
display: -moz-inline-box;
width: 9em;
min-width: 9em;
font-weight: 600;
color: #fd9800;
}
/* -------------------------------------------------------------
Avatars wall
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
.avatar {
float: left;
margin-bottom: 2em;
margin-right: 2em;
text-align: center;
}
.avatar_name {
display: block;
}
/* -------------------------------------------------------------
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;
}
.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;
}
/* -------------------------------------------------------------
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;
}
.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 {
- background-color: green;
+
}
#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: #7F0707;
font-weight: 900;
}
.floatingPaneTutorial p {
color: black;
margin: 0;
padding: 5px 10px 0px 10px;
}
.dojoxDockList {
color: black;
}
/* -------------------------------------------------------------
Footer
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
#footer {
font-size: 80%;
}
\ No newline at end of file
diff --git a/includes/config.php b/includes/config.php
index 74337f1..ac02726 100644
--- a/includes/config.php
+++ b/includes/config.php
@@ -1,135 +1,167 @@
<?php
/*
* Zed
* (c) 2010, Dereckson, some rights reserved
* Released under BSD license
*
* Autogenerable configuration file
*/
////////////////////////////////////////////////////////////////////////////////
/// ///
/// I. SQL configuration ///
/// ///
////////////////////////////////////////////////////////////////////////////////
//SQL configuration
$Config['sql']['product'] = 'MySQL'; //Only MySQL is currently implemented
$Config['sql']['host'] = 'localhost';
$Config['sql']['username'] = 'zed';
$Config['sql']['password'] = 'zed';
$Config['sql']['database'] = 'zed';
//SQL tables
$prefix = '';
define('TABLE_API_KEYS', $prefix . 'api_keys');
define('TABLE_COMMENTS', $prefix . 'comments');
define('TABLE_LOG_SMARTLINE', $prefix . 'log_smartline');
define('TABLE_MESSAGES', $prefix . 'messages');
define('TABLE_MOTD', $prefix . 'motd');
define('TABLE_PAGES', $prefix . 'pages');
define('TABLE_PAGES_EDITS', $prefix . 'pages_edits');
define('TABLE_PERSOS', $prefix . 'persos');
define('TABLE_PERSOS_FLAGS', $prefix . 'persos_flags');
define('TABLE_PROFILES', $prefix . 'profiles');
define('TABLE_PROFILES_COMMENTS', $prefix . 'profiles_comments');
define('TABLE_PROFILES_PHOTOS', $prefix . 'profiles_photos');
define('TABLE_SESSIONS', $prefix . 'sessions');
define('TABLE_USERS', $prefix . 'users');
define('TABLE_USERS_OPENID', $prefix . 'users_openid');
//Geo tables
define('TABLE_BODIES', $prefix . 'geo_bodies');
define('TABLE_LOCATIONS', $prefix . 'geo_locations'); //Well... it's view
define('TABLE_PLACES', $prefix . 'geo_places');
////////////////////////////////////////////////////////////////////////////////
/// ///
/// II. Site configuration ///
/// ///
////////////////////////////////////////////////////////////////////////////////
//Default theme
$Config['DefaultTheme'] = "Zed";
//Dates
date_default_timezone_set("UTC");
////////////////////////////////////////////////////////////////////////////////
/// ///
/// III. Script URLs ///
/// ///
////////////////////////////////////////////////////////////////////////////////
/*
* Without mod_rewrite:
*
* Subdirectory:
* - $Config['SiteURL'] = 'http://zed.dereckson.be/hypership/index.php';
* - $Config['BaseURL'] = '/hypership/index.php';
*
* Root directory:
* - $Config['SiteURL'] = 'http://zed.dereckson.be/index.php';
* - $Config['BaseURL'] = '/index.php';
*
* With mod_rewrite:
*
* Subdirectory:
* - $Config['SiteURL'] = 'http://zed.dereckson.be/hypership';
* - $Config['BaseURL'] = '/hypership';
*
* In .htaccess or your vhost definition:
* RewriteEngine On
* RewriteBase /hypership/
* RewriteCond %{REQUEST_FILENAME} !-f
* RewriteCond %{REQUEST_FILENAME} !-d
* RewriteRule . /hypership/index.php [L]
*
* Root directory:
* - $Config['SiteURL'] = 'http://zed.dereckson.be';
* - $Config['BaseURL'] = '';
*
* In .htaccess or your vhost definition:
* RewriteEngine On
* RewriteBase /
* RewriteCond %{REQUEST_FILENAME} !-f
* RewriteCond %{REQUEST_FILENAME} !-d
* RewriteRule . /index.php [L]
*
*
* If you don't want to specify the server domain, you can use get_server_url:
* $Config['SiteURL'] = get_server_url() . '/hypership';
* $Config['SiteURL'] = get_server_url();
- *
- * $Config['StaticContentURL'] is used to serve js, css, img and content
- * directories. To improve site performance, you can use a CDN for that.
*
* !!! No trailing slash !!!
*
*/
$Config['SiteURL'] = get_server_url();
$Config['BaseURL'] = '';
-$Config['StaticContentURL'] = $Config['SiteURL'];
-define('SCENE_URL', "$Config[StaticContentURL]/content/scenes");
+////////////////////////////////////////////////////////////////////////////////
+/// ///
+/// IV. Static content ///
+/// ///
+////////////////////////////////////////////////////////////////////////////////
+
+//Where the static content is located?
+//Static content = 4 directories: js, css, img and content
+//On default installation, those directories are at site root.
+//To improve site performance, you can use a CDN for that.
+//To use
+//
+//Recommanded setting: $Config['StaticContentURL'] = $Config['SiteURL'];
+//Or if Zed is the site root: $Config['StaticContentURL'] = '';
+//With CoralCDN: $Config['StaticContentURL'] = . '.nyud.net';
+//
+$Config['StaticContentURL'] = '';
+//$Config['StaticContentURL'] = get_server_url() . '.nyud.net';
+
+//Scenes
+define('SCENE_DIR', 'content/scenes');
+define('SCENE_URL', $Config['StaticContentURL'] . '/' . SCENE_DIR);
+
+//Stories
+define('STORIES_DIR', "content/stories");
+
+//Profile's photos
+define('PHOTOS_DIR', 'content/users/_photos');
+define('PHOTOS_URL', $Config['StaticContentURL'] . '/' . PHOTOS_DIR);
+
+//ImageMagick paths
+//Be careful on Windows platform convert could match the NTFS convert command.
+$Config['ImageMagick']['convert'] = 'convert';
+$Config['ImageMagick']['mogrify'] = 'mogrify';
+$Config['ImageMagick']['composite'] = 'composite';
+$Config['ImageMagick']['identify'] = 'identify';
+
////////////////////////////////////////////////////////////////////////////////
/// ///
-/// IV. Sessions ///
+/// V. Sessions ///
/// ///
////////////////////////////////////////////////////////////////////////////////
//Sessions
//If you want to use a common table of sessions / user handling
//with several websites, specify a different resource id for each site.
$Config['ResourceID'] = 21;
//PHP variables
ini_set('session.serialize_handler', 'wddx');
ini_set('session.save_path', 'cache/sessions');
ini_set('session.gc_maxlifetime', 345600); //4 days, for week-end story pause and continue url
?>
\ No newline at end of file
diff --git a/includes/objects/azhar_profile.php b/includes/objects/azhar_profile.php
deleted file mode 100644
index 1c6ff6d..0000000
--- a/includes/objects/azhar_profile.php
+++ /dev/null
@@ -1,69 +0,0 @@
-<?php
-
-/*
- * Azhàr, faeries intranet
- * (c) 2010, Wolfæym, some rights reserved
- * Released under BSD license
- *
- * Profile class.
- *
- * 0.1 2010-01-02 16:49 Autogenerated by Pluton Scaffolding
- *
- */
-
- class Profile {
-
- public $user_id;
- public $text;
- public $updated;
- public $fixedwidth;
-
- function __construct ($user_id = '') {
- if ($user_id) {
- $this->user_id = $user_id;
- $this->loadFromDatabase();
- }
- }
-
- //Loads the object Profile (ie fill the properties) from the $_POST array
- function loadFromForm () {
- if (array_key_exists('user_id', $_POST)) $this->user_id = $_POST['user_id'];
- if (array_key_exists('text', $_POST)) $this->text = $_POST['text'];
- if (array_key_exists('updated', $_POST)) $this->updated = $_POST['updated'];
- if (array_key_exists('fixedwidth', $_POST)) $this->fixedwidth = $_POST['fixedwidth'];
- }
-
- //Loads the object Profile (ie fill the properties) from the database
- function loadFromDatabase () {
- global $db;
- $sql = "SELECT * FROM " . TABLE_PROFILES . " WHERE user_id = '" . $this->user_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->user_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 saveToDatabase () {
- global $db;
-
- $user_id = $db->sql_escape($this->user_id);
- $text = $db->sql_escape($this->text);
- $updated = $db->sql_escape($this->updated);
- $fixedwidth = $this->fixedwidth ? 1 : 0;
-
- $sql = "REPLACE INTO " . TABLE_PROFILES . " (`user_id`, `profile_text`, `profile_updated`, `profile_fixedwidth`) VALUES ('$user_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/perso.php b/includes/objects/perso.php
index d5418db..059dc05 100644
--- a/includes/objects/perso.php
+++ b/includes/objects/perso.php
@@ -1,290 +1,304 @@
<?php
/*
* Perso class
*
* 0.1 2010-01-27 00:39 Autogenerated by Pluton Scaffolding
* 0.2 2010-01-29 14:39 Adding flags support
*
* @package Zed
* @copyright Copyright (c) 2010, Dereckson
* @license Released under BSD license
* @version 0.1
*
*/
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;
/*
* Initializes a new instance
* @param int $id the primary key
*/
- function __construct ($id = null) {
- if ($id) {
- $this->id = $id;
+ 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();
}
}
/*
* 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
- $id = $db->sql_escape($this->id);
- $sql = "SELECT * FROM " . TABLE_PERSOS . " WHERE perso_id = '" . $id . "'";
+ $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
);
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 record not yet saved in the database");
+ 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
);
}
- public function setflag ($key, $value) {
+ public function setflag ($key, $value = 1) {
//Checks if flag isn't already set at this value
if ($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;
}
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");
}
}
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
*/
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);
}
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[] = new Perso($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);
}
}
}
?>
\ No newline at end of file
diff --git a/includes/objects/profile.php b/includes/objects/profile.php
new file mode 100644
index 0000000..7c8c65d
--- /dev/null
+++ b/includes/objects/profile.php
@@ -0,0 +1,70 @@
+<?php
+
+/*
+ * Azhàr, faeries intranet
+ * (c) 2010, Wolfæym, some rights reserved
+ * Released under BSD license
+ *
+ * Profile class.
+ *
+ * 0.1 2010-01-02 16:49 Autogenerated by Pluton Scaffolding
+ *
+ */
+
+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/azhar_profilecomment.php b/includes/objects/profilecomment.php
similarity index 66%
rename from includes/objects/azhar_profilecomment.php
rename to includes/objects/profilecomment.php
index bcdb3c7..dcca5c1 100644
--- a/includes/objects/azhar_profilecomment.php
+++ b/includes/objects/profilecomment.php
@@ -1,103 +1,98 @@
<?php
/*
* Azhàr, faeries intranet
* (c) 2010, Wolfæym, some rights reserved
* Released under BSD license
*
* ProfileComment class.
*
* 0.1 2010-01-03 01:02 Autogenerated by Pluton Scaffolding
*
*/
class ProfileComment {
public $id;
- public $user_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->loadFromDatabase();
+ $this->load_from_database();
} else {
$this->date = time();
}
}
//Loads the object comment (ie fill the properties) from the $_POST array
- function loadFromForm () {
- if (array_key_exists('user_id', $_POST)) $this->user_id = $_POST['user_id'];
+ 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 loadFromDatabase () {
+ function load_from_database () {
global $db;
- $sql = "SELECT c.*, u.user_longname as author FROM " . TABLE_PROFILES_COMMENTS . " c, " . TABLE_USERS . " u WHERE c.comment_id = '" . $this->id . "' AND u.user_id = c.comment_author";
+ $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->user_id = $row['user_id'];
+ $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 saveToDatabase () {
+ function save_to_database () {
global $db;
- $id = $db->sql_escape($this->id);
- $user_id = $db->sql_escape($this->user_id);
+ $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);
- if ($id) {
- //Updates
- $sql = "REPLACE INTO " . TABLE_PROFILES_COMMENTS . " (`comment_id`, `user_id`, `comment_author`, `comment_date`, `comment_text`) VALUES ('$id', '$user_id', '$author', '$date', '$text')";
- } else {
- //Inserts
- $sql = "INSERT INTO " . TABLE_PROFILES_COMMENTS . " (`user_id`, `comment_author`, `comment_date`, `comment_text`) VALUES ('$user_id', '$author', '$date', '$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->saveToDatabase();
+ $this->save_to_database();
//TODO: triggers new profile comment notifier
}
- static function get_comments ($user_id) {
+ static function get_comments ($perso_id) {
global $db;
- $sql = "SELECT comment_id FROM " . TABLE_PROFILES_COMMENTS . " WHERE user_id = " . $db->sql_escape($user_id);
+ $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/azhar_profilephoto.php b/includes/objects/profilephoto.php
similarity index 58%
rename from includes/objects/azhar_profilephoto.php
rename to includes/objects/profilephoto.php
index 09b088b..6cc75a5 100644
--- a/includes/objects/azhar_profilephoto.php
+++ b/includes/objects/profilephoto.php
@@ -1,146 +1,159 @@
<?php
/*
-* Azhàr, faeries intranet
-* (c) 2010, Wolfæym, some rights reserved
-* Released under BSD license
-*
-* photo class.
-*
-* 0.1 2010-01-03 21:00 Autogenerated by Pluton Scaffolding
-*
-*/
+ * Zed
+ * (c) 2010, Dereckson, some rights reserved
+ * Released under BSD license
+ *
+ * photo class.
+ *
+ * 0.1 2010-01-03 21:00 Autogenerated by Pluton Scaffolding
+ * 0.2 2010-02-02 00:52 Thumbnail ImageMagick generation code
+ *
+ */
class ProfilePhoto {
public $id;
- public $user_id;
+ public $perso_id;
public $name;
public $description;
- public $safe;
public $avatar;
function __construct ($id = '') {
if ($id) {
$this->id = $id;
- $this->loadFromDatabase();
+ $this->load_from_database();
}
}
//Loads the object photo (ie fill the properties) from the $_POST array
- function loadFromForm ($readBoolean = true) {
- if (array_key_exists('user_id', $_POST)) $this->user_id = $_POST['user_id'];
+ 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->safe = $_POST['safe'] ? true : false;
$this->avatar = $_POST['avatar'] ? true : false;
}
}
//Loads the object photo (ie fill the properties) from the database
- function loadFromDatabase () {
+ function load_from_database () {
global $db;
- $sql = "SELECT * FROM azhar_profiles_photos WHERE photo_id = '" . $this->id . "'";
+ $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->user_id = $row['user_id'];
+ $this->perso_id = $row['perso_id'];
$this->name = $row['photo_name'];
$this->description = $row['photo_description'];
- $this->safe = $row['photo_safe'];
$this->avatar = $row['photo_avatar'];
return true;
}
- function promoteToAvatar () {
+ function promote_to_avatar () {
global $db;
- $sql = "UPDATE " . TABLE_PROFILES_PHOTOS . " SET photo_avatar = 0 WHERE user_id = " . $this->user_id;
+ $sql = "UPDATE " . TABLE_PROFILES_PHOTOS . " SET photo_avatar = 0 WHERE perso_id = " . $this->perso_id;
$db->sql_query_express($sql);
$this->avatar = true;
}
//Saves the object to the database
- function saveToDatabase () {
+ function save_to_database () {
global $db;
$id = $db->sql_escape($this->id);
- $user_id = $db->sql_escape($this->user_id);
+ $perso_id = $db->sql_escape($this->perso_id);
$name = $db->sql_escape($this->name);
$description = $db->sql_escape($this->description);
$safe = $this->safe ? 1 : 0;
$avatar = $this->avatar ? 1 : 0;
if ($id) {
//Updates
- $sql = "REPLACE INTO " . TABLE_PROFILES_PHOTOS . " (`photo_id`, `user_id`, `photo_name`, `photo_description`, `photo_safe`, `photo_avatar`) VALUES ('$id', '$user_id', '$name', '$description', $safe, $avatar)";
+ $sql = "REPLACE INTO " . TABLE_PROFILES_PHOTOS . " (`photo_id`, `perso_id`, `photo_name`, `photo_description`, `photo_safe`, `photo_avatar`) VALUES ('$id', '$perso_id', '$name', '$description', $safe, $avatar)";
} else {
//Inserts
- $sql = "INSERT INTO " . TABLE_PROFILES_PHOTOS . " (`user_id`, `photo_name`, `photo_description`, `photo_safe`, `photo_avatar`) VALUES ('$user_id', '$name', '$description', $safe, $avatar)";
+ $sql = "INSERT INTO " . TABLE_PROFILES_PHOTOS . " (`perso_id`, `photo_name`, `photo_description`, `photo_safe`, `photo_avatar`) VALUES ('$perso_id', '$name', '$description', $safe, $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();
}
}
function delete () {
global $db;
//Deletes from disk
- $pic_tn = DIR_PHOTOS . '/' . $this->name;
- $pic_genuine = DIR_PHOTOS . '/tn/' . $this->name;
+ $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);
}
}
- static function get_photos ($user_id, $allowUnsafe = true) {
+ /*
+ * 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);
+ }
+
+ static function get_photos ($perso_id, $allowUnsafe = true) {
global $db;
- $sql = "SELECT photo_id FROM " . TABLE_PROFILES_PHOTOS . " WHERE user_id = " . $db->sql_escape($user_id);
+ $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 ($user_id, $username = '') {
+ static function get_avatar ($perso_id, $username = '') {
global $db;
- $user_id = $db->sql_escape($user_id);
+ $perso_id = $db->sql_escape($perso_id);
- $sql = "SELECT photo_description, photo_name FROM " . TABLE_PROFILES_PHOTOS . " WHERE user_id = '$user_id' and photo_avatar = 1";
+ $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 = getname($user_id);
+ if (!$username) $username = get_name($perso_id);
$description = $row['photo_description'] ? "$row[photo_description] ($username's avatar)" : "$username's avatar";
- $url = '/' . DIR_PHOTOS . '/tn/' . $row['photo_name'];
+ $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/index.php b/index.php
index 4b41303..369d08b 100644
--- a/index.php
+++ b/index.php
@@ -1,187 +1,190 @@
<?php
/*
* Zed
* (c) 2010, Dereckson, some rights reserved
* Released under BSD license
*
* Application entry point
*/
////////////////////////////////////////////////////////////////////////////////
///
/// Initialization
///
//Pluton library
include('includes/core.php');
//Session
$IP = encode_ip($_SERVER["REMOTE_ADDR"]);
require_once('includes/story/story.php'); //this class can be stored in session
session_start();
$_SESSION[ID] = session_id();
session_update(); //updates or creates the session
include("includes/login.php"); //login/logout
$CurrentUser = get_logged_user(); //Gets current user infos
//Gets current perso
require_once('includes/objects/perso.php');
if ($perso_id = $CurrentUser->session['perso_id']) {
$CurrentPerso = new Perso($perso_id);
}
//Skin and accent to load
define('THEME', $CurrentUser->session['Skin']);
define('ACCENT', $CurrentUser->session['Skin_accent']);
//Loads Smarty
require('includes/Smarty/Smarty.class.php');
$smarty = new Smarty();
$current_dir = dirname(__FILE__);
$smarty->template_dir = $current_dir . '/skins/' . THEME;
$smarty->compile_dir = $current_dir . '/cache/compiled';
$smarty->cache_dir = $current_dir . '/cache';
$smarty->config_dir = $current_dir;
$smarty->config_vars['StaticContentURL'] = $Config['StaticContentURL'];
//Loads language files
define('LANG', 'fr');
lang_load('core.conf');
if ($CurrentUser->id < 1000) {
//Anonymous user, proceed to login
if (array_key_exists('LastUsername', $_COOKIE))
$smarty->assign('username', $_COOKIE['LastUsername']);
if (array_key_exists('LastOpenID', $_COOKIE))
$smarty->assign('OpenID', $_COOKIE['LastOpenID']);
$smarty->assign('LoginError', $LoginError);
$smarty->display('login.tpl');
exit;
}
////////////////////////////////////////////////////////////////////////////////
///
/// Perso selector
///
//Handles form
if ($_POST['form'] == 'perso.create') {
$perso = new Perso();
$perso->load_from_form();
$perso->user_id = $CurrentUser->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");
}
//Save or prints again forms
if (!$errors) {
$perso->save_to_database();
$smarty->assign('NOTIFY', lang_get('NewCharacterCreated'));
$CurrentPerso = $perso;
set_info('perso_id', $perso->id);
$CurrentPerso->setflag("site.lastlogin", $_SERVER['REQUEST_TIME']);
} else {
$smarty->assign('WAP', join("<br />", $errors));
$smarty->assign('perso', $perso);
}
}
if ($_GET['action'] == 'perso.logout') {
//User wants to change perso
$CurrentPerso = null;
set_info('perso_id', null);
clean_session();
} elseif ($_GET['action'] == 'perso.select') {
//User have selected a perso
$CurrentPerso = new Perso($_GET['perso_id']);
if ($CurrentPerso->user_id != $CurrentUser->id) {
//Hack
message_die(HACK_ERROR, "This isn't your perso.");
}
set_info('perso_id', $CurrentPerso->id);
$CurrentPerso->setflag("site.lastlogin", $_SERVER['REQUEST_TIME']);
}
if (!$CurrentPerso) {
switch ($count = Perso::get_persos_count($CurrentUser->id)) {
case 0:
//Create a perso
$smarty->display("perso_create.tpl");
exit;
case 1:
//Autoselect
$CurrentPerso = Perso::get_first_perso($CurrentUser->id);
set_info('perso_id', $CurrentPerso->id);
$CurrentPerso->setflag("site.lastlogin", $_SERVER['REQUEST_TIME']);
break;
default:
//Pick a perso
$persos = Perso::get_persos($CurrentUser->id);
$smarty->assign("PERSOS", $persos);
$smarty->display("perso_select.tpl");
$_SESSION['UserWithSeveralPersos'] = true;
exit;
}
}
//Assigns current perso object as Smarty variable
$smarty->assign('CurrentPerso', $CurrentPerso);
////////////////////////////////////////////////////////////////////////////////
///
/// Tasks to execute before calling the URL controller:
/// - assert the perso is somewhere
/// - executes the smartline
///
//If the perso location is unknown, ejects it to an asteroid
if (!$CurrentPerso->location_global) {
require_once('includes/geo/place.php');
$smarty->assign('NOTIFY', lang_get('NewLocationNotify'));
$CurrentPerso->move_to(GeoPlace::get_start_location());
}
//SmartLine
include("includes/SmartLine/ZedSmartLine.php");
////////////////////////////////////////////////////////////////////////////////
///
/// Calls the specific controller to serve the requested page
///
$url = get_current_url_fragments();
switch ($controller = $url[0]) {
case '':
include('controllers/home.php');
break;
case 'request':
case 'page':
case 'explore':
include("controllers/$controller.php");
break;
-
+
+ case 'who':
+ include('controllers/profile.php'); //Azhàr controller
+ break;
default:
//TODO: returns a 404 error
dieprint_r($url, 'Unknown URL');
}
?>
\ No newline at end of file
diff --git a/lang/en/core.conf b/lang/en/core.conf
index 1106d25..30a5754 100644
--- a/lang/en/core.conf
+++ b/lang/en/core.conf
@@ -1,120 +1,121 @@
#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 = ":"
###
### 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"
FatalErrorScreen = Fatal error screen
FatalErrorInterrupt = Fatal error breaking screen
GeneralError = General error
PageNotFound = "Page not found"
###
### 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
###
#messages.tpl, Reply
Reply = Reply
#messages.tpl, the X link title
DeleteThisMessage = Delete this message
#home.php, messages error
MessageDeleted = Message deleted.
NotYourMessage = This message is not one of yours.
MessageAlreadyDeleted = Message already deleted.
###
### Perso create/select
###
NewCharacterCreated = New character created
CreateCharacter = Create a character
EditCharacter = Edit %s information
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>'."
NicknameUnavailable = "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."
###
### Places
###
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
###
### 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
###
-Title = Titre
\ No newline at end of file
+Title = Title
\ No newline at end of file
diff --git a/lang/en/profile.conf b/lang/en/profile.conf
new file mode 100644
index 0000000..89f5ce0
--- /dev/null
+++ b/lang/en/profile.conf
@@ -0,0 +1,121 @@
+#Azhàr language config file - Profiles
+#Language: English
+#Code: en
+#Author: Wolfaeym
+
+###
+### 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).
+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>.
+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.
+
+###
+### 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
+Who = Who?
+WhoIsFaerie = 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
diff --git a/lang/fr/core.conf b/lang/fr/core.conf
index cca5eab..06f9db3 100644
--- a/lang/fr/core.conf
+++ b/lang/fr/core.conf
@@ -1,121 +1,122 @@
#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 = " :"
###
### 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
###
### 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
###
#messages.tpl, Reply
Reply = Répondre
#messages.tpl, the X link title
DeleteThisMessage = Effacer ce message
#home.php, messages error
MessageDeleted = Message effacé.
NotYourMessage = Hey, ce message appartient à autrui !
MessageAlreadyDeleted = Message déjà effacé
###
### Errors
###
UnauthorizedAccess = "Accès non autorisé"
SQLError = "Erreur dans la requête SQL"
line = ligne
Error = Erreur
BackToHome = "Retour à la page d'accueil"
FatalErrorScreen = Fatal error screen
FatalErrorInterrupt = Fatal error screen (interruption)
GeneralError = "Erreur"
PageNotFound = "Cette page n'existe pas."
###
### Perso create/select
###
NewCharacterCreated = Nouveau perso créé.
CreateCharacter = Nouveau perso
EditCharacter = Éditer les infos de %s
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>'."
NicknameUnavailable = "This nickname is already used.<br />Choose a more original one."
PickPerso = "Sélectionnez votre perso"
SwapPerso = "Changer de perso (déco %s)"
NewLocationNotify = "Vous vous réveillez lentement dans un endroit inconnu"
###
### Places
###
UnknownBody = "Astéroïde inconnu"
UnknownPlace = "Endroit inconnu"
WherePlace = "%2$s, %1$s."
SpaceAround = "%s et l'espace autour"
hypership = hypership
asteroid = astéroïde
moon = lune
planet = planète
star = étoile
orbital = orbitale
###
### Stories
###
-InvalidStoryGUID = "En mode récit, il n'est pas possible d'utiliser les boutons précédents et suivants."
+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
###
Title = Titre
\ No newline at end of file
diff --git a/lang/fr/profile.conf b/lang/fr/profile.conf
new file mode 100644
index 0000000..f636530
--- /dev/null
+++ b/lang/fr/profile.conf
@@ -0,0 +1,122 @@
+#Azhàr language config file - Profiles
+#Language: French
+#Code: fr
+#Author: Wolfaeym
+
+###
+### 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).
+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>.
+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.
+
+###
+### 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.
+Who = Qui ?
+WhoIsFaerie = 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
diff --git a/skins/zed/profile.tpl b/skins/zed/profile.tpl
new file mode 100644
index 0000000..80376e4
--- /dev/null
+++ b/skins/zed/profile.tpl
@@ -0,0 +1,99 @@
+ <!-- Faerie profile -->
+ <div class="grid_11 alpha profile">
+ <div class="profile_id clearfix">
+ <h1 class="profile_nick">{$NAME}</h1>
+ <div class="profile_info">
+{if $PHONE}
+ <img src="/skins/VacuumCleanerBridge/images/tel.png" title="{#PhoneNumber#}" alt="{#PhoneNumberAlt#}" align="top" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {$PHONE}
+{/if}
+ <br />
+{if $MAIL}
+ <img src="/skins/VacuumCleanerBridge/images/mail.png" title="{#Mail#}" alt="{#MailAlt#}" align="top" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="mailto:{$MAIL}">{$MAIL}</a>&nbsp;
+{/if}
+ </div>
+ </div>
+ <div class="profile_separator"></div>
+{if $PICS}
+ <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 class="photos_item"></div>
+ </div>
+{/if}
+ <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="{$URL_USER}/edit/profile">{/if}<img src="/skins/VacuumCleanerBridge/images/empty_profile.png" width="642" height="392" alt="Be creative ! Fill this space with your best words." />{if $PROFILE_SELF}</a>{/if}{/if}</div>
+ <div class="profile_separator_light"></div>
+ <div class="profile_message">
+ <h2 id="Message">{#DropMessage#}</h2>
+ <form method="post" action="{$URL_USER}/{$USERNAME}">
+ <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>
+
+ <!-- Faerie 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="{$URL_USER}/edit/profile">{#EditProfile#}</a></li>
+ <li><a href="{$URL_USER}/edit/account">{#EditAccount#}</a></li>
+ <li><a href="{$URL_USER}/edit/photos">{if $PICS}{#ManagePhotos#}{else}{#AddPhoto#}{/if}</a></li>
+ </ul>
+{/if}
+{if $SIDEBAR_LASTPICS}
+
+ <!-- {{counter name=section}|romanize}. content from http://photos.folleterre.org -->
+ <h2>{#LastSharedPhotos#}</h2>
+ <div style="text-align: center">
+{foreach from=$SIDEBAR_LASTPICS item=pic}
+ <a href="{$pic->link}"><img src="{$pic->url}" /></a>
+{/foreach}
+ <br />
+ <a href="{$SIDEBAR_LASTPICS_URL}">{#ViewRecentUploads#}</a>
+ </div>
+{/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>
+{if $lift}
+
+ <!-- {{counter name=section}|romanize}. lift request -->
+ <div class="postit_cyan lift">
+ <h2>{$NAME} needs a pickup for {$lift->event->name}</h2>
+ <p>{#IdealDate#}{#_t#} {$lift->date}<br />{#From#}{#_t#} {$lift->from}</p>
+ <p><a href="{$URL_EVENT}/{$lift->event->id}/travel?LiftID={$lift->id}">{#OfferLift#}</a></p>
+ </div>
+{/if}
+
+ </div>
+ <div class="border_bottom"></div>
+ </div>
+ </div>
+
+{if $PROFILE_COMMENTS}
+ <!-- Profile comments -->
+ <div class="grid_16 alpha omega profile_comments" id="comments">
+{foreach from=$PROFILE_COMMENTS item=comment}
+ <div class="comment">
+ <div class="profile_comments_text"><p>{$comment->text|nl2br}</p></div>
+ <div class="profile_comments_info">-- <a href="{$URL_USER}/{$comment->author}">{$comment->authorname}</a>, {$comment->date|date_format:"%Y-%m-%d %H:%M:%S"}.</div>
+ </div>
+{/foreach}
+ </div>
+{/if}
diff --git a/skins/zed/profile_edit.tpl b/skins/zed/profile_edit.tpl
new file mode 100644
index 0000000..c4d8e20
--- /dev/null
+++ b/skins/zed/profile_edit.tpl
@@ -0,0 +1,58 @@
+ <!-- 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="" class="search_form" name="faerie" method="post">
+ <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;">{#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, Fixed; font-weight: 100;">{#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="{$URL_USER}/edit/account">{#EditAccount#}</a></li>
+ <li><a href="{$URL_USER}/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
new file mode 100644
index 0000000..c1d66de
--- /dev/null
+++ b/skins/zed/profile_photo.tpl
@@ -0,0 +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="{$URL_USER}/edit/profile">{#EditProfile#}</a></li>
+ <li><a href="{$URL_USER}/edit/account">{#EditAccount#}</a></li>
+ <li>{if $PICS}{#ManagePhotos#}{else}{#AddPhoto#}{/if}</a></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="{$URL_USER}/edit/photos/edit/{$photo->id}" title="{#EditPictureProperties#}"><img src="/skins/VacuumCleanerBridge/images/open.gif" alt="{#PictureProperties#}"></a>
+ <a href="{$URL_USER}/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
new file mode 100644
index 0000000..e0064d1
--- /dev/null
+++ b/skins/zed/profile_photo_edit.tpl
@@ -0,0 +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="{$URL_USER}/edit/photos/delete/{$photo->id}" title="{#DeletePicture#}">{#DeletePicture#}</a></li>
+ <li><a href="{$URL_USER}/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="{$URL_USER}/edit/profile">{#EditProfile#}</a></li>
+ <li><a href="{$URL_USER}/edit/account">{#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/user_account.tpl b/skins/zed/user_account.tpl
new file mode 100644
index 0000000..2df782b
--- /dev/null
+++ b/skins/zed/user_account.tpl
@@ -0,0 +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="{$URL_USER}/edit/profile">{#EditProfile#}</a></li>
+ <li>{#EditAccount#}</li>
+ <li><a href="{$URL_USER}/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

File Metadata

Mime Type
text/x-diff
Expires
Mon, Nov 25, 03:21 (1 h, 37 m ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
21058
Default Alt Text
(106 KB)

Event Timeline