Merge branch 'stable'

This commit is contained in:
following
2013-05-09 13:15:12 +02:00
10 changed files with 92 additions and 41 deletions

View File

@@ -799,7 +799,7 @@ class Okapi
{ {
public static $data_store; public static $data_store;
public static $server; public static $server;
public static $revision = 786; # This gets replaced in automatically deployed packages public static $revision = 796; # This gets replaced in automatically deployed packages
private static $okapi_vars = null; private static $okapi_vars = null;
/** Get a variable stored in okapi_vars. If variable not found, return $default. */ /** Get a variable stored in okapi_vars. If variable not found, return $default. */

View File

@@ -51,7 +51,8 @@ class CronJobController
new FulldumpGeneratorJob(), new FulldumpGeneratorJob(),
new TileTreeUpdater(), new TileTreeUpdater(),
new SearchSetsCleanerJob(), new SearchSetsCleanerJob(),
new AttrsRefresherJob(), // WRCLEANIT: new AttrsRefresherJob(),
new TableOptimizerJob(),
); );
foreach ($cache as $cronjob) foreach ($cache as $cronjob)
if (!in_array($cronjob->get_type(), array('pre-request', 'cron-5'))) if (!in_array($cronjob->get_type(), array('pre-request', 'cron-5')))
@@ -779,7 +780,9 @@ class LocaleChecker extends Cron5Job
* Once every hour, update the official cache attributes listing. * Once every hour, update the official cache attributes listing.
* *
* WRTODO: Make it 12 hours later. * WRTODO: Make it 12 hours later.
*/ *
* WRCLEANIT
*
class AttrsRefresherJob extends Cron5Job class AttrsRefresherJob extends Cron5Job
{ {
public function get_period() { return 3600; } public function get_period() { return 3600; }
@@ -789,3 +792,15 @@ class AttrsRefresherJob extends Cron5Job
AttrHelper::refresh_if_stale(); AttrHelper::refresh_if_stale();
} }
} }
*/
/** Once per day, optimize certain MySQL tables. */
class TableOptimizerJob extends Cron5Job
{
public function get_period() { return 86400; }
public function execute()
{
Db::query("optimize table okapi_tile_caches");
Db::query("optimize table okapi_tile_status");
}
}

View File

