Started with JSON API module system

This commit is contained in:
Stefan Brannfjell
2014-03-09 04:42:28 +01:00
parent 7861292449
commit 733766dd45
8 changed files with 166 additions and 5 deletions

View File

@@ -97,7 +97,6 @@ function url($path = false) {
return $protocol . $domain . $folder . '/' . $path;
}
// Get last cached
function getCache() {
$results = mysql_select_single("SELECT `cached` FROM `znote`;");
return ($results !== false) ? $results['cached'] : false;
@@ -294,6 +293,7 @@ function getIP() {
return $_SERVER['REMOTE_ADDR'];
}
// Deprecated, just use count($array) instead.
function array_length($ar) {
$r = 1;
foreach($ar as $a) {
@@ -329,7 +329,6 @@ function online_id_to_name($id) {
// Parameter: players.vocation_id. Returns: Configured vocation name.
function vocation_id_to_name($id) {
$vocations = config('vocations');
return ($vocations[$id] >= 0) ? $vocations[$id] : false;
}
@@ -361,7 +360,6 @@ function skillid_to_name($skillid) {
// Parameter: players.town_id. Returns: Configured town name.
function town_id_to_name($id) {
$towns = config('towns');
return (array_key_exists($id, $towns)) ? $towns[$id] : 'Missing Town';
}