ported search.php & tools to lib2, and ...

- fixed logentry sorting for logs with identical date
- fixed ä etc. display in short descriptions on search results page
- try to select a matching language for the short descriptions
- added some translations
- hide download and map links if no search results (updates #235)
- nicer display of selectlocid page
- use site-dependent urls in GPX, LOC, TXT and KML
- unified XML encoding, now all done via two functions in lib2/util.inc.php (updates #121)
- some preventive XML encoding adjustments in GPX
- removed XML encoding in LOC CDATA section
- improved charset conversion for OVL and OV2 output
- some optimizations
- discarded lots of obsolete code
- disabled debug mode force_compile in OcSmarty class (performance)
This commit is contained in:
following
2013-07-12 15:11:23 +02:00
parent 463c645a72
commit f5565a918c
47 changed files with 2447 additions and 2661 deletions

View File

@ -325,6 +325,12 @@
update_triggers();
}
function dbv_116() // optimize index for sorting logs
{
sql("ALTER TABLE `cache_logs` DROP INDEX `date`,
ADD INDEX `date` (`cache_id`,`date`,`date_created`)");
}
// When adding new mutations, take care that they behave well if run multiple
// times. This improves robustness of database versioning.

View File

@ -115,6 +115,7 @@
// other settings
$opt['page']['showdonations'] = true;
$opt['logic']['pictures']['dummy']['replacepic'] = $dev_basepath . $dev_codepath . 'htdocs/images/no_image_license.png';
$opt['logic']['license']['disclaimer'] = true;
$opt['template']['locales']['DA']['show'] = false;
$opt['template']['locales']['FR']['show'] = false;

View File

@ -29,7 +29,7 @@
$opt['db']['servername'] = 'localhost';
$opt['db']['username'] = '<db>';
$opt['db']['password'] = '<pw>';
$opt['db']['pconnect'] = true;
$opt['db']['pconnect'] = false;
// ... how long a query can take without warning (0 <= disabled)
$opt['db']['warn']['time'] = 1;

View File

@ -889,6 +889,8 @@ INSERT INTO `sys_menu` (`id`, `id_string`, `title`, `title_trans_id`, `menustrin
INSERT INTO `sys_menu` (`id`, `id_string`, `title`, `title_trans_id`, `menustring`, `menustring_trans_id`, `access`, `href`, `visible`, `parent`, `position`, `color`, `sitemap`, `only_if_parent`) VALUES ('94', 'MNU_START_NEWLOGSREST', 'Without Germany', '121', 'Without Germany', '121', '0', 'newlogsrest.php', '1', '7', '1', '', '1', NULL);
INSERT INTO `sys_menu` (`id`, `id_string`, `title`, `title_trans_id`, `menustring`, `menustring_trans_id`, `access`, `href`, `visible`, `parent`, `position`, `color`, `sitemap`, `only_if_parent`) VALUES ('95', 'MNU_MYPROFILE_OKAPI', 'OKAPI Applications', '2008', 'OKAPI Apps', '2009', '0', '!okapi/apps/', '1', '9', '9', '', '1', NULL);
INSERT INTO `sys_menu` (`id`, `id_string`, `title`, `title_trans_id`, `menustring`, `menustring_trans_id`, `access`, `href`, `visible`, `parent`, `position`, `color`, `sitemap`, `only_if_parent`) VALUES ('96', 'MNU_ADMIN_HISTORY', 'Cache history', '2059', 'Cache history', '2059', '1', 'adminhistory.php', '1', '12', '4', '', '0', NULL);
INSERT INTO `sys_menu` (`id`, `id_string`, `title`, `title_trans_id`, `menustring`, `menustring_trans_id`, `access`, `href`, `visible`, `parent`, `position`, `color`, `sitemap`, `only_if_parent`) VALUES ('97', 'MNU_CACHES_SEARCH_SELECT_CITY', 'Select city', '1694', 'Select city', '1694', '0', 'search.php', '0', '20', '1', '', '0', NULL);
INSERT INTO `sys_menu` (`id`, `id_string`, `title`, `title_trans_id`, `menustring`, `menustring_trans_id`, `access`, `href`, `visible`, `parent`, `position`, `color`, `sitemap`, `only_if_parent`) VALUES ('98', 'MNU_CACHES_SEARCH_RESULT', 'Show search result', '1695', 'Result', '1696', '0', 'search.php', '0', '20', '2', '', '0', NULL);
-- Table sys_trans
SET NAMES 'utf8';
@ -1922,8 +1924,8 @@ INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1430', 'Do not
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1431', 'I have read and agree to the <a href=\"articles.php?page=impressum#tos\" target=\"_blank\">Opencaching.de Terms of Service</a> and the <a href=\"articles.php?page=impressum#datalicense\" target=\"_blank\">Opencaching.de Datalicense</a>', '2010-09-07 20:19:05');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1432', 'Info: Your log entry has been removed from the cache owner', '2010-09-07 20:19:05');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1433', 'Selection of city', '2010-09-07 20:19:05');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1434', 'Total of {resultscount} cities matched', '2010-09-07 20:19:05');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1435', 'For the search criterion no clear result was found. Please choose the correct location.', '2010-09-07 20:19:05');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1434', 'Total of %1 cities matched', '2010-09-07 20:19:05');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1435', 'For the search criterion no clear result was found. Please choose the desired location:', '2010-09-07 20:19:05');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1436', 'Add log-entry for the cache <a href=\"viewcache.php?cacheid={cacheid}\">{cachename}</a>', '2010-09-07 20:19:06');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1437', 'Cachename is invalid', '2010-09-07 20:19:06');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1438', 'The used coordinates are invalid.', '2010-09-07 20:19:06');
@ -1932,8 +1934,8 @@ INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1440', 'The dis
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1441', 'The cache-status does not fit to your publishing options', '2010-09-07 20:19:06');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1442', 'Choose both valuations!', '2010-09-07 20:19:06');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1443', 'No pictures available', '2010-09-07 20:19:06');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1444', '{results_count} caches<span style=\"{search_headline_caches}\"> matched</span>', '2010-09-07 20:19:07');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1445', 'Result {startatp1} to {endat} (as zip):', '2010-09-07 20:19:07');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1444', '%1 caches<span style=\"%2\"> matched</span>', '2010-09-07 20:19:07');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1445', 'Result %1 to %2 (as zip)', '2010-09-07 20:19:07');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1446', 'this description was created on another Opencaching-webserver and can only be deleted there.', '2010-09-07 20:19:07');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1447', 'the cache description has been deleted', '2010-09-07 20:19:07');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1448', 'delete this cache-description', '2010-09-07 20:19:07');
@ -2180,7 +2182,6 @@ INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1713', 'You hav
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1714', 'Revoke the recommendation', '2010-11-29 21:04:55');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1717', 'Please select!', '2010-12-05 00:00:40');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1718', 'Results on this page', '2010-12-05 00:00:57');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1719', 'Result {startatp1} to {endat} (as zip)', '2010-12-05 00:00:57');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1722', 'Do you really want to delete this entry?', '2010-12-05 00:01:46');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1723', 'Do you really want to remove this recommendation?', '2010-12-05 00:01:49');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1724', 'Waylength', '2010-12-05 00:02:00');
@ -2512,6 +2513,8 @@ INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2091', 'Test fo
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2096', '%2 has activated %1', '2013-04-25 23:00:00');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2097', '%1 has activated the geocache', '2013-04-25 23:00:00');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2098', 'converted from HTML', '2013-04-25 23:00:00');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2099', 'unknown search option', '2013-04-25 23:00:00');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2100', 'no coordinates available', '2013-04-25 23:00:00');
-- Table sys_trans_ref
SET NAMES 'utf8';
@ -5887,8 +5890,8 @@ INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUE
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1431', 'DE', 'Die <a href=\"articles.php?page=impressum#tos\" target=\"_blank\">Opencaching.de-Nutzungsbedingungen</a> und -<a href=\"articles.php?page=impressum#datalicense\" target=\"_blank\">Datenlizenz</a> habe ich gelesen und bin damit einverstanden.', '2010-09-10 23:39:25');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1432', 'DE', 'Info: Dein Logeintrag wurde vom Cachebesitzer entfernt', '2010-09-10 23:39:09');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1433', 'DE', 'Ortsauswahl', '2010-09-10 23:39:01');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1434', 'DE', 'Insgesamt {resultscount} Ortschaften gefunden', '2010-09-10 23:38:52');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1435', 'DE', 'Für das Suchkriterium wurde kein eindeutiges Ergebnis gefunden. Bitte wähle die richtige Ortschaft aus.', '2010-09-10 23:38:27');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1434', 'DE', 'Insgesamt %1 Ortschaften gefunden', '2010-09-10 23:38:52');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1435', 'DE', 'Für das Suchkriterium wurde kein eindeutiges Ergebnis gefunden. Bitte wähle die gewünschte Ortschaft aus:', '2010-09-10 23:38:27');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1436', 'DE', 'Logeintrag f\&uuml;r den Cache <a href=\"viewcache.php?cacheid={cacheid}\">{cachename}</a> hinzuf\&uuml;gen', '2010-09-10 23:38:14');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1437', 'DE', 'Cachename ung\&uuml;ltig', '2010-09-10 23:34:32');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1438', 'DE', 'Die angegebene Koordinate ist ung\&uuml;ltig.', '2010-09-10 23:38:00');
@ -5897,8 +5900,8 @@ INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUE
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1441', 'DE', 'Der Cachestatus paßt nicht zu den Veröffentlichungsoptionen.', '2010-09-10 23:34:16');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1442', 'DE', 'Wähle beide Bewertungsangaben aus!', '2010-09-10 23:33:56');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1443', 'DE', 'Keine Bilder vorhanden', '2010-09-10 23:32:13');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1444', 'DE', '{results_count} Caches<span style=\"{search_headline_caches}\"> gefunden</span>', '2010-09-10 23:33:47');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1445', 'DE', 'Einträge {startatp1} bis {endat} (als zip):', '2010-09-10 23:33:33');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1444', 'DE', '%1 Caches<span style=\"%2\"> gefunden</span>', '2010-09-10 23:33:47');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1445', 'DE', 'Einträge %1 bis %2 (als zip)', '2010-09-10 23:33:33');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1446', 'DE', 'Diese Beschreibung wurde auf einem anderen Opencaching-Webserver erstellt und kann nur auf diesem gelöscht werden.', '2010-09-10 23:31:28');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1447', 'DE', 'Die Cache Beschreibung wurde gel\&ouml;scht.', '2010-09-10 23:31:10');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1448', 'DE', 'Cachebeschreibung l\&ouml;schen', '2010-09-10 23:30:52');
@ -6475,6 +6478,8 @@ INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUE
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2096', 'DE', '%2 hat %1 aktiviert', '2013-04-25 23:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2097', 'DE', '%1 hat den Geocache aktiviert', '2013-04-25 23:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2098', 'DE', 'aus HTML konvertiert', '2013-04-25 23:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2099', 'DE', 'unbekannte Suchoption', '2013-04-25 23:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2100', 'DE', 'keine Koordinaten verfügbar', '2013-04-25 23:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1', 'EN', 'Reorder IDs \r', '2010-09-02 00:15:30');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2', 'EN', 'The database could not be reconnected.', '2010-08-28 11:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('3', 'EN', 'Testing please do not login', '2010-08-28 11:48:07');
@ -7504,8 +7509,8 @@ INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUE
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1431', 'EN', 'I have read and agree to the <a href=\"articles.php?page=impressum#tos\" target=\"_blank\">Opencaching.de Terms of Service</a> and <a href=\"articles.php?page=impressum#datalicense\" target=\"_blank\">Opencaching.de Data license</a>.', '2010-09-10 23:39:25');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1432', 'EN', 'Info: Your log entry has been removed from the cache owner', '2010-09-10 23:39:09');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1433', 'EN', 'Selection of city', '2010-09-10 23:39:01');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1434', 'EN', 'Total of {resultscount} cities matched', '2010-09-10 23:38:52');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1435', 'EN', 'For the search criterion no clear result was found. Please choose the correct location.', '2010-09-10 23:38:27');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1434', 'EN', 'Total of %1 cities matched', '2010-09-10 23:38:52');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1435', 'EN', 'For the search criterion no clear result was found. Please choose the desired location:', '2010-09-10 23:38:27');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1436', 'EN', 'Add log-entry for the cache <a href=\"viewcache.php?cacheid={cacheid}\">{cachename}</a>', '2010-09-10 23:38:20');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1437', 'EN', 'Cachename is invalid', '2010-09-10 23:34:40');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1438', 'EN', 'The used coordinates are invalid.', '2010-09-10 23:38:00');
@ -7514,8 +7519,8 @@ INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUE
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1441', 'EN', 'The cache-status does not fit to your publishing options', '2010-09-10 23:34:23');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1442', 'EN', 'Choose both valuations!', '2010-09-10 23:33:56');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1443', 'EN', 'No pictures available', '2010-09-10 23:32:19');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1444', 'EN', '{results_count} caches<span style=\"{search_headline_caches}\"> matched</span>', '2010-09-10 23:33:47');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1445', 'EN', 'Result {startatp1} to {endat} (as zip):', '2010-09-10 23:33:37');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1444', 'EN', '%1 caches<span style=\"%2\"> matched</span>', '2010-09-10 23:33:47');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1445', 'EN', 'Result %1 to %2 (as zip)', '2010-09-10 23:33:37');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1446', 'EN', 'This description was created on another Opencaching-webserver and can only be deleted there.', '2010-09-10 23:31:36');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1447', 'EN', 'The cache description has been deleted', '2010-09-10 23:31:16');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1448', 'EN', 'Delete this cache description', '2010-09-10 23:31:02');
@ -7762,7 +7767,6 @@ INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUE
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1714', 'EN', 'Revoke the recommendation', '2012-08-24 17:35:49');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1717', 'EN', 'Please select!', '2012-08-24 17:35:49');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1718', 'EN', 'Results on this page', '2012-08-24 17:35:49');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1719', 'EN', 'Result {startatp1} to {endat} (as zip)', '2012-08-24 17:35:49');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1722', 'EN', 'Do you really want to delete this entry?', '2012-08-24 17:35:49');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1723', 'EN', 'Do you really want to remove this recommendation?', '2012-08-24 17:35:49');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1724', 'EN', 'Route', '2012-08-24 17:35:49');
@ -9073,8 +9077,8 @@ INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUE
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1431', 'ES', 'He leído y acepto las <a href=\"articles.php?page=impressum#tos\" target=\"_blank\">la condiciones de uso de Opencaching.de</a>', '2010-12-09 00:18:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1432', 'ES', 'Información: el registro ha sido retirado por el titular del cache', '2010-12-09 00:18:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1433', 'ES', 'Seleccione una ciudad', '2010-12-09 00:18:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1434', 'ES', 'Total de {resultscount} las ciudades correspondientes', '2010-12-09 00:18:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1435', 'ES', 'Para el criterio de búsqueda no encontró resultado un claro. Por favor, elije una ubicación correcta.', '2010-12-09 00:18:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1434', 'ES', 'Total de %1 las ciudades correspondientes', '2010-12-09 00:18:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1435', 'ES', 'Para el criterio de búsqueda no encontró resultado un claro. Por favor, elije una ubicación correcta:', '2010-12-09 00:18:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1436', 'ES', 'Añadir un log para el cache <a href=\"viewcache.php?cacheid={cacheid}\">{cachename}</a>', '2010-12-09 00:18:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1437', 'ES', 'El nombre del cache es invalido', '2010-12-09 00:18:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1438', 'ES', 'Las coordenadas usada no son validas', '2010-12-09 00:18:00');
@ -9083,8 +9087,8 @@ INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUE
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1441', 'ES', 'El estado del cache no se corresponde a las opciones para su publicación.', '2010-12-09 00:18:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1442', 'ES', '¡Seleccione la revisión de los datos de ambos!', '2010-12-09 00:18:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1443', 'ES', 'No hay fotos disponibles', '2010-12-09 00:18:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1444', 'ES', ' {results_count} caches<span style=\"{search_headline_caches}\"> encontrados</span>', '2010-12-09 00:18:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1445', 'ES', 'Resultado {startatp1} a {endat} (como zip):', '2010-12-09 00:18:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1444', 'ES', ' %1 caches<span style=\"%2\"> encontrados</span>', '2010-12-09 00:18:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1445', 'ES', 'Resultado %1 a %2 (como zip)', '2010-12-09 00:18:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1446', 'ES', 'su descripción fue creado en otro Opencaching-servidor web y sólo puede ser eliminado allí.', '2010-12-09 00:18:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1447', 'ES', 'La descripción del caché ha sido eliminada.', '2010-12-09 00:18:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1448', 'ES', 'Borrar la descripción del cache', '2010-12-09 00:18:00');
@ -10625,8 +10629,8 @@ INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUE
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1431', 'IT', 'Ho letto e accetto le <a href=\"articles.php?page=impressum#tos\" target=\"_blank\">condizioni d\'uso di Opencaching.de</a> e la <a href=\"http://www.opencaching.de/articles.php?page=impressum#datalicense\">Lecenza dati Opencaching.de</a>.', '2010-09-10 23:39:25');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1432', 'IT', 'Informazione: il tuo log è stato cancellato dal proprietario della cache', '2010-09-10 23:39:09');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1433', 'IT', 'Seleziona città', '2010-10-27 18:49:19');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1434', 'IT', 'Totale di {resultscount} città corrispondenti', '2010-09-10 23:38:52');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1435', 'IT', 'Esiste più di un risultato che soddisfa i tuoi criteri di scelta. Per favore seleziona la città corretta.', '2010-09-10 23:38:27');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1434', 'IT', 'Totale di %1 città corrispondenti', '2010-09-10 23:38:52');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1435', 'IT', 'Esiste più di un risultato che soddisfa i tuoi criteri di scelta. Per favore seleziona la città corretta:', '2010-09-10 23:38:27');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1436', 'IT', 'Aggiungi log per la cache <a href=\"viewcache.php?cacheid={cacheid}\">{cachename}</a>', '2010-09-10 23:38:14');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1437', 'IT', 'Nome cache non valido', '2010-09-10 23:34:32');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1438', 'IT', 'Le coordinate usate non sono valide.', '2010-09-10 23:38:00');
@ -10635,8 +10639,8 @@ INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUE
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1441', 'IT', 'Lo stato della cache non corrisponde alle opzioni di pubblicazione.', '2010-09-10 23:34:16');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1442', 'IT', 'Seleziona la revisione dei dati di entrambi!', '2010-09-10 23:33:56');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1443', 'IT', 'Nessuna foto disponibile', '2010-09-10 23:32:13');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1444', 'IT', '{results_count} cache <span style=\"{search_headline_caches}\">trovate</span>', '2010-09-10 23:33:47');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1445', 'IT', 'Risultati {startatp1} a {endat} (come zip):', '2010-09-10 23:33:33');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1444', 'IT', '%1 cache <span style=\"%2\">trovate</span>', '2010-09-10 23:33:47');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1445', 'IT', 'Risultati %1 a %2 (come zip)', '2010-09-10 23:33:33');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1446', 'IT', 'Questa descrizione è stata creata su un server Web Opencaching diverso e può essere cancellata solo su quello.', '2010-10-27 18:49:19');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1447', 'IT', 'La descrizione della cache è stata eliminata.', '2010-09-10 23:31:10');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1448', 'IT', 'Cancella descrizione cache', '2010-09-10 23:30:52');

View File

@ -15,9 +15,9 @@ Used by: lang/de/ocstyle/selectlocid.inc.php
lib2/logic/geodb.inc.php (not in use)
search.php
util/gns/mkadmtxt.php
Source: OpenGeoDb ?
Source: OpenGeoDb
Import: ?
License: GNU Free Documentation License ?
License: GNU Free Documentation License
geodb_locations is only referenced by lib2/logic/geodb.inc.php i.e. it is
not used (yet) by OC production code.
@ -25,9 +25,8 @@ not used (yet) by OC production code.
Tables: geodb_search
Content: searching for caches by city
Used by: (not in use)
Source: OpenGeoDb
Import: util/geodb_searchindex/index.php
License: GNU Free Documentation License
Source: geodb_textdata
Import: util2/geodb/make_searchindex.php
There are more geodb_ tables present in OC developer and production systems,
which are undocumented, mostly empty and not in use anywhere.
@ -41,7 +40,7 @@ Content: political geographical data
Purpose: searching for caches by city (Ortschaften)
Used by: search.php
Source: http://earth-info.nga.mil/gns/html/
Impport: util/gns/mksearchindex.php
Import: util2/gns/gns_import.php
License: Public Domain

View File

@ -25,5 +25,5 @@ CREATE TABLE `cache_logs` (
KEY `date_created` (`date_created`),
KEY `user_id` (`user_id`,`cache_id`),
KEY `cache_id` (`cache_id`,`user_id`),
KEY `date` (`cache_id`,`date`)
KEY `date` (`cache_id`,`date`,`date_created`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;

View File

@ -62,8 +62,12 @@ class OcSmarty extends Smarty
$this->load_filter('output', 'session');
// cache control
/* This will make templates with many includes (e.g. search result list,
images galleries ..) VERY slow, and it is not necessary - auto-compile
when file time is touched will work find. -- following 2013/7/13
if (($opt['debug'] & DEBUG_TEMPLATES) == DEBUG_TEMPLATES)
$this->force_compile = true;
*/
// process debug level
if (($opt['debug'] & DEBUG_SQLDEBUGGER) == DEBUG_SQLDEBUGGER)

View File

@ -1,18 +1,10 @@
<?php
/****************************************************************************
./lib/charset.inc.php
--------------------
begin : July 7, 2012
For license information see doc/license.txt
****************************************************************************/
/****************************************************************************
Unicode Reminder メモ
charset related functions
****************************************************************************/

View File

@ -148,6 +148,8 @@ function configure_php()
ini_set('display_errors', true);
ini_set('error_reporting', E_ALL);
ini_set('mysql.trace_mode', true);
// SQL_CALC_FOUND_ROWS will not work with trace_mode on!
// Use the next two functions below as workaround.
// not for production use yet (has to be tested thoroughly)
register_errorhandlers();
@ -160,6 +162,19 @@ function configure_php()
}
}
function sql_enable_foundrows()
{
ini_set('mysql.trace_mode', false);
}
function sql_foundrows_done()
{
global $opt;
if ($opt['php']['debug'] == PHP_DEBUG_ON)
ini_set('mysql.trace_mode', true);
}
function set_domain()
{
global $opt;

View File

@ -25,6 +25,10 @@ function getLicenseDisclaimer($userid, $username, $userlicense, $cacheid, $langu
$ltext = "";
$language = strtoupper($language);
if (isset($absolute_server_URI))
$server_address = $absolute_server_URI;
else
$server_address = $opt['page']['absolute_url'];
if ($opt['logic']['license']['disclaimer'])
{
@ -43,17 +47,17 @@ function getLicenseDisclaimer($userid, $username, $userlicense, $cacheid, $langu
else
$df = 'd-m-Y';
$purl = parse_url($absolute_server_URI);
$purl = parse_url($server_address);
// may be shortened if linked to www.opencaching.de
if ($html && strpos($purl['host'],'opencaching.de'))
$purl['host'] = "Opencaching.de";
$ltext = "&copy; ";
if ($html) $ltext .= "<a href='" . $absolute_server_URI . "viewprofile.php?userid=" . $userid . "' target='_blank'>";
if ($html) $ltext .= "<a href='" . $server_address . "viewprofile.php?userid=" . $userid . "' target='_blank'>";
$ltext .= $username;
if ($html) $ltext .= "</a>";
$ltext .= ", ";
if ($html) $ltext .= "<a href='" . $absolute_server_URI . "viewcache.php?cacheid=" . $cacheid . "' target='_blank'>";
if ($html) $ltext .= "<a href='" . $server_address . "viewcache.php?cacheid=" . $cacheid . "' target='_blank'>";
$ltext .= $purl['host'];
if ($html) $ltext .= "</a>";
$ltext .= ", ";

View File

@ -337,7 +337,8 @@ class cache
LEFT JOIN `cache_rating` ON `cache_logs`.`cache_id`=`cache_rating`.`cache_id` AND `cache_logs`.`user_id`=`cache_rating`.`user_id` AND `cache_logs`.`date`=`cache_rating`.`rating_date`
".$addjoin."
WHERE `cache_logs`.`cache_id`='&1'
ORDER BY `cache_logs`.`date` DESC, `cache_logs`.`Id` DESC LIMIT &2, &3", $cacheid, $start+0, $count+0);
ORDER BY `cache_logs`.`date` DESC, `cache_logs`.`date_created` DESC
LIMIT &2, &3", $cacheid, $start+0, $count+0);
$logs = array();
while ($rLog = sql_fetch_assoc($rsLogs))

View File

@ -37,7 +37,7 @@
$npas = get_npas($cache_id);
if ($npas)
{
$desc = "<p>" . str_replace('%1',$opt['cms']['npa'], t('This geocache is probably placed within the following nature protection areas (<a href="%1">Info</a>):')) . "</p>\n" .
$desc = "<p>" . str_replace('%1',$opt['cms']['npa'], _('This geocache is probably placed within the following nature protection areas (<a href="%1">Info</a>):')) . "</p>\n" .
"<ul>\n";
foreach ($npas as $npa)
$desc .= "<li>" . $npa['npaTypeName'] . ": <a href='http://www.google.de/search?q=".urlencode($npa['npaTypeName'].' '.$npa['npaName'])."' target='_blank'>" . $npa['npaName'] . "</a></li>\n";

View File

@ -1,17 +1,10 @@
<?php
/****************************************************************************
./lib/ftsearch.inc.php
--------------------
begin : January 10 2007
For license information see doc/license.txt
****************************************************************************/
/****************************************************************************
Unicode Reminder メモ
functions for the full text search-engine
functions for the full text search-engine
****************************************************************************/
@ -105,7 +98,7 @@ function ftsearch_split(&$str, $simple)
else
{
if ($simple)
$astr[$i] = ftsearch_text2simple($astr[$i]);
$astr[$i] = ftsearch_text2simple($astr[$i]);
if ($astr[$i] == '')
unset($astr[$i]);
@ -323,7 +316,7 @@ function ftsearch_strip_html($text)
$text = str_replace('<br>', ' ', $text);
$text = strip_tags($text);
$text = html_entity_decode($text, ENT_COMPAT, 'UTF-8');
return $text;
}
?>

View File

@ -1,15 +1,14 @@
<?php
/****************************************************************************
For license information see doc/license.txt
Unicode Reminder メモ
GPX search output (GC compatible)
used by Ocprop
****************************************************************************/
require_once('lib/npas.inc.php');
require_once('lib2/logic/npas.inc.php');
$search_output_file_download = true;
$content_type_plain = 'application/gpx';
@ -17,29 +16,32 @@
function search_output()
{
global $absolute_server_URI, $locale, $usr, $login;
global $opt, $login;
global $cache_note_text;
$gpxHead =
$server_address = $opt['page']['absolute_url'];
$server_domain = parse_url($server_address, PHP_URL_HOST);
$gpxHead =
'<?xml version="1.0" encoding="utf-8"?>
<gpx xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" version="1.0" creator="Opencaching.de - http://www.opencaching.de" xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd http://www.groundspeak.com/cache/1/0/1 http://www.groundspeak.com/cache/1/0/1/cache.xsd" xmlns="http://www.topografix.com/GPX/1/0">
<name>Cache listing generated from Opencaching.de</name>
<desc>This is a waypoint file generated from Opencaching.de{wpchildren}</desc>
<author>Opencaching.de</author>
<email>contact@opencaching.de</email>
<url>http://www.opencaching.de</url>
<url>http://'.$server_domain.'</url>
<urlname>Opencaching.de - Geocaching in Deutschland, Oesterreich und der Schweiz</urlname>
<time>{time}</time>
<keywords>cache, geocache, opencaching, waypoint</keywords>
';
$gpxLine =
$gpxLine =
' <wpt lat="{lat}" lon="{lon}">
<time>{time}</time>
<name>{waypoint}</name>
<desc>{cachename}</desc>
<src>www.opencaching.de</src>
<url>' . $absolute_server_URI . 'viewcache.php?cacheid={cacheid}</url>
<src>'.$server_domain.'</src>
<url>' . $server_address . 'viewcache.php?cacheid={cacheid}</url>
<urlname>{cachename}</urlname>
<sym>{sym}</sym>
<type>Geocache|{type}</type>
@ -104,7 +106,7 @@ function search_output()
<name>{name}</name>
<cmt>{comment}</cmt>
<desc>{desc}</desc>
<url>' . $absolute_server_URI . 'viewcache.php?cacheid={cacheid}</url>
<url>' . $server_address . 'viewcache.php?cacheid={cacheid}</url>
<urlname>{parent} {cachename}</urlname>
<sym>{type}</sym>
<type>Waypoint|{type}</type>
@ -145,7 +147,7 @@ function search_output()
$gpxType[7] = 'Unknown Cache';
$gpxType[8] = 'Unknown Cache';
$gpxType[10] = 'Traditional Cache';
$gpxLogType[0] = 'Other';
$gpxLogType[1] = 'Found it';
$gpxLogType[2] = 'Didn\'t find it';
@ -164,41 +166,40 @@ function search_output()
$childwphandler = new ChildWp_Handler();
$children='';
$rs = sql('SELECT `searchtmp`.`cache_id` `cacheid` FROM `searchtmp`');
while ($r = sql_fetch_array($rs))
while ($r = sql_fetch_array($rs) && $children == '')
{
if (count($childwphandler->getChildWps($r['cacheid'])))
$children=" (HasChildren)";
$children = ' (HasChildren)';
}
mysql_free_result($rs);
$gpxHead = mb_ereg_replace('{wpchildren}', $children, $gpxHead);
$gpxHead = mb_ereg_replace('{time}', date($gpxTimeFormat, time()), $gpxHead);
append_output($gpxHead);
if ($usr === false)
$user_id = 0;
else
$user_id = $usr['userid'];
$rs = sql_slave("SELECT SQL_BUFFER_RESULT `searchtmp`.`cache_id` `cacheid`, `searchtmp`.`longitude` `longitude`, `searchtmp`.`latitude` `latitude`,
`cache_location`.`adm2` `state`, `caches`.`wp_oc` `waypoint`, `caches`.`date_hidden` `date_hidden`, `caches`.`name` `name`,
`caches`.`country` `country`, `countries`.`name` AS `country_name`, `caches`.`terrain` `terrain`, `caches`.`difficulty` `difficulty`, `caches`.`desc_languages` `desc_languages`,
$user_id = $login->userid;
$rs = sql_slave("SELECT SQL_BUFFER_RESULT `searchtmp`.`cache_id` `cacheid`, `searchtmp`.`longitude` `longitude`, `searchtmp`.`latitude` `latitude`,
`cache_location`.`adm2` `state`, `caches`.`wp_oc` `waypoint`, `caches`.`date_hidden` `date_hidden`, `caches`.`name` `name`,
`caches`.`country` `country`, `countries`.`name` AS `country_name`, `caches`.`terrain` `terrain`, `caches`.`difficulty` `difficulty`, `caches`.`desc_languages` `desc_languages`,
`caches`.`size` `size`, `caches`.`type` `type`, `caches`.`status` `status`, `user`.`username` `username`, `caches`.`user_id` `userid`, `user`.`data_license`,
`cache_desc`.`desc` `desc`, `cache_desc`.`short_desc` `short_desc`, `cache_desc`.`hint` `hint`,
IFNULL(`stat_cache_logs`.`found`, 0) AS `found`
FROM `searchtmp`
FROM `searchtmp`
INNER JOIN `caches` ON `searchtmp`.`cache_id`=`caches`.`cache_id`
INNER JOIN `countries` ON `caches`.`country`=`countries`.`short`
INNER JOIN `user` ON `searchtmp`.`user_id`=`user`.`user_id`
INNER JOIN `cache_desc` ON `caches`.`cache_id`=`cache_desc`.`cache_id`AND `caches`.`default_desclang`=`cache_desc`.`language`
INNER JOIN `cache_desc` ON `caches`.`cache_id`=`cache_desc`.`cache_id`AND `caches`.`default_desclang`=`cache_desc`.`language`
LEFT JOIN `cache_location` ON `searchtmp`.`cache_id`=`cache_location`.`cache_id`
LEFT JOIN `stat_cache_logs` ON `searchtmp`.`cache_id`=`stat_cache_logs`.`cache_id` AND `stat_cache_logs`.`user_id`='&1'", $user_id);
while ($r = sql_fetch_array($rs))
{
$thisline = $gpxLine;
$lat = sprintf('%01.5f', $r['latitude']);
$thisline = mb_ereg_replace('{lat}', $lat, $thisline);
$lon = sprintf('%01.5f', $r['longitude']);
$thisline = mb_ereg_replace('{lon}', $lon, $thisline);
@ -206,44 +207,44 @@ function search_output()
$thisline = mb_ereg_replace('{time}', $time, $thisline);
$thisline = mb_ereg_replace('{waypoint}', $r['waypoint'], $thisline);
$thisline = mb_ereg_replace('{cacheid}', $r['cacheid'], $thisline);
$thisline = mb_ereg_replace('{cachename}', xmlentities($r['name']), $thisline);
$thisline = mb_ereg_replace('{country}', $r['country_name'], $thisline);
$thisline = mb_ereg_replace('{state}', xmlentities($r['state']), $thisline);
$thisline = mb_ereg_replace('{cachename}', text_xmlentities($r['name']), $thisline);
$thisline = mb_ereg_replace('{country}', text_xmlentities($r['country_name']), $thisline);
$thisline = mb_ereg_replace('{state}', text_xmlentities($r['state']), $thisline);
if ($r['hint'] == '')
$thisline = mb_ereg_replace('{hints}', '', $thisline);
else
// Ocprop: <groundspeak:encoded_hints>(.*?)<\/groundspeak:encoded_hints>
$hint = html_entity_decode(strip_tags($r['hint']), ENT_COMPAT, "UTF-8");
$thisline = mb_ereg_replace('{hints}', ' <groundspeak:encoded_hints>' . xmlentities($hint) . '</groundspeak:encoded_hints>
$thisline = mb_ereg_replace('{hints}', ' <groundspeak:encoded_hints>' . text_xmlentities($hint) . '</groundspeak:encoded_hints>
', $thisline);
$thisline = mb_ereg_replace('{shortdesc}', xmlentities($r['short_desc']), $thisline);
$thisline = mb_ereg_replace('{shortdesc}', text_xmlentities($r['short_desc']), $thisline);
$desc = str_replace('<img src="images/uploads/','<img src="' . $absolute_server_URI . 'images/uploads/', $r['desc']);
$desc = str_replace('<img src="images/uploads/','<img src="' . $server_address . 'images/uploads/', $r['desc']);
$license = getLicenseDisclaimer(
$r['userid'], $r['username'], $r['data_license'], $r['cacheid'], $locale, true, true);
$r['userid'], $r['username'], $r['data_license'], $r['cacheid'], $opt['template']['locale'], true, true);
if ($license != "")
$desc .= "<p><em>$license</em></p>\n";
$desc .= get_desc_npas($r['cacheid']);
$thisline = mb_ereg_replace('{desc}', xmlentities(decodeEntities($desc)), $thisline);
$thisline = mb_ereg_replace('{desc}', text_xmlentities(decodeEntities($desc)), $thisline);
$thisline = mb_ereg_replace('{images}', xmlentities(getPictures($r['cacheid'])), $thisline);
$thisline = mb_ereg_replace('{images}', text_xmlentities(getPictures($r['cacheid'],$server_address)), $thisline);
if (isset($gpxType[$r['type']]))
$thisline = mb_ereg_replace('{type}', $gpxType[$r['type']], $thisline);
$thisline = mb_ereg_replace('{type}', $gpxType[$r['type']], $thisline);
else
$thisline = mb_ereg_replace('{type}', $gpxType[0], $thisline);
$thisline = mb_ereg_replace('{type}', $gpxType[0], $thisline);
if (isset($gpxContainer[$r['size']]))
$thisline = mb_ereg_replace('{container}', $gpxContainer[$r['size']], $thisline);
$thisline = mb_ereg_replace('{container}', $gpxContainer[$r['size']], $thisline);
else
$thisline = mb_ereg_replace('{container}', $gpxContainer[0], $thisline);
$thisline = mb_ereg_replace('{container}', $gpxContainer[0], $thisline);
if (isset($gpxStatus[$r['status']]))
$thisline = mb_ereg_replace('{status}', $gpxStatus[$r['status']], $thisline);
$thisline = mb_ereg_replace('{status}', $gpxStatus[$r['status']], $thisline);
else
$thisline = mb_ereg_replace('{status}', $gpxStatus[0], $thisline);
$thisline = mb_ereg_replace('{status}', $gpxStatus[0], $thisline);
$sDiffDecimals = '';
if ($r['difficulty'] % 2) $sDiffDecimals = '.5';
@ -255,13 +256,13 @@ function search_output()
$r['terrain'] -= $r['terrain'] % 2;
$thisline = mb_ereg_replace('{terrain}', ($r['terrain']/2) . $sTerrDecimals, $thisline);
$thisline = mb_ereg_replace('{owner}', xmlentities($r['username']), $thisline);
$thisline = mb_ereg_replace('{userid}', xmlentities($r['userid']), $thisline);
$thisline = mb_ereg_replace('{owner}', text_xmlentities($r['username']), $thisline);
$thisline = mb_ereg_replace('{userid}', $r['userid'], $thisline);
if ($r['found'] > 0)
$thisline = mb_ereg_replace('{sym}', xmlentities($gpxSymFound), $thisline);
$thisline = mb_ereg_replace('{sym}', text_xmlentities($gpxSymFound), $thisline);
else
$thisline = mb_ereg_replace('{sym}', xmlentities($gpxSymNormal), $thisline);
$thisline = mb_ereg_replace('{sym}', text_xmlentities($gpxSymNormal), $thisline);
// clear cache specific data
$logentries = '';
@ -283,56 +284,56 @@ function search_output()
$thislog = mb_ereg_replace('{id}', 0, $thislog);
$thislog = mb_ereg_replace('{date}', date($gpxTimeFormat), $thislog);
$thislog = mb_ereg_replace('{userid}', $user_id, $thislog);
$thislog = mb_ereg_replace('{username}', xmlentities($login->username), $thislog);
$thislog = mb_ereg_replace('{username}', text_xmlentities($login->username), $thislog);
$thislog = mb_ereg_replace('{type}', $gpxLogType[3], $thislog);
$thislog = mb_ereg_replace('{text}', xmlentities($cacheNote['note']), $thislog);
$thislog = mb_ereg_replace('{text}', text_xmlentities($cacheNote['note']), $thislog);
$logentries .= $thislog . "\n";
}
// current users logs
$rsLogs = sql_slave("SELECT `cache_logs`.`id`, `cache_logs`.`type`, `cache_logs`.`date`, `cache_logs`.`text`, `user`.`username`, `user`.`user_id` FROM `cache_logs`, `user` WHERE `cache_logs`.`user_id`=`user`.`user_id` AND `cache_logs`.`cache_id`=&1 AND `user`.`user_id`=&2 ORDER BY `cache_logs`.`date` DESC", $r['cacheid'], $user_id);
$rsLogs = sql_slave("SELECT `cache_logs`.`id`, `cache_logs`.`type`, `cache_logs`.`date`, `cache_logs`.`text`, `user`.`username`, `user`.`user_id` FROM `cache_logs`, `user` WHERE `cache_logs`.`user_id`=`user`.`user_id` AND `cache_logs`.`cache_id`=&1 AND `user`.`user_id`=&2 ORDER BY `cache_logs`.`date` DESC, `cache_logs`.`date_created` DESC", $r['cacheid'], $user_id);
while ($rLog = sql_fetch_array($rsLogs))
{
$thislog = $gpxLog;
$thislog = mb_ereg_replace('{id}', $rLog['id'], $thislog);
$thislog = mb_ereg_replace('{date}', date($gpxTimeFormat, strtotime($rLog['date'])), $thislog);
$thislog = mb_ereg_replace('{userid}', xmlentities($rLog['user_id']), $thislog);
$thislog = mb_ereg_replace('{username}', xmlentities($rLog['username']), $thislog);
$thislog = mb_ereg_replace('{userid}', $rLog['user_id'], $thislog);
$thislog = mb_ereg_replace('{username}', text_xmlentities($rLog['username']), $thislog);
if (isset($gpxLogType[$rLog['type']]))
$logtype = $gpxLogType[$rLog['type']];
else
$logtype = $gpxLogType[0];
$thislog = mb_ereg_replace('{type}', $logtype, $thislog);
$thislog = mb_ereg_replace('{text}', xmlentities(decodeEntities($rLog['text'])), $thislog);
$thislog = mb_ereg_replace('{text}', text_xmlentities(decodeEntities($rLog['text'])), $thislog);
$logentries .= $thislog . "\n";
}
mysql_free_result($rsLogs);
}
// newest 20 logs (except current users)
$rsLogs = sql_slave("SELECT `cache_logs`.`id`, `cache_logs`.`type`, `cache_logs`.`date`, `cache_logs`.`text`, `user`.`username`, `user`.`user_id` FROM `cache_logs`, `user` WHERE `cache_logs`.`user_id`=`user`.`user_id` AND `cache_logs`.`cache_id`=&1 AND `user`.`user_id`!=&2 ORDER BY `cache_logs`.`date` DESC LIMIT 20", $r['cacheid'], $user_id);
$rsLogs = sql_slave("SELECT `cache_logs`.`id`, `cache_logs`.`type`, `cache_logs`.`date`, `cache_logs`.`text`, `user`.`username`, `user`.`user_id` FROM `cache_logs`, `user` WHERE `cache_logs`.`user_id`=`user`.`user_id` AND `cache_logs`.`cache_id`=&1 AND `user`.`user_id`!=&2 ORDER BY `cache_logs`.`date` DESC, `cache_logs`.`date_created` DESC LIMIT 20", $r['cacheid'], $user_id);
while ($rLog = sql_fetch_array($rsLogs))
{
$thislog = $gpxLog;
$thislog = mb_ereg_replace('{id}', $rLog['id'], $thislog);
$thislog = mb_ereg_replace('{date}', date($gpxTimeFormat, strtotime($rLog['date'])), $thislog);
$thislog = mb_ereg_replace('{userid}', xmlentities($rLog['user_id']), $thislog);
$thislog = mb_ereg_replace('{username}', xmlentities($rLog['username']), $thislog);
$thislog = mb_ereg_replace('{userid}', $rLog['user_id'], $thislog);
$thislog = mb_ereg_replace('{username}', text_xmlentities($rLog['username']), $thislog);
if (isset($gpxLogType[$rLog['type']]))
$logtype = $gpxLogType[$rLog['type']];
else
$logtype = $gpxLogType[0];
$thislog = mb_ereg_replace('{type}', $logtype, $thislog);
$thislog = mb_ereg_replace('{text}', xmlentities(decodeEntities($rLog['text'])), $thislog);
$thislog = mb_ereg_replace('{text}', text_xmlentities(decodeEntities($rLog['text'])), $thislog);
$logentries .= $thislog . "\n";
}
mysql_free_result($rsLogs);
@ -353,7 +354,7 @@ function search_output()
{
$thisattribute = mb_ereg_replace('{attrib_id}', $rAttrib['gc_id'], $gpxAttributes);
$thisattribute = mb_ereg_replace('{attrib_inc}', $rAttrib['gc_inc'], $thisattribute);
$thisattribute = mb_ereg_replace('{attrib_name}', xmlentities($rAttrib['gc_name']), $thisattribute);
$thisattribute = mb_ereg_replace('{attrib_name}', text_xmlentities($rAttrib['gc_name']), $thisattribute);
$attribentries .= $thisattribute . "\n";
$gc_ids[$rAttrib['gc_id']] = true;
}
@ -370,8 +371,8 @@ function search_output()
$thiskrety = mb_ereg_replace('{gkid}', $rGK['id'], $thiskrety);
$thiskrety = mb_ereg_replace('{gkref}', sprintf("GK%04X",$rGK['id']), $thiskrety);
$thiskrety = mb_ereg_replace('{gkname}', xmlentities($rGK['name']), $thiskrety);
$thiskrety = mb_ereg_replace('{gkname}', text_xmlentities($rGK['name']), $thiskrety);
$gkentries .= $thiskrety . "\n";
}
mysql_free_result($rsGeokrety);
@ -389,9 +390,9 @@ function search_output()
$thiswp = mb_ereg_replace('{wp_lon}', sprintf('%01.5f', $childWaypoint['longitude']), $thiswp);
$thiswp = mb_ereg_replace('{time}', $time, $thiswp);
$thiswp = mb_ereg_replace('{name}', $r['waypoint'].'-'.sprintf($digits,$n) , $thiswp);
$thiswp = mb_ereg_replace('{cachename}', xmlentities($r['name']), $thiswp);
$thiswp = mb_ereg_replace('{comment}',xmlentities($childWaypoint['description']), $thiswp);
$thiswp = mb_ereg_replace('{desc}', xmlentities($childWaypoint['name']), $thiswp);
$thiswp = mb_ereg_replace('{cachename}', text_xmlentities($r['name']), $thiswp);
$thiswp = mb_ereg_replace('{comment}',text_xmlentities($childWaypoint['description']), $thiswp);
$thiswp = mb_ereg_replace('{desc}', text_xmlentities($childWaypoint['name']), $thiswp);
switch ($childWaypoint['type'])
{
case 1: $wp_typename = "Parking Area"; break; // well-known garmin symbols
@ -401,7 +402,7 @@ function search_output()
case 5: $wp_typename = "Diamond, Green"; break; // point of interest
default: $wp_typename = "Flag, Blue"; break; // for the case new types are forgotten here ..
}
$thiswp = mb_ereg_replace('{type}', $wp_typename, $thiswp);
$thiswp = mb_ereg_replace('{type}', text_xmlentities($wp_typename), $thiswp);
$thiswp = mb_ereg_replace('{parent}', $r['waypoint'], $thiswp);
$thiswp = mb_ereg_replace('{cacheid}', $r['cacheid'], $thiswp);
$waypoints .= $thiswp;
@ -415,9 +416,9 @@ function search_output()
$thiswp = mb_ereg_replace('{wp_lon}', sprintf('%01.5f', $cacheNote['longitude']), $thiswp);
$thiswp = mb_ereg_replace('{time}', $time, $thiswp);
$thiswp = mb_ereg_replace('{name}', $r['waypoint'].'NOTE', $thiswp);
$thiswp = mb_ereg_replace('{cachename}', xmlentities($r['name']), $thiswp);
$thiswp = mb_ereg_replace('{comment}', xmlentities($cacheNote['note']), $thiswp);
$thiswp = mb_ereg_replace('{desc}', $cache_note_text, $thiswp);
$thiswp = mb_ereg_replace('{cachename}', text_xmlentities($r['name']), $thiswp);
$thiswp = mb_ereg_replace('{comment}', text_xmlentities($cacheNote['note']), $thiswp);
$thiswp = mb_ereg_replace('{desc}', text_xmlentities($cache_note_text), $thiswp);
$thiswp = mb_ereg_replace('{type}', "Reference Point", $thiswp);
$thiswp = mb_ereg_replace('{parent}', $r['waypoint'], $thiswp);
$thiswp = mb_ereg_replace('{cacheid}', $r['cacheid'], $thiswp);
@ -453,28 +454,13 @@ function search_output()
foreach ($translate as $entity => $placeholder)
{
if (!$inverse)
{
$str = mb_ereg_replace($entity, $placeholder, $str);
}
else
{
$str = mb_ereg_replace($placeholder, $entity, $str);
}
}
return $str;
}
function xmlentities($str)
{
$str = htmlspecialchars($str, ENT_NOQUOTES, "UTF-8");
return filterevilchars($str);
}
function filterevilchars($str)
{
return mb_ereg_replace('[\\x00-\\x09|\\x0B-\\x0C|\\x0E-\\x1F]', '', $str);
}
function getCacheNote($userid, $cacheid)
{
$cacheNoteHandler = new CacheNote_Handler();
@ -488,22 +474,20 @@ function search_output()
// based on oc.pl code, but embedded thumbs instead of full pictures
// (also to hide spoilers first)
function getPictures($cacheid)
function getPictures($cacheid, $server_address)
{
global $translate, $absolute_server_URI;
$retval = "";
$rs = sql_slave("SELECT uuid, title, url, spoiler FROM pictures
WHERE object_id='&1' AND object_type=2 AND display=1
WHERE object_id='&1' AND object_type=2 AND display=1
ORDER BY date_created", $cacheid);
while ($r = sql_fetch_array($rs))
{
$retval .= '<div style="float:left; padding:8px"><a href="' . $r['url'] . '" target="_blank">' .
'<img src="' . $absolute_server_URI . 'thumbs.php?uuid=' . $r["uuid"]. '" >' .
'<img src="' . $server_address . 'thumbs.php?uuid=' . $r["uuid"]. '" >' .
'</a><br />' . $r['title'];
if ($r['spoiler'])
$retval .= ' (' . $translate->t('click on spoiler to display','',basename(__FILE__), __LINE__) . ')';
$retval .= ' (' . _('click on spoiler to display') . ')';
$retval .= "</div>";
}
mysql_free_result($rs);

View File

@ -4,12 +4,10 @@
Unicode Reminder メモ
(X)HTML search output
Used by Ocprop
****************************************************************************/
HTML search output
(Used by Ocprop)
require_once($stylepath . '/lib/icons.inc.php');
require_once('lib/cache_icon.inc.php');
****************************************************************************/
$search_output_file_download = false;
@ -17,183 +15,100 @@
`caches`.`desc_languages`, `caches`.`date_created`,
`user`.`username`,
`cache_type`.`icon_large`,
`cache_type`.`name` `cacheTypeName`,
`stt`.`text` AS `cacheTypeName`,
IFNULL(`stat_caches`.`found`, 0) `founds`,
IFNULL(`stat_caches`.`toprating`, 0) `topratings`,
IF(ISNULL(`tbloconly`.`cache_id`), 0, 1) AS `oconly`';
$sAddJoin .= 'INNER JOIN `user` ON `caches`.`user_id`=`user`.`user_id`
INNER JOIN `cache_type` ON `cache_type`.`id`=`caches`.`type`
LEFT JOIN `caches_attributes` AS `tbloconly`
ON `caches`.`cache_id`=`tbloconly`.`cache_id` AND `tbloconly`.`attrib_id`=6';
$sAddJoin .= ' INNER JOIN `user` ON `caches`.`user_id`=`user`.`user_id`
INNER JOIN `cache_type` ON `cache_type`.`id`=`caches`.`type`
LEFT JOIN `caches_attributes` AS `tbloconly`
ON `caches`.`cache_id`=`tbloconly`.`cache_id` AND `tbloconly`.`attrib_id`=6
LEFT JOIN `sys_trans_text` `stt` ON `stt`.`trans_id`=`cache_type`.`trans_id`';
$sAddWhere .= ' AND `stt`.`lang`=\'' . sql_escape($opt['template']['locale']) . '\'';
function search_output()
{
global $sqldebug, $stylepath, $tplname, $logdateformat, $usr, $bgcolor1, $bgcolor2;
global $string_by, $caches_olddays, $caches_newstring, $caches_oconlystring, $showonmap;
global $options, $lat_rad, $lon_rad, $distance_unit, $startat, $caches_per_page, $sql;
global $opt, $tpl, $login;
global $newcache_days, $showonmap;
global $calledbysearch, $options, $lat_rad, $lon_rad, $distance_unit;
global $startat, $caches_per_page, $sql;
$tplname = 'search.result.caches';
$cache_line = read_file($stylepath . '/search.result.caches.row.tpl.php');
$cache_line = mb_ereg_replace('{string_by}', $string_by, $cache_line);
$caches_output = '';
$tpl->name = 'search.result.caches';
$tpl->menuitem = MNU_CACHES_SEARCH_RESULT;
// output range
$startat = floor($startat / $caches_per_page) * $caches_per_page;
$sql .= ' LIMIT ' . $startat . ', ' . $caches_per_page;
// run SQL query
$nRowIndex = 0;
$rs_caches = sql_slave("SELECT SQL_BUFFER_RESULT SQL_CALC_FOUND_ROWS " . $sql, $sqldebug);
sql_enable_foundrows();
$rs_caches = sql_slave("SELECT SQL_BUFFER_RESULT SQL_CALC_FOUND_ROWS " . $sql);
$resultcount = sql_value_slave('SELECT FOUND_ROWS()', 0);
tpl_set_var('results_count', $resultcount);
sql_foundrows_done();
$tpl->assign('results_count', $resultcount);
$tpl->assign('startat',$startat);
while ($caches_record = sql_fetch_array($rs_caches))
$caches = array();
while ($rCache = sql_fetch_array($rs_caches))
{
$tmpline = $cache_line;
// select best-fitting short desc for active language
$rCache['short_desc'] = sql_value_slave("
SELECT `short_desc`
FROM `cache_desc`
WHERE `cache_id`='&1' AND `language`='&2'",
false, $rCache['cache_id'], $opt['template']['locale']);
if ($rCache['short_desc'] === false) $rCache['short_desc'] = sql_value_slave("
SELECT `short_desc`
FROM `cache_desc`
WHERE `cache_id`='&1' AND `language`='EN'",
false, $rCache['cache_id']);
if ($rCache['short_desc'] === false) $rCache['short_desc'] = sql_value_slave("
SELECT `short_desc`
FROM `cache_desc`
WHERE `cache_id`='&1'
ORDER BY `date_created`
LIMIT 1",
'', $rCache['cache_id']);
list($iconname, $inactive) = getCacheIcon($usr['userid'], $caches_record['cache_id'], $caches_record['status'],
$caches_record['user_id'], $caches_record['icon_large']);
$tmpline = mb_ereg_replace('{icon_large}', $iconname, $tmpline);
$tmpline = mb_ereg_replace('{cachetype}', htmlspecialchars(t($caches_record['cacheTypeName']), ENT_COMPAT, 'UTF-8'), $tmpline);
// short_desc ermitteln TODO: nicht die erste sondern die richtige wählen
$rsdesc = sql_slave("SELECT `short_desc` FROM `cache_desc` WHERE `cache_id`='&1' LIMIT 1", $caches_record['cache_id']);
$desc_record = sql_fetch_array($rsdesc);
mysql_free_result($rsdesc);
$tmpline = mb_ereg_replace('{short_desc}', htmlspecialchars($desc_record['short_desc'], ENT_COMPAT, 'UTF-8'), $tmpline);
$dDiff = abs(dateDiff('d', $caches_record['date_created'], date('Y-m-d')));
if ($dDiff < $caches_olddays)
$tmpline = mb_ereg_replace('{new}', $caches_newstring, $tmpline);
else
$tmpline = mb_ereg_replace('{new}', '', $tmpline);
$tmpline = mb_ereg_replace('{diffpic}', icon_difficulty("diff", $caches_record['difficulty']), $tmpline);
$tmpline = mb_ereg_replace('{terrpic}', icon_difficulty("terr", $caches_record['terrain']), $tmpline);
$tmpline = mb_ereg_replace('{ratpic}', icon_rating($caches_record['founds'], $caches_record['topratings']), $tmpline);
if ($caches_record['oconly'] == 1)
$tmpline = mb_ereg_replace('{oconly}', $caches_oconlystring, $tmpline);
else
$tmpline = mb_ereg_replace('{oconly}', '', $tmpline);
$rCache['desclangs'] = mb_split(',', $rCache['desc_languages']);
// decide if the cache is new
$dDiff = abs(dateDiff('d', $rCache['date_created'], date('Y-m-d')));
$rCache['isnew'] = ($dDiff <= $newcache_days);
// get last logs
if ($options['sort'] != 'bymylastlog' || $usr === false)
if ($options['sort'] != 'bymylastlog' || !$login->logged_in())
$ownlogs = "";
else
$ownlogs = " AND `cache_logs`.`user_id`='" . sql_escape($usr['userid']) . "'";
$sql = 'SELECT `cache_logs`.`id` `id`, `cache_logs`.`type` `type`, `cache_logs`.`date` `date`, `log_types`.`icon_small` `icon_small`
$ownlogs = " AND `cache_logs`.`user_id`='" . sql_escape($login->userid) . "'";
$sql = "
SELECT `cache_logs`.`id`, `cache_logs`.`type`, `cache_logs`.`date`, `log_types`.`icon_small`
FROM `cache_logs`, `log_types`
WHERE `cache_logs`.`cache_id`=\'' . sql_escape($caches_record['cache_id']) . '\'
AND `log_types`.`id`=`cache_logs`.`type`' . $ownlogs . '
ORDER BY `cache_logs`.`date` DESC LIMIT 6';
$result = sql_slave($sql);
WHERE `cache_logs`.`cache_id`='" . sql_escape($rCache['cache_id']) . "'
AND `log_types`.`id`=`cache_logs`.`type`" . $ownlogs . "
ORDER BY `cache_logs`.`date` DESC, `cache_logs`.`date_created` DESC
LIMIT 6";
$rs = sql_slave($sql);
$rCache['logs'] = sql_fetch_assoc_table($rs);
$rCache['firstlog'] = array_shift($rCache['logs']);
if ($row = sql_fetch_array($result))
{
$loglink = '<a href=\'viewlogs.php?cacheid='.htmlspecialchars($caches_record['cache_id'], ENT_COMPAT, 'UTF-8').'#log'.htmlspecialchars($row['id'], ENT_COMPAT, 'UTF-8').'\'>';
$tmpline = mb_ereg_replace('{logimage1}',
$loglink . icon_log_type($row['icon_small'], ""). '</a>{gray_s}' . $loglink. date($logdateformat, strtotime($row['date'])) . '{gray_e}</a>', $tmpline);
$tmpline = mb_ereg_replace('{logdate1}', "", $tmpline);
}
else
{
$tmpline = mb_ereg_replace('{logimage1}', "<img src='images/trans.gif' border='0' width='16' height='16' />", $tmpline);
$tmpline = mb_ereg_replace('{logdate1}', "--.--.----", $tmpline);
}
$lastlogs = "";
while ($row = sql_fetch_array($result))
{
$lastlogs .= '<a href=\'viewlogs.php?cacheid=' . urlencode($caches_record['cache_id']) . '#log' . htmlspecialchars($row['id'], ENT_COMPAT, 'UTF-8') . '\'>' . icon_log_type($row['icon_small'], '') . '</a>&nbsp;';
}
$tmpline = mb_ereg_replace('{lastlogs}', $lastlogs, $tmpline);
// und jetzt noch die Richtung ...
if ($caches_record['distance'] > 0)
{
$tmpline = mb_ereg_replace('{direction}', Bearing2Text(calcBearing($lat_rad / 3.14159 * 180, $lon_rad / 3.14159 * 180, $caches_record['latitude'], $caches_record['longitude']), 1), $tmpline);
}
else
$tmpline = mb_ereg_replace('{direction}', '', $tmpline);
$desclangs = '';
$aLangs = mb_split(',', $caches_record['desc_languages']);
foreach ($aLangs AS $thislang)
{
$desclangs .= '<a href="viewcache.php?cacheid=' . urlencode($caches_record['cache_id']) . '&desclang=' . urlencode($thislang) . '" style="text-decoration:none;"><b><font color="blue">' . htmlspecialchars($thislang, ENT_COMPAT, 'UTF-8') . '</font></b></a> ';
}
// strikeout inavtive caches
// see also res_cachestatus_span.tpl
$status_style = ""; // (colored) strike-through for inactive caches
$line_style = ""; // color of the linked cache name
$name_style = ""; // color of "by <username>"
switch ($caches_record['status'])
{
case 2: // disabled
$status_style = "text-decoration: line-through;";
break;
case 3: // archived
case 6: // locked
$status_style = "text-decoration: line-through; color: #c00000;";
// $line_style = "color:grey";
break;
case 7: // locked, invisible
$status_style = "text-decoration: line-through; color: #e00000";
$name_style = "color: #e00000";
// $line_style = "color:grey";
break;
case 5: // not published yet
$name_style = "color: #e00000";
break;
default: $status_style = $line_style = "";
}
$tmpline = mb_ereg_replace('{line_style}', $line_style, $tmpline);
$tmpline = mb_ereg_replace('{status_style}', $status_style, $tmpline);
$tmpline = mb_ereg_replace('{name_style}', $name_style, $tmpline);
$tmpline = mb_ereg_replace('{desclangs}', $desclangs, $tmpline);
$tmpline = mb_ereg_replace('{cachename}', htmlspecialchars($caches_record['name'], ENT_COMPAT, 'UTF-8'), $tmpline);
$tmpline = mb_ereg_replace('{urlencode_cacheid}', htmlspecialchars(urlencode($caches_record['cache_id']), ENT_COMPAT, 'UTF-8'), $tmpline);
$tmpline = mb_ereg_replace('{urlencode_userid}', htmlspecialchars(urlencode($caches_record['user_id']), ENT_COMPAT, 'UTF-8'), $tmpline);
$tmpline = mb_ereg_replace('{username}', htmlspecialchars($caches_record['username'], ENT_COMPAT, 'UTF-8'), $tmpline);
$tmpline = mb_ereg_replace('{position}', $nRowIndex + $startat + 1, $tmpline);
if ($caches_record['distance'] == NULL)
$tmpline = mb_ereg_replace('{distance}', '', $tmpline);
else
$tmpline = mb_ereg_replace('{distance}', htmlspecialchars(sprintf("%01.1f", $caches_record['distance']), ENT_COMPAT, 'UTF-8'), $tmpline);
// backgroundcolor of line
if (($nRowIndex % 2) == 1) $bgcolor = $bgcolor2;
else $bgcolor = $bgcolor1;
if ($inactive)
{
//$bgcolor = $bgcolor_inactive;
$tmpline = mb_ereg_replace('{gray_s}', "<span class='text_gray'>", $tmpline);
$tmpline = mb_ereg_replace('{gray_e}', "</span>", $tmpline);
}
else
{
$tmpline = mb_ereg_replace('{gray_s}', "", $tmpline);
$tmpline = mb_ereg_replace('{gray_e}', "", $tmpline);
}
$tmpline = mb_ereg_replace('{bgcolor}', $bgcolor, $tmpline);
$nRowIndex++;
$caches_output .= $tmpline;
// get direction from search coordinate
if ($rCache['distance'] > 0)
$rCache['direction'] = geomath::Bearing2Text(geomath::calcBearing($lat_rad / 3.14159 * 180, $lon_rad / 3.14159 * 180, $rCache['latitude'], $rCache['longitude']), 1);
else
$rCache['direction'] = '';
// other data
$rCache['icon'] = getCacheIcon($login->userid, $rCache['cache_id'], $rCache['status'], $rCache['user_id'], $rCache['icon_large']);
$rCache['redname'] = ($rCache['status']==5 || $rCache['status']==7);
$caches[] = $rCache;
}
mysql_free_result($rs_caches);
tpl_set_var('results', $caches_output);
$tpl->assign('caches', $caches);
// more than one page?
if ($resultcount <= $caches_per_page)
@ -201,9 +116,9 @@ function search_output()
else
{
if ($startat > 0) // Ocprop: queryid=([0-9]+)
$pages = '<a href="search.php?queryid=' . $options['queryid'] . '&startat=0"><img src="resource2/ocstyle/images/navigation/16x16-browse-first.png" width="16" height="16"></a> <a href="search.php?queryid=' . $options['queryid'] . '&startat=' . ($startat - $caches_per_page) . '"><img src="resource2/ocstyle/images/navigation/16x16-browse-prev.png" width="16" height="16"></a></a> ';
$pages = '<a href="search.php?queryid=' . $options['queryid'] . '&startat=0"><img src="resource2/ocstyle/images/navigation/16x16-browse-first.png" width="16" height="16"></a> <a href="search.php?queryid=' . $options['queryid'] . '&startat=' . ($startat - $caches_per_page) . '"><img src="resource2/ocstyle/images/navigation/16x16-browse-prev.png" width="16" height="16"></a> ';
else
$pages = ' <img src="resource2/ocstyle/images/navigation/16x16-browse-first-inactive.png" width="16" height="16"></a> <img src="resource2/ocstyle/images/navigation/16x16-browse-prev-inactive.png" width="16" height="16"></a> ';
$pages = ' <img src="resource2/ocstyle/images/navigation/16x16-browse-first-inactive.png" width="16" height="16"> <img src="resource2/ocstyle/images/navigation/16x16-browse-prev-inactive.png" width="16" height="16"> ';
$frompage = ($startat / $caches_per_page) - 3;
if ($frompage < 1) $frompage = 1;
@ -222,41 +137,130 @@ function search_output()
if ($startat / $caches_per_page < ($maxpage - 1))
$pages .= ' <a href="search.php?queryid=' . $options['queryid'] . '&startat=' . ($startat + $caches_per_page) . '"><img src="resource2/ocstyle/images/navigation/16x16-browse-next.png" width="16" height="16"></a> <a href="search.php?queryid=' . $options['queryid'] . '&startat=' . (($maxpage - 1) * $caches_per_page) . '"><img src="resource2/ocstyle/images/navigation/16x16-browse-last.png" width="16" height="16"></a> ';
else
$pages .= ' <img src="resource2/ocstyle/images/navigation/16x16-browse-next-inactive.png" width="16" height="16"> <img src="resource2/ocstyle/images/navigation/16x16-browse-last-inactive.png" width="16" height="16"></a>';
$pages .= ' <img src="resource2/ocstyle/images/navigation/16x16-browse-next-inactive.png" width="16" height="16"> <img src="resource2/ocstyle/images/navigation/16x16-browse-last-inactive.png" width="16" height="16">';
}
//'<a href="search.php?queryid=' . $options['queryid'] . '&startat=20">20</a> 40 60 80 100';
//$caches_per_page
//count($caches) - 1
tpl_set_var('pages', $pages);
tpl_set_var('showonmap', $showonmap);
$tpl->assign('pages', $pages);
$tpl->assign('showonmap', $showonmap);
// downloads
tpl_set_var('queryid', $options['queryid']);
tpl_set_var('startat', $startat);
tpl_set_var('startatp1', min($resultcount,$startat + 1));
$tpl->assign('queryid', $options['queryid']);
$tpl->assign('startatp1', min($resultcount,$startat + 1));
if (($resultcount - $startat) < 500)
tpl_set_var('endat', $startat + $resultcount - $startat);
$tpl->assign('endat', $startat + $resultcount - $startat);
else
tpl_set_var('endat', $startat + 500);
$tpl->assign('endat', $startat + 500);
// kompatibilität!
if ($distance_unit == 'sm')
tpl_set_var('distanceunit', 'mi');
$tpl->assign('distanceunit', 'mi');
else if ($distance_unit == 'nm')
tpl_set_var('distanceunit', 'sm');
$tpl->assign('distanceunit', 'sm');
else
tpl_set_var('distanceunit', $distance_unit);
$tpl->assign('distanceunit', $distance_unit);
tpl_set_var('displaylastlogs', $options['sort'] == 'bymylastlog' ? 'none' : 'inline');
tpl_set_var('displayownlogs', $options['sort'] == 'bymylastlog' ? 'inline' : 'none');
$tpl->assign('displayownlogs', $options['sort'] == 'bymylastlog');
$tpl->assign('search_headline_caches', $calledbysearch);
if ($sqldebug == true)
sqldbg_end();
else
tpl_BuildTemplate();
$tpl->display();
}
function dateDiff($interval, $dateTimeBegin, $dateTimeEnd)
{
//Parse about any English textual datetime
//$dateTimeBegin, $dateTimeEnd
$dateTimeBegin = strtotime($dateTimeBegin);
if ($dateTimeBegin === -1)
return("..begin date Invalid");
$dateTimeEnd = strtotime($dateTimeEnd);
if ($dateTimeEnd === -1)
return("..end date Invalid");
$dif = $dateTimeEnd - $dateTimeBegin;
switch($interval)
{
case "s"://seconds
return($dif);
case "n"://minutes
return(floor($dif/60)); //60s=1m
case "h"://hours
return(floor($dif/3600)); //3600s=1h
case "d"://days
return(floor($dif/86400)); //86400s=1d
case "ww"://Week
return(floor($dif/604800)); //604800s=1week=1semana
case "m": //similar result "m" dateDiff Microsoft
$monthBegin = (date("Y",$dateTimeBegin)*12) + date("n",$dateTimeBegin);
$monthEnd = (date("Y",$dateTimeEnd)*12) + date("n",$dateTimeEnd);
$monthDiff = $monthEnd - $monthBegin;
return($monthDiff);
case "yyyy": //similar result "yyyy" dateDiff Microsoft
return(date("Y",$dateTimeEnd) - date("Y",$dateTimeBegin));
default:
return(floor($dif/86400)); //86400s=1d
}
}
function getCacheIcon($user_id, $cache_id, $cache_status, $cache_userid, $iconname)
{
$iconname = mb_eregi_replace("cache/", "", $iconname);
$iconext = "." . mb_eregi_replace("^.*\.", "", $iconname);
$iconname = mb_eregi_replace("\..*", "", $iconname);
// add status
switch ($cache_status)
{
case 1: $iconname .= "-s"; break;
case 2: $iconname .= "-n"; break;
case 3: $iconname .= "-a"; break;
case 4: $iconname .= "-a"; break;
case 5: $iconname .= "-s"; break; // fix for RT ticket #3403
case 6: $iconname .= "-a"; break;
case 7: $iconname .= "-a"; break;
}
// mark if (not) found
if ($user_id)
{
if ($cache_userid == $user_id)
{
$iconname .= "-owner";
}
else
{
$logtype = sql_value_slave("
SELECT `type`
FROM `cache_logs`
WHERE `cache_id`='&1' AND `user_id`='&2' AND `type` IN (1,2,7)
ORDER BY `type`
LIMIT 1",
0, $cache_id, $user_id);
if ($logtype == 1 || $logtype == 7)
$iconname .= '-found';
elseif ($logtype == 2)
$iconname .= '-dnf';
}
}
return $iconname . $iconext;
}
?>

View File

@ -1,22 +1,13 @@
<?php
/****************************************************************************
./lib/search.inc.php
--------------------
begin : Sun September 25 2005
For license information see doc/license.txt
****************************************************************************/
/****************************************************************************
Unicode Reminder メモ
functions for the search-engine
functions for the search-engine
****************************************************************************/
require_once($opt['rootpath'] . 'lib/data-license.inc.php');
/* begin conversion rules */
$search_simplerules[] = array('qu', 'k');

View File

@ -1,9 +1,9 @@
<?php
/***************************************************************************
For license information see doc/license.txt
Unicode Reminder メモ
kml search output
****************************************************************************/
@ -14,13 +14,13 @@
function search_output()
{
global $sqldebug, $stylepath;
global $opt;
global $state_temporarily_na, $state_archived, $state_locked;
$kmlLine =
$kmlLine =
'
<Placemark>
<description><![CDATA[<a href="http://www.opencaching.de/viewcache.php?cacheid={cacheid}">Beschreibung ansehen</a><br>Von {username}<br>&nbsp;<br><table cellspacing="0" cellpadding="0" border="0"><tr><td>{typeimgurl} </td><td>Art: {type}<br>Größe: {size}</td></tr><tr><td colspan="2">Schwierigkeit: {difficulty} von 5.0<br>Gelände: {terrain} von 5.0</td></tr></table>]]></description>
<description><![CDATA[<a href="'.$opt['page']['absolute_url'].'viewcache.php?cacheid={cacheid}">Beschreibung ansehen</a><br>Von {username}<br>&nbsp;<br><table cellspacing="0" cellpadding="0" border="0"><tr><td>{typeimgurl} </td><td>Art: {type}<br>Größe: {size}</td></tr><tr><td colspan="2">Schwierigkeit: {difficulty} von 5.0<br>Gelände: {terrain} von 5.0</td></tr></table>]]></description>
<name>{name}{archivedflag}</name>
<LookAt>
<longitude>{lon}</longitude>
@ -40,8 +40,9 @@ function search_output()
$kmlFoot = '</Folder></Document></kml>';
$kmlTimeFormat = 'Y-m-d\TH:i:s\Z';
$kmlDetailHead = read_file($stylepath . '/search.result.caches.kml.head.tpl.php');
$style = $opt['template']['style'];
$kmlDetailHead = file_get_contents("templates2/$style/search.result.caches.kml.head.tpl");
$rsMinMax = sql_slave('
SELECT
MIN(`longitude`) `minlon`,
@ -49,16 +50,16 @@ function search_output()
MIN(`latitude`) `minlat`,
MAX(`latitude`) `maxlat`
FROM
`searchtmp`', $sqldebug);
`searchtmp`');
$rMinMax = sql_fetch_array($rsMinMax);
mysql_free_result($rsMinMax);
$kmlDetailHead = mb_ereg_replace('{minlat}', $rMinMax['minlat'], $kmlDetailHead);
$kmlDetailHead = mb_ereg_replace('{minlon}', $rMinMax['minlon'], $kmlDetailHead);
$kmlDetailHead = mb_ereg_replace('{maxlat}', $rMinMax['maxlat'], $kmlDetailHead);
$kmlDetailHead = mb_ereg_replace('{maxlon}', $rMinMax['maxlon'], $kmlDetailHead);
$kmlDetailHead = mb_ereg_replace('{time}', date($kmlTimeFormat), $kmlDetailHead);
append_output($kmlDetailHead);
/*
@ -96,63 +97,62 @@ function search_output()
`searchtmp`.`cache_id`=`caches`.`cache_id` AND
`searchtmp`.`type`=`cache_type`.`id` AND
`searchtmp`.`size`=`cache_size`.`id` AND
`searchtmp`.`user_id`=`user`.`user_id`',
$sqldebug);
`searchtmp`.`user_id`=`user`.`user_id`');
while ($r = sql_fetch_array($rs))
{
$thisline = $kmlLine;
// icon suchen
switch ($r['type'])
{
case 2:
$icon = 'tradi';
$typeimgurl = '<img src="http://www.opencaching.de/resource2/ocstyle/images/cacheicon/traditional.gif" alt="Normaler Cache" title="Normaler Cache" />';
$typeimgurl = '<img src="http://www.opencaching.de/resource2/'.$style.'ocstyle/images/cacheicon/traditional.gif" alt="Normaler Cache" title="Normaler Cache" />';
break;
case 3:
$icon = 'multi';
$typeimgurl = '<img src="http://www.opencaching.de/resource2/ocstyle/images/cacheicon/multi.gif" alt="Multicache" title="Multicache" />';
$typeimgurl = '<img src="http://www.opencaching.de/resource2/'.$style.'/images/cacheicon/multi.gif" alt="Multicache" title="Multicache" />';
break;
case 4:
$icon = 'virtual';
$typeimgurl = '<img src="http://www.opencaching.de/resource2/ocstyle/images/cacheicon/virtual.gif" alt="virtueller Cache" title="virtueller Cache" />';
$typeimgurl = '<img src="http://www.opencaching.de/resource2/'.$style.'/images/cacheicon/virtual.gif" alt="virtueller Cache" title="virtueller Cache" />';
break;
case 5:
$icon = 'webcam';
$typeimgurl = '<img src="http://www.opencaching.de/resource2/ocstyle/images/cacheicon/webcam.gif" alt="Webcam Cache" title="Webcam Cache" />';
$typeimgurl = '<img src="http://www.opencaching.de/resource2/'.$style.'/images/cacheicon/webcam.gif" alt="Webcam Cache" title="Webcam Cache" />';
break;
case 6:
$icon = 'event';
$typeimgurl = '<img src="http://www.opencaching.de/resource2/ocstyle/images/cacheicon/event.gif" alt="Event Cache" title="Event Cache" />';
$typeimgurl = '<img src="http://www.opencaching.de/resource2/'.$style.'/images/cacheicon/event.gif" alt="Event Cache" title="Event Cache" />';
break;
case 7:
$icon = 'mystery';
$typeimgurl = '<img src="http://www.opencaching.de/resource2/ocstyle/images/cacheicon/mystery.gif" alt="Rätselcache" title="Event Cache" />';
$typeimgurl = '<img src="http://www.opencaching.de/resource2/'.$style.'/images/cacheicon/mystery.gif" alt="Rätselcache" title="Event Cache" />';
break;
case 8:
$icon = 'mathe';
$typeimgurl = '<img src="http://www.opencaching.de/resource2/ocstyle/images/cacheicon/mathe.gif" alt="Mathe-/Physik-Cache" title="Event Cache" />';
$typeimgurl = '<img src="http://www.opencaching.de/resource2/'.$style.'/images/cacheicon/mathe.gif" alt="Mathe-/Physik-Cache" title="Event Cache" />';
break;
case 9:
$icon = 'moving';
$typeimgurl = '<img src="http://www.opencaching.de/resource2/ocstyle/images/cacheicon/moving.gif" alt="Moving Cache" title="Event Cache" />';
$typeimgurl = '<img src="http://www.opencaching.de/resource2/'.$style.'/images/cacheicon/moving.gif" alt="Moving Cache" title="Event Cache" />';
break;
case 10:
$icon = 'drivein';
$typeimgurl = '<img src="http://www.opencaching.de/resource2/ocstyle/images/cacheicon/drivein.gif" alt="Drive-In Cache" title="Event Cache" />';
$typeimgurl = '<img src="http://www.opencaching.de/resource2/'.$style.'/images/cacheicon/drivein.gif" alt="Drive-In Cache" title="Event Cache" />';
break;
default:
$icon = 'other';
$typeimgurl = '<img src="http://www.opencaching.de/resource2/ocstyle/images/cacheicon/unknown.gif" alt="unbekannter Cachetyp" title="unbekannter Cachetyp" />';
$typeimgurl = '<img src="http://www.opencaching.de/resource2/'.$style.'/images/cacheicon/unknown.gif" alt="unbekannter Cachetyp" title="unbekannter Cachetyp" />';
break;
}
$thisline = mb_ereg_replace('{icon}', $icon, $thisline);
$thisline = mb_ereg_replace('{typeimgurl}', $typeimgurl, $thisline);
$lat = sprintf('%01.5f', $r['latitude']);
$thisline = mb_ereg_replace('{lat}', $lat, $thisline);
$lon = sprintf('%01.5f', $r['longitude']);
$thisline = mb_ereg_replace('{lon}', $lon, $thisline);
@ -160,7 +160,7 @@ function search_output()
$thisline = mb_ereg_replace('{time}', $time, $thisline);
$thisline = mb_ereg_replace('{name}', xmlentities($r['name']), $thisline);
if (($r['status'] == 2) || ($r['status'] == 3) || ($r['status'] == 6))
{
if ($r['status'] == 2)
@ -172,10 +172,10 @@ function search_output()
}
else
$thisline = mb_ereg_replace('{archivedflag}', '', $thisline);
$thisline = mb_ereg_replace('{type}', xmlentities($r['typedesc']), $thisline);
$thisline = mb_ereg_replace('{size}', xmlentities($r['sizedesc']), $thisline);
$difficulty = sprintf('%01.1f', $r['difficulty'] / 2);
$thisline = mb_ereg_replace('{difficulty}', $difficulty, $thisline);
@ -196,18 +196,4 @@ function search_output()
}
function xmlentities($str)
{
$from[0] = '&'; $to[0] = '&amp;';
$from[1] = '<'; $to[1] = '&lt;';
$from[2] = '>'; $to[2] = '&gt;';
$from[3] = '"'; $to[3] = '&quot;';
$from[4] = '\''; $to[4] = '&apos;';
for ($i = 0; $i <= 4; $i++)
$str = mb_ereg_replace($from[$i], $to[$i], $str);
return $str;
}
?>

View File

@ -1,9 +1,9 @@
<?php
/***************************************************************************
For license information see doc/license.txt
Unicode Reminder メモ
loc search output
****************************************************************************/
@ -13,24 +13,28 @@
function search_output()
{
global $opt;
global $state_temporarily_na, $state_archived, $state_locked;
$locHead = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><loc version="1.0" src="opencaching.de">' . "\n";
$locLine =
$server_address = $opt['page']['absolute_url'];
$server_domain = parse_url($server_address, PHP_URL_HOST);
$locHead = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><loc version="1.0" src="'.$server_domain.'">' . "\n";
$locLine =
'
<waypoint>
<name id="{waypoint}"><![CDATA[{archivedflag}{name} by {username}]]></name>
<coord lat="{lat}" lon="{lon}"/>
<type>Geocache</type>
<link text="Beschreibung">http://www.opencaching.de/viewcache.php?cacheid={cacheid}</link>
<link text="Beschreibung">'.$server_address.'viewcache.php?cacheid={cacheid}</link>
</waypoint>
';
$locFoot = '</loc>';
append_output($locHead);
/*
{waypoint}
status -> {archivedflag}
@ -61,16 +65,16 @@ function search_output()
while ($r = sql_fetch_array($rs))
{
$thisline = $locLine;
$lat = sprintf('%01.5f', $r['latitude']);
$thisline = mb_ereg_replace('{lat}', $lat, $thisline);
$lon = sprintf('%01.5f', $r['longitude']);
$thisline = mb_ereg_replace('{lon}', $lon, $thisline);
$thisline = mb_ereg_replace('{waypoint}', $r['waypoint'], $thisline);
$thisline = mb_ereg_replace('{name}', xmlentities($r['name']), $thisline);
$thisline = mb_ereg_replace('{name}', $r['name'], $thisline);
if (($r['status'] == 2) || ($r['status'] == 3) || ($r['status'] == 6))
{
if ($r['status'] == 2)
@ -82,30 +86,15 @@ function search_output()
}
else
$thisline = mb_ereg_replace('{archivedflag}', '', $thisline);
$thisline = mb_ereg_replace('{username}', xmlentities($r['username']), $thisline);
$thisline = mb_ereg_replace('{username}', $r['username'], $thisline);
$thisline = mb_ereg_replace('{cacheid}', $r['cacheid'], $thisline);
append_output($thisline);
}
mysql_free_result($rs);
append_output($locFoot);
}
function xmlentities($str)
{
$from[0] = '&'; $to[0] = '&amp;';
$from[1] = '<'; $to[1] = '&lt;';
$from[2] = '>'; $to[2] = '&gt;';
$from[3] = '"'; $to[3] = '&quot;';
$from[4] = '\''; $to[4] = '&apos;';
for ($i = 0; $i <= 4; $i++)
$str = mb_ereg_replace($from[$i], $to[$i], $str);
return $str;
}
?>

View File

@ -6,16 +6,10 @@
*
* Execute search request for map.php
* (use caching of the same quries)
* TODO:cleanup
***************************************************************************/
global $dblink, $dbslaveid;
$sqlchecksum = sprintf('%u', crc32($cachesFilter."\n".$sqlFilter));
/* config */
$opt['map']['maxcacheage'] = 3600;
// check if query was already executed within the cache period
$rsMapCache = sql("SELECT `result_id` FROM `map2_result` WHERE `sqlchecksum`='&1' AND DATE_ADD(`date_created`, INTERVAL '&2' SECOND)>NOW() AND `sqlquery`='&3'", $sqlchecksum, $opt['map']['maxcacheage'], $sqlFilter);
if ($rMapCache = sql_fetch_assoc($rsMapCache))
@ -25,14 +19,12 @@
}
else
{
db_connect_anyslave();
// ensure that query is performed without errors before reserving the result_id
sql_slave("CREATE TEMPORARY TABLE `tmpmapresult` (`cache_id` INT UNSIGNED NOT NULL, PRIMARY KEY (`cache_id`)) ENGINE=MEMORY");
sql_slave("INSERT INTO `tmpmapresult` (`cache_id`) " . $sqlFilter);
sql("INSERT INTO `map2_result` (`slave_id`, `sqlchecksum`, `sqlquery`, `date_created`, `date_lastqueried`) VALUES ('&1', '&2', '&3', NOW(), NOW())", $dbslaveid, $sqlchecksum, $cachesFilter."\n".$sqlFilter);
$resultId = mysql_insert_id($dblink);
sql("INSERT INTO `map2_result` (`slave_id`, `sqlchecksum`, `sqlquery`, `date_created`, `date_lastqueried`) VALUES ('&1', '&2', '&3', NOW(), NOW())", $db['slave_id'], $sqlchecksum, $cachesFilter."\n".$sqlFilter);
$resultId = sql_insert_id();
sql_slave("INSERT IGNORE INTO `map2_data` (`result_id`, `cache_id`) SELECT '&1', `cache_id` FROM `tmpmapresult`", $resultId);
sql_slave("DROP TEMPORARY TABLE `tmpmapresult`");
@ -63,7 +55,7 @@
}
sql_free_result($rs);
tpl_redirect('map2.php?queryid=' . $options['queryid'] . '&resultid=' . $resultId . $bounds_param);
$tpl->redirect('map2.php?queryid=' . $options['queryid'] . '&resultid=' . $resultId . $bounds_param);
}
else
echo $resultId;

View File

@ -1,12 +1,14 @@
<?php
/***************************************************************************
For license information see doc/license.txt
Unicode Reminder メモ
ov2 search output
****************************************************************************/
require_once($opt['rootpath'] . 'lib2/charset.inc.php');
$search_output_file_download = true;
$content_type_plain = 'application/ov2';
@ -68,7 +70,7 @@ function search_output()
$line = "$name by $username, $type, $size, $cacheid";
$record = pack("CLllA*x", 2, 1 + 4 + 4 + 4 + strlen($line) + 1, (int)$lon, (int)$lat, $line);
append_output($record);
}
mysql_free_result($rs);
@ -77,11 +79,7 @@ function search_output()
function convert_string($str)
{
$newstr = iconv("UTF-8", "ISO-8859-1", $str);
if ($newstr == false)
return "--- charset error ---";
else
return $newstr;
return utf8ToIso88591($str);
}
?>

View File

@ -1,12 +1,14 @@
<?php
/***************************************************************************
For license information see doc/license.txt
Unicode Reminder メモ
ovl search output for TOP25, TOP50 etc.
****************************************************************************/
require_once($opt['rootpath'] . 'lib2/charset.inc.php');
$search_output_file_download = true;
$content_type_plain = 'application/ovl';
@ -43,16 +45,16 @@ function search_output()
while ($r = sql_fetch_array($rs))
{
$thisline = $ovlLine;
$lat = sprintf('%01.5f', $r['latitude']);
$thisline = mb_ereg_replace('{lat}', $lat, $thisline);
$thisline = mb_ereg_replace('{latname}', $lat, $thisline);
$lon = sprintf('%01.5f', $r['longitude']);
$thisline = mb_ereg_replace('{lon}', $lon, $thisline);
$thisline = mb_ereg_replace('{lonname}', $lon, $thisline);
$thisline = mb_ereg_replace('{cachename}', convert_string($r['name']), $thisline);
$thisline = mb_ereg_replace('{cachename}', utf8ToIso88591($r['name']), $thisline);
$thisline = mb_ereg_replace('{symbolnr1}', $nr, $thisline);
$thisline = mb_ereg_replace('{symbolnr2}', $nr + 1, $thisline);
@ -60,19 +62,10 @@ function search_output()
$nr += 2;
}
mysql_free_result($rs);
$ovlFoot = mb_ereg_replace('{symbolscount}', $nr - 1, $ovlFoot);
append_output($ovlFoot);
}
function convert_string($str)
{
$newstr = iconv("UTF-8", "ISO-8859-1", $str);
if ($newstr == false)
return $str;
else
return $newstr;
}
?>

View File

@ -3,7 +3,7 @@
For license information see doc/license.txt
Unicode Reminder メモ
GPX search output
****************************************************************************/
@ -15,7 +15,7 @@
function search_output()
{
global $absolute_server_URI, $locale;
global $opt;
global $converted_from_html;
global $phpzip, $bUseZip;
@ -29,7 +29,7 @@ Land: {country}
Cacheart: {type}
Behälter: {container}
D/T: {difficulty}/{terrain}
Online: " . $absolute_server_URI . "viewcache.php?wp={waypoint}
Online: " . $opt['page']['absolute_url'] . "viewcache.php?wp={waypoint}
Kurzbeschreibung: {shortdesc}
@ -63,10 +63,10 @@ Logeinträge:
`caches`.`wp_oc` `waypoint`,
`caches`.`date_hidden` `date_hidden`,
`caches`.`name` `name`,
`caches`.`country` `country`,
`caches`.`terrain` `terrain`,
`caches`.`difficulty` `difficulty`,
`caches`.`desc_languages` `desc_languages`,
`sys_trans_text`.`text` AS `country`,
`cache_size`.`de` `size`,
`cache_type`.`de` `type`,
`cache_status`.`de` `status`,
@ -79,29 +79,26 @@ Logeinträge:
`user`.`username`,
`user`.`data_license`
FROM
`searchtmp`,
`caches`,
`user`,
`cache_desc`,
`cache_type`,
`cache_status`,
`cache_size`
WHERE
`searchtmp`.`cache_id`=`caches`.`cache_id` AND
`caches`.`cache_id`=`cache_desc`.`cache_id` AND
`caches`.`default_desclang`=`cache_desc`.`language` AND
`searchtmp`.`user_id`=`user`.`user_id` AND
`caches`.`type`=`cache_type`.`id` AND
`caches`.`status`=`cache_status`.`id` AND
`caches`.`size`=`cache_size`.`id`');
`searchtmp`
INNER JOIN `caches` ON `searchtmp`.`cache_id`=`caches`.`cache_id`
INNER JOIN `cache_desc` ON `cache_desc`.`cache_id`=`caches`.`cache_id`
AND `caches`.`default_desclang`=`cache_desc`.`language`
INNER JOIN `cache_type` ON `cache_type`.`id`=`caches`.`type`
INNER JOIN `cache_size` ON `cache_size`.`id`=`caches`.`size`
INNER JOIN `cache_status` ON `cache_status`.`id`=`caches`.`status`
INNER JOIN `user` ON `user`.`user_id`=`caches`.`user_id`
LEFT JOIN `countries` ON `countries`.`short`=`caches`.`country`
LEFT JOIN `sys_trans_text` ON `sys_trans_text`.`trans_id`=`countries`.`trans_id`
AND `sys_trans_text`.`lang`=\'&1\'',
$opt['template']['locale']);
while ($r = sql_fetch_array($rs))
{
$thisline = $txtLine;
$lat = sprintf('%01.5f', $r['latitude']);
$thisline = mb_ereg_replace('{lat}', help_latToDegreeStr($lat), $thisline);
$lon = sprintf('%01.5f', $r['longitude']);
$thisline = mb_ereg_replace('{lon}', help_lonToDegreeStr($lon), $thisline);
@ -110,17 +107,17 @@ Logeinträge:
$thisline = mb_ereg_replace('{waypoint}', $r['waypoint'], $thisline);
$thisline = mb_ereg_replace('{cacheid}', $r['cacheid'], $thisline);
$thisline = mb_ereg_replace('{cachename}', $r['name'], $thisline);
$thisline = mb_ereg_replace('{country}', db_CountryFromShort($r['country']), $thisline);
$thisline = mb_ereg_replace('{country}', $r['country'], $thisline);
if ($r['hint'] == '')
$thisline = mb_ereg_replace('{hints}', '', $thisline);
else
$thisline = mb_ereg_replace('{hints}', str_rot13_html(decodeEntities(strip_tags($r['hint']))), $thisline);
$thisline = mb_ereg_replace('{hints}', str_rot13_gc(decodeEntities(strip_tags($r['hint']))), $thisline);
$thisline = mb_ereg_replace('{shortdesc}', $r['short_desc'], $thisline);
$license = getLicenseDisclaimer(
$r['user_id'], $r['username'], $r['data_license'], $r['cacheid'], $locale, true, false, true);
$r['user_id'], $r['username'], $r['data_license'], $r['cacheid'], $opt['template']['locale'], true, false, true);
if ($license != "")
$license = "\r\n\r\n$license";
@ -134,11 +131,11 @@ Logeinträge:
$thisline = mb_ereg_replace('{htmlwarn}', " ($converted_from_html)", $thisline);
$thisline = mb_ereg_replace('{desc}', html2txt($r['desc']) . $license, $thisline);
}
$thisline = mb_ereg_replace('{type}', $r['type'], $thisline);
$thisline = mb_ereg_replace('{container}', $r['size'], $thisline);
$thisline = mb_ereg_replace('{status}', $r['status'], $thisline);
$difficulty = sprintf('%01.1f', $r['difficulty'] / 2);
$thisline = mb_ereg_replace('{difficulty}', $difficulty, $thisline);
@ -153,7 +150,7 @@ Logeinträge:
while ($rLog = sql_fetch_array($rsLogs))
{
$thislog = $txtLogs;
$thislog = mb_ereg_replace('{id}', $rLog['id'], $thislog);
if (substr($rLog['date'],11) == "00:00:00")
$dateformat = "d.m.Y";
@ -161,9 +158,9 @@ Logeinträge:
$dateformat = "d.m.Y H:i";
$thislog = mb_ereg_replace('{date}', date($dateformat, strtotime($rLog['date'])), $thislog);
$thislog = mb_ereg_replace('{username}', $rLog['username'], $thislog);
$logtype = $rLog['type'];
$thislog = mb_ereg_replace('{type}', $logtype, $thislog);
if ($rLog['text_html'] == 0)
$thislog = mb_ereg_replace('{text}', decodeEntities(strip_tags($rLog['text'])), $thislog);
@ -184,12 +181,11 @@ Logeinträge:
}
mysql_free_result($rs);
}
function decodeEntities($str)
{
$str = html_entity_decode($str, ENT_COMPAT, "UTF-8");
return $str;
return html_entity_decode($str, ENT_COMPAT, "UTF-8");
}
function html2txt($html)
@ -201,7 +197,7 @@ Logeinträge:
$str = decodeEntities($str);
return $str;
}
function lf2crlf($str)
{
return mb_ereg_replace("\r\r\n" ,"\r\n" , mb_ereg_replace("\n" ,"\r\n" , $str));

View File

@ -2,7 +2,7 @@
/***************************************************************************
For license information see doc/license.txt
XML search output
****************************************************************************/
@ -11,9 +11,9 @@ $search_output_file_download = false;
function search_output()
{
global $sqldebug;
global $opt;
global $distance_unit, $startat, $count, $sql, $sqlLimit;
$encoding = 'UTF-8';
$xmlLine = " <cache>
@ -48,15 +48,12 @@ function search_output()
mysql_free_result($rsCount);
// start output
if ($sqldebug == false)
{
header("Content-type: application/xml; charset=".$encoding);
//header("Content-Disposition: attachment; filename=" . $sFilebasename . ".txt");
}
header("Content-type: application/xml; charset=".$encoding);
//header("Content-Disposition: attachment; filename=" . $sFilebasename . ".txt");
echo "<?xml version=\"1.0\" encoding=\"".$encoding."\"?>\n";
echo "<result>\n";
echo " <docinfo>\n";
echo " <results>" . $rCount['count'] . "</results>\n";
echo " <startat>" . $startat . "</startat>\n";
@ -64,44 +61,50 @@ function search_output()
echo " <total>" . $resultcount . "</total>\n";
echo " </docinfo>\n";
$rs = sql_slave('SELECT `searchtmp`.`cache_id` `cacheid`,
`searchtmp`.`longitude` `longitude`,
`searchtmp`.`latitude` `latitude`,
`caches`.`wp_oc` `waypoint`,
`caches`.`date_hidden` `date_hidden`,
`caches`.`name` `name`,
`caches`.`country` `country`,
`caches`.`terrain` `terrain`,
`caches`.`difficulty` `difficulty`,
`caches`.`desc_languages` `desc_languages`,
`cache_size`.`name` `size`,
`cache_size`.`id` `size_id`,
`cache_type`.`name` `type`,
`cache_type`.`id` `type_id`,
`cache_status`.`name` `status`,
`cache_status`.`id` `status_id`,
`user`.`username` `username`,
`user`.`user_id` `user_id`,
`cache_desc`.`desc` `desc`,
`cache_desc`.`short_desc` `short_desc`,
`cache_desc`.`hint` `hint`,
`cache_desc`.`desc_html` `html`,
`searchtmp`.`distance` `distance`
FROM `searchtmp`
$rs = sql_slave("SELECT `searchtmp`.`cache_id` `cacheid`,
`searchtmp`.`longitude` `longitude`,
`searchtmp`.`latitude` `latitude`,
`caches`.`wp_oc` `waypoint`,
`caches`.`date_hidden` `date_hidden`,
`caches`.`name` `name`,
`caches`.`country` `countrycode`,
`caches`.`terrain` `terrain`,
`caches`.`difficulty` `difficulty`,
`caches`.`desc_languages` `desc_languages`,
`cache_size`.`name` `size`,
`cache_size`.`id` `size_id`,
`cache_type`.`name` `type`,
`cache_type`.`id` `type_id`,
`cache_status`.`name` `status`,
`cache_status`.`id` `status_id`,
`user`.`username` `username`,
`user`.`user_id` `user_id`,
`cache_desc`.`desc` `desc`,
`cache_desc`.`short_desc` `short_desc`,
`cache_desc`.`hint` `hint`,
`cache_desc`.`desc_html` `html`,
`searchtmp`.`distance` `distance`,
`sys_trans_text`.`text` `country`
FROM `searchtmp`
INNER JOIN `caches` ON `searchtmp`.`cache_id`=`caches`.`cache_id`
INNER JOIN `user` ON `searchtmp`.`user_id`=`user`.`user_id`
INNER JOIN `cache_desc` ON `caches`.`cache_id`=`cache_desc`.`cache_id` AND `caches`.`default_desclang`=`cache_desc`.`language`
INNER JOIN `cache_type` ON `caches`.`type`=`cache_type`.`id`
INNER JOIN `cache_status` ON `caches`.`status`=`cache_status`.`id`
INNER JOIN `cache_size` ON `caches`.`size`=`cache_size`.`id`');
INNER JOIN `cache_size` ON `caches`.`size`=`cache_size`.`id`
LEFT JOIN `countries` ON `countries`.`short`=`caches`.`country`
LEFT JOIN `sys_trans_text` ON `sys_trans_text`.`trans_id`=`countries`.`trans_id`
AND `sys_trans_text`.`lang`='&1'",
$opt['template']['locale']);
while ($r = sql_fetch_array($rs))
{
$thisline = $xmlLine;
$lat = sprintf('%01.5f', $r['latitude']);
$thisline = str_replace('{lat}', help_latToDegreeStr($lat), $thisline);
$thisline = str_replace('{latvalue}', $lat, $thisline);
$lon = sprintf('%01.5f', $r['longitude']);
$thisline = str_replace('{lon}', help_lonToDegreeStr($lon), $thisline);
$thisline = str_replace('{lonvalue}', $lon, $thisline);
@ -111,16 +114,16 @@ function search_output()
$thisline = str_replace('{waypoint}', $r['waypoint'], $thisline);
$thisline = str_replace('{cacheid}', $r['cacheid'], $thisline);
$thisline = str_replace('{cachename}', filterevilchars($r['name']), $thisline);
$thisline = str_replace('{country}', db_CountryFromShort($r['country']), $thisline);
$thisline = str_replace('{country}', text_xmlentities($r['country']), $thisline);
$thisline = str_replace('{countryid}', $r['country'], $thisline);
if ($r['hint'] == '')
$thisline = str_replace('{hints}', '', $thisline);
else
$thisline = str_replace('{hints}', str_rot13_html(filterevilchars(strip_tags($r['hint']))), $thisline);
$thisline = str_replace('{hints}', str_rot13_gc(decodeEntities(filterevilchars(strip_tags($r['hint'])))), $thisline);
$thisline = str_replace('{shortdesc}', filterevilchars($r['short_desc']), $thisline);
if ($r['html'] == 0)
{
$thisline = str_replace('{htmlwarn}', '', $thisline);
@ -131,14 +134,14 @@ function search_output()
$thisline = str_replace('{htmlwarn}', ' (Text converted from HTML)', $thisline);
$thisline = str_replace('{desc}', html2txt(filterevilchars($r['desc'])), $thisline);
}
$thisline = str_replace('{type}', $r['type'], $thisline);
$thisline = str_replace('{typeid}', $r['type_id'], $thisline);
$thisline = str_replace('{container}', $r['size'], $thisline);
$thisline = str_replace('{sizeid}', $r['size_id'], $thisline);
$thisline = str_replace('{status}', $r['status'], $thisline);
$thisline = str_replace('{statusid}', $r['status_id'], $thisline);
$difficulty = sprintf('%01.1f', $r['difficulty'] / 2);
$thisline = str_replace('{difficulty}', $difficulty, $thisline);
@ -147,7 +150,7 @@ function search_output()
$thisline = str_replace('{owner}', filterevilchars($r['username']), $thisline);
$thisline = str_replace('{ownerid}', filterevilchars($r['user_id']), $thisline);
$thisline = str_replace('{distance}', htmlspecialchars(sprintf("%01.1f", $r['distance'])), $thisline);
$thisline = str_replace('{distance}', text_xmlentities(sprintf("%01.1f", $r['distance'])), $thisline);
$thisline = lf2crlf($thisline);
@ -155,11 +158,16 @@ function search_output()
}
mysql_free_result($rs);
sql_slave('DROP TABLE `searchtmp`');
if ($sqldebug == true) sqldbg_end();
echo "</result>\n";
}
function decodeEntities($str)
{
return html_entity_decode($str, ENT_COMPAT, "UTF-8");
}
function html2txt($html)
{
$str = str_replace("\r\n", '', $html);
@ -168,24 +176,24 @@ function search_output()
$str = strip_tags($str);
return $str;
}
function lf2crlf($str)
{
return str_replace("\r\r\n" ,"\r\n" , str_replace("\n" ,"\r\n" , $str));
}
function filterevilchars($str)
{
$evilchars = array(31 => 31, 30 => 30,
29 => 29, 28 => 28, 27 => 27, 26 => 26, 25 => 25, 24 => 24,
23 => 23, 22 => 22, 21 => 21, 20 => 20, 19 => 19, 18 => 18,
17 => 17, 16 => 16, 15 => 15, 14 => 14, 12 => 12, 11 => 11,
9 => 9, 8 => 8, 7 => 7, 6 => 6, 5 => 5, 4 => 4, 3 => 3,
2 => 2, 1 => 1, 0 => 0);
$evilchars = array(31 => 31, 30 => 30,
29 => 29, 28 => 28, 27 => 27, 26 => 26, 25 => 25, 24 => 24,
23 => 23, 22 => 22, 21 => 21, 20 => 20, 19 => 19, 18 => 18,
17 => 17, 16 => 16, 15 => 15, 14 => 14, 12 => 12, 11 => 11,
9 => 9, 8 => 8, 7 => 7, 6 => 6, 5 => 5, 4 => 4, 3 => 3,
2 => 2, 1 => 1, 0 => 0);
foreach ($evilchars AS $ascii)
$str = str_replace(chr($ascii), '', $str);
$str = preg_replace('/&([a-zA-Z]{1})caron;/', '\\1', $str);
$str = preg_replace('/&([a-zA-Z]{1})acute;/', '\\1', $str);

View File

@ -1410,7 +1410,6 @@ class Smarty
*/
function _compile_resource($resource_name, $compile_path)
{
$_params = array('resource_name' => $resource_name);
if (!$this->_fetch_resource_info($_params)) {
return false;

View File

@ -273,27 +273,117 @@ function read_file($filename, $maxlength)
return $content;
}
// encodes &<>"'
function xmlentities($str)
{
$from[0] = '&'; $to[0] = '&amp;';
$from[1] = '<'; $to[1] = '&lt;';
$from[2] = '>'; $to[2] = '&gt;';
$from[3] = '"'; $to[3] = '&quot;';
$from[4] = '\''; $to[4] = '&apos;';
return htmlspecialchars(xmlfilterevilchars($str), ENT_QUOTES, 'UTF-8');
}
for ($i = 0; $i <= 4; $i++)
$str = mb_ereg_replace($from[$i], $to[$i], $str);
return xmlfilterevilchars($str);
// encodes &<>
// This is ok for XML content text between tags, but not for XML attribute contents.
function text_xmlentities($str)
{
return htmlspecialchars(xmlfilterevilchars($str), ENT_NOQUOTES, 'UTF-8');
}
function xmlfilterevilchars($str)
{
global $sCharset;
// the same for for ISO-8859-1 and UTF-8
$str = mb_ereg_replace('[\x{00}-\x{09}\x{0B}\x{0C}\x{0E}-\x{1F}]*', '', $str);
return $str;
return mb_ereg_replace('[\x{00}-\x{09}\x{0B}\x{0C}\x{0E}-\x{1F}]*', '', $str);
}
// decimal longitude to string E/W hhh°mm.mmm
function help_lonToDegreeStr($lon)
{
if ($lon < 0)
{
$retval = 'W ';
$lon = -$lon;
}
else
{
$retval = 'E ';
}
$retval = $retval . sprintf("%03d", floor($lon)) . '° ';
$lon = $lon - floor($lon);
$retval = $retval . sprintf("%06.3f", round($lon * 60, 3)) . '\'';
return $retval;
}
// decimal latitude to string N/S hh°mm.mmm
function help_latToDegreeStr($lat)
{
if ($lat < 0)
{
$retval = 'S ';
$lat = -$lat;
}
else
{
$retval = 'N ';
}
$retval = $retval . sprintf("%02d", floor($lat)) . '° ';
$lat = $lat - floor($lat);
$retval = $retval . sprintf("%06.3f", round($lat * 60, 3)) . '\'';
return $retval;
}
function escape_javascript($text)
{
return str_replace('\'', '\\\'', str_replace('"', '&quot;', $text));
}
// perform str_rot13 without renaming parts in []
function str_rot13_gc($str)
{
$delimiter[0][0] = '[';
$delimiter[0][1] = ']';
$retval = '';
while (mb_strlen($retval) < mb_strlen($str))
{
$nNextStart = false;
$sNextEndChar = '';
foreach ($delimiter AS $del)
{
$nThisStart = mb_strpos($str, $del[0], mb_strlen($retval));
if ($nThisStart !== false)
if (($nNextStart > $nThisStart) || ($nNextStart === false))
{
$nNextStart = $nThisStart;
$sNextEndChar = $del[1];
}
}
if ($nNextStart === false)
{
$retval .= str_rot13(mb_substr($str, mb_strlen($retval), mb_strlen($str) - mb_strlen($retval)));
}
else
{
// crypted part
$retval .= str_rot13(mb_substr($str, mb_strlen($retval), $nNextStart - mb_strlen($retval)));
// uncrypted part
$nNextEnd = mb_strpos($str, $sNextEndChar, $nNextStart);
if ($nNextEnd === false)
$retval .= mb_substr($str, $nNextStart, mb_strlen($str) - mb_strlen($retval));
else
$retval .= mb_substr($str, $nNextStart, $nNextEnd - $nNextStart + 1);
}
}
return $retval;
}
?>

View File

@ -352,6 +352,8 @@ td.listicon {
td.listcolor1 { background:#fff; line-height:1.7em; }
td.listcolor2 { background:#f0f0f0; line-height:1.7em; }
td.search_listcolor1 { background:#fff; }
td.search_listcolor2 { background:#f0f0f0; }
/* Images */
.img-left-noborder-notopmargin {float: left; margin: 0px 10px 0px 0px;}
@ -1469,4 +1471,6 @@ div#havefound {
#forum div.rsstext img {max-width:200px; max-height:120px;}
p.editlog { font-weight: 400; display:inline; }
.newsymbol { background:#ff9d11; color:#fff; }
.newsymbol { background:#ff9d11; color:#fff; }
label.disabled { color:grey; }

Binary file not shown.

After

Width:  |  Height:  |  Size: 526 B

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,8 @@
{***************************************************************************
* You can find the license in the docs directory
*
* Unicode Reminder メモ
***************************************************************************}
{strip} {* OCSTYLE *}
<img src='resource2/{$opt.template.style}/images/difficulty/diff-{$difficulty*5}.gif' border='0' width='19' height='16' hspace='2' onmouseover='Tip("{t 1=$difficulty*0.5}Difficulty:&nbsp;%1&nbsp;of&nbsp;5{/t}", DELAY, 0, FADEIN, false, FADEOUT, false, BGCOLOR, "#fffedf", BORDERCOLOR, "grey")' onmouseout='UnTip()' />
{/strip}

View File

@ -3,7 +3,8 @@
*
* Unicode Reminder メモ
***************************************************************************}
{* OCSTYLE *}
{* OCSTYLE *}{strip}
{* strip is needed by search.result.caches.row.tpl *}
{if $type==1}
<img src="resource2/{$opt.template.style}/images/log/16x16-found.png" alt="{t}Found{/t}" title="{t}Found{/t}" />
{elseif $type==2}
@ -27,3 +28,4 @@
{else}
&nbsp;
{/if}
{/strip}

View File

@ -0,0 +1,8 @@
{***************************************************************************
* You can find the license in the docs directory
*
* Unicode Reminder メモ
***************************************************************************}
{strip} {* OCSTYLE *}
<img src='resource2/{$opt.template.style}/images/difficulty/terr-{$terrain*5}.gif' border='0' width='19' height='16' hspace='2' onmouseover='Tip("{t 1=$terrain*0.5}Terrain:&nbsp;%1&nbsp;of&nbsp;5{/t}", DELAY, 0, FADEIN, false, FADEOUT, false, BGCOLOR, "#fffedf", BORDERCOLOR, "grey")' onmouseout='UnTip()'/>
{/strip}

View File

@ -1,17 +1,32 @@
<!--m-->
<tr>
<td width="18" class="{bgcolor}" style="{line_style}">&nbsp;{position}&nbsp;</td>
<td width="45" class="{bgcolor}" style="{line_style}">{distance}&nbsp;</td>
<td width="32" class="{bgcolor}" rowspan="2"><img src='lang/de/ocstyle/images/{icon_large}' alt='{cachetype}' title='{cachetype}'></td>
<td width="46" class="{bgcolor}" rowspan="2" nowrap="nowarp">{diffpic}{terrpic}</td>
<td width="448" class="{bgcolor}">{new} <span style="{status_style}"><a href="viewcache.php?cacheid={urlencode_cacheid}"><span style="{name_style}">{cachename}</span></a></span> &nbsp;<span style="{line_style}">{string_by}</span> <a href="viewprofile.php?userid={urlencode_userid}" style="{line_style}">{username}</a><!-- Ocprop: <a href="viewcache.php?cacheid={urlencode_cacheid}">{cachename}</a> {string_by} <a href="viewprofile.php?userid={urlencode_userid}">{username}</a> --></td>
<td width="74" class="{bgcolor}" rowspan="2" style="padding: 0px">{oconly}</td>
<td width="110" valign="top" class="{bgcolor}">{logimage1} {logdate1}&nbsp;</td>
<td width="18" class="{$listcolor}">&nbsp;{$position}&nbsp;</td>
<td width="45" class="{$listcolor}">{$cache.distance|sprintf:"%1.1f"|escape}&nbsp;</td>
<td width="32" class="{$listcolor}" rowspan="2"><img src="resource2/{$opt.template.style}/images/cacheicon/{$cache.icon}" title="{$cache.cacheTypeName}"></td>
<td width="46" class="{$listcolor}" rowspan="2"><nobr>{include file="res_difficon.tpl" difficulty=$cache.difficulty}{include file="res_terricon.tpl" terrain=$cache.terrain}</nobr></td>
<td width="448" class="{$listcolor}">{if $cache.isnew}<b class="newsymbol">&nbsp;{t}NEW{/t}&nbsp;</b>&nbsp; {/if}<span style="{include file="res_cachestatus_span.tpl" status=$cache.status}"><a href="viewcache.php?cacheid={$cache.cache_id|escape}"><span style="{if $cache.redname}color: #e00000{/if}">{$cache.name|escape}</span></a></span> &nbsp;{t}by{/t} <a href="viewprofile.php?userid={$cache.user_id|escape}">{$cache.username|escape}</a><!-- Ocprop: <a href="viewcache.php?cacheid={$cache.cache_id|escape}">{$cache.name|escape}</a> {t}by{/t} <a href="viewprofile.php?userid={$cache.user_id|escape}">{$cache.username|escape}</a> --></td>
<td width="74" class="{$listcolor}" rowspan="2" style="padding: 0px">{if $cache.oconly}<img src="resource2/ocstyle/images/misc/is_oconly.png" alt="OConly" title="OConly" style="margin:0px; padding:0px" width="64" height="35" />{/if}</td>
<td width="110" valign="top" class="{$listcolor}">
{if $cache.firstlog}
<a href="viewcache.php?cacheid={$cache.cache_id}#logentries">{include file="res_logtype.tpl" type=$cache.firstlog.type}</a><a href="viewcache.php?cacheid={$cache.cache_id}#logentries">{$cache.firstlog.date|date_format:$opt.format.date}</a>&nbsp;
{else}
<img src="resource2/{$opt.template.style}/images/log/16x16-none.png" width="16" height="16"> --.--.----&nbsp;
{/if}
</td>
</tr>
<!--n-->
<tr>
<td width="25" class="{bgcolor}">&nbsp;</td>
<td width="32" class="{bgcolor}" valign="top" style="{line_style}">{direction}&nbsp;</td>
<td width="448" class="{bgcolor}" valign="top"><p style="{line_style}">{ratpic}{desclangs} {short_desc} &nbsp;</p></td>
<td width="110" class="{bgcolor}" valign="top">{lastlogs}&nbsp;</td>
<td width="25" class="{$listcolor}">&nbsp;</td>
<td width="32" class="{$listcolor}" valign="top">{$cache.direction}&nbsp;</td>
<td width="448" class="{$listcolor}" valign="top">
<p>{strip}
{if $cache.topratings>0}<img src="images/rating-star.gif" title="{t}Recommendations{/t}" width="17" height="16" />{/if}
{if $cache.topratings>1}<img src="images/rating-star.gif" title="{t}Recommendations{/t}" width="17" height="16" />{/if}
{if $cache.topratings>2}<img src="images/rating-plus.gif" title="{t}Recommendations{/t}" width="17" height="16" />{/if}
{/strip}
{foreach from=$cache.desclangs item=desclang}
<a href="viewcache.php?cacheid={$cache.cache_id}&desclang={$desclang|escape}" style="text-decoration:none"><b><span style="color:blue">{$desclang|escape}</span></b></a>
{/foreach}
{$cache.short_desc} &nbsp;</p></td>
<td width="110" class="{$listcolor}" valign="top">{foreach from=$cache.logs item=log}<a href="viewlogs.php?cacheid={$cache.cache_id}#log{$log.id}">{include file="res_logtype.tpl" type=$log.type}</a>&nbsp;{/foreach}</td>
</tr>

View File

@ -1,127 +1,124 @@
<?php
/***************************************************************************
./lang/de/ocstyle/search.result.tpl.php
-------------------
begin : July 25 2004
copyright : (C) 2004 The OpenCaching Group
forum contact at : http://www.opencaching.com/phpBB2
{***************************************************************************
* You can find the license in the docs directory
*
* Unicode Reminder メモ
***************************************************************************}
***************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
/****************************************************************************
Unicode Reminder メモ
(X)HTML search output template
****************************************************************************/
?>
<script type="text/javascript" src="resource2/{$opt.template.style}/js/wz_tooltip.js"></script>
<div class="content2-container bg-blue02" style="margin-top:20px;">
<table cellspacing="0" cellpadding="0" width="100%" border="0"><tr>
<td style="white-space:nowrap">
<p class="content-title-noshade-size15" style="padding:0; margin:4px;">&nbsp;{t}{results_count} caches<span style="{search_headline_caches}"> matched</span>{/t}&nbsp;</p>
<p class="content-title-noshade-size15" style="padding:0; margin:4px;">&nbsp;{t 1=$results_count 2=($search_headline_caches?'':'display:none')}%1 caches<span style="%2"> matched</span>{/t}&nbsp;</p>
</td>
{if $caches|@count}
<td style="text-align:right; width:1px">
<a href="search.php?queryid={queryid}&output=map2bounds&showresult=1&skipqueryid=1&expert=0&utf8=1" class="nooutline"><img src="resource2/ocstyle/images/misc/32x32-world.png"/></a>
<a href="search.php?queryid={$queryid}&output=map2bounds&showresult=1&skipqueryid=1&expert=0&utf8=1" class="nooutline"><img src="resource2/ocstyle/images/misc/32x32-world.png"/></a>
</td>
<td style="white-space:nowrap; text-align:left; padding-bottom:2px">
<p class="inheader"><a href="search.php?queryid={queryid}&output=map2bounds&showresult=1&skipqueryid=1&expert=0&utf8=1">{showonmap}</a></p>
<p class="inheader"><a href="search.php?queryid={$queryid}&output=map2bounds&showresult=1&skipqueryid=1&expert=0&utf8=1">{t}Show on map{/t}</a></p>
</td>
{/if}
<td style="text-align:right; padding-bottom:2px"><p class="inheader">
<span style="white-space:nowrap">[<a href="query.php?action=save&queryid={queryid}">{t}Save options{/t}</a>]</span>
&nbsp;<span style="white-space:nowrap">[<a href="search.php?queryid={queryid}&showresult=0">{t}Edit options{/t}</a>]</span></p>
<span style="white-space:nowrap">[<a href="query.php?action=save&queryid={$queryid}">{t}Save options{/t}</a>]</span>
&nbsp;<span style="white-space:nowrap">[<a href="search.php?queryid={$queryid}&showresult=0">{t}Edit options{/t}</a>]</span></p>
</td>
</tr></table>
</div>
<div class="buffer" style="height:5px;"></div>
<font size="2">
<table class="content" border="0" cellspacing="0px" cellpadding="0px">
<table cellspacing="0" cellpadding="0">
{if $caches|@count}
<tr>
<td class="header-small" colspan="2">
<table width="98.5%">
<tr>
<td rowspan="1" style="vertical-align:top; width:300px">{pages}</td>
<td rowspan="1" style="vertical-align:top; width:300px">{$pages}</td>
<td style="text-align:right;">{t}Download{/t}:&nbsp;</td>
<td><nobr>
<select name="wpdownload-page" class="wpdownload" onChange="location.href=this.options[this.selectedIndex].value">
<select name="wpdownload-page" class="wpdownload" onChange="location.href=this.options[this.selectedIndex].value">
<option value="#">{t}Results on this page{/t}</option>
<option value="search.php?queryid={queryid}&output=gpx&startat={startat}">GPX</option>
<option value="search.php?queryid={queryid}&output=loc&startat={startat}">LOC</option>
<option value="search.php?queryid={queryid}&output=kml&startat={startat}">KML</option>
<option value="search.php?queryid={queryid}&output=ov2&startat={startat}">OV2</option>
<option value="search.php?queryid={queryid}&output=ovl&startat={startat}">OVL</option>
<option value="search.php?queryid={queryid}&output=txt&startat={startat}">TXT</option>
<option value="search.php?queryid={$queryid}&output=gpx&startat={$startat}">GPX</option>
<option value="search.php?queryid={$queryid}&output=loc&startat={$startat}">LOC</option>
<option value="search.php?queryid={$queryid}&output=kml&startat={$startat}">KML</option>
<option value="search.php?queryid={$queryid}&output=ov2&startat={$startat}">OV2</option>
<option value="search.php?queryid={$queryid}&output=ovl&startat={$startat}">OVL</option>
<option value="search.php?queryid={$queryid}&output=txt&startat={$startat}">TXT</option>
</select>
<select name="wpdownload-all" class="wpdownload" onChange="location.href=this.options[this.selectedIndex].value">
<option value="#">{t}Result {startatp1} to {endat} (as zip){/t}</option>
<option value="search.php?queryid={queryid}&output=gpx&startat={startat}&count=max&zip=1">GPX</option>
<option value="search.php?queryid={queryid}&output=loc&startat={startat}&count=max&zip=1">LOC</option>
<option value="search.php?queryid={queryid}&output=kml&startat={startat}&count=max&zip=1">KML</option>
<option value="search.php?queryid={queryid}&output=ov2&startat={startat}&count=max&zip=1">OV2</option>
<option value="search.php?queryid={queryid}&output=ovl&startat={startat}&count=max&zip=1">OVL</option>
<option value="search.php?queryid={queryid}&output=txt&startat={startat}&count=max&zip=1">TXT</option>
<select name="wpdownload-all" class="wpdownload" onChange="location.href=this.options[this.selectedIndex].value">
<option value="#">{t 1=$startatp1 2=$endat}Result %1 to %2 (as zip){/t}</option>
<option value="search.php?queryid={$queryid}&output=gpx&startat={$startat}&count=max&zip=1">GPX</option>
<option value="search.php?queryid={$queryid}&output=loc&startat={$startat}&count=max&zip=1">LOC</option>
<option value="search.php?queryid={$queryid}&output=kml&startat={$startat}&count=max&zip=1">KML</option>
<option value="search.php?queryid={$queryid}&output=ov2&startat={$startat}&count=max&zip=1">OV2</option>
<option value="search.php?queryid={$queryid}&output=ovl&startat={$startat}&count=max&zip=1">OVL</option>
<option value="search.php?queryid={$queryid}&output=txt&startat={$startat}&count=max&zip=1">TXT</option>
</select></nobr>
</td>
</tr>
</table>
</table>
</td>
</tr>
{/if}
<tr><td class="spacer" colspan="2">&nbsp;</td></tr>
<tr>
<td colspan="2" style="padding-left: 0px; padding-right: 0px;">
<table border="0" cellspacing="0px" cellpadding="0px" class="searchtable">
<table class="searchtable" border="0" cellspacing="0" cellpadding="0">
<tr>
<th width="18" height="13" >&nbsp;#&nbsp;</th>
<th width="45" height="13">{distanceunit}</th>
<th width="45" height="13">{$distanceunit|escape}</th>
<th width="32" height="13">{t}Type{/t}</th>
<th width="46" height="13">{t}D/T{/t}</th>
<th width="448" height="13">{t}Name{/t}</th>
<th width="48" height="13">&nbsp;</th>
<th width="126" height="13"><span style="display:{displaylastlogs}">{t}Last logs{/t}<span style="display:{displayownlogs}">{t}Own logs{/t}</th>
<th width="126" height="13">{if $displayownlogs}{t}Own logs{/t}{else}{t}Last logs{/t}{/if}</th>
</tr>
<tr><td></td></tr>
<!--a-->{results}<!--z-->
<!--a-->
{assign var=position value=$startat+1}
{foreach from=$caches item=cache}
{cycle assign=listcolor values="search_listcolor1,search_listcolor2"}
{include file="search.result.caches.row.tpl"}
{assign var=position value=$position+1}
{/foreach}
<!--z-->
</table>
</td>
<tr><td class="spacer" colspan="2">&nbsp;</td></tr>
</tr>
<tr>
<td colspan="2" class="header-small">{pages}</td>
</tr>
<tr><td style="height:0.6em"></td></tr>
{if $pages != ''}
<tr><td class="spacer" colspan="2">&nbsp;</td></tr>
<tr>
<td colspan="2" class="header-small">{$pages}</td>
</tr>
<tr><td style="height:0.6em"></td></tr>
{/if}
</table>
{if $caches|@count}
<table width="100%">
<tr>
<td style="text-align:right; width:50%">{t}Download{/t}:&nbsp;&nbsp;</td>
<td align="right" style="padding-right:20px; white-space:nowrap">
<b>{t}Results on this page:{/t}</b>
<a href="search.php?queryid={queryid}&output=gpx&startat={startat}" title="{t}GPS Exchange Format .gpx{/t}">GPX</a>
<a href="search.php?queryid={queryid}&output=loc&startat={startat}" title="{t}Waypointfile .loc{/t}">LOC</a>
<a href="search.php?queryid={queryid}&output=kml&startat={startat}" title="{t}Google Earth .kml{/t}">KML</a>
{search_in_gm}
<a href="search.php?queryid={queryid}&output=ov2&startat={startat}" title="{t}TomTom POI .ov2{/t}">OV2</a>
<a href="search.php?queryid={queryid}&output=ovl&startat={startat}" title="{t}TOP50-Overlay .ovl{/t}">OVL</a>
<a href="search.php?queryid={queryid}&output=txt&startat={startat}" title="{t}Textfile .txt{/t}">TXT</a>
<a href="search.php?queryid={$queryid}&output=gpx&startat={$startat}" title="{t}GPS Exchange Format .gpx{/t}">GPX</a>
<a href="search.php?queryid={$queryid}&output=loc&startat={$startat}" title="{t}Waypointfile .loc{/t}">LOC</a>
<a href="search.php?queryid={$queryid}&output=kml&startat={$startat}" title="{t}Google Earth .kml{/t}">KML</a>
{$search_in_gm}
<a href="search.php?queryid={$queryid}&output=ov2&startat={$startat}" title="{t}TomTom POI .ov2{/t}">OV2</a>
<a href="search.php?queryid={$queryid}&output=ovl&startat={$startat}" title="{t}TOP50-Overlay .ovl{/t}">OVL</a>
<a href="search.php?queryid={$queryid}&output=txt&startat={$startat}" title="{t}Textfile .txt{/t}">TXT</a>
<br />
<b>{t}Result {startatp1} to {endat} (as zip):{/t}</b>
<a href="search.php?queryid={queryid}&output=gpx&startat={startat}&count=max&zip=1" title="{t}GPS Exchange Format .gpx{/t}">GPX</a>
<a href="search.php?queryid={queryid}&output=loc&startat={startat}&count=max&zip=1" title="{t}Waypointfile .loc{/t}">LOC</a>
<a href="search.php?queryid={queryid}&output=kml&startat={startat}&count=max&zip=1" title="{t}Google Earth .kml{/t}">KML</a>
{search_in_gm_zip}
<a href="search.php?queryid={queryid}&output=ov2&startat={startat}&count=max&zip=1" title="{t}TomTom POI .ov2{/t}">OV2</a>
<a href="search.php?queryid={queryid}&output=ovl&startat={startat}&count=max&zip=1" title="{t}TOP50-Overlay .ovl{/t}">OVL</a>
<a href="search.php?queryid={queryid}&output=txt&startat={startat}&count=max&zip=1" title="{t}Textfile .txt{/t}">TXT</a>
<b>{t 1=$startatp1 2=$endat}Result %1 to %2 (as zip){/t}:</b>
<a href="search.php?queryid={$queryid}&output=gpx&startat={$startat}&count=max&zip=1" title="{t}GPS Exchange Format .gpx{/t}">GPX</a>
<a href="search.php?queryid={$queryid}&output=loc&startat={$startat}&count=max&zip=1" title="{t}Waypointfile .loc{/t}">LOC</a>
<a href="search.php?queryid={$queryid}&output=kml&startat={$startat}&count=max&zip=1" title="{t}Google Earth .kml{/t}">KML</a>
{$search_in_gm_zip}
<a href="search.php?queryid={$queryid}&output=ov2&startat={$startat}&count=max&zip=1" title="{t}TomTom POI .ov2{/t}">OV2</a>
<a href="search.php?queryid={$queryid}&output=ovl&startat={$startat}&count=max&zip=1" title="{t}TOP50-Overlay .ovl{/t}">OVL</a>
<a href="search.php?queryid={$queryid}&output=txt&startat={$startat}&count=max&zip=1" title="{t}Textfile .txt{/t}">TXT</a>
</td>
</tr>
<tr>
@ -130,4 +127,5 @@
</td>
</tr>
</table>
{/if}
</font>

View File

@ -1,32 +1,23 @@
<?php
/***************************************************************************
./lang/de/ocstyle/search.simple.tpl.php
-------------------
begin : July 25 2004
{***************************************************************************
* You can find the license in the docs directory
*
* Unicode Reminder メモ
***************************************************************************}
For license information see doc/license.txt
****************************************************************************/
/****************************************************************************
Unicode Reminder メモ
simple filter template for XHTML search form
****************************************************************************/
?>
<script type="text/javascript" src="resource2/ocstyle/js/wz_tooltip.js"></script>
<script type="text/javascript">
<!--
var mnAttributesShowCat2 = 1;
var maAttributes = new Array({attributes_jsarray});
var cachesizes = {cachesizes};
var maAttributes = new Array({$attributes_jsarray});
var cachesizes = {$cachesizes};
{literal}
function _sbn_click()
{
if (document.searchbyname.cachename.value == "")
{
alert("{t}Enter a name, please!{/t}");
alert("{/literal}{t}Enter a name, please!{/t}{literal}");
resetbutton('submit_cachename');
return false;
}
@ -37,7 +28,7 @@ function _sbft_click()
{
if (document.searchbyfulltext.fulltext.value == "")
{
alert("{t}Fill out the text field, please!{/t}");
alert("{/literal}{t}Fill out the text field, please!{/t}{literal}");
resetbutton('submit_ft');
return false;
}
@ -47,7 +38,7 @@ function _sbft_click()
(document.searchbyfulltext.ft_logs.checked == false) &&
(document.searchbyfulltext.ft_pictures.checked == false))
{
alert("{t}You have to check at least one field!{/t}");
alert("{/literal}{t}You have to check at least one field!{/t}{literal}");
resetbutton('submit_ft');
return false;
}
@ -59,25 +50,25 @@ function _sbd_click()
{
if (isNaN(document.searchbydistance.lon_h.value) || isNaN(document.searchbydistance.lon_min.value))
{
alert("{t}Longitude has to be a number!\nFormat: hh° mm.mmm{/t}");
alert("{/literal}{t}Longitude has to be a number!\nFormat: hh° mm.mmm{/t}{literal}");
resetbutton('submit_dist');
return false;
}
else if (isNaN(document.searchbydistance.lat_h.value) || isNaN(document.searchbydistance.lat_min.value))
{
alert("{t}Latitude has to be a number!\nFormat: hh° mm.mmm{/t}");
alert("{/literal}{t}Latitude has to be a number!\nFormat: hh° mm.mmm{/t}{literal}");
resetbutton('submit_dist');
return false;
}
else if (isNaN(document.searchbydistance.distance.value))
{
alert("{t}The maximum distance has to be a number!{/t}");
alert("{/literal}{t}The maximum distance has to be a number!{/t}{literal}");
resetbutton('submit_dist');
return false;
}
else if (document.searchbydistance.distance.value <= 0 || document.searchbydistance.distance.value > 9999)
{
alert("{t}The distance has to be between 0 and 9999{/t}");
alert("{/literal}{t}The distance has to be between 0 and 9999{/t}{literal}");
resetbutton('submit_dist');
return false;
}
@ -88,7 +79,7 @@ function _sbplz_click()
{
if (document.searchbyplz.plz.value == "")
{
alert("{t}Enter the postal code, please!{/t}");
alert("{/literal}{t}Enter the postal code, please!{/t}{literal}");
resetbutton('submit_plz');
return false;
}
@ -99,7 +90,7 @@ function _sbort_click()
{
if (document.searchbyort.ort.value == "")
{
alert("{t}Enter the city, please!{/t}");
alert("{/literal}{t}Enter the city, please!{/t}{literal}");
resetbutton('submit_city');
return false;
}
@ -110,7 +101,7 @@ function _sbo_click()
{
if (document.searchbyowner.owner.value == "")
{
alert("{t}Enter the owner, please!{/t}");
alert("{/literal}{t}Enter the owner, please!{/t}{literal}");
resetbutton('submit_owner');
return false;
}
@ -121,7 +112,7 @@ function _sbf_click()
{
if (document.searchbyfinder.finder.value == "")
{
alert("{t}Enter the username, please!{/t}");
alert("{/literal}{t}Enter the username, please!{/t}{literal}");
resetbutton('submit_finder');
return false;
}
@ -248,7 +239,7 @@ function hideAttributesCat2()
mnAttributesShowCat2 = 0;
document.getElementById('attributesCat1').style.display = "block";
document.getElementById('attributesCat2').style.display = "none";
document.getElementById('toggleAttributesCaption').firstChild.nodeValue = "{t}Show all{/t}";
document.getElementById('toggleAttributesCaption').firstChild.nodeValue = "{/literal}{t}Show all{/t}{literal}";
}
function showAttributesCat2()
@ -256,7 +247,7 @@ function showAttributesCat2()
mnAttributesShowCat2 = 1;
document.getElementById('attributesCat1').style.display = "none";
document.getElementById('attributesCat2').style.display = "block";
document.getElementById('toggleAttributesCaption').firstChild.nodeValue = "{t}Less{/t}";
document.getElementById('toggleAttributesCaption').firstChild.nodeValue = "{/literal}{t}Less{/t}{literal}";
}
function switchAttributeCat2()
@ -268,6 +259,7 @@ function switchAttributeCat2()
}
//-->
</script>
{/literal}
<div class="content2-pagetitle"><img src="resource2/ocstyle/images/misc/32x32-search.png" style="align: left; margin-right: 10px;" width="32" height="32" alt="{t}Search for caches{/t}" />{t}Search for caches{/t}</div>
@ -275,22 +267,22 @@ function switchAttributeCat2()
<div class="searchdiv">
<table class="table">
<tr>
<td style="vertical-align:top">{t}Sorting of result:{/t}</td>
<td colspan="2">
<div style="padding:0 0 5px 0">
<input type="radio" name="sort" value="byname" index="0" id="l_sortbyname" class="radio" onclick="sync_options(this)" {byname_checked} > <label for="l_sortbyname">{t}Cachename{/t}</label>&nbsp;
<input type="radio" name="sort" value="bydistance" index="1" id="l_sortbydistance" class="radio" onclick="sync_options(this)" {bydistance_checked} {bydistance_enabled} {disable_nologin}> <label for="l_sortbydistance" {grey_nologin}>{t}Distance from <a href="myprofile.php">user-profile home coordinates</a>{/t}</label></div>
<input type="radio" name="sort" value="bycreated" index="2" id="l_sortbycreated" class="radio" onclick="sync_options(this)" {bycreated_checked}> <label for="l_sortbycreated">{t}Listed since{/t}</label>&nbsp;
<input type="radio" name="sort" value="bylastlog" index="3" id="l_sortbylastlog" class="radio" onclick="sync_options(this)" {bylastlog_checked}> <label for="l_sortbylastlog" >{t}Last log{/t}</label>&nbsp;
<input type="radio" name="sort" value="bymylastlog" index="4" id="l_sortbymylastlog" class="radio" onclick="sync_options(this)" {bymylastlog_checked} {disable_nologin}> <label for="l_sortbymylastlog" {grey_nologin}>{t}My last log{/t}</label>
<input type="radio" name="sort" value="byname" index="0" id="l_sortbyname" class="radio" onclick="sync_options(this)" {if $byname_checked}checked="checked"{/if} > <label for="l_sortbyname">{t}Cachename{/t}</label>&nbsp;
<input type="radio" name="sort" value="bydistance" index="1" id="l_sortbydistance" class="radio" onclick="sync_options(this)" {if $bydistance_checked}checked="checked"{/if} {if !$bydistance_enabled}disabled="disabled"{/if} {if $disable_nologin}disabled="disabled"{/if}> <label for="l_sortbydistance" {if $disable_nologin}class="disabled">{/if}{t}Distance from <a href="myprofile.php">user-profile home coordinates</a>{/t}</label></div>
<input type="radio" name="sort" value="bycreated" index="2" id="l_sortbycreated" class="radio" onclick="sync_options(this)" {if $bycreated_checked}checked="checked"{/if}> <label for="l_sortbycreated">{t}Listed since{/t}</label>&nbsp;
<input type="radio" name="sort" value="bylastlog" index="3" id="l_sortbylastlog" class="radio" onclick="sync_options(this)" {if $bylastlog_checked}checked="checked"{/if}> <label for="l_sortbylastlog" >{t}Last log{/t}</label>&nbsp;
<input type="radio" name="sort" value="bymylastlog" index="4" id="l_sortbymylastlog" class="radio" onclick="sync_options(this)" {if $bymylastlog_checked}checked="checked"{/if} {if $disable_nologin}disabled="disabled"{/if}> <label for="l_sortbymylastlog" {if $disable_nologin}class="disabled"{/if}>{t}My last log{/t}</label>
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>
<input id="orderRatingFirst" type="checkbox" name="orderRatingFirst" class="checkbox" value="1" onclick="sync_options(this)" {orderRatingFirst_checked} />
<input id="orderRatingFirst" type="checkbox" name="orderRatingFirst" class="checkbox" value="1" onclick="sync_options(this)" {if $orderRatingFirst_checked}checked="checked"{/if} />
<label for="orderRatingFirst">{t}Show recommendation from other users first{/t}</label>
</td>
</tr>
@ -301,18 +293,18 @@ function switchAttributeCat2()
<tr>
<td>{t}Hide following caches:{/t}</td>
<td colspan="2">
<input type="checkbox" name="f_userowner" value="1" id="l_userowner" class="checkbox" onclick="sync_options(this)" {f_userowner_disabled} /> <label for="l_userowner" {grey_nologin}>{t}My owned{/t}</label>&nbsp;&nbsp;
<input type="checkbox" name="f_userfound" value="1" id="l_userfound" class="checkbox" onclick="sync_options(this)" {f_userfound_disabled} /> <label for="l_userfound" {grey_nologin}>{t}My finds{/t}</label>&nbsp;&nbsp;
<input type="checkbox" name="f_ignored" value="1" id="l_ignored" class="checkbox" onclick="sync_options(this)" {f_ignored_disabled} > <label for="l_ignored" {grey_nologin}>{t}My ignored{/t}</label>&nbsp;&nbsp;
<input type="checkbox" name="f_userowner" value="1" id="l_userowner" class="checkbox" onclick="sync_options(this)" {if $f_userowner_disabled}disabled="disabled"{/if} /> <label for="l_userowner" {if $disable_nologin}class="disabled"{/if}>{t}My owned{/t}</label>&nbsp;&nbsp;
<input type="checkbox" name="f_userfound" value="1" id="l_userfound" class="checkbox" onclick="sync_options(this)" {if $f_userfound_disabled}disabled="disabled"{/if} /> <label for="l_userfound" {if $disable_nologin}class="disabled"{/if}>{t}My finds{/t}</label>&nbsp;&nbsp;
<input type="checkbox" name="f_ignored" value="1" id="l_ignored" class="checkbox" onclick="sync_options(this)" {if $f_ignored_disabled}disabled="disabled"{/if} > <label for="l_ignored" {if $disable_nologin}class="disabled"{/if}>{t}My ignored{/t}</label>&nbsp;&nbsp;
<img src="lang/de/ocstyle/images/misc/hint.gif" border="0" width="15" height="11" alt="{t}Notice{/t}" title="{t}Notice{/t}" align="middle">{t}Only usable if signed in.{/t}
</td>
</tr>
<tr>
<td>&nbsp;</td>
<td colspan="2">
<input type="checkbox" name="f_disabled" value="1" id="l_disabled" class="checkbox" onclick="sync_options(this)" {f_disabled_checked} > <label for="l_disabled">{t}disabled[pl]{/t}</label>&nbsp;
<input type="checkbox" name="f_inactive" value="1" id="l_inactive" class="checkbox" onclick="sync_options(this)" {f_inactive_checked} > <label for="l_inactive">{t}archived[pl]{/t}</label>&nbsp;
<input type="checkbox" name="f_otherPlatforms" value="1" id="l_otherPlatforms" class="checkbox" onclick="sync_options(this)" {f_otherPlatforms_checked} > <label for="l_otherPlatforms">{t}GC listings (also listed at gc.com){/t}</label>
<input type="checkbox" name="f_disabled" value="1" id="l_disabled" class="checkbox" onclick="sync_options(this)" {if $f_disabled_checked}checked="checked"{/if} > <label for="l_disabled">{t}disabled[pl]{/t}</label>&nbsp;
<input type="checkbox" name="f_inactive" value="1" id="l_inactive" class="checkbox" onclick="sync_options(this)" {if $f_inactive_checked}checked="checked"{/if} > <label for="l_inactive">{t}archived[pl]{/t}</label>&nbsp;
<input type="checkbox" name="f_otherPlatforms" value="1" id="l_otherPlatforms" class="checkbox" onclick="sync_options(this)" {if $f_otherPlatforms_checked}checked="checked"{/if} > <label for="l_otherPlatforms">{t}GC listings (also listed at gc.com){/t}</label>
</td>
</tr>
</table>
@ -321,22 +313,22 @@ function switchAttributeCat2()
<table class="table">
<tr>
<td>{t}Cachetype:{/t}</td>
<td><input type="checkbox" id="cachetype2" name="cachetype2" value="2" onclick="sync_options(this)" class="checkbox" {cachetype2checked} /> <label for="cachetype2">{t}Traditional Cache{/t}</label></td>
<td><input type="checkbox" id="cachetype3" name="cachetype3" value="3" onclick="sync_options(this)" class="checkbox" {cachetype3checked} /> <label for="cachetype3">{t}Multicache{/t}</label></td>
<td><input type="checkbox" id="cachetype5" name="cachetype5" value="5" onclick="sync_options(this)" class="checkbox" {cachetype5checked} /> <label for="cachetype5">{t}Webcam Cache{/t}</label></td>
<td><input type="checkbox" id="cachetype6" name="cachetype6" value="6" onclick="sync_options(this)" class="checkbox" {cachetype6checked} /> <label for="cachetype6">{t}Event Cache{/t}</label></td>
<td><input type="checkbox" id="cachetype2" name="cachetype2" value="2" onclick="sync_options(this)" class="checkbox" {if $cachetype2checked}checked="checked"{/if} /> <label for="cachetype2">{t}Traditional Cache{/t}</label></td>
<td><input type="checkbox" id="cachetype3" name="cachetype3" value="3" onclick="sync_options(this)" class="checkbox" {if $cachetype3checked}checked="checked"{/if} /> <label for="cachetype3">{t}Multicache{/t}</label></td>
<td><input type="checkbox" id="cachetype5" name="cachetype5" value="5" onclick="sync_options(this)" class="checkbox" {if $cachetype5checked}checked="checked"{/if} /> <label for="cachetype5">{t}Webcam Cache{/t}</label></td>
<td><input type="checkbox" id="cachetype6" name="cachetype6" value="6" onclick="sync_options(this)" class="checkbox" {if $cachetype6checked}checked="checked"{/if} /> <label for="cachetype6">{t}Event Cache{/t}</label></td>
</tr>
<tr>
<td></td>
<td><input type="checkbox" id="cachetype7" name="cachetype7" value="7" onclick="sync_options(this)" class="checkbox" {cachetype7checked} /> <label for="cachetype7">{t}Quizcache{/t}</label></td>
<td><input type="checkbox" id="cachetype8" name="cachetype8" value="8" onclick="sync_options(this)" class="checkbox" {cachetype8checked} /> <label for="cachetype8">{t}Math/Physics-Cache{/t}</label></td>
<td><input type="checkbox" id="cachetype9" name="cachetype9" value="9" onclick="sync_options(this)" class="checkbox" {cachetype9checked} /> <label for="cachetype9">{t}Moving Cache{/t}</label></td>
<td><input type="checkbox" id="cachetype10" name="cachetype10" value="10" onclick="sync_options(this)" class="checkbox" {cachetype10checked} /> <label for="cachetype10">{t}Drive-In{/t}</label></td>
<td><input type="checkbox" id="cachetype7" name="cachetype7" value="7" onclick="sync_options(this)" class="checkbox" {if $cachetype7checked}checked="checked"{/if} /> <label for="cachetype7">{t}Quizcache{/t}</label></td>
<td><input type="checkbox" id="cachetype8" name="cachetype8" value="8" onclick="sync_options(this)" class="checkbox" {if $cachetype8checked}checked="checked"{/if} /> <label for="cachetype8">{t}Math/Physics-Cache{/t}</label></td>
<td><input type="checkbox" id="cachetype9" name="cachetype9" value="9" onclick="sync_options(this)" class="checkbox" {if $cachetype9checked}checked="checked"{/if} /> <label for="cachetype9">{t}Moving Cache{/t}</label></td>
<td><input type="checkbox" id="cachetype10" name="cachetype10" value="10" onclick="sync_options(this)" class="checkbox" {if $cachetype10checked}checked="checked"{/if} /> <label for="cachetype10">{t}Drive-In{/t}</label></td>
</tr>
<tr>
<td></td>
<td><input type="checkbox" id="cachetype4" name="cachetype4" value="4" onclick="sync_options(this)" class="checkbox" {cachetype4checked} /> <label for="cachetype4">{t}virtual Cache{/t}</label></td>
<td><input type="checkbox" id="cachetype1" name="cachetype1" value="1" onclick="sync_options(this)" class="checkbox" {cachetype1checked} /> <label for="cachetype1">{t}unknown cachetyp{/t}</label></td>
<td><input type="checkbox" id="cachetype4" name="cachetype4" value="4" onclick="sync_options(this)" class="checkbox" {if $cachetype4checked}checked="checked"{/if} /> <label for="cachetype4">{t}virtual Cache{/t}</label></td>
<td><input type="checkbox" id="cachetype1" name="cachetype1" value="1" onclick="sync_options(this)" class="checkbox" {if $cachetype1checked}checked="checked"{/if} /> <label for="cachetype1">{t}unknown cachetyp{/t}</label></td>
</tr>
</table>
</div>
@ -344,17 +336,17 @@ function switchAttributeCat2()
<table class="table">
<tr>
<td>{t}Cachesize:{/t}</td>
<td><input type="checkbox" id="cachesize8" name="cachesize8" value="8" onclick="sync_options(this)" class="checkbox" {cachesize8checked} /> <label for="cachesize8">{t}nano{/t}</label>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td><input type="checkbox" id="cachesize2" name="cachesize2" value="2" onclick="sync_options(this)" class="checkbox" {cachesize2checked} /> <label for="cachesize2">{t}micro{/t}</label></td>
<td><input type="checkbox" id="cachesize3" name="cachesize3" value="3" onclick="sync_options(this)" class="checkbox" {cachesize3checked} /> <label for="cachesize3">{t}small{/t}</label></td>
<td><input type="checkbox" id="cachesize4" name="cachesize4" value="4" onclick="sync_options(this)" class="checkbox" {cachesize4checked} /> <label for="cachesize4">{t}normal{/t}</label></td>
<td><input type="checkbox" id="cachesize8" name="cachesize8" value="8" onclick="sync_options(this)" class="checkbox" {if $cachesize8checked}checked="checked"{/if} /> <label for="cachesize8">{t}nano{/t}</label>&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td><input type="checkbox" id="cachesize2" name="cachesize2" value="2" onclick="sync_options(this)" class="checkbox" {if $cachesize2checked}checked="checked"{/if} /> <label for="cachesize2">{t}micro{/t}</label></td>
<td><input type="checkbox" id="cachesize3" name="cachesize3" value="3" onclick="sync_options(this)" class="checkbox" {if $cachesize3checked}checked="checked"{/if} /> <label for="cachesize3">{t}small{/t}</label></td>
<td><input type="checkbox" id="cachesize4" name="cachesize4" value="4" onclick="sync_options(this)" class="checkbox" {if $cachesize4checked}checked="checked"{/if} /> <label for="cachesize4">{t}normal{/t}</label></td>
</tr>
<tr>
<td></td>
<td><input type="checkbox" id="cachesize5" name="cachesize5" value="5" onclick="sync_options(this)" class="checkbox" {cachesize5checked} /> <label for="cachesize5">{t}large{/t}</label></td>
<td><input type="checkbox" id="cachesize6" name="cachesize6" value="6" onclick="sync_options(this)" class="checkbox" {cachesize6checked} /> <label for="cachesize6">{t}very large{/t}</label></td>
<td><input type="checkbox" id="cachesize7" name="cachesize7" value="7" onclick="sync_options(this)" class="checkbox" {cachesize7checked} /> <label for="cachesize7">{t}no container{/t}</label></td>
<td><input type="checkbox" id="cachesize1" name="cachesize1" value="1" onclick="sync_options(this)" class="checkbox" {cachesize1checked} /> <label for="cachesize1">{t}other size{/t}</label></td>
<td><input type="checkbox" id="cachesize5" name="cachesize5" value="5" onclick="sync_options(this)" class="checkbox" {if $cachesize5checked}checked="checked"{/if} /> <label for="cachesize5">{t}large{/t}</label></td>
<td><input type="checkbox" id="cachesize6" name="cachesize6" value="6" onclick="sync_options(this)" class="checkbox" {if $cachesize6checked}checked="checked"{/if} /> <label for="cachesize6">{t}very large{/t}</label></td>
<td><input type="checkbox" id="cachesize7" name="cachesize7" value="7" onclick="sync_options(this)" class="checkbox" {if $cachesize7checked}checked="checked"{/if} /> <label for="cachesize7">{t}no container{/t}</label></td>
<td><input type="checkbox" id="cachesize1" name="cachesize1" value="1" onclick="sync_options(this)" class="checkbox" {if $cachesize1checked}checked="checked"{/if} /> <label for="cachesize1">{t}other size{/t}</label></td>
</tr>
</table>
</div>
@ -364,11 +356,15 @@ function switchAttributeCat2()
<td>{t}Difficulty:{/t}</td>
<td>
<select name="difficultymin" class="input80" onchange="sync_options(this)">
{difficultymin_options}
{foreach from=$difficulty_options item=difficulty_option}
<option value="{$difficulty_option}" {if $difficultymin==$difficulty_option}selected="selected"{/if}>{if $difficulty_option==0}-{else}{$difficulty_option/2|sprintf:"%1.1f"}{/if}</option>
{/foreach}
</select>
&nbsp;&nbsp;&nbsp;{t}to{/t}&nbsp;&nbsp;&nbsp;
<select name="difficultymax" class="input80" onchange="sync_options(this)">
{difficultymax_options}
{foreach from=$difficulty_options item=difficulty_option}
<option value="{$difficulty_option}" {if $difficultymax==$difficulty_option}selected="selected"{/if}>{if $difficulty_option==0}-{else}{$difficulty_option/2|sprintf:"%1.1f"}{/if}</option>
{/foreach}
</select>
</td>
</tr>
@ -376,11 +372,15 @@ function switchAttributeCat2()
<td>{t}Terrain:{/t}</td>
<td>
<select name="terrainmin" class="input80" onchange="sync_options(this)">
{terrainmin_options}
{foreach from=$terrain_options item=terrain_option}
<option value="{$terrain_option}" {if $terrainmin==$terrain_option}selected="selected"{/if}>{if $terrain_option==0}-{else}{$terrain_option/2|sprintf:"%1.1f"}{/if}</option>
{/foreach}
</select>
&nbsp;&nbsp;&nbsp;{t}to{/t}&nbsp;&nbsp;&nbsp;
<select name="terrainmax" class="input80" onchange="sync_options(this)">
{terrainmax_options}
{foreach from=$terrain_options item=terrain_option}
<option value="{$terrain_option}" {if $terrainmax==$terrain_option}selected="selected"{/if}>{if $terrain_option==0}-{else}{$terrain_option/2|sprintf:"%1.1f"}{/if}</option>
{/foreach}
</select>
</td>
</tr>
@ -392,7 +392,10 @@ function switchAttributeCat2()
<td>{t}Country:{/t}&nbsp;&nbsp;</td>
<td>
<select name="country" class="input200" onchange="sync_options(this)">
{countryoptions}
<option value="" selected="selected">{t}All countries{/t}</option
{foreach from=$countryoptions item=countryoption}
<option value="{$countryoption.short|escape}" {if $countryoption.selected}selected="selected"{/if}>{$countryoption.name|escape}</option>
{/foreach}
</select>
</td>
</tr>
@ -406,8 +409,8 @@ function switchAttributeCat2()
(<a href="javascript:switchAttributeCat2()"><span id="toggleAttributesCaption">{t}Show all{/t}</span></a>)
</td>
<td>
<div id="attributesCat1" style="display:none;">{cache_attribCat1_list}</div>
<div id="attributesCat2" style="display:block;">{cache_attribCat2_list}</div>
<div id="attributesCat1" style="display:none;">{$cache_attribCat1_list}</div>
<div id="attributesCat2" style="display:block;">{$cache_attribCat2_list}</div>
</td>
</tr>
</table>
@ -418,6 +421,7 @@ function switchAttributeCat2()
<p><span class="errormsg">{t}JavaScript is not activated, you cannot use the above options (sorting to attributes) - basic search is supported nevertheless.{/t}</span></p>
</div>
{literal}
<script language="javascript">
<!--
document.getElementById("scriptwarning").style.display = "none";
@ -438,40 +442,41 @@ function switchAttributeCat2()
hideAttributesCat2();
-->
</script>
{/literal}
<form action="search.php" onsubmit="return(_sbn_click());" method="{formmethod}" enctype="application/x-www-form-urlencoded" name="searchbyname" dir="ltr" style="display:inline;">
<form action="search.php" onsubmit="return(_sbn_click());" method="{$formmethod}" enctype="application/x-www-form-urlencoded" name="searchbyname" dir="ltr" style="display:inline;">
<input type="hidden" name="searchto" value="searchbyname" />
<input type="hidden" name="showresult" value="1" />
<input type="hidden" name="expert" value="0" />
<input type="hidden" name="output" value="HTML" />
<input type="hidden" name="utf8" value="1" />
<input type="hidden" name="sort" value="{hidopt_sort}" />
<input type="hidden" name="orderRatingFirst" value="{hidopt_orderRatingFirst}" />
<input type="hidden" name="f_userowner" value="{hidopt_userowner}" />
<input type="hidden" name="f_userfound" value="{hidopt_userfound}" />
<input type="hidden" name="f_inactive" value="{hidopt_inactive}" />
<input type="hidden" name="f_disabled" value="{hidopt_disabled}" />
<input type="hidden" name="f_ignored" value="{hidopt_ignored}" />
<input type="hidden" name="f_otherPlatforms" value="{hidopt_otherPlatforms}" />
<input type="hidden" name="country" value="{country}" />
<input type="hidden" name="cachetype" value="{cachetype}" />
<input type="hidden" name="cachesize" value="{cachesize}" />
<input type="hidden" name="difficultymin" value="{difficultymin}" />
<input type="hidden" name="difficultymax" value="{difficultymax}" />
<input type="hidden" name="terrainmin" value="{terrainmin}" />
<input type="hidden" name="terrainmax" value="{terrainmax}" />
<input type="hidden" name="cache_attribs" value="{hidopt_attribs}" />
<input type="hidden" name="cache_attribs_not" value="{hidopt_attribs_not}" />
<input type="hidden" name="sort" value="{$hidopt_sort}" />
<input type="hidden" name="orderRatingFirst" value="{$hidopt_orderRatingFirst}" />
<input type="hidden" name="f_userowner" value="{$hidopt_userowner}" />
<input type="hidden" name="f_userfound" value="{$hidopt_userfound}" />
<input type="hidden" name="f_inactive" value="{$hidopt_inactive}" />
<input type="hidden" name="f_disabled" value="{$hidopt_disabled}" />
<input type="hidden" name="f_ignored" value="{$hidopt_ignored}" />
<input type="hidden" name="f_otherPlatforms" value="{$hidopt_otherPlatforms}" />
<input type="hidden" name="country" value="{$country}" />
<input type="hidden" name="cachetype" value="{$cachetype}" />
<input type="hidden" name="cachesize" value="{$cachesize}" />
<input type="hidden" name="difficultymin" value="{$difficultymin}" />
<input type="hidden" name="difficultymax" value="{$difficultymax}" />
<input type="hidden" name="terrainmin" value="{$terrainmin}" />
<input type="hidden" name="terrainmax" value="{$terrainmax}" />
<input type="hidden" name="cache_attribs" value="{$hidopt_attribs}" />
<input type="hidden" name="cache_attribs_not" value="{$hidopt_attribs_not}" />
<div class="buffer" style="width: 500px;">&nbsp;</div>
<div class="content2-container bg-blue02">
<p class="content-title-noshade-size2">
<img src="resource2/ocstyle/images/misc/32x32-search.png" style="align: left; margin-right: 10px;" width="22" height="22" alt="" />
<img src="resource2/ocstyle/images/misc/32x32-search.png" style="align: left; margin-right: 10px;" width="22" height="22" alt="" />
{t}Search by cachename{/t}
</p>
</div>
<table class="table">
<colgroup>
<col width="200">
@ -481,42 +486,42 @@ function switchAttributeCat2()
<tr><td class="spacer" colspan="3"></td></tr>
<tr>
<td>{t}Name:{/t}</td>
<td><input type="text" name="cachename" value="{cachename}" class="input200" /></td>
<td><input type="text" name="cachename" value="{$cachename}" class="input200" /></td>
<td><input type="submit" name="submit_cachename" value="{t}Search{/t}" class="formbutton" onclick="submitbutton('submit_cachename')" /></td>
</tr>
<tr><td class="spacer" colspan="3"></td></tr>
</table>
</form>
<form action="search.php" onsubmit="return(_sbd_click());" method="{formmethod}" enctype="application/x-www-form-urlencoded" name="searchbydistance" dir="ltr" style="display:inline;">
<form action="search.php" onsubmit="return(_sbd_click());" method="{$formmethod}" enctype="application/x-www-form-urlencoded" name="searchbydistance" dir="ltr" style="display:inline;">
<input type="hidden" name="searchto" value="searchbydistance" />
<input type="hidden" name="showresult" value="1" />
<input type="hidden" name="expert" value="0" />
<input type="hidden" name="output" value="HTML" />
<input type="hidden" name="utf8" value="1" />
<input type="hidden" name="sort" value="{hidopt_sort}" />
<input type="hidden" name="orderRatingFirst" value="{hidopt_orderRatingFirst}" />
<input type="hidden" name="f_userowner" value="{hidopt_userowner}" />
<input type="hidden" name="f_userfound" value="{hidopt_userfound}" />
<input type="hidden" name="f_inactive" value="{hidopt_inactive}" />
<input type="hidden" name="f_disabled" value="{hidopt_disabled}" />
<input type="hidden" name="f_ignored" value="{hidopt_ignored}" />
<input type="hidden" name="f_otherPlatforms" value="{hidopt_otherPlatforms}" />
<input type="hidden" name="country" value="{country}" />
<input type="hidden" name="cachetype" value="{cachetype}" />
<input type="hidden" name="cachesize" value="{cachesize}" />
<input type="hidden" name="difficultymin" value="{difficultymin}" />
<input type="hidden" name="difficultymax" value="{difficultymax}" />
<input type="hidden" name="terrainmin" value="{terrainmin}" />
<input type="hidden" name="terrainmax" value="{terrainmax}" />
<input type="hidden" name="cache_attribs" value="{hidopt_attribs}" />
<input type="hidden" name="cache_attribs_not" value="{hidopt_attribs_not}" />
<input type="hidden" name="sort" value="{$hidopt_sort}" />
<input type="hidden" name="orderRatingFirst" value="{$hidopt_orderRatingFirst}" />
<input type="hidden" name="f_userowner" value="{$hidopt_userowner}" />
<input type="hidden" name="f_userfound" value="{$hidopt_userfound}" />
<input type="hidden" name="f_inactive" value="{$hidopt_inactive}" />
<input type="hidden" name="f_disabled" value="{$hidopt_disabled}" />
<input type="hidden" name="f_ignored" value="{$hidopt_ignored}" />
<input type="hidden" name="f_otherPlatforms" value="{$hidopt_otherPlatforms}" />
<input type="hidden" name="country" value="{$country}" />
<input type="hidden" name="cachetype" value="{$cachetype}" />
<input type="hidden" name="cachesize" value="{$cachesize}" />
<input type="hidden" name="difficultymin" value="{$difficultymin}" />
<input type="hidden" name="difficultymax" value="{$difficultymax}" />
<input type="hidden" name="terrainmin" value="{$terrainmin}" />
<input type="hidden" name="terrainmax" value="{$terrainmax}" />
<input type="hidden" name="cache_attribs" value="{$hidopt_attribs}" />
<input type="hidden" name="cache_attribs_not" value="{$hidopt_attribs_not}" />
<div class="buffer" style="width: 500px;">&nbsp;</div>
<div class="content2-container bg-blue02">
<p class="content-title-noshade-size2">
<img src="resource2/ocstyle/images/misc/32x32-search.png" style="align: left; margin-right: 10px;" width="22" height="22" alt="" />
<img src="resource2/ocstyle/images/misc/32x32-search.png" style="align: left; margin-right: 10px;" width="22" height="22" alt="" />
{t}Search by distance{/t}
</p>
</div>
@ -532,28 +537,28 @@ function switchAttributeCat2()
<td valign="top">{t}Of coordinates:{/t}</td>
<td colspan="2" valign="top">
<select name="latNS" class="input40">
<option value="N" {latN_sel}>{t}N{/t}</option>
<option value="S" {latS_sel}>{t}S{/t}</option>
<option value="N" {if $latN_sel}selected="selected"{/if}>{t}N{/t}</option>
<option value="S" {if $latS_sel}selected="selected"{/if}>{t}S{/t}</option>
</select>&nbsp;
<input type="text" name="lat_h" maxlength="2" value="{lat_h}" class="input30" />&nbsp;°&nbsp;
<input type="text" name="lat_min" maxlength="6" value="{lat_min}" class="input40" />&nbsp;'&nbsp;
<input type="text" name="lat_h" maxlength="2" value="{$lat_h}" class="input30" />&nbsp;°&nbsp;
<input type="text" name="lat_min" maxlength="6" value="{$lat_min}" class="input40" />&nbsp;'&nbsp;
<br>
<select name="lonEW" class="input40">
<option value="E" {lonE_sel}>{t}E{/t}</option>
<option value="W" {lonW_sel}>{t}W{/t}</option>
<option value="E" {if $lonE_sel}selected="selected"{/if}>{t}E{/t}</option>
<option value="W" {if $lonW_sel}selected="selected"{/if}>{t}W{/t}</option>
</select>&nbsp;
<input type="text" name="lon_h" maxlength="3" value="{lon_h}" class="input30" />&nbsp;°&nbsp;
<input type="text" name="lon_min" maxlength="6" value="{lon_min}" class="input40" />&nbsp;'&nbsp;
<input type="text" name="lon_h" maxlength="3" value="{$lon_h}" class="input30" />&nbsp;°&nbsp;
<input type="text" name="lon_min" maxlength="6" value="{$lon_min}" class="input40" />&nbsp;'&nbsp;
</td>
</tr>
<tr>
<td>{t}Maximum distance:{/t}</td>
<td>
<input type="text" name="distance" value="{distance}" maxlength="4" class="input50" />&nbsp;
<input type="text" name="distance" value="{$distance}" maxlength="4" class="input50" />&nbsp;
<select name="unit" class="input100">
<option value="km" {sel_km}>{t}Kilometer{/t}</option>
<option value="sm" {sel_sm}>{t}Miles{/t}</option>
<option value="nm" {sel_nm}>{t}Seamiles{/t}</option>
<option value="km" {if $sel_km}selected="selected"{/if}>{t}Kilometer{/t}</option>
<option value="sm" {if $sel_sm}selected="selected"{/if}>{t}Miles{/t}</option>
<option value="nm" {if $sel_nm}selected="selected"{/if}>{t}Seamiles{/t}</option>
</select>
</td>
<td><input type="submit" name="submit_dist" value="{t}Search{/t}" class="formbutton" onclick="submitbutton('submit_dist')" /></td>
@ -565,7 +570,7 @@ function switchAttributeCat2()
<div class="buffer" style="width: 500px;">&nbsp;</div>
<div class="content2-container bg-blue02">
<p class="content-title-noshade-size2">
<img src="resource2/ocstyle/images/misc/32x32-search.png" style="align: left; margin-right: 10px;" width="22" height="22" alt="" />
<img src="resource2/ocstyle/images/misc/32x32-search.png" style="align: left; margin-right: 10px;" width="22" height="22" alt="" />
{t}Search for city{/t}
</p>
</div>
@ -576,35 +581,35 @@ function switchAttributeCat2()
<col width="220">
<col>
</colgroup>
<tr><td class="spacer" colspan="3"></td></tr>
{ortserror}
{$ortserror}
</table>
<form action="search.php" onsubmit="return(_sbplz_click());" method="{formmethod}" enctype="application/x-www-form-urlencoded" name="searchbyplz" dir="ltr" style="display:inline;">
<form action="search.php" onsubmit="return(_sbplz_click());" method="{$formmethod}" enctype="application/x-www-form-urlencoded" name="searchbyplz" dir="ltr" style="display:inline;">
<input type="hidden" name="searchto" value="searchbyplz" />
<input type="hidden" name="showresult" value="1" />
<input type="hidden" name="expert" value="0" />
<input type="hidden" name="output" value="HTML" />
<input type="hidden" name="utf8" value="1" />
<input type="hidden" name="sort" value="{hidopt_sort}" />
<input type="hidden" name="orderRatingFirst" value="{hidopt_orderRatingFirst}" />
<input type="hidden" name="f_userowner" value="{hidopt_userowner}" />
<input type="hidden" name="f_userfound" value="{hidopt_userfound}" />
<input type="hidden" name="f_inactive" value="{hidopt_inactive}" />
<input type="hidden" name="f_disabled" value="{hidopt_disabled}" />
<input type="hidden" name="f_ignored" value="{hidopt_ignored}" />
<input type="hidden" name="f_otherPlatforms" value="{hidopt_otherPlatforms}" />
<input type="hidden" name="country" value="{country}" />
<input type="hidden" name="cachetype" value="{cachetype}" />
<input type="hidden" name="cachesize" value="{cachesize}" />
<input type="hidden" name="difficultymin" value="{difficultymin}" />
<input type="hidden" name="difficultymax" value="{difficultymax}" />
<input type="hidden" name="terrainmin" value="{terrainmin}" />
<input type="hidden" name="terrainmax" value="{terrainmax}" />
<input type="hidden" name="cache_attribs" value="{hidopt_attribs}" />
<input type="hidden" name="cache_attribs_not" value="{hidopt_attribs_not}" />
<input type="hidden" name="sort" value="{$hidopt_sort}" />
<input type="hidden" name="orderRatingFirst" value="{$hidopt_orderRatingFirst}" />
<input type="hidden" name="f_userowner" value="{$hidopt_userowner}" />
<input type="hidden" name="f_userfound" value="{$hidopt_userfound}" />
<input type="hidden" name="f_inactive" value="{$hidopt_inactive}" />
<input type="hidden" name="f_disabled" value="{$hidopt_disabled}" />
<input type="hidden" name="f_ignored" value="{$hidopt_ignored}" />
<input type="hidden" name="f_otherPlatforms" value="{$hidopt_otherPlatforms}" />
<input type="hidden" name="country" value="{$country}" />
<input type="hidden" name="cachetype" value="{$cachetype}" />
<input type="hidden" name="cachesize" value="{$cachesize}" />
<input type="hidden" name="difficultymin" value="{$difficultymin}" />
<input type="hidden" name="difficultymax" value="{$difficultymax}" />
<input type="hidden" name="terrainmin" value="{$terrainmin}" />
<input type="hidden" name="terrainmax" value="{$terrainmax}" />
<input type="hidden" name="cache_attribs" value="{$hidopt_attribs}" />
<input type="hidden" name="cache_attribs_not" value="{$hidopt_attribs_not}" />
<table class="table">
<colgroup>
@ -614,36 +619,36 @@ function switchAttributeCat2()
</colgroup>
<tr>
<td>{t}Postal code:{/t}</td>
<td><input type="text" name="plz" value="{plz}" maxlength="5" class="input50" /></td>
<td><input type="text" name="plz" value="{$plz}" maxlength="5" class="input50" /></td>
<td><input type="submit" name="submit_plz" value="{t}Search{/t}" class="formbutton" onclick="submitbutton('submit_plz')" /></td>
</tr>
</table>
</form>
<form action="search.php" onsubmit="return(_sbort_click());" method="{formmethod}" enctype="application/x-www-form-urlencoded" name="searchbyort" dir="ltr" style="display:inline;">
<form action="search.php" onsubmit="return(_sbort_click());" method="{$formmethod}" enctype="application/x-www-form-urlencoded" name="searchbyort" dir="ltr" style="display:inline;">
<input type="hidden" name="searchto" value="searchbyort" />
<input type="hidden" name="showresult" value="1" />
<input type="hidden" name="expert" value="0" />
<input type="hidden" name="output" value="HTML" />
<input type="hidden" name="utf8" value="1" />
<input type="hidden" name="sort" value="{hidopt_sort}" />
<input type="hidden" name="orderRatingFirst" value="{hidopt_orderRatingFirst}" />
<input type="hidden" name="f_userowner" value="{hidopt_userowner}" />
<input type="hidden" name="f_userfound" value="{hidopt_userfound}" />
<input type="hidden" name="f_inactive" value="{hidopt_inactive}" />
<input type="hidden" name="f_disabled" value="{hidopt_disabled}" />
<input type="hidden" name="f_ignored" value="{hidopt_ignored}" />
<input type="hidden" name="f_otherPlatforms" value="{hidopt_otherPlatforms}" />
<input type="hidden" name="country" value="{country}" />
<input type="hidden" name="difficultymin" value="{difficultymin}" />
<input type="hidden" name="difficultymax" value="{difficultymax}" />
<input type="hidden" name="terrainmin" value="{terrainmin}" />
<input type="hidden" name="terrainmax" value="{terrainmax}" />
<input type="hidden" name="cachetype" value="{cachetype}" />
<input type="hidden" name="cachesize" value="{cachesize}" />
<input type="hidden" name="cache_attribs" value="{hidopt_attribs}" />
<input type="hidden" name="cache_attribs_not" value="{hidopt_attribs_not}" />
<input type="hidden" name="sort" value="{$hidopt_sort}" />
<input type="hidden" name="orderRatingFirst" value="{$hidopt_orderRatingFirst}" />
<input type="hidden" name="f_userowner" value="{$hidopt_userowner}" />
<input type="hidden" name="f_userfound" value="{$hidopt_userfound}" />
<input type="hidden" name="f_inactive" value="{$hidopt_inactive}" />
<input type="hidden" name="f_disabled" value="{$hidopt_disabled}" />
<input type="hidden" name="f_ignored" value="{$hidopt_ignored}" />
<input type="hidden" name="f_otherPlatforms" value="{$hidopt_otherPlatforms}" />
<input type="hidden" name="country" value="{$country}" />
<input type="hidden" name="difficultymin" value="{$difficultymin}" />
<input type="hidden" name="difficultymax" value="{$difficultymax}" />
<input type="hidden" name="terrainmin" value="{$terrainmin}" />
<input type="hidden" name="terrainmax" value="{$terrainmax}" />
<input type="hidden" name="cachetype" value="{$cachetype}" />
<input type="hidden" name="cachesize" value="{$cachesize}" />
<input type="hidden" name="cache_attribs" value="{$hidopt_attribs}" />
<input type="hidden" name="cache_attribs_not" value="{$hidopt_attribs_not}" />
<table class="table">
<colgroup>
@ -653,7 +658,7 @@ function switchAttributeCat2()
</colgroup>
<tr>
<td>{t}City:{/t}</td>
<td><input type="text" name="ort" value="{ort}" class="input200" /></td>
<td><input type="text" name="ort" value="{$ort}" class="input200" /></td>
<td><input type="submit" name="submit_city" value="{t}Search{/t}" class="formbutton" onclick="submitbutton('submit_city')" /></td>
</tr>
</table>
@ -668,35 +673,35 @@ function switchAttributeCat2()
<tr><td class="spacer" colspan="3"></td></tr>
</table>
<form action="search.php" onsubmit="return(_sbft_click());" method="{formmethod}" enctype="application/x-www-form-urlencoded" name="searchbyfulltext" dir="ltr" style="display:inline;">
<form action="search.php" onsubmit="return(_sbft_click());" method="{$formmethod}" enctype="application/x-www-form-urlencoded" name="searchbyfulltext" dir="ltr" style="display:inline;">
<input type="hidden" name="searchto" value="searchbyfulltext" />
<input type="hidden" name="showresult" value="1" />
<input type="hidden" name="expert" value="0" />
<input type="hidden" name="output" value="HTML" />
<input type="hidden" name="utf8" value="1" />
<input type="hidden" name="sort" value="{hidopt_sort}" />
<input type="hidden" name="orderRatingFirst" value="{hidopt_orderRatingFirst}" />
<input type="hidden" name="f_userowner" value="{hidopt_userowner}" />
<input type="hidden" name="f_userfound" value="{hidopt_userfound}" />
<input type="hidden" name="f_inactive" value="{hidopt_inactive}" />
<input type="hidden" name="f_disabled" value="{hidopt_disabled}" />
<input type="hidden" name="f_ignored" value="{hidopt_ignored}" />
<input type="hidden" name="f_otherPlatforms" value="{hidopt_otherPlatforms}" />
<input type="hidden" name="country" value="{country}" />
<input type="hidden" name="difficultymin" value="{difficultymin}" />
<input type="hidden" name="difficultymax" value="{difficultymax}" />
<input type="hidden" name="terrainmin" value="{terrainmin}" />
<input type="hidden" name="terrainmax" value="{terrainmax}" />
<input type="hidden" name="cachetype" value="{cachetype}" />
<input type="hidden" name="cachesize" value="{cachesize}" />
<input type="hidden" name="cache_attribs" value="{hidopt_attribs}" />
<input type="hidden" name="cache_attribs_not" value="{hidopt_attribs_not}" />
<input type="hidden" name="sort" value="{$hidopt_sort}" />
<input type="hidden" name="orderRatingFirst" value="{$hidopt_orderRatingFirst}" />
<input type="hidden" name="f_userowner" value="{$hidopt_userowner}" />
<input type="hidden" name="f_userfound" value="{$hidopt_userfound}" />
<input type="hidden" name="f_inactive" value="{$hidopt_inactive}" />
<input type="hidden" name="f_disabled" value="{$hidopt_disabled}" />
<input type="hidden" name="f_ignored" value="{$hidopt_ignored}" />
<input type="hidden" name="f_otherPlatforms" value="{$hidopt_otherPlatforms}" />
<input type="hidden" name="country" value="{$country}" />
<input type="hidden" name="difficultymin" value="{$difficultymin}" />
<input type="hidden" name="difficultymax" value="{$difficultymax}" />
<input type="hidden" name="terrainmin" value="{$terrainmin}" />
<input type="hidden" name="terrainmax" value="{$terrainmax}" />
<input type="hidden" name="cachetype" value="{$cachetype}" />
<input type="hidden" name="cachesize" value="{$cachesize}" />
<input type="hidden" name="cache_attribs" value="{$hidopt_attribs}" />
<input type="hidden" name="cache_attribs_not" value="{$hidopt_attribs_not}" />
<div class="buffer" style="width: 500px;">&nbsp;</div>
<div class="content2-container bg-blue02">
<p class="content-title-noshade-size2">
<img src="resource2/ocstyle/images/misc/32x32-search.png" style="align: left; margin-right: 10px;" width="22" height="22" alt="" />
<img src="resource2/ocstyle/images/misc/32x32-search.png" style="align: left; margin-right: 10px;" width="22" height="22" alt="" />
{t}Search for text{/t}
</p>
</div>
@ -708,10 +713,10 @@ function switchAttributeCat2()
<col>
</colgroup>
<tr><td class="spacer" colspan="3"></td></tr>
{fulltexterror}
{$fulltexterror}
<tr>
<td>Text:</td>
<td><input type="text" name="fulltext" value="{fulltext}" class="input200" /></td>
<td><input type="text" name="fulltext" value="{$fulltext}" class="input200" /></td>
<td><input type="submit" name="submit_ft" value="{t}Search{/t}" class="formbutton" onclick="submitbutton('submit_ft')" /></td>
</tr>
<tr>
@ -719,12 +724,12 @@ function switchAttributeCat2()
<td colspan="2">
<table class="table" width="250px">
<tr>
<td><input type="checkbox" name="ft_name" id="ft_name" class="checkbox" value="1" {ft_name_checked} /> <label for="ft_name">{t}Name{/t}</label></td>
<td><input type="checkbox" name="ft_desc" id="ft_desc" class="checkbox" value="1" {ft_desc_checked} /> <label for="ft_desc">{t}Description{/t}</label></td>
<td><input type="checkbox" name="ft_name" id="ft_name" class="checkbox" value="1" {if $ft_name_checked}checked="checked"{/if} /> <label for="ft_name">{t}Name{/t}</label></td>
<td><input type="checkbox" name="ft_desc" id="ft_desc" class="checkbox" value="1" {if $ft_desc_checked}checked="checked"{/if} /> <label for="ft_desc">{t}Description{/t}</label></td>
</tr>
<tr>
<td><input type="checkbox" name="ft_logs" id="ft_logs" class="checkbox" value="1" {ft_logs_checked} /> <label for="ft_logs">{t}Logs{/t}</label></td>
<td><input type="checkbox" name="ft_pictures" id="ft_pictures" class="checkbox" value="1" {ft_pictures_checked} /> <label for="ft_pictures">{t}Pictures{/t}</label></td>
<td><input type="checkbox" name="ft_logs" id="ft_logs" class="checkbox" value="1" {if $ft_logs_checked}checked="checked"{/if} /> <label for="ft_logs">{t}Logs{/t}</label></td>
<td><input type="checkbox" name="ft_pictures" id="ft_pictures" class="checkbox" value="1" {if $ft_pictures_checked}checked="checked"{/if} /> <label for="ft_pictures">{t}Pictures{/t}</label></td>
</tr>
</table>
</td>
@ -733,35 +738,35 @@ function switchAttributeCat2()
</table>
</form>
<form action="search.php" onsubmit="return(_sbo_click());" method="{formmethod}" enctype="application/x-www-form-urlencoded" name="searchbyowner" dir="ltr" style="display:inline;">
<form action="search.php" onsubmit="return(_sbo_click());" method="{$formmethod}" enctype="application/x-www-form-urlencoded" name="searchbyowner" dir="ltr" style="display:inline;">
<input type="hidden" name="searchto" value="searchbyowner" />
<input type="hidden" name="showresult" value="1" />
<input type="hidden" name="expert" value="0" />
<input type="hidden" name="output" value="HTML" />
<input type="hidden" name="utf8" value="1" />
<input type="hidden" name="sort" value="{hidopt_sort}" />
<input type="hidden" name="orderRatingFirst" value="{hidopt_orderRatingFirst}" />
<input type="hidden" name="f_userowner" value="{hidopt_userowner}" />
<input type="hidden" name="f_userfound" value="{hidopt_userfound}" />
<input type="hidden" name="f_inactive" value="{hidopt_inactive}" />
<input type="hidden" name="f_disabled" value="{hidopt_disabled}" />
<input type="hidden" name="f_ignored" value="{hidopt_ignored}" />
<input type="hidden" name="f_otherPlatforms" value="{hidopt_otherPlatforms}" />
<input type="hidden" name="country" value="{country}" />
<input type="hidden" name="difficultymin" value="{difficultymin}" />
<input type="hidden" name="difficultymax" value="{difficultymax}" />
<input type="hidden" name="terrainmin" value="{terrainmin}" />
<input type="hidden" name="terrainmax" value="{terrainmax}" />
<input type="hidden" name="cachetype" value="{cachetype}" />
<input type="hidden" name="cachesize" value="{cachesize}" />
<input type="hidden" name="cache_attribs" value="{hidopt_attribs}" />
<input type="hidden" name="cache_attribs_not" value="{hidopt_attribs_not}" />
<input type="hidden" name="sort" value="{$hidopt_sort}" />
<input type="hidden" name="orderRatingFirst" value="{$hidopt_orderRatingFirst}" />
<input type="hidden" name="f_userowner" value="{$hidopt_userowner}" />
<input type="hidden" name="f_userfound" value="{$hidopt_userfound}" />
<input type="hidden" name="f_inactive" value="{$hidopt_inactive}" />
<input type="hidden" name="f_disabled" value="{$hidopt_disabled}" />
<input type="hidden" name="f_ignored" value="{$hidopt_ignored}" />
<input type="hidden" name="f_otherPlatforms" value="{$hidopt_otherPlatforms}" />
<input type="hidden" name="country" value="{$country}" />
<input type="hidden" name="difficultymin" value="{$difficultymin}" />
<input type="hidden" name="difficultymax" value="{$difficultymax}" />
<input type="hidden" name="terrainmin" value="{$terrainmin}" />
<input type="hidden" name="terrainmax" value="{$terrainmax}" />
<input type="hidden" name="cachetype" value="{$cachetype}" />
<input type="hidden" name="cachesize" value="{$cachesize}" />
<input type="hidden" name="cache_attribs" value="{$hidopt_attribs}" />
<input type="hidden" name="cache_attribs_not" value="{$hidopt_attribs_not}" />
<div class="buffer" style="width: 500px;">&nbsp;</div>
<div class="content2-container bg-blue02">
<p class="content-title-noshade-size2">
<img src="resource2/ocstyle/images/misc/32x32-search.png" style="align: left; margin-right: 10px;" width="22" height="22" alt="" />
<img src="resource2/ocstyle/images/misc/32x32-search.png" style="align: left; margin-right: 10px;" width="22" height="22" alt="" />
{t}Search for Owner{/t}
</p>
</div>
@ -775,42 +780,42 @@ function switchAttributeCat2()
<tr><td class="spacer" colspan="3"></td></tr>
<tr>
<td>{t}Owner:{/t}</td>
<td><input type="text" name="owner" value="{owner}" maxlength="40" class="input200" /></td>
<td><input type="text" name="owner" value="{$owner}" maxlength="40" class="input200" /></td>
<td><input type="submit" name="submit_owner" value="{t}Search{/t}" class="formbutton" onclick="submitbutton('submit_owner')" /></td>
</tr>
<tr><td class="spacer" colspan="3"></td></tr>
</table>
</form>
<form action="search.php" onsubmit="return(_sbf_click());" method="{formmethod}" enctype="application/x-www-form-urlencoded" name="searchbyfinder" dir="ltr" style="display:inline;">
<form action="search.php" onsubmit="return(_sbf_click());" method="{$formmethod}" enctype="application/x-www-form-urlencoded" name="searchbyfinder" dir="ltr" style="display:inline;">
<input type="hidden" name="searchto" value="searchbyfinder" />
<input type="hidden" name="showresult" value="1" />
<input type="hidden" name="expert" value="0" />
<input type="hidden" name="output" value="HTML" />
<input type="hidden" name="utf8" value="1" />
<input type="hidden" name="sort" value="{hidopt_sort}" />
<input type="hidden" name="orderRatingFirst" value="{hidopt_orderRatingFirst}" />
<input type="hidden" name="f_userowner" value="{hidopt_userowner}" />
<input type="hidden" name="f_userfound" value="{hidopt_userfound}" />
<input type="hidden" name="f_inactive" value="{hidopt_inactive}" />
<input type="hidden" name="f_disabled" value="{hidopt_disabled}" />
<input type="hidden" name="f_ignored" value="{hidopt_ignored}" />
<input type="hidden" name="f_otherPlatforms" value="{hidopt_otherPlatforms}" />
<input type="hidden" name="country" value="{country}" />
<input type="hidden" name="difficultymin" value="{difficultymin}" />
<input type="hidden" name="difficultymax" value="{difficultymax}" />
<input type="hidden" name="terrainmin" value="{terrainmin}" />
<input type="hidden" name="terrainmax" value="{terrainmax}" />
<input type="hidden" name="cachetype" value="{cachetype}" />
<input type="hidden" name="cachesize" value="{cachesize}" />
<input type="hidden" name="cache_attribs" value="{hidopt_attribs}" />
<input type="hidden" name="cache_attribs_not" value="{hidopt_attribs_not}" />
<input type="hidden" name="sort" value="{$hidopt_sort}" />
<input type="hidden" name="orderRatingFirst" value="{$hidopt_orderRatingFirst}" />
<input type="hidden" name="f_userowner" value="{$hidopt_userowner}" />
<input type="hidden" name="f_userfound" value="{$hidopt_userfound}" />
<input type="hidden" name="f_inactive" value="{$hidopt_inactive}" />
<input type="hidden" name="f_disabled" value="{$hidopt_disabled}" />
<input type="hidden" name="f_ignored" value="{$hidopt_ignored}" />
<input type="hidden" name="f_otherPlatforms" value="{$hidopt_otherPlatforms}" />
<input type="hidden" name="country" value="{$country}" />
<input type="hidden" name="difficultymin" value="{$difficultymin}" />
<input type="hidden" name="difficultymax" value="{$difficultymax}" />
<input type="hidden" name="terrainmin" value="{$terrainmin}" />
<input type="hidden" name="terrainmax" value="{$terrainmax}" />
<input type="hidden" name="cachetype" value="{$cachetype}" />
<input type="hidden" name="cachesize" value="{$cachesize}" />
<input type="hidden" name="cache_attribs" value="{$hidopt_attribs}" />
<input type="hidden" name="cache_attribs_not" value="{$hidopt_attribs_not}" />
<div class="buffer" style="width: 500px;">&nbsp;</div>
<div class="content2-container bg-blue02">
<p class="content-title-noshade-size2">
<img src="resource2/ocstyle/images/misc/32x32-search.png" style="align: left; margin-right: 10px;" width="22" height="22" alt="" />
<img src="resource2/ocstyle/images/misc/32x32-search.png" style="align: left; margin-right: 10px;" width="22" height="22" alt="" />
{t}Search for Logs{/t}
</p>
</div>
@ -826,13 +831,15 @@ function switchAttributeCat2()
<td>{t}Logtype:{/t}</td>
<td colspan="2">
<select name="logtype">
{logtype_options}
</select>
{foreach from=$logtype_options item=logtype_option}
<option value="{$logtype_option.id|escape}" {if $logtype_option.selcted}selected="selected"{/if}>{$logtype_option.name|escape}</option>
{/foreach}
</select>
</td>
</tr>
<tr>
<td>{t}Username:{/t}</td>
<td><input type="text" name="finder" value="{finder}" maxlength="40" class="input200" /></td>
<td><input type="text" name="finder" value="{$finder}" maxlength="40" class="input200" /></td>
<td><input type="submit" name="submit_finder" value="{t}Search{/t}" class="formbutton" onclick="submitbutton('submit_finder')" /></td>
</tr>
<tr><td class="spacer" colspan="3"></td></tr>

View File

@ -1,88 +1,47 @@
<?php
/****************************************************************************
./lang/de/ocstyle/search.inc.php
-------------------
begin : July 25 2004
For license information see doc/license.txt
****************************************************************************/
/****************************************************************************
For license information see doc/license.txt
Unicode Reminder メモ
set template specific language variables
variable search template contents
****************************************************************************/
$outputformat_notexist = t('The selected output format is unknown!');
$error_query_not_found = t('The search operation could not be executed, please reenter the search data.');
// search.php -> $tpl->error
$outputformat_notexist = _('The selected output format is unknown!');
$error_query_not_found = _('The search operation could not be executed, please reenter the search data.');
$unknown_searchoption = _('unknown search option');
$unknown_searchtype = _('unknown search type');
$caches_newstring = '<b class="newsymbol">&nbsp;' . t('NEW') . '&nbsp;</b>&nbsp;';
$caches_olddays = 14; // changed from 7 to 14 -- following 2013/6/17
// search.php -> search.tpl
$error_plz = '<tr><td colspan="3"><span class="errormsg">' . _('The postal code could not be found') . '</span></td></tr>';
$error_ort = '<tr><td colspan="3"><span class="errormsg">' . _('There does no city exist with this name') . '</span></td></tr>';
$error_locidnocoords = '<tr><td colspan="3"><span class="errormsg">' . _('There are no Koordinates available for the selected city') . '</span></td></tr>';
$error_noort = '<tr><td colspan="3"><span class="errormsg">' . _('The entered city is not valid.') . '</span></td></tr>';
$error_nofulltext = '<tr><td colspan="3"><span class="errormsg">' . _('The entered text is invalid.') . '</span></td></tr>';
$error_fulltexttoolong = '<tr><td colspan="3"><span class="errormsg">' . _('The entered text contains more than 50 words.') . '</span></td></tr>';
// search.php -> selectlocid.tpl
$locline = '<tr><td width="50px"><p>{nr}.&nbsp;</p></td><td><p><b><a href="search.php?{urlparams}">{locationname}</a>{secondlocationname}</b></p></td></tr>
<tr><td width="50px">&nbsp;</td><td><p style="margin-bottom:4px">{coords}</p></td></tr>
<tr><td width="50px">&nbsp;</td><td style="padding-bottom:8px; vertical-align:top"><span style="color:#001BBC">{parentlocations}</span></td></tr>';
$secondlocationname = '&nbsp;<font size="1">({secondlocationname})</font>';
$no_location_coords = _('no coordinates available');
$pages_left_inactive = '<img src="resource2/ocstyle/images/navigation/16x16-browse-first-inactive.png" width="16" height="16"> <img src="resource2/ocstyle/images/navigation/16x16-browse-prev-inactive.png" width="16" height="16">';
$pages_left = '<a href="search.php?{urlparams}&locidsite=0"><img src="resource2/ocstyle/images/navigation/16x16-browse-first.png" width="16" height="16"></a> <a href="search.php?{urlparams}&locidsite={prevpage}"><img src="resource2/ocstyle/images/navigation/16x16-browse-prev.png" width="16" height="16"></a>';
$page_selectable = '<a href="search.php?{urlparams}&locidsite={linkpage}">{showpage}</a>';
$page_selected = '<b>{page}</b>';
$pages_right = '<a href="search.php?{urlparams}&locidsite={nextpage}"><img src="resource2/ocstyle/images/navigation/16x16-browse-next.png" width="16" height="16"></a> <a href="search.php?{urlparams}&locidsite={lastpage}"><img src="resource2/ocstyle/images/navigation/16x16-browse-last.png" width="16" height="16"></a>';
$pages_right_inactive = '<img src="resource2/ocstyle/images/navigation/16x16-browse-next-inactive.png" width="16" height="16"> <img src="resource2/ocstyle/images/navigation/16x16-browse-last-inactive.png" width="16" height="16">';
// search.html.inc.php -> search.result.caches.tpl
$newcache_days = 14; // changed from 7 to 14 -- following 2013/6/17
$caches_newstring = '<b class="newsymbol">&nbsp;' . _('NEW') . '&nbsp;</b>&nbsp;';
$caches_oconlystring = '<img src="resource2/ocstyle/images/misc/is_oconly.png" alt="OConly" title="OConly" style="margin:0px; padding:0px" width="64" height="35" />';
$bgcolor1 = 'odd'; // even lines
$bgcolor2 = 'even'; // odd lines
$bgcolor_found = "#66FFCC"; // if cache was found by user
$bgcolor_owner = "#ffffc5"; // if user is owner
$bgcolor_inactive = "#fafafa"; // if cache is inactive
$string_by = t('by');
$logdateformat = 'd.m.Y';
$logpics[1] = '<img alt="' . t('Find') . '" border="0" src="images/ok.gif">';
$logpics[2] = '<img alt="' . t('Didn\'t find') . '" border="0" src="images/redcross.gif">';
$logpics[3] = '<img alt="' . t('Note') . '" border="0" src="images/info.gif">';
$diffpics[2] = 'diff-10.gif';
$diffpics[3] = 'diff-15.gif';
$diffpics[4] = 'diff-20.gif';
$diffpics[5] = 'diff-25.gif';
$diffpics[6] = 'diff-30.gif';
$diffpics[7] = 'diff-35.gif';
$diffpics[8] = 'diff-40.gif';
$diffpics[9] = 'diff-45.gif';
$diffpics[10] = 'diff-50.gif';
$terrpics[2] = 'terr-10.gif';
$terrpics[3] = 'terr-15.gif';
$terrpics[4] = 'terr-20.gif';
$terrpics[5] = 'terr-25.gif';
$terrpics[6] = 'terr-30.gif';
$terrpics[7] = 'terr-35.gif';
$terrpics[8] = 'terr-40.gif';
$terrpics[9] = 'terr-45.gif';
$terrpics[10] = 'terr-50.gif';
$terrpics[1] = 'rat-10.gif';
$terrpics[2] = 'rat-20.gif';
$terrpics[3] = 'rat-30.gif';
$terrpics[4] = 'rat-40.gif';
$terrpics[5] = 'rat-50.gif';
$difficulty_text_diff = t("Difficulty: %01.1f of 5.0");
$difficulty_text_terr = t("Terrain: %01.1f of 5.0");
$rating_text = t("Rating: {rating}%");
$not_rated = t('No Rating');
$error_plz = '<tr><td colspan="3"><span class="errormsg">' . t('The postal code could not be found') . '</span></td></tr>';
$error_ort = '<tr><td colspan="3"><span class="errormsg">' . t('There does no city exist with this name') . '</span></td></tr>';
$error_locidnocoords = '<tr><td colspan="3"><span class="errormsg">' . t('There are no Koordinates available for the selected city') . '</span></td></tr>';
$error_noort = '<tr><td colspan="3"><span class="errormsg">' . t('The entered city is not valid.') . '</span></td></tr>';
$error_nofulltext = '<tr><td colspan="3"><span class="errormsg">' . t('The entered text is invalid.') . '</span></td></tr>';
$error_fulltexttoolong = '<tr><td colspan="3"><span class="errormsg">' . t('The entered text contains more than 50 words.') . '</span></td></tr>';
$gns_countries['GM'] = t('Germany');
$gns_countries['AU'] = t('Austria');
$gns_countries['SZ'] = t('Switzerland');
$default_lang = t('EN');
$search_all_countries = '<option value="" selected="selected">' . t('All countries') . '</option>';
$search_all_cachetypes = '<option value="" selected="selected">' . t('All cachetypes') . '</option>';
$cache_attrib_group =
$cache_attrib_group =
'<div class="attribgroup"><table cellspacing="0">
<tr><td bgcolor="{color}" style="line-height:9px;padding-top:2px;margin:0 0 0 0;border-left:1px solid gray;border-right:1px solid gray;border-top:1px solid gray;"><font size="1">{name}</font></td></tr>
<tr><td bgcolor="#F8F8F8" style="margin:0 0 0 0;border-left:1px solid gray;border-right:1px solid gray;border-bottom:1px solid gray;">{attribs}</td></tr>
@ -94,59 +53,11 @@
$search_in_gm = '<a href="http://maps.google.de/maps?f=q&hl=de&q=' . urlencode("http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']."&output=kml") . '" title="' . $translate->t('Show in Google Maps','','',0) . '">' . $translate->t('(in GM)','','',0) . '</a>';
$search_in_gm_zip = '<a href="http://maps.google.de/maps?f=q&hl=de&q=' . urlencode("http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']."&output=kml&zip=1&count=max") . '" title="' . $translate->t('Show in Google Maps','','',0) . '">' . $translate->t('(in GM)','','',0) . '</a>';
$unknown_searchtype = t('unknown search type');
$showonmap = t('Show on map');
// search.*.inc.php (TXT, KML, LOC, GPX ...)
$converted_from_html = _('converted from HTML');
$state_temporarily_na = _('Temporary not available');
$state_archived = _('Archived');
$state_locked = _('Locked');
$cache_note_text = _('Personal cache note');
$converted_from_html = t('converted from HTML');
$state_temporarily_na = t('Temporary not available');
$state_archived = t('Archived');
$state_locked = t('Locked');
$cache_note_text = t('Personal cache note');
function dateDiff($interval, $dateTimeBegin, $dateTimeEnd)
{
//Parse about any English textual datetime
//$dateTimeBegin, $dateTimeEnd
$dateTimeBegin = strtotime($dateTimeBegin);
if ($dateTimeBegin === -1)
return("..begin date Invalid");
$dateTimeEnd = strtotime($dateTimeEnd);
if ($dateTimeEnd === -1)
return("..end date Invalid");
$dif = $dateTimeEnd - $dateTimeBegin;
switch($interval)
{
case "s"://seconds
return($dif);
case "n"://minutes
return(floor($dif/60)); //60s=1m
case "h"://hours
return(floor($dif/3600)); //3600s=1h
case "d"://days
return(floor($dif/86400)); //86400s=1d
case "ww"://Week
return(floor($dif/604800)); //604800s=1week=1semana
case "m": //similar result "m" dateDiff Microsoft
$monthBegin = (date("Y",$dateTimeBegin)*12) + date("n",$dateTimeBegin);
$monthEnd = (date("Y",$dateTimeEnd)*12) + date("n",$dateTimeEnd);
$monthDiff = $monthEnd - $monthBegin;
return($monthDiff);
case "yyyy": //similar result "yyyy" dateDiff Microsoft
return(date("Y",$dateTimeEnd) - date("Y",$dateTimeBegin));
default:
return(floor($dif/86400)); //86400s=1d
}
}
?>

View File

@ -1,21 +1,22 @@
<?php
/****************************************************************************
For license information see doc/license.txt
{***************************************************************************
* You can find the license in the docs directory
*
* Unicode Reminder メモ
***************************************************************************}
Unicode Reminder メモ
****************************************************************************/
?>
<div class="content2-pagetitle"><img src="resource2/ocstyle/images/cacheicon/traditional.gif" style="align: left; margin-right: 10px;" width="32" height="32" alt="{t}Search result{/t}" />{t}Selection of city{/t} - {t}Total of {resultscount} cities matched{/t}</div>
<div class="content2-pagetitle"><img src="resource2/ocstyle/images/cacheicon/traditional.gif" style="align: left; margin-right: 10px;" width="32" height="32" alt="{t}Search result{/t}" />{t}Selection of city{/t} - {t 1=$resultscount}Total of %1 cities matched{/t}</div>
<p>{t}For the search criterion no clear result was found. Please choose the correct location.{/t}</p>
<p>{t}For the search criterion no clear result was found. Please choose the desired location:{/t}</p>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr><td colspan="2" style="margin-bottom:1px;">{pages}</td></tr>
<tr><td colspan="2" style="margin-bottom:1px;"><p>{$pages}</p></td></tr>
<tr><td>&nbsp;</td></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
{locations}
{$locations}
</table>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr><td colspan="2" style="margin-top:1px;">{pages}</td></tr>
</table>
<tr><td>&nbsp;</td></td></tr>
<tr><td colspan="2" style="margin-top:1px;"><p>{$pages}</p></td></tr>
<tr><td>&nbsp;</td></td></tr>
</table>

View File

@ -108,8 +108,8 @@
<div class="content2-container-2col-left" style="width:60px; clear: left;">
<div><a href="articles.php?page=cacheinfo#cachetype">{include file="res_cacheicon.tpl" cachetype=$cache.type status=$cache.status}</a></div>
<div><a href="articles.php?page=cacheinfo#difficulty"><img src='./resource2/{$opt.template.style}/images/difficulty/diff-{$cache.difficulty*5}.gif' border='0' width='19' height='16' hspace='2' onmouseover='Tip("{t 1=$cache.difficulty*0.5}Difficulty:&nbsp;%1&nbsp;of&nbsp;5{/t}", DELAY, 0, FADEIN, false, FADEOUT, false, BGCOLOR, "#fffedf", BORDERCOLOR, "grey")' onmouseout='UnTip()' /></a></div>
<div><a href="articles.php?page=cacheinfo#difficulty"><img src='./resource2/{$opt.template.style}/images/difficulty/terr-{$cache.terrain*5}.gif' border='0' width='19' height='16' hspace='2' onmouseover='Tip("{t 1=$cache.terrain*0.5}Terrain:&nbsp;%1&nbsp;of&nbsp;5{/t}", DELAY, 0, FADEIN, false, FADEOUT, false, BGCOLOR, "#fffedf", BORDERCOLOR, "grey")' onmouseout='UnTip()'/></a></div>
<div><a href="articles.php?page=cacheinfo#difficulty">{include file="res_difficon.tpl" difficulty=$cache.difficulty}</a></div>
<div><a href="articles.php?page=cacheinfo#difficulty">{include file="res_terricon.tpl" terrain=$cache.terrain}</a></div>
<div></div>
</div>

View File

@ -1,70 +0,0 @@
#!/usr/local/bin/php -q
<?php
/***************************************************************************
./util/geodb_serachindex/index.php
-------------------
begin : Sat September 24 2005
For license information see doc/license.txt
****************************************************************************/
/***************************************************************************
Unicode Reminder メモ
Ggf. muss die Location des php-Binaries angepasst werden.
Dieses Script erstellt den Suchindex für Ortsnamen aus den Daten der
Opengeodb.
***************************************************************************/
$rootpath = '../../';
require_once($rootpath . 'lib/clicompatbase.inc.php');
require_once($rootpath . 'lib/search.inc.php');
/* begin db connect */
db_connect();
if ($dblink === false)
{
echo 'Unable to connect to database';
exit;
}
/* end db connect */
/* begin search index rebuild */
sql('DELETE FROM geodb_search');
$rs = sql("SELECT `loc_id`, `text_val` FROM `geodb_textdata` WHERE `text_type`=500100000 AND text_locale IN ('da', 'de', 'en', 'fi', 'fr', 'it', 'nl', 'rm')");
while ($r = sql_fetch_array($rs))
{
$simpletexts = search_text2sort($r['text_val']);
$simpletextsarray = explode_multi($simpletexts, ' -/,');
foreach ($simpletextsarray AS $text)
{
if ($text != '')
{
if (nonalpha($text))
die($text . "\n");
$simpletext = search_text2simple($text);
sql("INSERT INTO `geodb_search` (`loc_id`, `sort`, `simple`, `simplehash`) VALUES ('&1', '&2', '&3', '&4')", $r['loc_id'], $text, $simpletext, sprintf("%u", crc32($simpletext)));
}
}
}
mysql_free_result($rs);
/* end search index rebuild */
function nonalpha($str)
{
for ($i = 0; $i < mb_strlen($str); $i++)
if (!((ord(mb_substr($str, $i, 1)) >= ord('a')) && (ord(mb_substr($str, $i, 1)) <= ord('z'))))
return true;
return false;
}
?>

View File

@ -0,0 +1,57 @@
#!/usr/local/bin/php -q
<?php
/***************************************************************************
For license information see doc/license.txt
Unicode Reminder メモ
Dieses Script erstellt den Suchindex für Ortsnamen aus den Daten der
Opengeodb. (Obsolet, dieser Suchindex wird nicht verwendet.)
***************************************************************************/
$opt['rootpath'] = '../../';
require_once($opt['rootpath'] . 'lib2/cli.inc.php');
require_once($opt['rootpath'] . 'lib2/search/search.inc.php');
sql('DELETE FROM geodb_search');
$rs = sql("
SELECT `loc_id`, `text_val`
FROM `geodb_textdata`
WHERE `text_type`=500100000
AND text_locale IN ('da', 'de', 'en', 'fi', 'fr', 'it', 'nl', 'rm')");
while ($r = sql_fetch_array($rs))
{
$simpletexts = search_text2sort($r['text_val']);
$simpletextsarray = explode_multi($simpletexts, ' -/,');
foreach ($simpletextsarray AS $text)
{
if ($text != '')
{
if (nonalpha($text))
die($text . "\n");
$simpletext = search_text2simple($text);
sql("INSERT INTO `geodb_search` (`loc_id`, `sort`, `simple`, `simplehash`)
VALUES ('&1', '&2', '&3', '&4')",
$r['loc_id'], $text, $simpletext, sprintf("%u", crc32($simpletext)));
}
}
}
mysql_free_result($rs);
function nonalpha($str)
{
for ($i = 0; $i < mb_strlen($str); $i++)
if (!((ord(mb_substr($str, $i, 1)) >= ord('a')) && (ord(mb_substr($str, $i, 1)) <= ord('z'))))
return true;
return false;
}
?>

View File

@ -1,14 +1,7 @@
#!/usr/local/bin/php -q
<?php
/***************************************************************************
./util/gns/gns_import.php
-------------------------
begin : Mon October 31 2005
For license information see doc/license.txt
****************************************************************************/
/***************************************************************************
Dieses Script liest Dateien von GEOnet Names Server (GNS) ein und importiert
diese in die Table gns_locations.
@ -20,39 +13,33 @@
http://earth-info.nga.mil/gns/html/cntyfile/sz.zip
***************************************************************************/
$rootpath = '../../';
require($rootpath . 'lib/clicompatbase.inc.php');
// ported from lib1 to lib2 / untested!
$opt['rootpath'] = '../../';
require($opt['rootpath'] . 'lib2/cli.inc.php');
/* defaults */
$importfiles = array("gm.txt", "au.txt", "sz.txt");
/* begin db connect */
db_connect();
if ($dblink === false)
{
echo 'Unable to connect to database';
exit;
}
/* end db connect */
sql("TRUNCATE TABLE gns_locations");
foreach($importfiles as $filename)
foreach ($importfiles as $filename)
importGns($filename, $dblink);
function importGns($filename, $dblink)
{
echo "Importing '$filename'...\n";
$file = fopen($filename, "r");
$cnt = 0;
while($line = fgets($file, 4096))
while ($line = fgets($file, 4096))
{
if($cnt++ == 0) // skip first line
if ($cnt++ == 0) // skip first line
continue;
$gns = mb_split("\t", $line);
$sql = "INSERT IGNORE INTO gns_locations SET
sql("INSERT IGNORE INTO gns_locations SET
rc = '" . sql_escape($gns[0]) . "',
ufi = '" . sql_escape($gns[1]) . "',
uni = '" . sql_escape($gns[2]) . "',
@ -77,12 +64,7 @@
SORT_NAME = _utf8'" . sql_escape($gns[21]) . "',
FULL_NAME = _utf8'" . sql_escape($gns[22]) . "',
FULL_NAME_ND = _utf8'" . sql_escape($gns[23]) . "',
MOD_DATE = '" . sql_escape($gns[24]) . "'";
if(!$resp = sql($sql, $dblink))
{
echo mysql_error($dblink); echo "\n";
}
MOD_DATE = '" . sql_escape($gns[24]) . "'");
}
fclose($file);
@ -93,4 +75,5 @@
sql("UPDATE gns_locations SET full_name='Zitaraves' WHERE uni=-2780984 LIMIT 1");
sql("UPDATE gns_locations SET full_name='Zvabek' WHERE uni=105075 LIMIT 1");
}
?>

View File

@ -1,50 +1,32 @@
#!/usr/local/bin/php -q
<?php
/***************************************************************************
./util/gns/mkadmtxt.php
-------------------
begin : Thu November 6 2005
For license information see doc/license.txt
****************************************************************************/
/***************************************************************************
Unicode Reminder メモ
Ggf. muss die Location des php-Binaries angepasst werden.
Dieses Script erstellt den Suchindex für Ortsnamen aus den Daten der
GNS-DB.
Dieses Script berechnet andhand von Geodb-Daten die adm1..adm4-Daten
für die GNS-DB.
***************************************************************************/
$rootpath = '../../';
require_once($rootpath . 'lib/clicompatbase.inc.php');
require_once($rootpath . 'lib/search.inc.php');
require_once($rootpath . 'lang/de/stdstyle/selectlocid.inc.php');
$opt['rootpath'] = '../../';
require_once($opt['rootpath'] . 'lib2/cli.inc.php');
require_once($opt['rootpath'] . 'lib2/search/search.inc.php');
require_once($opt['rootpath'] . 'lib2/logic/geomath.class.php');
require_once($opt['rootpath'] . 'lib2/logic/geodb.inc.php');
/* begin db connect */
db_connect();
if ($dblink === false)
{
echo 'Unable to connect to database';
exit;
}
/* end db connect */
/* begin search index rebuild */
$rsLocations = sql("SELECT `uni`, `lat`, `lon`, `rc`, `cc1`, `adm1` FROM `gns_locations` WHERE `dsg` LIKE 'PPL%'");
while ($rLocations = sql_fetch_array($rsLocations))
{
$minlat = getMinLat($rLocations['lon'], $rLocations['lat'], 10, 1);
$maxlat = getMaxLat($rLocations['lon'], $rLocations['lat'], 10, 1);
$minlon = getMinLon($rLocations['lon'], $rLocations['lat'], 10, 1);
$maxlon = getMaxLon($rLocations['lon'], $rLocations['lat'], 10, 1);
$minlat = geomath::getMinLat($rLocations['lon'], $rLocations['lat'], 10, 1);
$maxlat = geomath::getMaxLat($rLocations['lon'], $rLocations['lat'], 10, 1);
$minlon = geomath::getMinLon($rLocations['lon'], $rLocations['lat'], 10, 1);
$maxlon = geomath::getMaxLon($rLocations['lon'], $rLocations['lat'], 10, 1);
// den nächsgelegenen Ort in den geodb ermitteln
$sql = 'SELECT ' . getSqlDistanceFormula($rLocations['lon'], $rLocations['lat'], 10, 1, 'lon', 'lat', 'geodb_coordinates') . ' `distance`,
$sql = 'SELECT ' . geomath::getSqlDistanceFormula($rLocations['lon'], $rLocations['lat'], 10, 1, 'lon', 'lat', 'geodb_coordinates') . ' `distance`,
`geodb_coordinates`.`loc_id` `loc_id`
FROM `geodb_coordinates`
WHERE `lon` > ' . $minlon . ' AND
@ -63,7 +45,7 @@
$locid = $r['loc_id'];
$admtxt1 = landFromLocid($locid);
$admtxt1 = geodb_landFromLocid($locid);
if ($admtxt1 == '0') $admtxt1 = '';
// bundesland ermitteln
@ -79,10 +61,10 @@
else
$admtxt3 = '';
$admtxt3 = regierungsbezirkFromLocid($locid);
$admtxt3 = geodb_regierungsbezirkFromLocid($locid);
if ($admtxt3 == '0') $admtxt3 = '';
$admtxt4 = landkreisFromLocid($locid);
$admtxt4 = geodb_landkreisFromLocid($locid);
if ($admtxt4 == '0') $admtxt4 = '';
sql("UPDATE `gns_locations` SET `admtxt1`='&1', `admtxt2`='&2', `admtxt3`='&3', `admtxt4`='&4' WHERE uni='&5'", $admtxt1, $admtxt2, $admtxt3, $admtxt4, $rLocations['uni']);
@ -95,5 +77,4 @@
}
mysql_free_result($rsLocations);
/* end search index rebuild */
?>

View File

@ -1,38 +1,19 @@
#!/usr/local/bin/php -q
<?php
/***************************************************************************
./util/gns/mksearchindex.php
-------------------
begin : Thu November 1 2005
For license information see doc/license.txt
****************************************************************************/
/***************************************************************************
Unicode Reminder メモ
Ggf. muss die Location des php-Binaries angepasst werden.
Dieses Script erstellt den Suchindex für Ortsnamen aus den Daten der
GNS-DB.
***************************************************************************/
$rootpath = '../../';
require_once($rootpath . 'lib/clicompatbase.inc.php');
require_once($rootpath . 'lib/search.inc.php');
$opt['rootpath'] = '../../';
require_once($opt['rootpath'] . 'lib2/cli.inc.php');
require_once($opt['rootpath'] . 'lib2/search/search.inc.php');
/* begin db connect */
db_connect();
if ($dblink === false)
{
echo 'Unable to connect to database';
exit;
}
/* end db connect */
/* begin search index rebuild */
$doubleindex['sankt'] = 'st';
@ -62,14 +43,14 @@
}
mysql_free_result($rs);
/* end search index rebuild */
function nonalpha($str)
{
for ($i = 0; $i < mb_strlen($str); $i++)
if (!((ord(mb_substr($str, $i, 1)) >= ord('a')) && (ord(mb_substr($str, $i, 1)) <= ord('z'))))
return true;
function nonalpha($str)
{
for ($i = 0; $i < mb_strlen($str); $i++)
if (!((ord(mb_substr($str, $i, 1)) >= ord('a')) && (ord(mb_substr($str, $i, 1)) <= ord('z'))))
return true;
return false;
}
return false;
}
?>

View File

@ -17,10 +17,10 @@
$opt['rootpath'] = '../';
require_once($opt['rootpath'] . 'lib/common.inc.php');
require_once($opt['rootpath'] . 'lib/charset.inc.php');
require_once($opt['rootpath'] . 'lib2/charset.inc.php');
require_once($opt['rootpath'] . 'lib2/const.inc.php');
require_once($opt['rootpath'] . 'lib/data-license.inc.php');
require_once($opt['rootpath'] . 'lib/npas.inc.php');
require_once($opt['rootpath'] . 'lib2/data-license.inc.php');
require_once($opt['rootpath'] . 'lib2/logic/npas.inc.php');
if ($error == true)
{
@ -828,8 +828,6 @@ function startXmlSession($sModifiedSince, $bCache, $bCachedesc, $bCachelog, $bUs
}
else if ($selection['type'] == 2)
{
require_once($opt['rootpath'] . 'lib/search.inc.php');
$sql = 'CREATE TEMPORARY TABLE `tmpxmlSesssionCaches` (`cache_id` int(11), `distance` double, KEY (`cache_id`)) ENGINE=MEMORY ';
$sql .= 'SELECT `cache_coordinates`.`cache_id`, ';
$sql .= getSqlDistanceFormula($selection['lon'], $selection['lat'], $selection['distance'], 1, 'longitude', 'latitude', 'cache_coordinates') . ' `distance` ';