@@ -20,7 +20,7 @@ namespace okapi;
# exception and error handlers. OKAPI is strict about PHP warnings and # exception and error handlers. OKAPI is strict about PHP warnings and
# notices, so you might need to temporarily disable the error handler in # notices, so you might need to temporarily disable the error handler in
# order to get it to work with your code. Just call this after you # order to get it to work with your code. Just call this after you
# include the Facade file: OkapiErrorHandler::disable(). # include the Facade file: Facade::disable_error_handling().
use Exception; use Exception;
@@ -119,6 +119,17 @@ class Facade
"); ");
} }
/**
* Run OKAPI database update.
* Will output messages to stdout.
*/
public static function database_update()
{
require_once($GLOBALS['rootpath']."okapi/views/update.php");
$update = new views\update\View;
$update->call();
}
/** /**
* You will probably want to call that with FALSE when using Facade * You will probably want to call that with FALSE when using Facade
* in buggy, legacy OC code. This will disable OKAPI's default behavior * in buggy, legacy OC code. This will disable OKAPI's default behavior

View File

@@ -2,8 +2,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: OKAPI\n" "Project-Id-Version: OKAPI\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-04-10 01:12+0100\n" "POT-Creation-Date: 2013-05-08 15:17+0100\n"
"PO-Revision-Date: 2013-04-10 01:14+0100\n" "PO-Revision-Date: 2013-05-08 15:25+0100\n"
"Last-Translator: Wojciech Rygielski <rygielski@mimuw.edu.pl>\n" "Last-Translator: Wojciech Rygielski <rygielski@mimuw.edu.pl>\n"
"Language-Team: \n" "Language-Team: \n"
"Language: pl_PL\n" "Language: pl_PL\n"
@@ -19,18 +19,18 @@ msgstr ""
"X-Generator: Poedit 1.5.5\n" "X-Generator: Poedit 1.5.5\n"
"X-Poedit-SearchPath-0: .\n" "X-Poedit-SearchPath-0: .\n"
#: services/caches/geocaches.php:846 #: services/caches/geocaches.php:911
msgid "Stage" msgid "Stage"
msgstr "Etap" msgstr "Etap"
#: services/caches/geocaches.php:1009 #: services/caches/geocaches.php:1139
#, php-format #, php-format
msgid "" msgid ""
"This <a href='%s'>geocache</a> description comes from the <a href='%s'>%s</" "This <a href='%s'>geocache</a> description comes from the <a href='%s'>%s</"
"a> site." "a> site."
msgstr "Opis <a href='%s'>skrzynki</a> pochodzi z serwisu <a href='%s'>%s</a>." msgstr "Opis <a href='%s'>skrzynki</a> pochodzi z serwisu <a href='%s'>%s</a>."
#: services/caches/geocaches.php:1021 #: services/caches/geocaches.php:1151
#, php-format #, php-format
msgid "" msgid ""
"&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://"
@@ -41,7 +41,7 @@ msgstr ""
"creativecommons.org/licenses/by-nc-nd/3.0/de/deed.pl'>CC-BY-NC-ND</a>, w " "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." "dniu %s. Prawa autorskie wpisów do logów należą do ich autorów."
#: services/caches/geocaches.php:1032 #: services/caches/geocaches.php:1162
#, php-format #, php-format
msgid "" msgid ""
"&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://"
@@ -93,15 +93,16 @@ msgstr "Atrybuty"
msgid "Trackables" msgid "Trackables"
msgstr "Geokrety, Travelbugi itp." msgstr "Geokrety, Travelbugi itp."
#: services/caches/formatters/gpxfile.tpl.php:84 #: services/caches/formatters/gpxfile.tpl.php:76
#: services/caches/formatters/gpxfile.tpl.php:92
msgid "Images" msgid "Images"
msgstr "Obrazki" msgstr "Obrazki"
#: services/caches/formatters/gpxfile.tpl.php:91 #: services/caches/formatters/gpxfile.tpl.php:99
msgid "Spoilers" msgid "Spoilers"
msgstr "Spoilery" msgstr "Spoilery"
#: services/caches/formatters/gpxfile.tpl.php:99 #: services/caches/formatters/gpxfile.tpl.php:108
msgid "Image descriptions" msgid "Image descriptions"
msgstr "Opisy obrazków" msgstr "Opisy obrazków"
@@ -122,7 +123,16 @@ msgstr ""
"Niestety Twoja ocena skrzynki nie została zapisana, ponieważ %s nie prowadzi " "Niestety Twoja ocena skrzynki nie została zapisana, ponieważ %s nie prowadzi "
"oceny skrzynek." "oceny skrzynek."
#: services/logs/submit.php:113 #: services/logs/submit.php:111
#, php-format
msgid ""
"However, your cache recommendation was ignored, because %s does not allow "
"recommending event caches."
msgstr ""
"Twoja rekomendacja skrzynki nie została zapisana, ponieważ %s nie pozwala na "
"rekomendowanie skrzynek typu Wydarzenie."
#: services/logs/submit.php:125
#, php-format #, php-format
msgid "" msgid ""
"However, your \"needs maintenance\" flag was ignored, because %s does not " "However, your \"needs maintenance\" flag was ignored, because %s does not "
@@ -131,31 +141,39 @@ msgstr ""
"Niestety, wpis \"potrzebny serwis\" został zignorowany, ponieważ %s nie " "Niestety, wpis \"potrzebny serwis\" został zignorowany, ponieważ %s nie "
"wspiera tej funkcjonalności." "wspiera tej funkcjonalności."
#: services/logs/submit.php:131 #: services/logs/submit.php:145
msgid "" msgid ""
"This cache is an Event cache. You cannot \"Find it\"! (But - you may " "This cache is an Event cache. You cannot \"Find\" it (but you can attend it, "
"\"Comment\" on it.)" "or comment on it)!"
msgstr "" msgstr ""
"Ta skrzynka jest typu Wydarzenie. Nie możesz jej \"znaleźć\"! (Ale - możesz " "Ta skrzynka jest Wydarzeniem. Nie możesz jej \"znaleźć\" (ale możesz w "
"dodać wpis typu \"Komentarz\".)" "wydarzeniu uczestniczyć lub dodać komentarz)!"
#: services/logs/submit.php:133 #: services/logs/submit.php:150
msgid ""
"This cache is NOT an Event cache. You cannot \"Attend\" it (but you can find "
"it, or comment on it)!"
msgstr ""
"Ta skrzynka NIE jest Wydarzeniem. Nie możesz w niej \"uczestniczyć\" (ale "
"możesz ją znaleźć lub dodać komentarz)!"
#: services/logs/submit.php:155
msgid "Your have to supply some text for your comment." msgid "Your have to supply some text for your comment."
msgstr "Wpis typu \"Komentarz\" wymaga wpisania komentarza." msgstr "Wpis typu \"Komentarz\" wymaga wpisania komentarza."
#: services/logs/submit.php:146 #: services/logs/submit.php:168
msgid "This cache requires a password. You didn't provide one!" msgid "This cache requires a password. You didn't provide one!"
msgstr "Ta skrzynka wymaga podania hasła. Nie wpisałeś go." msgstr "Ta skrzynka wymaga podania hasła. Nie wpisałeś go."
#: services/logs/submit.php:148 #: services/logs/submit.php:170
msgid "Invalid password!" msgid "Invalid password!"
msgstr "Niepoprawne hasło!" msgstr "Niepoprawne hasło!"
#: services/logs/submit.php:260 #: services/logs/submit.php:282
msgid "You have already submitted a log entry with exactly the same contents." 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ą." msgstr "Już opublikowałeś wcześniej wpis z dokładnie taką samą treścią."
#: services/logs/submit.php:279 #: services/logs/submit.php:305
msgid "" msgid ""
"You have already submitted a \"Found it\" log entry once. Now you may submit " "You have already submitted a \"Found it\" log entry once. Now you may submit "
"\"Comments\" only!" "\"Comments\" only!"
@@ -163,26 +181,30 @@ msgstr ""
"Już opublikowałeś jeden wpis typu \"Znaleziona\" dla tej skrzynki. Teraz " "Już opublikowałeś jeden wpis typu \"Znaleziona\" dla tej skrzynki. Teraz "
"możesz dodawać jedynie \"Komentarze\"!" "możesz dodawać jedynie \"Komentarze\"!"
#: services/logs/submit.php:281 #: services/logs/submit.php:307
msgid "You are the owner of this cache. You may submit \"Comments\" only!" msgid "You are the owner of this cache. You may submit \"Comments\" only!"
msgstr "" msgstr ""
"Jesteś właścicielem tej skrzynki. Możesz przesyłać jedynie \"Komentarze\"." "Jesteś właścicielem tej skrzynki. Możesz przesyłać jedynie \"Komentarze\"."
#: services/logs/submit.php:299 #: services/logs/submit.php:325
msgid "You have already rated this cache once. Your rating cannot be changed." 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." msgstr "Już oceniłeś tę skrzynkę. Ocena nie może być zmieniona."
#: services/logs/submit.php:316 #: services/logs/submit.php:342
msgid "You have already recommended this cache once." msgid "You have already recommended this cache once."
msgstr "Już raz zarekomendowałeś tę skrzynkę." msgstr "Już raz zarekomendowałeś tę skrzynkę."
#: services/logs/submit.php:323 #: services/logs/submit.php:352
msgid "You don't have any recommendations to give. Find more caches first!" msgid "You don't have any recommendations to give. Find more caches first!"
msgstr "" msgstr ""
"Aktualnie nie możesz wystawić kolejnej rekomendacji. Znajdź najpierw więcej " "Aktualnie nie możesz wystawić kolejnej rekomendacji. Znajdź najpierw więcej "
"skrzynek!" "skrzynek!"
#: services/logs/submit.php:491 #: services/logs/submit.php:395
msgid "Event caches cannot \"need maintenance\"."
msgstr "Skrzynki typu Wydarzenie nie mogą \"potrzebować serwisu\"."
#: services/logs/submit.php:525
msgid "Your cache log entry was posted successfully." msgid "Your cache log entry was posted successfully."
msgstr "Twój wpis do logbooka został opublikowany pomyślnie." msgstr "Twój wpis do logbooka został opublikowany pomyślnie."

View File

@@ -20,12 +20,6 @@
<p>Currently available fields:</p> <p>Currently available fields:</p>
<ul> <ul>
<li><b>code</b> - unique Opencaching code of the geocache,</li> <li><b>code</b> - unique Opencaching code of the geocache,</li>
<li><p><b>gc_code</b> - geocaching.com code (GC code) of the geocache;
<b>null</b> if not crosslisted or unknown.</p>
<p>Please note that many cache owners do not provide this information.
It may be missing or wrong, or the GC listing may be inactive
(<a href='https://code.google.com/p/opencaching-api/issues/detail?id=195'>Discussion</a>).</p>
</li>
<li><b>name</b> - name of the geocache,</li> <li><b>name</b> - name of the geocache,</li>
<li><b>names</b> - a dictionary (language code => plain-text string) of <li><b>names</b> - a dictionary (language code => plain-text string) of
names of the geocache (at this time, there will be only one language, names of the geocache (at this time, there will be only one language,
@@ -67,6 +61,14 @@
<li><b>profile_url</b> - URL of the user profile page,</li> <li><b>profile_url</b> - URL of the user profile page,</li>
</ul> </ul>
</li> </li>
<li>
<p><b>gc_code</b> - Geocaching.com code (GC code) of the geocache
<b>or null</b> if the cache is not listed on GC or the GC code is
unknown.</p>
<p>Please note that this information is supplied by cache owners
and it is often missing, obsolete or otherwise incorrect.</p>
</li>
<li> <li>
<p><b>distance</b> - float, the distance to a cache, in meters. <p><b>distance</b> - float, the distance to a cache, in meters.
This requires <b>my_location</b> parameter to be provided.</p> This requires <b>my_location</b> parameter to be provided.</p>

View File

@@ -832,7 +832,7 @@ class WebService
# waypoint types in 'waypoint_type' table. # waypoint types in 'waypoint_type' table.
# OCPL also have a special 'status' field to denote a hidden waypoint # OCPL also have a special 'status' field to denote a hidden waypoint
# (i.e. final location of a multicache). Such hidden waypoints are not # (i.e. final location of a multicache). Such hidden waypoints are not
# exposed by OKAPI. A stage fields is used for ordering and naming. # exposed by OKAPI.
$cacheid2waypoints = Db::select_group_by("cache_id", " $cacheid2waypoints = Db::select_group_by("cache_id", "
select select
@@ -863,7 +863,7 @@ class WebService
{ {
# OCDE uses 'coordinates' table (with type=1) to store additional waypoints # OCDE uses 'coordinates' table (with type=1) to store additional waypoints
# and defines waypoint types in 'coordinates_type' table. # and defines waypoint types in 'coordinates_type' table.
# All additional waypoints are are public. # All additional waypoints are public.
$cacheid2waypoints = Db::select_group_by("cache_id", " $cacheid2waypoints = Db::select_group_by("cache_id", "
select select

View File

@@ -44,6 +44,7 @@ class View
"); ");
$vars = array(); $vars = array();
$vars['okapi_base_url'] = Settings::get('SITE_URL')."okapi/"; $vars['okapi_base_url'] = Settings::get('SITE_URL')."okapi/";
$vars['site_url'] = Settings::get('SITE_URL');
$vars['site_name'] = Okapi::get_normalized_site_name(); $vars['site_name'] = Okapi::get_normalized_site_name();
$vars['apps'] = array(); $vars['apps'] = array();
while ($row = mysql_fetch_assoc($rs)) while ($row = mysql_fetch_assoc($rs))

View File

@@ -6,7 +6,7 @@
</head> </head>
<style> <style>
.okapi { font-size: 15px; max-width: 600px; font-family: "lucida grande", "Segoe UI", tahoma, arial, sans-serif; color: #555; margin: 20px 60px 0 40px; } .okapi { font-size: 15px; max-width: 600px; font-family: "lucida grande", "Segoe UI", tahoma, arial, sans-serif; color: #555; margin: 20px 60px 0 40px; }
.okapi a.opencaching { font-size: 20px; font-weight: bold; padding-top: 13px; color: #333; text-decoration: none; display: block; } .okapi a.opencaching { font-size: 20px; font-weight: bold; padding-top: 13px; color: #333; text-decoration: none; outline:none; display: block; }
.okapi * { padding: 0; margin: 0; border: 0; } .okapi * { padding: 0; margin: 0; border: 0; }
.okapi input, select { font-size: 15px; font-family: "lucida grande", "Segoe UI", tahoma, arial, sans-serif; color: #444; } .okapi input, select { font-size: 15px; font-family: "lucida grande", "Segoe UI", tahoma, arial, sans-serif; color: #444; }
.okapi a, .okapi a:hover, .okapi a:visited { cursor: pointer; color: #3e48a8; text-decoration: underline; } .okapi a, .okapi a:hover, .okapi a:visited { cursor: pointer; color: #3e48a8; text-decoration: underline; }
@@ -23,8 +23,8 @@
<div class='okapi'> <div class='okapi'>
<a href='<?= $vars['okapi_base_url'] ?>'><img src='<?= $vars['okapi_base_url'] ?>static/logo-xsmall.gif' alt='OKAPI' style='float: right; margin-left: 10px;'></a> <a href='<?= $vars['okapi_base_url'] ?>'><img src='<?= $vars['okapi_base_url'] ?>static/logo-xsmall.gif' alt='OKAPI' style='float: right; margin-left: 10px;'></a>
<a href='/'><img src="<?= $vars['okapi_base_url'] ?>static/oc_logo.png" alt='Opencaching' style='float: left; margin-right: 10px'></a> <a href='<?= $vars['site_url'] ?>'><img src="<?= $vars['okapi_base_url'] ?>static/oc_logo.png" alt='Opencaching' style='float: left; margin-right: 10px'></a>
<a class='opencaching'><?= $vars['site_name'] ?></a> <a href='<?= $vars['site_url'] ?>' class='opencaching'><?= $vars['site_name'] ?></a>
<h1 style='clear: both'><?= _("Your external applications") ?></h1> <h1 style='clear: both'><?= _("Your external applications") ?></h1>
<? if (count($vars['apps']) > 0) { ?> <? if (count($vars['apps']) > 0) { ?>

View File

@@ -128,7 +128,7 @@ class View
Okapi::set_var("cron_nearest_event", 0); Okapi::set_var("cron_nearest_event", 0);
Okapi::execute_prerequest_cronjobs(); Okapi::execute_prerequest_cronjobs();
self::out("\nUpdate complete."); self::out("\nUpdate complete.\n");
} }
/** /**