okapi r768

This commit is contained in:
following
2013-04-21 15:50:08 +02:00
parent a23bf150ca
commit ebb9d45160
4 changed files with 17 additions and 9 deletions
+2 -1
View File
@@ -201,6 +201,7 @@ class OkapiExceptionHandler
$exception_info .= (isset($_SERVER['REQUEST_URI']) ? "--- OKAPI method called ---\n".
preg_replace("/([?&])/", "\n$1", $_SERVER['REQUEST_URI'])."\n\n" : "");
$exception_info .= "--- OKAPI revision ---\n".Okapi::$revision."\n\n";
$exception_info .= "--- Request headers ---\n".implode("\n", array_map(
function($k, $v) { return "$k: $v"; },
array_keys(getallheaders()), array_values(getallheaders())
@@ -798,7 +799,7 @@ class Okapi
{
public static $data_store;
public static $server;
public static $revision = 764; # This gets replaced in automatically deployed packages
public static $revision = 768; # This gets replaced in automatically deployed packages
private static $okapi_vars = null;
/** Get a variable stored in okapi_vars. If variable not found, return $default. */
+8 -3
View File
@@ -289,9 +289,14 @@
<li><b>last_modified</b> - date and time (ISO 8601) when the
geocache was last modified (changed status, attributes, etc.),</li>
<li><b>date_created</b> - date and time (ISO 8601) when the
geocache was initially created,</li>
<li><b>date_hidden</b> - date and time (ISO 8601) when the
geocache was first hidden,</li>
geocache was listed at the Opencaching site,</li>
<li><b>date_hidden</b> - date and time (ISO 8601) when
<ul>
<li>the geocache was first hidden (for physical caches), or </li>
<li>the geocache was first published (for virtual caches), or</li>
<li>the event takes place (for event caches),</li>
</ul>
</li>
<!-- Note: I think cache uuids should not be ever revealed to the public.
We have already one universally unique key - the cache code. It is uncommon
to have multiple universally unique keys. -->
+5 -4
View File
@@ -151,6 +151,7 @@ class WebService
# - Total numbers of founds and notfounds are kept in the "stat_caches" table.
# - search_time and way_length are both round trip values and cannot be null;
# 0 = not specified
# - will-attend-count is stored in separate field
$rs = Db::query("
select
@@ -163,6 +164,7 @@ class WebService
ifnull(sc.toprating, 0) as topratings,
ifnull(sc.found, 0) as founds,
ifnull(sc.notfound, 0) as notfounds,
ifnull(sc.will_attend, 0) as willattends,
sc.last_found,
0 as votes, 0 as score
-- SEE ALSO OC.PL BRANCH BELOW
@@ -181,6 +183,7 @@ class WebService
# - Total numbers of found and notfounds are kept in the "caches" table.
# - search_time is round trip and way_length one way or both ways (this is different on OCDE!);
# both can be null; 0 or null = not specified
# - will-attend-count is stored in caches.notfounds
$rs = Db::query("
select
@@ -193,6 +196,7 @@ class WebService
c.topratings,
c.founds,
c.notfounds,
c.notfounds as willattends,
c.last_found,
c.votes, c.score
-- SEE ALSO OC.DE BRANCH ABOVE
@@ -254,11 +258,8 @@ class WebService
}
break;
case 'willattends':
# OCPL stats count "Will attend" log entries as "notfounds"
# (just another pecularity regarding "event caches").
# I am not sure about OCDE branch though...
if ($row['type'] == 6) { # event
$entry['willattends'] = $row['notfounds'] + 0;
$entry['willattends'] = $row['willattends'] + 0;
} else { # non-event
$entry['willattends'] = 0;
}
+2 -1
View File
@@ -69,7 +69,8 @@
<input type='checkbox' id='terms' name='terms'>
<label for='terms'>I read and agree to both:</label>
<ul>
<li><?= $vars['site_name'] ?> <?= $vars['data_license_html'] ?>, and</li>
<li><?= $vars['site_name'] ?> <?= $vars['data_license_html'] ?>
(these differ across various OC nodes!), and</li>
<li>OKAPI Terms of Use (see below)</li>
</ul>
<input type='button' class='button' id='submit' value='Send me my API Key!'>