okapi r669

This commit is contained in:
following
2013-04-04 19:36:29 +02:00
parent b07075c066
commit 1c9c57ddc3
14 changed files with 304 additions and 132 deletions

View File

@ -778,7 +778,7 @@ class Okapi
{
public static $data_store;
public static $server;
public static $revision = 651; # This gets replaced in automatically deployed packages
public static $revision = 669; # 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. */
@ -1097,7 +1097,7 @@ class Okapi
static $init_made = false;
if ($init_made)
return;
ini_set('memory_limit', '128M');
ini_set('memory_limit', '256M');
Db::connect();
if (Settings::get('TIMEZONE') !== null)
date_default_timezone_set(Settings::get('TIMEZONE'));

View File

@ -2,8 +2,8 @@ msgid ""
msgstr ""
"Project-Id-Version: OKAPI\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-03-30 23:41+0100\n"
"PO-Revision-Date: 2013-03-30 23:42+0100\n"
"POT-Creation-Date: 2013-04-01 20:47+0100\n"
"PO-Revision-Date: 2013-04-01 20:48+0100\n"
"Last-Translator: following <following@online.de>\n"
"Language-Team: following <following@online.de>\n"
"Language: German\n"
@ -11,28 +11,28 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Poedit-KeywordsList: _;gettext;gettext_noop\n"
"X-Poedit-Basepath: c:\\source\\oc\\okapi\\following2\n"
"X-Poedit-Basepath: c:\\source\\oc\\server-3.0\\htdocs\\okapi\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Generator: Poedit 1.5.5\n"
"X-Poedit-SearchPath-0: c:\\source\\oc\\okapi\\following2\n"
"X-Poedit-SearchPath-0: c:\\source\\oc\\server-3.0\\htdocs\\okapi\n"
#: c:\source\oc\okapi\following2/okapi/services/caches/geocaches.php:817
#: c:\source\oc\server-3.0\htdocs\okapi/services/caches/geocaches.php:821
msgid "Stage"
msgstr "Station"
#: c:\source\oc\okapi\following2/okapi/services/caches/geocaches.php:950
#: c:\source\oc\server-3.0\htdocs\okapi/services/caches/geocaches.php:975
#, php-format
msgid ""
"<em>&copy; <a href='%s'>%s</a>, <a href='%s'>%s</a>, <a href='http://"
"&copy; <a href='%s'>%s</a>, <a href='%s'>%s</a>, <a href='http://"
"creativecommons.org/licenses/by-nc-nd/3.0/de/deed.en'>CC-BY-NC-ND</a>, as of "
"%s; all log entries &copy; their authors</em>"
"%s; all log entries &copy; their authors"
msgstr ""
"<em>&copy; <a href='%s'>%s</a>, <a href='%s'>%s</a>, <a href='http://"
"&copy; <a href='%s'>%s</a>, <a href='%s'>%s</a>, <a href='http://"
"creativecommons.org/licenses/by-nc-nd/3.0/de/'>CC-BY-NC-ND</a>, Stand: %s; "
"alle Logeinträge &copy; jeweiliger Autor</em>"
"alle Logeinträge &copy; jeweiliger Autor"
#: c:\source\oc\okapi\following2/okapi/services/caches/geocaches.php:960
#: c:\source\oc\server-3.0\htdocs\okapi/services/caches/geocaches.php:988
#, php-format
msgid ""
"This <a href='%s'>geocache</a> description comes from the <a href='%s'>%s</"
@ -40,57 +40,57 @@ msgid ""
msgstr ""
"Diese <a href='%s'>Cache</a>-Beschreibung stammt von <a href='%s'>%s</a>."
#: c:\source\oc\okapi\following2/okapi/services/caches/formatters/gpxfile.tpl.php:31
#: c:\source\oc\okapi\following2/okapi/services/caches/formatters/gpxfile.tpl.php:48
#: c:\source\oc\server-3.0\htdocs\okapi/services/caches/formatters/gpxfile.tpl.php:31
#: c:\source\oc\server-3.0\htdocs\okapi/services/caches/formatters/gpxfile.tpl.php:48
msgid "hidden by"
msgstr "versteckt von"
#: c:\source\oc\okapi\following2/okapi/services/caches/formatters/gpxfile.tpl.php:50
#: c:\source\oc\server-3.0\htdocs\okapi/services/caches/formatters/gpxfile.tpl.php:50
#, php-format
msgid "%d recommendation"
msgid_plural "%d recommendations"
msgstr[0] "%d Empfehlung"
msgstr[1] "%d Empfehlungen"
#: c:\source\oc\okapi\following2/okapi/services/caches/formatters/gpxfile.tpl.php:51
#: c:\source\oc\server-3.0\htdocs\okapi/services/caches/formatters/gpxfile.tpl.php:51
#, php-format
msgid "found %d time"
msgid_plural "found %d times"
msgstr[0] "%d mal gefunden"
msgstr[1] "%d mal gefunden"
#: c:\source\oc\okapi\following2/okapi/services/caches/formatters/gpxfile.tpl.php:54
#: c:\source\oc\server-3.0\htdocs\okapi/services/caches/formatters/gpxfile.tpl.php:54
#, php-format
msgid "%d trackable"
msgid_plural "%d trackables"
msgstr[0] "%d Geokret"
msgstr[1] "%d Geokrets"
#: c:\source\oc\okapi\following2/okapi/services/caches/formatters/gpxfile.tpl.php:58
#: c:\source\oc\server-3.0\htdocs\okapi/services/caches/formatters/gpxfile.tpl.php:58
msgid "Personal notes"
msgstr "Persönliche Notizen"
#: c:\source\oc\okapi\following2/okapi/services/caches/formatters/gpxfile.tpl.php:62
#: c:\source\oc\server-3.0\htdocs\okapi/services/caches/formatters/gpxfile.tpl.php:62
msgid "Attributes"
msgstr "Attribute"
#: c:\source\oc\okapi\following2/okapi/services/caches/formatters/gpxfile.tpl.php:66
#: c:\source\oc\server-3.0\htdocs\okapi/services/caches/formatters/gpxfile.tpl.php:66
msgid "Trackables"
msgstr "Geokrets"
#: c:\source\oc\okapi\following2/okapi/services/caches/formatters/gpxfile.tpl.php:84
#: c:\source\oc\server-3.0\htdocs\okapi/services/caches/formatters/gpxfile.tpl.php:84
msgid "Images"
msgstr "Bilder"
#: c:\source\oc\okapi\following2/okapi/services/caches/formatters/gpxfile.tpl.php:91
#: c:\source\oc\server-3.0\htdocs\okapi/services/caches/formatters/gpxfile.tpl.php:91
msgid "Spoilers"
msgstr "Spoiler"
#: c:\source\oc\okapi\following2/okapi/services/caches/formatters/gpxfile.tpl.php:99
#: c:\source\oc\server-3.0\htdocs\okapi/services/caches/formatters/gpxfile.tpl.php:99
msgid "Image descriptions"
msgstr "Bildbeschreibungen"
#: c:\source\oc\okapi\following2/okapi/services/logs/submit.php:75
#: c:\source\oc\server-3.0\htdocs\okapi/services/logs/submit.php:70
msgid ""
"You are trying to publish a log entry with a date in future. Cache log "
"entries are allowed to be published in the past, but NOT in the future."
@ -98,7 +98,7 @@ msgstr ""
"Das Datum deines Logeintrags liegt in der Zukunft. Cache-Logs können nur für "
"die Vergangenheit oder für heute eingetragen werden."
#: c:\source\oc\okapi\following2/okapi/services/logs/submit.php:97
#: c:\source\oc\server-3.0\htdocs\okapi/services/logs/submit.php:92
#, php-format
msgid ""
"However, your cache rating was ignored, because %s does not have a rating "
@ -106,11 +106,11 @@ msgid ""
msgstr ""
"Deine Cachewertung wurde jedoch ignoriert, weil %s kein Bewertungssystem hat."
#: c:\source\oc\okapi\following2/okapi/services/logs/submit.php:108
#: c:\source\oc\server-3.0\htdocs\okapi/services/logs/submit.php:103
msgid "Recommending is allowed only for 'Found it' logtypes."
msgstr "Empfehlungen sind nur bei 'Gefunden'-Logs erlaubt."
#: c:\source\oc\okapi\following2/okapi/services/logs/submit.php:118
#: c:\source\oc\server-3.0\htdocs\okapi/services/logs/submit.php:113
#, php-format
msgid ""
"However, your \"needs maintenance\" flag was ignored, because %s does not "
@ -119,7 +119,7 @@ msgstr ""
"Deine Angabe \"benötigt Wartung\" wurde jedoch ignoriert, weil es diese "
"Funktion bei %s nicht gibt."
#: c:\source\oc\okapi\following2/okapi/services/logs/submit.php:136
#: c:\source\oc\server-3.0\htdocs\okapi/services/logs/submit.php:131
msgid ""
"This cache is an Event cache. You cannot \"Find it\"! (But - you may "
"\"Comment\" on it.)"
@ -127,26 +127,26 @@ msgstr ""
"Dies ist ein Event-Cache. Du kannst ihn nicht \"finden\" (aber du kannst "
"einen Hinweis loggen)."
#: c:\source\oc\okapi\following2/okapi/services/logs/submit.php:138
#: c:\source\oc\server-3.0\htdocs\okapi/services/logs/submit.php:133
msgid "Your have to supply some text for your comment."
msgstr "Du musst einen Text für dein Hinweislog eingeben!"
#: c:\source\oc\okapi\following2/okapi/services/logs/submit.php:151
#: c:\source\oc\server-3.0\htdocs\okapi/services/logs/submit.php:146
msgid "This cache requires a password. You didn't provide one!"
msgstr ""
"Dieser Cache kann nur mit Kennwort geloggt werden, aber du hast keines "
"angegeben."
#: c:\source\oc\okapi\following2/okapi/services/logs/submit.php:153
#: c:\source\oc\server-3.0\htdocs\okapi/services/logs/submit.php:148
msgid "Invalid password!"
msgstr "Ungültiges Kennwort!"
#: c:\source\oc\okapi\following2/okapi/services/logs/submit.php:203
#: c:\source\oc\server-3.0\htdocs\okapi/services/logs/submit.php:264
msgid "You have already submitted a log entry with exactly the same contents."
msgstr ""
"Du hast bereits einen Logeintrag mit genau dem gleichen Inhalt gemacht."
#: c:\source\oc\okapi\following2/okapi/services/logs/submit.php:222
#: c:\source\oc\server-3.0\htdocs\okapi/services/logs/submit.php:283
msgid ""
"You have already submitted a \"Found it\" log entry once. Now you may submit "
"\"Comments\" only!"
@ -154,49 +154,49 @@ msgstr ""
"Du hast diesen Cache bereits als gefunden geloggt. Ein zweites Fundlog ist "
"nicht möglich, aber du kannst stattdessen einen Hinweis loggen."
#: c:\source\oc\okapi\following2/okapi/services/logs/submit.php:224
#: c:\source\oc\server-3.0\htdocs\okapi/services/logs/submit.php:285
msgid "You are the owner of this cache. You may submit \"Comments\" only!"
msgstr ""
"Als Besitzer des Caches kannst du nur Hinweise loggen, keine Funde oder "
"Nichtfunde."
#: c:\source\oc\okapi\following2/okapi/services/logs/submit.php:242
#: c:\source\oc\server-3.0\htdocs\okapi/services/logs/submit.php:303
msgid "You have already rated this cache once. Your rating cannot be changed."
msgstr ""
"Du hast diesen Cache bereits bewertet. Deine Bewertung ist nicht änderbar."
#: c:\source\oc\okapi\following2/okapi/services/logs/submit.php:259
#: c:\source\oc\server-3.0\htdocs\okapi/services/logs/submit.php:320
msgid "You have already recommended this cache once."
msgstr "Du hast diesen Cache bereits empfohlen."
#: c:\source\oc\okapi\following2/okapi/services/logs/submit.php:266
#: c:\source\oc\server-3.0\htdocs\okapi/services/logs/submit.php:327
msgid "You don't have any recommendations to give. Find more caches first!"
msgstr ""
"Du musst mehr Caches finden, um eine weitere Bewertung abgeben zu können!"
#: c:\source\oc\okapi\following2/okapi/services/logs/submit.php:430
#: c:\source\oc\server-3.0\htdocs\okapi/services/logs/submit.php:495
msgid "Your cache log entry was posted successfully."
msgstr "Dein Log wurde veröffentlicht."
#: c:\source\oc\okapi\following2/okapi/views/apps/authorize.tpl.php:5
#: c:\source\oc\server-3.0\htdocs\okapi/views/apps/authorize.tpl.php:5
msgid "Authorization Form"
msgstr "Authorisierungs-Formular"
#: c:\source\oc\okapi\following2/okapi/views/apps/authorize.tpl.php:46
#: c:\source\oc\server-3.0\htdocs\okapi/views/apps/authorize.tpl.php:46
msgid "Expired request"
msgstr "Anfrage abgelaufen"
#: c:\source\oc\okapi\following2/okapi/views/apps/authorize.tpl.php:47
#: c:\source\oc\server-3.0\htdocs\okapi/views/apps/authorize.tpl.php:47
msgid "Unfortunately, the request has expired. Please try again."
msgstr ""
"Die Anfrage ist wegen Zeitüberschreitung abgelaufen. Bitte versuche es noch "
"einmal."
#: c:\source\oc\okapi\following2/okapi/views/apps/authorize.tpl.php:49
#: c:\source\oc\server-3.0\htdocs\okapi/views/apps/authorize.tpl.php:49
msgid "External application is requesting access..."
msgstr "Eine externe Anwendung wünscht Zugriff ..."
#: c:\source\oc\okapi\following2/okapi/views/apps/authorize.tpl.php:50
#: c:\source\oc\server-3.0\htdocs\okapi/views/apps/authorize.tpl.php:50
#, php-format
msgid ""
"<b>%s</b> wants to access your <b>%s</b> account. Do you agree to grant "
@ -205,15 +205,15 @@ msgstr ""
"<b>%s</b> möchte auf dein <b>%s</b>-Benutzerkonto zugreifen. Möchtest du "
"dieser Anwendung Zugriff gewähren?"
#: c:\source\oc\okapi\following2/okapi/views/apps/authorize.tpl.php:53
#: c:\source\oc\server-3.0\htdocs\okapi/views/apps/authorize.tpl.php:53
msgid "I agree"
msgstr "Ja"
#: c:\source\oc\okapi\following2/okapi/views/apps/authorize.tpl.php:54
#: c:\source\oc\server-3.0\htdocs\okapi/views/apps/authorize.tpl.php:54
msgid "Decline"
msgstr "Nein"
#: c:\source\oc\okapi\following2/okapi/views/apps/authorize.tpl.php:56
#: c:\source\oc\server-3.0\htdocs\okapi/views/apps/authorize.tpl.php:56
#, php-format
msgid ""
"\n"
@ -241,15 +241,15 @@ msgstr ""
"\t\t\t\t\tDu kannst diese Erlaubnis jederzeit widerrufen.</p>\n"
"\t\t\t\t"
#: c:\source\oc\okapi\following2/okapi/views/apps/authorized.tpl.php:5
#: c:\source\oc\server-3.0\htdocs\okapi/views/apps/authorized.tpl.php:5
msgid "Authorization Succeeded"
msgstr "Authorisierung erfolgreich"
#: c:\source\oc\okapi\following2/okapi/views/apps/authorized.tpl.php:28
#: c:\source\oc\server-3.0\htdocs\okapi/views/apps/authorized.tpl.php:28
msgid "Access successfully granted"
msgstr "Zugang wurde gewährt"
#: c:\source\oc\okapi\following2/okapi/views/apps/authorized.tpl.php:29
#: c:\source\oc\server-3.0\htdocs\okapi/views/apps/authorized.tpl.php:29
#, php-format
msgid ""
"\n"
@ -266,15 +266,15 @@ msgstr ""
"PIN-Code ein:</p>\n"
"\t\t\t"
#: c:\source\oc\okapi\following2/okapi/views/apps/index.tpl.php:5
#: c:\source\oc\server-3.0\htdocs\okapi/views/apps/index.tpl.php:5
msgid "My Apps"
msgstr "Meine Apps"
#: c:\source\oc\okapi\following2/okapi/views/apps/index.tpl.php:29
#: c:\source\oc\server-3.0\htdocs\okapi/views/apps/index.tpl.php:29
msgid "Your external applications"
msgstr "Deine externe Anwendung"
#: c:\source\oc\okapi\following2/okapi/views/apps/index.tpl.php:31
#: c:\source\oc\server-3.0\htdocs\okapi/views/apps/index.tpl.php:31
#, php-format
msgid ""
"\n"
@ -296,11 +296,11 @@ msgstr ""
"Aktionen mehr unter deinem \t\t\t\t\tBenutzername ausführen können.</p>\n"
"\t\t\t\t"
#: c:\source\oc\okapi\following2/okapi/views/apps/index.tpl.php:45
#: c:\source\oc\server-3.0\htdocs\okapi/views/apps/index.tpl.php:45
msgid "remove"
msgstr "entfernen"
#: c:\source\oc\okapi\following2/okapi/views/apps/index.tpl.php:50
#: c:\source\oc\server-3.0\htdocs\okapi/views/apps/index.tpl.php:50
#, php-format
msgid ""
"\n"

View File

@ -2,8 +2,8 @@ msgid ""
msgstr ""
"Project-Id-Version: OKAPI\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-02-19 10:36+0100\n"
"PO-Revision-Date: 2013-02-19 10:37+0100\n"
"POT-Creation-Date: 2013-04-04 16:09+0100\n"
"PO-Revision-Date: 2013-04-04 16:13+0100\n"
"Last-Translator: Wojciech Rygielski <rygielski@mimuw.edu.pl>\n"
"Language-Team: \n"
"Language: pl_PL\n"
@ -19,17 +19,39 @@ msgstr ""
"X-Generator: Poedit 1.5.5\n"
"X-Poedit-SearchPath-0: .\n"
#: services/caches/geocaches.php:746
#: services/caches/geocaches.php:847
msgid "Stage"
msgstr "Etap"
#: services/caches/geocaches.php:866
#: services/caches/geocaches.php:1014
#, php-format
msgid ""
"This <a href='%s'>geocache</a> description comes from the <a href='%s'>%s</"
"a> site."
msgstr "Opis <a href='%s'>skrzynki</a> pochodzi z serwisu <a href='%s'>%s</a>."
#: services/caches/geocaches.php:1024
#, php-format
msgid ""
"&copy; <a href='%s'>%s</a>, <a href='%s'>%s</a>, <a href='http://"
"creativecommons.org/licenses/by-nc-nd/3.0/de/deed.en'>CC-BY-NC-ND</a>, as of "
"%s; all log entries &copy; their authors"
msgstr ""
"Prawa autorskie: <a href='%s'>%s</a>, <a href='%s'>%s</a>, <a href='http://"
"creativecommons.org/licenses/by-nc-nd/3.0/de/deed.pl'>CC-BY-NC-ND</a>, w "
"dniu %s. Prawa autorskie wpisów do logów należą do ich autorów."
#: services/caches/geocaches.php:1035
#, php-format
msgid ""
"&copy; <a href='%s'>%s</a>, <a href='%s'>%s</a>, <a href='http://"
"creativecommons.org/licenses/by-nc-nd/3.0/de/deed.en'>CC-BY-NC-ND</a>; all "
"log entries &copy; their authors"
msgstr ""
"Prawa autorskie: <a href='%s'>%s</a>, <a href='%s'>%s</a>, <a href='http://"
"creativecommons.org/licenses/by-nc-nd/3.0/de/deed.pl'>CC-BY-NC-ND</a>. Prawa "
"autorskie wpisów do logów należą do ich autorów."
#: services/caches/formatters/gpxfile.tpl.php:31
#: services/caches/formatters/gpxfile.tpl.php:48
msgid "hidden by"
@ -83,7 +105,7 @@ msgstr "Spoilery"
msgid "Image descriptions"
msgstr "Opisy obrazków"
#: services/logs/submit.php:62
#: services/logs/submit.php:70
msgid ""
"You are trying to publish a log entry with a date in future. Cache log "
"entries are allowed to be published in the past, but NOT in the future."
@ -91,7 +113,7 @@ msgstr ""
"Próbujesz opublikować wpis do logbooka używając daty w przyszłości. Wpisy "
"mogą być publikowane z datą w przeszłości, ale NIE w przyszłości."
#: services/logs/submit.php:82
#: services/logs/submit.php:92
#, php-format
msgid ""
"However, your cache rating was ignored, because %s does not have a rating "
@ -100,11 +122,11 @@ msgstr ""
"Niestety Twoja ocena skrzynki nie została zapisana, ponieważ %s nie prowadzi "
"oceny skrzynek."
#: services/logs/submit.php:92
#: services/logs/submit.php:103
msgid "Recommending is allowed only for 'Found it' logtypes."
msgstr "Rekomendacje są dozwolone jedynie z wpisem \"Znaleziona\"."
#: services/logs/submit.php:101
#: services/logs/submit.php:113
#, php-format
msgid ""
"However, your \"needs maintenance\" flag was ignored, because %s does not "
@ -113,7 +135,7 @@ msgstr ""
"Niestety, wpis \"potrzebny serwis\" został zignorowany, ponieważ %s nie "
"wspiera tej funkcjonalności."
#: services/logs/submit.php:119
#: services/logs/submit.php:131
msgid ""
"This cache is an Event cache. You cannot \"Find it\"! (But - you may "
"\"Comment\" on it.)"
@ -121,23 +143,23 @@ msgstr ""
"Ta skrzynka jest typu Wydarzenie. Nie możesz jej \"znaleźć\"! (Ale - możesz "
"dodać wpis typu \"Komentarz\".)"
#: services/logs/submit.php:121
#: services/logs/submit.php:133
msgid "Your have to supply some text for your comment."
msgstr "Wpis typu \"Komentarz\" wymaga wpisania komentarza."
#: services/logs/submit.php:134
#: services/logs/submit.php:146
msgid "This cache requires a password. You didn't provide one!"
msgstr "Ta skrzynka wymaga podania hasła. Nie wpisałeś go."
#: services/logs/submit.php:136
#: services/logs/submit.php:148
msgid "Invalid password!"
msgstr "Niepoprawne hasło!"
#: services/logs/submit.php:186
#: services/logs/submit.php:264
msgid "You have already submitted a log entry with exactly the same contents."
msgstr "Już opublikowałeś wcześniej wpis z dokładnie taką samą treścią."
#: services/logs/submit.php:205
#: services/logs/submit.php:283
msgid ""
"You have already submitted a \"Found it\" log entry once. Now you may submit "
"\"Comments\" only!"
@ -145,26 +167,26 @@ msgstr ""
"Już opublikowałeś jeden wpis typu \"Znaleziona\" dla tej skrzynki. Teraz "
"możesz dodawać jedynie \"Komentarze\"!"
#: services/logs/submit.php:207
#: services/logs/submit.php:285
msgid "You are the owner of this cache. You may submit \"Comments\" only!"
msgstr ""
"Jesteś właścicielem tej skrzynki. Możesz przesyłać jedynie \"Komentarze\"."
#: services/logs/submit.php:225
#: services/logs/submit.php:303
msgid "You have already rated this cache once. Your rating cannot be changed."
msgstr "Już oceniłeś tę skrzynkę. Ocena nie może być zmieniona."
#: services/logs/submit.php:242
#: services/logs/submit.php:320
msgid "You have already recommended this cache once."
msgstr "Już raz zarekomendowałeś tę skrzynkę."
#: services/logs/submit.php:249
#: services/logs/submit.php:327
msgid "You don't have any recommendations to give. Find more caches first!"
msgstr ""
"Aktualnie nie możesz wystawić kolejnej rekomendacji. Znajdź najpierw więcej "
"skrzynek!"
#: services/logs/submit.php:413
#: services/logs/submit.php:495
msgid "Your cache log entry was posted successfully."
msgstr "Twój wpis do logbooka został opublikowany pomyślnie."

View File

@ -32,10 +32,13 @@ class WebService
if (!$log_fields) $log_fields = "uuid|date|user|type|comment";
$lpc = $request->get_parameter('lpc');
if (!$lpc) $lpc = 10;
$attribution_append = $request->get_parameter('attribution_append');
if (!$attribution_append) $attribution_append = 'full';
$params = array(
'cache_codes' => $cache_code,
'langpref' => $langpref,
'fields' => $fields,
'attribution_append' => $attribution_append,
'lpc' => $lpc,
'log_fields' => $log_fields
);

View File

@ -141,6 +141,17 @@
</li>
<li><b>difficulty</b> - float (between 1 and 5), difficulty rating of the cache,</li>
<li><b>terrain</b> - float (between 1 and 5), terrain rating of the cache,</li>
<li>
<b>trip_time</b> - float, approximate total amount of time needed to
find the cache, in hours; this will usually include the time to reach the
cache location <em>and</em> go back (from/to a parking spot, etc.);
<b>null</b> if unknown,
</li>
<li><b>trip_distance</b> - float, approximate total distance needed to
find the cache, in kilometers; this will usually include the time to reach the
cache location <em>and</em> go back (from/to a parking spot, etc.);
<b>null</b> if unknown,
</li>
<li>
<p><b>rating</b> - float (between 1 and 5), an overall rating of the cache,
or <b>null</b> when the geocache does not have a sufficient amount of votes
@ -196,6 +207,11 @@
*if* OC installations would begin to use UUIDs for their attributes and synchronize them
between all installations.</p>
</li>
<li>
<p><b>attribution_note</b> - the proper attribution note for the cache listing according
to the local OC site's Data License. By default, this note is also appended to geocache
descriptions (see the <b>attribution_append</b> parameter).</p>
</li>
<li>
<p><b>latest_logs</b> - a couple of latest log entries in the cache.
The format is the same as the one returned by the services/logs/logs method.</p>
@ -243,8 +259,10 @@
</li>
<li>
<p><b>state</b> - name of the state the cache is placed in.</p>
<p><b>Note:</b> This data is user-supplied and is not validated in
any way. Consider using external geocoding services instead. Also,
<p><b>Note:</b> On some installations this data is user-supplied and
is not validated in any way. Other installations calculate it from
cache coordinates but may have problems in border regions.
Consider using external geocoding services instead. Also,
currently you have no way of knowing in which language it will appear
in (but it *may* start to vary on the value of your <b>langpref</b>
parameter in the future).</p>
@ -268,6 +286,37 @@
this, unless you know what you're doing; use the "code" as an identifier).</li>
</ul>
</opt>
<opt name='attribution_append' default='full'>
<p>By default, OKAPI appends the value of <b>attribution_note</b> field to all the
cache descriptions. If you would like to display the attribution note separately,
you may use this parameter. Use one of the following values:</p>
<ul>
<li>
<b>full</b> - OKAPI will append the attribution note to the descriptions of the
geocache. The language of the note will match the language of the description
(i.e. each value in <b>descriptions</b> may contain attribution notes in
a different language).
</li>
<li>
<p><b>none</b> - OKAPI will not append the attribution note to geocache
descriptions. You will use the <b>attribution_note</b> instead (which depends
on the <b>langpref</b> parameter).</p>
<p><b>Important note:</b> You are still <b>required</b> to display the
<b>attribution_note</b> field in some other way.</p>
</li>
<li>
<b>static</b> - OKAPI will append a "static" attribution note to the descriptions
of the geocache. This might equal the "full" attribution note, but not necessarilly,
since the "full" note may contain a current date
(<a href='https://code.google.com/p/opencaching-api/issues/detail?id=178'>why?</a>),
and the "static" note will not. This is implemented primarily for internal use
(i.e. the replicate module). Usually you should not use it, because on some
installations the static note will not be sufficient to meet the data license
requirements.
</li>
</ul>
</opt>
<opt name='lpc' default='10'>
Log-entries per cache - the number of logs returned in the <b>latest_logs</b> field.
This should be an integer or a special "all" value. Please note, that you must include

View File

@ -31,7 +31,8 @@ class WebService
'descriptions', 'hint', 'hints', 'images', 'attrnames', 'latest_logs',
'my_notes', 'trackables_count', 'trackables', 'alt_wpts', 'last_found',
'last_modified', 'date_created', 'date_hidden', 'internal_id', 'is_watched',
'is_ignored', 'willattends', 'country', 'state', 'preview_image');
'is_ignored', 'willattends', 'country', 'state', 'preview_image',
'trip_time', 'trip_distance', 'attribution_note');
public static function call(OkapiRequest $request)
{
@ -63,16 +64,33 @@ class WebService
if (!in_array($field, self::$valid_field_names))
throw new InvalidParam('fields', "'$field' is not a valid field code.");
# Currently, the "owner" field needs to be included whenever the "description" field is.
# That's a little ugly. Grep for "issue 178" below for more insight on this.
# Some fields need to be temporarily included whenever the "description"
# or "attribution_note" field are included. That's a little ugly, but
# helps performance and conforms to the DRY rule.
$fields_to_remove_later = array();
if (
(
in_array('description', $fields) || in_array('descriptions', $fields)
|| in_array('hint', $fields) || in_array('hints', $fields)
)
&& !in_array('owner', $fields)
in_array('description', $fields) || in_array('descriptions', $fields)
|| in_array('hint', $fields) || in_array('hints', $fields)
|| in_array('attribution_note', $fields)
)
$fields[] = "owner";
{
if (!in_array('owner', $fields))
{
$fields[] = "owner";
$fields_to_remove_later[] = "owner";
}
if (!in_array('internal_id', $fields))
{
$fields[] = "internal_id";
$fields_to_remove_later[] = "internal_id";
}
}
$attribution_append = $request->get_parameter('attribution_append');
if (!$attribution_append) $attribution_append = 'full';
if (!in_array($attribution_append, array('none', 'static', 'full')))
throw new InvalidParam('attribution_append');
$log_fields = $request->get_parameter('log_fields');
if (!$log_fields) $log_fields = "uuid|date|user|type|comment"; // validation is done on call
@ -131,12 +149,16 @@ class WebService
# DE branch:
# - Caches do not have ratings.
# - 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
$rs = Db::query("
select
c.cache_id, c.name, c.longitude, c.latitude, c.listing_last_modified as last_modified,
c.date_created, c.type, c.status, c.date_hidden, c.size, c.difficulty,
c.terrain, c.wp_oc, c.logpw, c.user_id,
if(c.search_time=0, null, c.search_time) as trip_time,
if(c.way_length=0, null, c.way_length) as trip_distance,
ifnull(sc.toprating, 0) as topratings,
ifnull(sc.found, 0) as founds,
@ -157,12 +179,16 @@ class WebService
# PL branch:
# - Caches have ratings.
# - Total numbers of found and notfounds are kept in the "caches" table.
# - search_time is round trip and way_length one way; both can be null;
# 0 or null = not specified
$rs = Db::query("
select
c.cache_id, c.name, c.longitude, c.latitude, c.last_modified,
c.date_created, c.type, c.status, c.date_hidden, c.size, c.difficulty,
c.terrain, c.wp_oc, c.logpw, c.user_id,
if(c.search_time=0, null, c.search_time) as trip_time,
if(c.way_length=0, null, 2*c.way_length) as trip_distance,
c.topratings,
c.founds,
@ -256,6 +282,16 @@ class WebService
case 'oxsize': $entry['oxsize'] = Okapi::cache_size2_to_oxsize(Okapi::cache_sizeid_to_size2($row['size'])); break;
case 'difficulty': $entry['difficulty'] = round($row['difficulty'] / 2.0, 1); break;
case 'terrain': $entry['terrain'] = round($row['terrain'] / 2.0, 1); break;
case 'trip_time':
# search time is entered in hours:minutes and converted to decimal hours,
# which can produce lots of unneeded decimal places; 2 of them are sufficient here
$entry['trip_time'] = $row['trip_time'] === null ? null : round($row['trip_time'],2); break;
break;
case 'trip_distance':
# way length is entered in km as decimal fraction, but number conversions can
# create fake digits which should be stripped; meter precision is sufficient here
$entry['trip_distance'] = $row['trip_distance'] === null ? null : round($row['trip_distance'],3); break;
break;
case 'rating':
if ($row['votes'] < 3) $entry['rating'] = null;
elseif ($row['score'] >= 2.2) $entry['rating'] = 5.0;
@ -286,6 +322,7 @@ class WebService
case 'date_created': $entry['date_created'] = date('c', strtotime($row['date_created'])); break;
case 'date_hidden': $entry['date_hidden'] = date('c', strtotime($row['date_hidden'])); break;
case 'internal_id': $entry['internal_id'] = $row['cache_id']; break;
case 'attribution_note': /* handled separately */ break;
default: throw new Exception("Missing field case: ".$field);
}
}
@ -437,17 +474,20 @@ class WebService
// strtolower - ISO 639-1 codes are lowercase
if ($row['desc'])
{
/* Regarding the attribution note - please note, that the "owner" field
* is automatically included, whenever the cache description is included.
* This is because we may need it for the attribution note - see issue 178. */
/* Note, that the "owner" and "internal_id" fields are automatically included,
* whenever the cache description is included. */
$results[$cache_code]['descriptions'][strtolower($row['language'])] = (
$row['desc']."\n".
self::get_cache_attribution_note(
$row['cache_id'], strtolower($row['language']), $langpref,
$results[$cache_code]['owner']
)
);
$tmp = $row['desc'];
if ($attribution_append != 'none')
{
$tmp .= "\n<p><em>".
self::get_cache_attribution_note(
$row['cache_id'], strtolower($row['language']), $langpref,
$results[$cache_code]['owner'], $attribution_append
).
"</em></p>";
}
$results[$cache_code]['descriptions'][strtolower($row['language'])] = $tmp;
}
if ($row['hint'])
$results[$cache_code]['hints'][strtolower($row['language'])] = $row['hint'];
@ -849,11 +889,36 @@ class WebService
unset($states);
}
# Attribution note
if (in_array('attribution_note', $fields))
{
/* Note, that the "owner" and "internal_id" fields are automatically included,
* whenever the attribution_note is included. */
foreach ($results as $cache_code => &$result_ref)
$result_ref['attribution_note'] =
self::get_cache_attribution_note(
$result_ref['internal_id'], $langpref[0], $langpref,
$results[$cache_code]['owner'], 'full'
);
}
# Check which cache codes were not found and mark them with null.
foreach ($cache_codes as $cache_code)
if (!isset($results[$cache_code]))
$results[$cache_code] = null;
if (count($fields_to_remove_later) > 0)
{
# Some of the fields in $results were added only temporarily
# (the Consumer did not ask for them). We will remove these fields now.
foreach ($results as &$result_ref)
foreach ($fields_to_remove_later as $field)
unset($result_ref[$field]);
}
# Order the results in the same order as the input codes were given.
# This might come in handy for languages which support ordered dictionaries
# (especially with conjunction with the search_and_retrieve method).
@ -910,7 +975,7 @@ class WebService
}
/**
* Return attribution note to be included in the cache description.
* Return attribution note for the given geocache.
*
* The $lang parameter identifies the language of the cache description
* to which the attribution note will be appended to (one cache may
@ -927,34 +992,54 @@ class WebService
*
* $owner is in object describing the user, it has the same format as
* defined in "geocache" method specs (see the "owner" field).
*
* The $type is either "full" or "static". Full attributions may contain
* dates and are not suitable for the replicate module. Static attributions
* don't change that frequently.
*/
public static function get_cache_attribution_note($cache_id, $lang, array $langpref, $owner)
{
public static function get_cache_attribution_note(
$cache_id, $lang, array $langpref, $owner, $type
) {
$site_url = Settings::get('SITE_URL');
$site_name = Okapi::get_normalized_site_name();
$cache_url = $site_url."viewcache.php?cacheid=$cache_id";
Okapi::gettext_domain_init(array_merge(array($lang), $langpref));
$note = "<p>";
if (Settings::get('OC_BRANCH') == 'oc.de')
if (Settings::get('OC_BRANCH') == 'oc.pl')
{
$note .= sprintf(
_(
"<em>&copy; <a href='%s'>%s</a>, <a href='%s'>%s</a>, ".
"<a href='http://creativecommons.org/licenses/by-nc-nd/3.0/de/deed.en'>CC-BY-NC-ND</a>, ".
"as of %s; all log entries &copy; their authors</em>"
),
$owner['profile_url'], $owner['username'], $cache_url, $site_name, strftime('%x')
);
}
else
{
$note .= sprintf(
# This does not vary on $type (yet).
$note = sprintf(
_("This <a href='%s'>geocache</a> description comes from the <a href='%s'>%s</a> site."),
$cache_url, $site_url, $site_name
);
}
$note .= "</p>";
else
{
if ($type == 'full')
{
$note = sprintf(
_(
"&copy; <a href='%s'>%s</a>, <a href='%s'>%s</a>, ".
"<a href='http://creativecommons.org/licenses/by-nc-nd/3.0/de/deed.en'>CC-BY-NC-ND</a>, ".
"as of %s; all log entries &copy; their authors"
),
$owner['profile_url'], $owner['username'], $cache_url, $site_name, strftime('%x')
);
}
elseif ($type == 'static')
{
$note = sprintf(
_(
"&copy; <a href='%s'>%s</a>, <a href='%s'>%s</a>, ".
"<a href='http://creativecommons.org/licenses/by-nc-nd/3.0/de/deed.en'>CC-BY-NC-ND</a>; ".
"all log entries &copy; their authors"
),
$owner['profile_url'], $owner['username'], $cache_url, $site_name
);
}
}
Okapi::gettext_domain_restore();
return $note;

View File

@ -25,6 +25,9 @@
of field names which you are interested with.
See services/caches/geocache method for a list available values.</p>
</opt>
<opt name='attribution_append' default='full'>
<p>Same as in the services/caches/geocache method.</p>
</opt>
<opt name='lpc' default='10'>
Same as in the services/caches/geocache method.
</opt>

View File

@ -2,17 +2,25 @@
<brief>Download OKAPI database snapshot</brief>
<issue-id>110</issue-id>
<desc>
<p><b>Beta status.</b> Download the latest snapshot of OKAPI database. You should call this method
only once in your lifetime.</p>
<p>Download the latest snapshot of OKAPI database. You should call this method
only once.</p>
<p>For some applications it might be desireable to have a quick access to the entire
OpenCaching database (instead of querying for specific portions of it). You may use
OKAPI's <b>replicate</b> module to achive this effect. The <b>changelog</b> method
OKAPI's <b>replicate</b> module to achive this condition. The <b>changelog</b> method
is the primary replication service which you will use. However, to correctly set up
your first database copy, you will need to use the <b>fulldump</b> method.</p>
<p><b>Important:</b> This method MAY change substantially or it might even get removed.
We don't plan on doing this, but we may be forced to (i.e. to prevent abuse).</p>
<p><b>Important:</b> There is a remote possibility that this method MAY change in
a non-backward-compatible way or it might even get removed. We don't plan on doing
this, but we might be forced to (i.e. to prevent abuse).</p>
<p><b>Note:</b> The cache descriptions will be generated using the <b>attribution_append=static</b>
parameter (see the geocache method). Full attributions are not always suitable for replication,
since they may contain dates on some installations
(<a href='https://code.google.com/p/opencaching-api/issues/detail?id=178'>why?</a>).
To make sure that static attributions are enough, consult the local Data
Licence (the Sign Up page).</p>
<p>A couple of things for you to remember:</p>

View File

@ -261,8 +261,11 @@ class ReplicateCommon
require_once($GLOBALS['rootpath'].'okapi/service_runner.php');
$current_values = OkapiServiceRunner::call($feeder_method, new OkapiInternalRequest(
new OkapiInternalConsumer(), null, array($feeder_keys_param => implode("|", $key_values),
'fields' => $fields)));
new OkapiInternalConsumer(), null, array(
$feeder_keys_param => implode("|", $key_values),
'fields' => $fields,
'attribution_append' => 'static' # currently, this is for the "geocaches" method only
)));
$entries = array();
foreach ($current_values as $key => $object)
{

View File

@ -50,7 +50,7 @@ $m = $vars['method'];
</td>
</tr>
<? foreach ($m['arguments'] as $arg) { ?>
<tr class='<?= $arg['class'] ?>'>
<tr class='<?= $arg['class'] ?>' id='<?= 'arg_'.$arg['name'] ?>'>
<td class='argname'><?= $arg['name'] ?></td>
<td class='<? echo $arg['is_required'] ? 'required' : 'optional'; ?>'><? echo $arg['is_required'] ? 'required' : 'optional'; ?></td>
<td class='argdesc'>

View File

@ -87,14 +87,15 @@
<h2>Terms of Use</h2>
<p>When using data from <b><?= $vars['site_name'] ?></b> you <b>must</b> attribute the
data back to <?= $vars['site_name'] ?>.</p>
<ul>
<li>This means, at a minimum, you may not remove the reference to
<b><?= $vars['site_name'] ?></b> from the end of any geocache descriptions.</li>
<li>If you are not showing geocache descriptions, you <b>must</b>
find some other way to attribute the data back to <b><?= $vars['site_name'] ?></b>.</li>
</ul>
<p>When using data from <b><?= $vars['site_name'] ?></b> you <b>must</b>
attribute it to the author and to <?= $vars['site_name'] ?> in the form
specifyed in the <?= $vars['site_name'] ?> <?= $vars['data_license_html'] ?>.
OKAPI supports you in doing so by either appending the proper attribution to
geocache descriptions or providing it in a separate data field (if you are not
showing cache descriptions you must attribute the data using this separate field).
Refer to <a href="<?= $vars['site_url'].'okapi/services/caches/geocache.html#arg_attribution_append' ?>">the geocache method</a>
for further advice.</p>
<p>You <b>must</b> comply with the requirements of the <?= $vars['site_name'] ?>
<?= $vars['data_license_html'] ?> when reproducing, displaying, copying,
formatting, compiling, or otherwise using Geocaching Data acquired through OKAPI.</p>

View File

@ -62,10 +62,8 @@ class View
public static function call()
{
# First, let's acquire a lock to make sure the update isn't already running.
# We will use one of the existing lock handles, because we don't want to use
# to many of them. See issue 141.
$lock = OkapiLock::get('cronjobs-cron-5');
$lock = OkapiLock::get('db-update');
$lock->acquire();
try