Page Menu
Home
Code
Search
Configure Global Search
Log In
Files
F211544
ship.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
ship.php
View Options
<?php
/*
* Zed
* (c) 2010, Dereckson, some rights reserved
* Released under BSD license
*
* Raw text or HTML content
*/
//
// Load library and language file
//
require_once
(
'includes/objects/ship.php'
);
lang_load
(
'ships.conf'
);
//
// Ship information
//
//Gets ship from URL
if
(
count
(
$url
)
<
2
)
{
//No parameter, gets ship perso is onboard
if
(!
$code
=
$CurrentPerso
->
location
->
ship_code
)
{
message_die
(
GENERAL_ERROR
,
"/ship/ must be followed by valid ship code.<br />/ship alone only works when you're aboard a ship"
,
"URL error"
);
}
$code
=
'S'
.
$code
;
}
else
{
//Code have been specified
$code
=
$url
[
1
];
if
(!
preg_match
(
"/^S[0-9]{5}$/"
,
$code
))
{
message_die
(
GENERAL_ERROR
,
"/ship/ must be followed by valid ship code"
,
"URL error"
);
}
}
//Gets ship information
$ship
=
Ship
::
get
(
$code
);
//Gets perso note about this ship
$note
=
$CurrentPerso
->
get_note
(
$code
);
//Determines the spatial relation between perso and ship
//dieprint_r($CurrentPerso->location->ship_code);
//
// Actions handling
//
if
(
$_REQUEST
[
'action'
]
==
'ship.setnote'
&&
$_REQUEST
[
'note'
]
!=
$note
)
{
//Updates note content
$CurrentPerso
->
set_note
(
$code
,
$_REQUEST
[
'note'
]);
$note
=
$_REQUEST
[
'note'
];
}
//
// HTML output
//
//Serves header
$smarty
->
assign
(
'PAGE_TITLE'
,
$ship
->
name
);
include
(
'header.php'
);
//Serves content
$smarty
->
assign
(
'note'
,
$note
);
$smarty
->
assign
(
'ship'
,
$ship
);
$smarty
->
display
(
'ship.tpl'
);
//Serves footer
include
(
'footer.php'
);
?>
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Nov 24, 09:08 (12 h, 45 m ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
22720
Default Alt Text
ship.php (1 KB)
Attached To
rZEDHG ZedLegacy
Event Timeline
Log In to Comment