Merge branch 'master' into stable
1
.gitignore
vendored
@ -3,6 +3,7 @@
|
||||
|
||||
# settings files
|
||||
/htdocs/config2/settings.inc.php
|
||||
/htdocs/config2/sqlroot.inc.php
|
||||
/htdocs/lib/settings.inc.php
|
||||
/htdocs/statpics/.htaccess
|
||||
/htdocs/util/mysql_root/settings.inc.php
|
||||
|
@ -54,10 +54,11 @@ on master:
|
||||
|
||||
Related Websites
|
||||
----------------
|
||||
* [Opencaching.de Team Blog](http://blog.opencaching.de/) (German)
|
||||
* [Opencaching.de development todo list](http://redmine.opencaching.de/projects/oc-dev)
|
||||
* [Opencaching.de Git tutorial](http://wiki.opencaching.de/index.php/Entwicklung/Git) (German)
|
||||
* [Opencaching.de Wiki](http://wiki.opencaching.de/index.php/Hauptseite) (German) -> [Development](http://wiki.opencaching.de/index.php/Entwicklung)
|
||||
* [Opencaching.de Team Blog](http://blog.opencaching.de/) (German)
|
||||
* [Opencaching Network Forum](http://forum.opencaching-network.org/) (German and English) -> [Development](http://forum.opencaching-network.org/index.php?board=43.0)
|
||||
* [Opencaching API project](http://code.google.com/p/opencaching-api/)
|
||||
* [Opencaching.pl project](http://code.google.com/p/opencaching-pl/)
|
||||
* [Git explained](http://gitref.org/index.html)
|
||||
* [Detailed Opencaching.de Git tutorial](http://wiki.opencaching.de/index.php/Entwicklung/Git) (German)
|
||||
|
@ -18,7 +18,7 @@
|
||||
$opt['rootpath'] = dirname(__FILE__) . '/../htdocs/';
|
||||
require_once($opt['rootpath'] . 'lib2/cli.inc.php');
|
||||
|
||||
if (!field_exists('cache_attrib','gc_id'))
|
||||
if (!sql_field_exists('cache_attrib','gc_id'))
|
||||
die("\n
|
||||
ERROR: Database structure too old. You must first do a manual update
|
||||
up to commit 467aae4 (March 27, 2013) to enable automatic updates.
|
||||
@ -44,52 +44,28 @@
|
||||
} while ($db_version > 0);
|
||||
|
||||
|
||||
// test if a certain database field exists
|
||||
function field_exists($table, $field)
|
||||
{
|
||||
global $opt;
|
||||
|
||||
return sql_value("SELECT COUNT(*)
|
||||
FROM `information_schema`.`columns`
|
||||
WHERE `table_schema`='&1' AND `table_name`='&2' AND `column_name`='&3'",
|
||||
0, $opt['db']['placeholder']['db'], $table, $field) > 0;
|
||||
}
|
||||
|
||||
// get type of a database field
|
||||
function field_type($table, $field)
|
||||
{
|
||||
global $opt;
|
||||
|
||||
return strtoupper(
|
||||
sql_value("SELECT `data_type`
|
||||
FROM `information_schema`.`columns`
|
||||
WHERE `table_schema`='&1' AND `table_name`='&2' AND `column_name`='&3'",
|
||||
'', $opt['db']['placeholder']['db'], $table, $field) );
|
||||
}
|
||||
|
||||
|
||||
// Database mutations
|
||||
// - must be consecutively numbered
|
||||
// - should behave well if run multiple times
|
||||
|
||||
function dbv_100() // expands log date to datetime, to enable time logging
|
||||
{
|
||||
if (field_type('cache_logs','date') != 'DATETIME')
|
||||
if (sql_field_type('cache_logs','date') != 'DATETIME')
|
||||
sql("ALTER TABLE `cache_logs` CHANGE COLUMN `date` `date` DATETIME NOT NULL");
|
||||
if (field_type('cache_logs_archived','date') != 'DATETIME')
|
||||
if (sql_field_type('cache_logs_archived','date') != 'DATETIME')
|
||||
sql("ALTER TABLE `cache_logs_archived` CHANGE COLUMN `date` `date` DATETIME NOT NULL");
|
||||
}
|
||||
|
||||
function dbv_101() // add fields for fixing OKAPI issue #232
|
||||
{
|
||||
if (!field_exists('caches','meta_last_modified'))
|
||||
if (!sql_field_exists('caches','meta_last_modified'))
|
||||
{
|
||||
// initialize with '0000-00-00 00:00:00' for existing data, that's ok
|
||||
sql("ALTER TABLE `caches` ADD COLUMN `meta_last_modified` DATETIME NOT NULL COMMENT 'via Trigger (cache_logs)' AFTER `listing_last_modified`");
|
||||
}
|
||||
if (!field_exists('cache_logs','log_last_modified'))
|
||||
if (!sql_field_exists('cache_logs','log_last_modified'))
|
||||
{
|
||||
if (field_exists('cache_logs','okapi_syncbase'))
|
||||
if (sql_field_exists('cache_logs','okapi_syncbase'))
|
||||
$after = 'okapi_syncbase';
|
||||
else
|
||||
$after = 'last_modified';
|
||||
@ -99,9 +75,9 @@
|
||||
IFNULL((SELECT MAX(`last_modified`) FROM `pictures` WHERE `pictures`.`object_type`=1 AND `pictures`.`object_id` = `cache_logs`.`id`),'0')
|
||||
)");
|
||||
}
|
||||
if (!field_exists('cache_logs_archived','log_last_modified'))
|
||||
if (!sql_field_exists('cache_logs_archived','log_last_modified'))
|
||||
{
|
||||
if (field_exists('cache_logs_archived','okapi_syncbase'))
|
||||
if (sql_field_exists('cache_logs_archived','okapi_syncbase'))
|
||||
$after = 'okapi_syncbase';
|
||||
else
|
||||
$after = 'last_modified';
|
||||
@ -117,4 +93,84 @@
|
||||
sql("CALL sp_refreshall_statpic()");
|
||||
}
|
||||
|
||||
function dbv_103() // update comments on static tables
|
||||
{
|
||||
if (sql_table_exists('geodb_areas')) sql("ALTER TABLE `geodb_areas` COMMENT = 'not in use'");
|
||||
if (sql_table_exists('geodb_changelog')) sql("ALTER TABLE `geodb_changelog` COMMENT = 'not in use'");
|
||||
if (sql_table_exists('geodb_coordinates')) sql("ALTER TABLE `geodb_coordinates` COMMENT = 'static content'");
|
||||
if (sql_table_exists('geodb_floatdata')) sql("ALTER TABLE `geodb_floatdata` COMMENT = 'not in use'");
|
||||
if (sql_table_exists('geodb_hierarchies')) sql("ALTER TABLE `geodb_hierarchies` COMMENT = 'static content'");
|
||||
if (sql_table_exists('geodb_intdata')) sql("ALTER TABLE `geodb_intdata` COMMENT = 'not in use'");
|
||||
if (sql_table_exists('geodb_locations')) sql("ALTER TABLE `geodb_locations` COMMENT = 'static content'");
|
||||
if (sql_table_exists('geodb_polygons')) sql("ALTER TABLE `geodb_polygons` COMMENT = 'not in use'");
|
||||
if (sql_table_exists('geodb_search')) sql("ALTER TABLE `geodb_search` COMMENT = 'static content, not in use'");
|
||||
if (sql_table_exists('geodb_textdata')) sql("ALTER TABLE `geodb_textdata` COMMENT = 'static content'");
|
||||
if (sql_table_exists('geodb_type_names')) sql("ALTER TABLE `geodb_type_names` COMMENT = 'not in use'");
|
||||
if (sql_table_exists('pw_dict')) sql("ALTER TABLE `pw_dict` COMMENT = 'static content'");
|
||||
sql("ALTER TABLE `npa_areas` COMMENT = 'static content'");
|
||||
sql("ALTER TABLE `npa_types` COMMENT = 'static content'");
|
||||
sql("ALTER TABLE `nuts_codes` COMMENT = 'static content'");
|
||||
sql("ALTER TABLE `nuts_layer` COMMENT = 'static content'");
|
||||
}
|
||||
|
||||
function dbv_104() // added maintenance logs and OC team comments
|
||||
{
|
||||
sql("ALTER TABLE `log_types_text` COMMENT = 'obsolete'");
|
||||
sql("ALTER TABLE `cache_logtype` COMMENT = 'obsolete'");
|
||||
sql("ALTER TABLE `log_types` CHANGE COLUMN `cache_status` `cache_status` tinyint(1) NOT NULL default '0'");
|
||||
sql("ALTER TABLE `log_types` CHANGE COLUMN `en` `en` varchar(60) NOT NULL");
|
||||
if (!sql_field_exists('stat_caches','maintenance'))
|
||||
sql("ALTER TABLE `stat_caches` ADD COLUMN `maintenance` smallint(5) unsigned NOT NULL AFTER `will_attend`");
|
||||
if (!sql_field_exists('stat_cache_logs','maintenance'))
|
||||
sql("ALTER TABLE `stat_cache_logs` ADD COLUMN `maintenance` smallint(5) unsigned NOT NULL AFTER `will_attend`");
|
||||
if (!sql_field_exists('stat_user','maintenance'))
|
||||
sql("ALTER TABLE `stat_user` ADD COLUMN `maintenance` smallint(5) unsigned NOT NULL AFTER `will_attend`");
|
||||
if (!sql_field_exists('cache_logs','oc_team_comment'))
|
||||
sql("ALTER TABLE `cache_logs` ADD COLUMN `oc_team_comment` tinyint(1) NOT NULL default '0' AFTER `type`");
|
||||
if (!sql_field_exists('cache_logs_archived','oc_team_comment'))
|
||||
sql("ALTER TABLE `cache_logs_archived` ADD COLUMN `oc_team_comment` tinyint(1) NOT NULL default '0' AFTER `type`");
|
||||
// The new fields need not to be initialized, as these are new features and all
|
||||
// values are initally zero.
|
||||
}
|
||||
|
||||
function dbv_105() // HTML user profile texts
|
||||
{
|
||||
if (!sql_field_exists('user','desc_htmledit'))
|
||||
sql("ALTER TABLE `user` ADD COLUMN `desc_htmledit` tinyint(1) unsigned NOT NULL DEFAULT '1' AFTER `data_license`");
|
||||
if (!sql_field_exists('user','description'))
|
||||
{
|
||||
sql("ALTER TABLE `user` ADD COLUMN `description` mediumtext NOT NULL AFTER `data_license`");
|
||||
$rs = sql("SELECT `user`.`user_id`,`user_options`.`option_value` FROM `user`,`user_options` WHERE `user_options`.`user_id`=`user`.`user_id` AND `user_options`.`option_id`=3");
|
||||
while ($r = sql_fetch_array($rs))
|
||||
{
|
||||
$text = nl2br(htmlspecialchars($r['option_value'], ENT_COMPAT, 'UTF-8'));
|
||||
sql("UPDATE `user` SET `description`='&2' WHERE `user_id`='&1'", $r['user_id'], $text);
|
||||
}
|
||||
sql_free_result($rs);
|
||||
// we keep the old entries in user_options for the case something went wrong here.
|
||||
}
|
||||
}
|
||||
|
||||
function dbv_106() // Cache status logging
|
||||
{
|
||||
if (!sql_table_exists('cache_status_modified'))
|
||||
sql(
|
||||
"CREATE TABLE `cache_status_modified` (
|
||||
`cache_id` int(10) unsigned NOT NULL,
|
||||
`date_modified` datetime NOT NULL,
|
||||
`old_state` tinyint(2) unsigned NOT NULL,
|
||||
`new_state` tinyint(2) unsigned NOT NULL,
|
||||
`user_id` int(10) unsigned NOT NULL default '0',
|
||||
UNIQUE KEY `cache_id` (`cache_id`,`date_modified`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8");
|
||||
}
|
||||
|
||||
function dbv_107() // sync of table definitions, developer and production system
|
||||
{
|
||||
sql("ALTER TABLE `caches` MODIFY `meta_last_modified` datetime NOT NULL COMMENT 'via Trigger (stat_caches, gk_item_waypoint)'");
|
||||
sql("ALTER TABLE `countries` MODIFY `en` varchar(128) NOT NULL");
|
||||
if (!sql_index_exists('cache_reports', 'userid'))
|
||||
sql("ALTER TABLE `cache_reports` ADD INDEX `userid` (`userid`)");
|
||||
}
|
||||
|
||||
?>
|
@ -25,11 +25,26 @@
|
||||
chdir ($rootpath . 'doc/sql/stored-proc');
|
||||
system('php maintain.php');
|
||||
|
||||
echo "updating OKAPI database\n";
|
||||
chdir ($rootpath . '../bin');
|
||||
system('php okapi-update.php | grep -i -e mutation');
|
||||
// We do *two* tests for OKAPI presence to get some robustness agains internal OKAPI changes.
|
||||
//
|
||||
// This should be replaced by a facade function call, but current OKAPI implementation
|
||||
// does not work well when called from the command line, due to exception handling problems
|
||||
// (see http://code.google.com/p/opencaching-api/issues/detail?id=243).
|
||||
$okapi_vars = sql_table_exists('okapi_vars');
|
||||
$okapi_syncbase = sql_field_exists('caches','okapi_syncbase');
|
||||
if ($okapi_vars != $okapi_syncbase)
|
||||
{
|
||||
echo "!! unknown OKAPI configuration; either dbupdate.php needs an update or your database configuration is wrong\n";
|
||||
}
|
||||
else if ($okapi_vars)
|
||||
{
|
||||
echo "updating OKAPI database\n";
|
||||
chdir ($rootpath . '../bin');
|
||||
system('php okapi-update.php | grep -i -e mutation');
|
||||
}
|
||||
|
||||
echo "resetting webcache:\n";
|
||||
chdir ($rootpath . '../bin');
|
||||
system('php clear-webcache.php');
|
||||
|
||||
?>
|
@ -22,6 +22,12 @@
|
||||
$GLOBALS['rootpath'] = dirname(__FILE__) . '/../htdocs/';
|
||||
require_once($GLOBALS['rootpath']."okapi/facade.php");
|
||||
okapi\Facade::database_update();
|
||||
// This may not work properly if an OKAPI update mutation function relies
|
||||
// on catching exceptions. The cryptic error message
|
||||
// "exception thrown without a stack frame in Unknown on line 0"
|
||||
// may appear (see http://code.google.com/p/opencaching-api/issues/detail?id=243).
|
||||
// Then, you must call OKAPI update manually via
|
||||
// http://site-address/okapi/update
|
||||
}
|
||||
|
||||
?>
|
@ -171,9 +171,11 @@ List of third party components:
|
||||
License : Creative Commons BY 3.0
|
||||
Author : Yusuke Kamiyamane
|
||||
|
||||
27. gears icon
|
||||
27. gears and gps-device icons
|
||||
Path : htdocs/resource2/ocstyle/images/misc/
|
||||
htdocs/resource2/ocstyle/images/viewcache/
|
||||
URI : http://www.softicons.com/free-icons/toolbar-icons/fatcow-hosting-icons-by-fatcow/gear-in-icon
|
||||
http://www.softicons.com/free-icons/web-icons/fatcow-hosting-additional-icons-by-fatcow/gps-handheld-icon
|
||||
License : Creative Commons BY 3.0
|
||||
Author : FatCow
|
||||
|
||||
|
41
htdocs/adminhistory.php
Normal file
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/***************************************************************************
|
||||
* For license information see doc/license.txt
|
||||
*
|
||||
* Unicode Reminder メモ
|
||||
***************************************************************************/
|
||||
|
||||
require('./lib2/web.inc.php');
|
||||
require_once('./lib2/logic/cache.class.php');
|
||||
|
||||
$tpl->name = 'adminhistory';
|
||||
$tpl->menuitem = MNU_ADMIN_HISTORY;
|
||||
|
||||
$login->verify();
|
||||
if ($login->userid == 0)
|
||||
$tpl->redirect_login();
|
||||
|
||||
if (($login->admin & ADMIN_USER) != ADMIN_USER)
|
||||
$tpl->error(ERROR_NO_ACCESS);
|
||||
|
||||
if (isset($_REQUEST['wp']))
|
||||
$cache_id = sql_value("SELECT `cache_id` FROM `caches` WHERE `wp_oc`='&1'", 0, $_REQUEST['wp']);
|
||||
else
|
||||
$cache_id = isset($_REQUEST['cacheid']) ? $_REQUEST['cacheid']+0 : -1;
|
||||
|
||||
$showhistory = false;
|
||||
$error = '';
|
||||
|
||||
if ($cache_id>=0 && sql_value("SELECT COUNT(*) FROM `caches` WHERE `cache_id`='&1'", 0, $cache_id) <> 1)
|
||||
$error = $translate->t('Cache not found', '', '', 0);
|
||||
else if ($cache_id > 0)
|
||||
{
|
||||
$showhistory = true;
|
||||
$cache = new Cache($cache_id);
|
||||
$cache->setTplHistoryData(0);
|
||||
}
|
||||
|
||||
$tpl->assign('showhistory', $showhistory);
|
||||
$tpl->assign('error', $error);
|
||||
$tpl->display();
|
||||
?>
|
@ -43,36 +43,6 @@
|
||||
{
|
||||
$tpl->redirect('mailto.php?userid=' . urlencode($reporterid));
|
||||
}
|
||||
elseif ((isset($_REQUEST['statusActive']) ||
|
||||
isset($_REQUEST['statusTNA']) ||
|
||||
isset($_REQUEST['statusArchived']) ||
|
||||
isset($_REQUEST['statusLockedVisible']) ||
|
||||
isset($_REQUEST['statusLockedInvisible']))
|
||||
&& $adminid == $login->userid)
|
||||
{
|
||||
$cache = new cache($cacheid);
|
||||
|
||||
if ($cache->exist() == false)
|
||||
$tpl->error(ERROR_CACHE_NOT_EXISTS);
|
||||
|
||||
if ($cache->allowView() == false)
|
||||
$tpl->error(ERROR_NO_ACCESS);
|
||||
|
||||
if (isset($_REQUEST['statusActive']))
|
||||
$cache->setStatus(1);
|
||||
else if (isset($_REQUEST['statusTNA']))
|
||||
$cache->setStatus(2);
|
||||
else if (isset($_REQUEST['statusArchived']))
|
||||
$cache->setStatus(3);
|
||||
else if (isset($_REQUEST['statusLockedVisible']))
|
||||
$cache->setStatus(6);
|
||||
else if (isset($_REQUEST['statusLockedInvisible']))
|
||||
$cache->setStatus(7);
|
||||
|
||||
$cache->save();
|
||||
|
||||
$tpl->redirect('adminreports.php?id=' . urlencode($rid));
|
||||
}
|
||||
elseif (isset($_REQUEST['done']) && $adminid == $login->userid)
|
||||
{
|
||||
sql("UPDATE `cache_reports` SET `status`=3 WHERE `id`=&1", $rid);
|
||||
@ -148,7 +118,9 @@
|
||||
`u1`.`username` AS `usernick`,
|
||||
IFNULL(`cr`.`adminid`, 0) AS `adminid`,
|
||||
IFNULL(`u2`.`username`, '') AS `adminnick`,
|
||||
IFNULL(`tt2`.`text`, `crr`.`name`) AS `reason`, `cr`.`note`, IFNULL(tt.text, crs.name) AS `status`,
|
||||
IFNULL(`tt2`.`text`, `crr`.`name`) AS `reason`,
|
||||
`cr`.`note`,
|
||||
IFNULL(tt.text, crs.name) AS `status`,
|
||||
`cr`.`date_created`, `cr`.`lastmodified`,
|
||||
`c`.`name` AS `cachename`,
|
||||
`c`.`user_id` AS `ownerid`
|
||||
@ -188,6 +160,9 @@
|
||||
$tpl->assign('list', false);
|
||||
$tpl->assign('otheradmin',$record['adminid']>0 && $record['adminid'] != $login->userid);
|
||||
$tpl->assign('ownreport',$record['adminid'] == $login->userid);
|
||||
|
||||
$cache = new cache($record['cacheid']);
|
||||
$cache->setTplHistoryData($id);
|
||||
}
|
||||
|
||||
$tpl->assign('error', $error);
|
||||
|
@ -16,7 +16,7 @@
|
||||
$tpl->redirect('login.php?target=change_statpic.php');
|
||||
|
||||
if (isset($_REQUEST['cancel']))
|
||||
$tpl->redirect('myprofile.php');
|
||||
$tpl->redirect('mystatpic.php');
|
||||
|
||||
$sp = new statpic($login->userid);
|
||||
|
||||
@ -39,7 +39,7 @@
|
||||
if (!$bError)
|
||||
{
|
||||
$sp->save();
|
||||
$tpl->redirect('myprofile.php');
|
||||
$tpl->redirect('mystatpic.php');
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -68,6 +68,7 @@
|
||||
// see settings-dist.inc.php for known node IDs
|
||||
$opt['logic']['node']['id'] = 4;
|
||||
$opt['logic']['waypoint_pool']['prefix'] = 'OC';
|
||||
$opt['logic']['shortlink_domain'] = 'opencaching.de';
|
||||
|
||||
/* cachemaps
|
||||
*/
|
||||
@ -87,6 +88,12 @@
|
||||
$opt['logic']['pictures']['url'] = $opt['page']['absolute_url'] . 'images/uploads';
|
||||
$opt['logic']['pictures']['thumb_url'] = $opt['logic']['pictures']['url'] . '/thumbs';
|
||||
|
||||
/* disable cronjobs which are not needed on devel site
|
||||
*/
|
||||
|
||||
$opt['cron']['sitemaps']['generate'] = false;
|
||||
$opt['cron']['geokrety']['run'] = false;
|
||||
|
||||
/* E-Mail for notification about news (newstopic.php)
|
||||
*/
|
||||
$opt['news']['mail'] = 'root';
|
||||
@ -108,7 +115,6 @@
|
||||
$opt['bin']['cs2cs'] = '/var/www/bin/cs2cs';
|
||||
|
||||
// other settings
|
||||
$opt['logic']['enableHTMLInUserDescription'] = false;
|
||||
$opt['page']['showdonations'] = true;
|
||||
$opt['logic']['pictures']['dummy']['replacepic'] = $dev_basepath . $dev_codepath . 'htdocs/images/no_image_license.png';
|
||||
|
||||
|
@ -305,7 +305,14 @@
|
||||
*/
|
||||
$opt['logic']['cachemaps']['url'] = 'http://maps.google.com/maps/api/staticmap?center={latitude},{longitude}&zoom={userzoom}&size=200x200&maptype=hybrid&markers=color:blue|label:|{latitude},{longitude}&sensor=false&key={gmkey}';
|
||||
$opt['logic']['cachemaps']['iframe'] = false;
|
||||
|
||||
|
||||
/* Minimap for the new-caches list on the front page.
|
||||
* If the url string is empty, no minimap is displayed on the front page.
|
||||
*
|
||||
* Coordinates of new caches are appended to the url.
|
||||
*/
|
||||
$opt['logic']['minimapurl'] = 'http://maps.googleapis.com/maps/api/staticmap?sensor=false&key={gmkey}&size=220x220&maptype=roadmap&markers=color:blue|size:small';
|
||||
|
||||
/* target vars
|
||||
* all _REQUEST-vars that identifiy the current page for target redirection after login
|
||||
*/
|
||||
@ -321,11 +328,6 @@
|
||||
*/
|
||||
$opt['logic']['password_hash'] = false;
|
||||
|
||||
/* If the user entered HTML in his description do we
|
||||
* display it as HTML or escape it and make it non-functional?
|
||||
*/
|
||||
$opt['logic']['enableHTMLInUserDescription'] = true;
|
||||
|
||||
/* new lows style
|
||||
*/
|
||||
$opt['logic']['new_logs_per_country'] = true;
|
||||
@ -339,6 +341,7 @@
|
||||
/* opencaching prefixes in database available to search for
|
||||
*/
|
||||
$opt['logic']['ocprefixes'] = 'oc';
|
||||
$opt['logic']['shortlink_domain'] = false;
|
||||
|
||||
/* pregenerated waypoint list for new caches
|
||||
* - Waypoint prefix (OC, OP, OZ ... AA=local development)
|
||||
@ -370,6 +373,12 @@
|
||||
$opt['logic']['license']['terms'] = 'articles.php?page=impressum#datalicense';
|
||||
// 'disclaimer' and 'terms' also in lib/settings.inc.php
|
||||
|
||||
/* admin functions
|
||||
*/
|
||||
// admin may use OC-team-comment log flag only when processing a cache report
|
||||
// see also setting in lib/settings.inc.php!
|
||||
$opt['logic']['admin']['team_comments_only_for_reports'] = true;
|
||||
|
||||
/* Database charset
|
||||
* frontend and php charsets are UTF-8
|
||||
* here you can set a different charset for the MySQL-Engine
|
||||
@ -416,6 +425,11 @@
|
||||
$opt['cron']['sitemaps']['generate'] = true;
|
||||
$opt['cron']['sitemaps']['submit'] = false;
|
||||
|
||||
/* Geokret cronjob
|
||||
*/
|
||||
|
||||
$opt['cron']['geokrety']['run'] = true;
|
||||
|
||||
/* E-Mail settings
|
||||
*
|
||||
*/
|
||||
|
@ -67,3 +67,5 @@ date commit ID change
|
||||
2013-04-22 c989c00 added fields caches.meta_last_modified, cache_logs.log_last_modified,
|
||||
cache_logs_archived.log_last_modified, and triggers
|
||||
2013-04-28 updated triggers to calculate hidden stats
|
||||
|
||||
(discontinued; see bin/dbsv-version.txt for further changes)
|
||||
|
83
htdocs/doc/sql/static-data/static-data.txt
Normal file
@ -0,0 +1,83 @@
|
||||
Unicode Reminder: メモ
|
||||
|
||||
The following static data is used by the OC code. Only some of this data is
|
||||
included in the Git repo distribution, but it is all included in Opencaching.de
|
||||
developer VMs and databases (see http://wiki.opencaching.de/index.php/Entwicklung/Entwicklersystem).
|
||||
|
||||
|
||||
Tables: geodb_coordinates
|
||||
geodb_hierarchies
|
||||
geodb_locations
|
||||
geodb_textdata
|
||||
Content: political geographic data
|
||||
Purpose: searching for caches by city (Ortschaften)
|
||||
Used by: lang/de/ocstyle/selectlocid.inc.php
|
||||
lib2/logic/geodb.inc.php (not in use)
|
||||
search.php
|
||||
util/gns/mkadmtxt.php
|
||||
Source: OpenGeoDb ?
|
||||
Import: ?
|
||||
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.
|
||||
|
||||
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
|
||||
|
||||
There are more geodb_ tables present in OC developer and production systems,
|
||||
which are undocumented, mostly empty and not in use anywhere.
|
||||
Probably some unfinished experiment.
|
||||
(see bin/dbsv-update.php, mutation #103)
|
||||
|
||||
|
||||
Tables: gns_locations
|
||||
gns_search
|
||||
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
|
||||
License: Public Domain
|
||||
|
||||
|
||||
Tables: npa_areas
|
||||
npa_types
|
||||
Content: German nature protection areas, as of 2009
|
||||
Purpose: display NPA information for cache listings
|
||||
Used by: util2/cron/modules/cache_npa_areas.class.php
|
||||
Source: Bundesamt für Naturschutz
|
||||
Import: ?
|
||||
License: probably free to use with attribution
|
||||
Docs: http://wiki.opencaching.de/index.php/Schutzgebiete
|
||||
|
||||
|
||||
Tables: nuts_codes
|
||||
nuts_layers
|
||||
Content: NUTS data for adm1..adm4 levels
|
||||
Purpose: assigning country, state, district, city to cache listings
|
||||
Used by: util2/cron/modules/cache_location.class.php
|
||||
Source: ?
|
||||
Import: ?
|
||||
License: probably Public Domain
|
||||
|
||||
|
||||
Tabels: pw_dict
|
||||
Content: list of common passwords
|
||||
Purpose: password security tests
|
||||
Used by: lib2/logic/cracklib.inc.php
|
||||
Source: http://pecl.php.net/package/crack -> doc/sql/static-data/pw_dict.bz2
|
||||
Import: doc/sql/static-data/pwlist.php
|
||||
License: PHP License
|
||||
|
||||
|
||||
Tables: miscellaneous, see header of data.sql
|
||||
Content: all other static data
|
||||
Purpose: misc
|
||||
Source: doc/sql/static-data/data.sql
|
||||
Import: SQL import, or bin/dbupdate.php
|
||||
License: see doc/license.txt
|
@ -278,6 +278,7 @@
|
||||
DECLARE nNotFound INT DEFAULT 0;
|
||||
DECLARE nNote INT DEFAULT 0;
|
||||
DECLARE nWillAttend INT DEFAULT 0;
|
||||
DECLARE nMaintenance INT DEFAULT 0;
|
||||
DECLARE nDate DATE DEFAULT NULL;
|
||||
|
||||
IF nLogType = 1 THEN SET nFound=1; END IF;
|
||||
@ -285,22 +286,24 @@
|
||||
IF nLogType = 3 THEN SET nNote=1; END IF;
|
||||
IF nLogType = 7 THEN SET nFound=1; END IF;
|
||||
IF nLogType = 8 THEN SET nWillAttend=1; END IF;
|
||||
IF nLogType IN (9,10,11,13,14) THEN SET nMaintenance=1; END IF;
|
||||
|
||||
IF bLogRemoved = TRUE THEN
|
||||
SET nFound = -nFound;
|
||||
SET nNotFound = -nNotFound;
|
||||
SET nNote = -nNote;
|
||||
SET nWillAttend = -nWillAttend;
|
||||
SET nMaintenance = -nMaintenance;
|
||||
END IF;
|
||||
|
||||
UPDATE `stat_cache_logs` SET `found`=IF(`found`+nFound>0, `found`+nFound, 0), `notfound`=IF(`notfound`+nNotFound>0, `notfound`+nNotFound, 0), `note`=IF(`note`+nNote>0, `note`+nNote, 0), `will_attend`=IF(`will_attend`+nWillAttend>0, `will_attend`+nWillAttend, 0) WHERE `cache_id`=nCacheId AND `user_id`=nUserId;
|
||||
UPDATE `stat_cache_logs` SET `found`=IF(`found`+nFound>0, `found`+nFound, 0), `notfound`=IF(`notfound`+nNotFound>0, `notfound`+nNotFound, 0), `note`=IF(`note`+nNote>0, `note`+nNote, 0), `will_attend`=IF(`will_attend`+nWillAttend>0, `will_attend`+nWillAttend, 0), `maintenance`=IF(`maintenance`+nMaintenance>0, `maintenance`+nMaintenance, 0) WHERE `cache_id`=nCacheId AND `user_id`=nUserId;
|
||||
IF ROW_COUNT() = 0 THEN
|
||||
INSERT IGNORE INTO `stat_cache_logs` (`cache_id`, `user_id`, `found`, `notfound`, `note`, `will_attend`) VALUES (nCacheId, nUserId, IF(nFound>0, nFound, 0), IF(nNotFound>0, nNotFound, 0), IF(nNote>0, nNote, 0), IF(nWillAttend>0, nWillAttend, 0));
|
||||
INSERT IGNORE INTO `stat_cache_logs` (`cache_id`, `user_id`, `found`, `notfound`, `note`, `will_attend`, `maintenance`) VALUES (nCacheId, nUserId, IF(nFound>0, nFound, 0), IF(nNotFound>0, nNotFound, 0), IF(nNote>0, nNote, 0), IF(nWillAttend>0, nWillAttend, 0), IF(nMaintenance>0, nMaintenance, 0));
|
||||
END IF;
|
||||
|
||||
UPDATE `stat_caches` SET `found`=IF(`found`+nFound>0, `found`+nFound, 0), `notfound`=IF(`notfound`+nNotFound>0, `notfound`+nNotFound, 0), `note`=IF(`note`+nNote>0, `note`+nNote, 0), `will_attend`=IF(`will_attend`+nWillAttend>0, `will_attend`+nWillAttend, 0) WHERE `cache_id`=nCacheId;
|
||||
UPDATE `stat_caches` SET `found`=IF(`found`+nFound>0, `found`+nFound, 0), `notfound`=IF(`notfound`+nNotFound>0, `notfound`+nNotFound, 0), `note`=IF(`note`+nNote>0, `note`+nNote, 0), `will_attend`=IF(`will_attend`+nWillAttend>0, `will_attend`+nWillAttend, 0), `maintenance`=IF(`maintenance`+nMaintenance>0, `maintenance`+nMaintenance, 0) WHERE `cache_id`=nCacheId;
|
||||
IF ROW_COUNT() = 0 THEN
|
||||
INSERT IGNORE INTO `stat_caches` (`cache_id`, `found`, `notfound`, `note`, `will_attend`) VALUES (nCacheId, IF(nFound>0, nFound, 0), IF(nNotFound>0, nNotFound, 0), IF(nNote>0, nNote, 0), IF(nWillAttend>0, nWillAttend, 0));
|
||||
INSERT IGNORE INTO `stat_caches` (`cache_id`, `found`, `notfound`, `note`, `will_attend`, `maintenance`) VALUES (nCacheId, IF(nFound>0, nFound, 0), IF(nNotFound>0, nNotFound, 0), IF(nNote>0, nNote, 0), IF(nWillAttend>0, nWillAttend, 0), IF(nMaintenance>0, nMaintenance, 0));
|
||||
END IF;
|
||||
|
||||
IF nFound!=0 THEN
|
||||
@ -308,9 +311,9 @@
|
||||
UPDATE `stat_caches` SET `last_found`=nDate WHERE `cache_id`=nCacheId;
|
||||
END IF;
|
||||
|
||||
UPDATE `stat_user` SET `found`=IF(`found`+nFound>0, `found`+nFound, 0), `notfound`=IF(`notfound`+nNotFound>0, `notfound`+nNotFound, 0), `note`=IF(`note`+nNote>0, `note`+nNote, 0), `will_attend`=IF(`will_attend`+nWillAttend>0, `will_attend`+nWillAttend, 0) WHERE `user_id`=nUserId;
|
||||
UPDATE `stat_user` SET `found`=IF(`found`+nFound>0, `found`+nFound, 0), `notfound`=IF(`notfound`+nNotFound>0, `notfound`+nNotFound, 0), `note`=IF(`note`+nNote>0, `note`+nNote, 0), `will_attend`=IF(`will_attend`+nWillAttend>0, `will_attend`+nWillAttend, 0), `maintenance`=IF(`maintenance`+nMaintenance>0, `maintenance`+nMaintenance, 0) WHERE `user_id`=nUserId;
|
||||
IF ROW_COUNT() = 0 THEN
|
||||
INSERT IGNORE INTO `stat_user` (`user_id`, `found`, `notfound`, `note`, `will_attend`) VALUES (nUserId, IF(nFound>0, nFound, 0), IF(nNotFound>0, nNotFound, 0), IF(nNote>0, nNote, 0), IF(nWillAttend>0, nWillAttend, 0));
|
||||
INSERT IGNORE INTO `stat_user` (`user_id`, `found`, `notfound`, `note`, `will_attend`, `maintenance`) VALUES (nUserId, IF(nFound>0, nFound, 0), IF(nNotFound>0, nNotFound, 0), IF(nNote>0, nNote, 0), IF(nWillAttend>0, nWillAttend, 0), IF(nMaintenance>0, nMaintenance, 0));
|
||||
END IF;
|
||||
|
||||
CALL sp_refresh_statpic(nUserId);
|
||||
@ -326,52 +329,35 @@
|
||||
INSERT IGNORE INTO `stat_caches` (`cache_id`) SELECT `cache_id` FROM `cache_logs` GROUP BY `cache_id`;
|
||||
INSERT IGNORE INTO `stat_cache_logs` (`cache_id`, `user_id`) SELECT `cache_id`, `user_id` FROM `cache_logs`;
|
||||
|
||||
/* stat_user.found */
|
||||
UPDATE `stat_user`, (SELECT `user_id`, COUNT(*) AS `count` FROM `cache_logs` WHERE `type` IN (1, 7) GROUP BY `user_id`) AS `tblFound` SET `stat_user`.`found`=`tblFound`.`count` WHERE `stat_user`.`user_id`=`tblFound`.`user_id`;
|
||||
/* This implementation is less performant than the previouse code (up to ~ commit 4ed7ee0),
|
||||
but the old did not update any values to zero - these entries were ignored!
|
||||
-- following 2013-05-12 */
|
||||
|
||||
/* stat_caches */
|
||||
UPDATE `stat_caches` SET
|
||||
`found` = (SELECT COUNT(*) FROM `cache_logs` WHERE `type` IN (1, 7) AND `cache_logs`.`cache_id` = `stat_caches`.`cache_id`),
|
||||
`last_found` = (SELECT MAX(`date`) FROM `cache_logs` WHERE `type` IN (1, 7) AND `cache_logs`.`cache_id` = `stat_caches`.`cache_id`),
|
||||
`notfound`= (SELECT COUNT(*) FROM `cache_logs` WHERE `type` IN (2) AND `cache_logs`.`cache_id` = `stat_caches`.`cache_id`),
|
||||
`note`= (SELECT COUNT(*) FROM `cache_logs` WHERE `type` IN (3) AND `cache_logs`.`cache_id` = `stat_caches`.`cache_id`),
|
||||
`will_attend`= (SELECT COUNT(*) FROM `cache_logs` WHERE `type` IN (8) AND `cache_logs`.`cache_id` = `stat_caches`.`cache_id`),
|
||||
`maintenance`= (SELECT COUNT(*) FROM `cache_logs` WHERE `type` IN (9,10,11,13,14) AND `cache_logs`.`cache_id` = `stat_caches`.`cache_id`);
|
||||
|
||||
/* stat_cache_logs */
|
||||
UPDATE `stat_cache_logs` SET
|
||||
`found` = (SELECT COUNT(*) FROM `cache_logs` WHERE `type` IN (1, 7) AND `cache_logs`.`cache_id` = `stat_cache_logs`.`cache_id` AND `cache_logs`.`user_id` = `stat_cache_logs`.`user_id`),
|
||||
`notfound`= (SELECT COUNT(*) FROM `cache_logs` WHERE `type` IN (2) AND `cache_logs`.`cache_id` = `stat_cache_logs`.`cache_id` AND `cache_logs`.`user_id` = `stat_cache_logs`.`user_id`),
|
||||
`note`= (SELECT COUNT(*) FROM `cache_logs` WHERE `type` IN (3) AND `cache_logs`.`cache_id` = `stat_cache_logs`.`cache_id` AND `cache_logs`.`user_id` = `stat_cache_logs`.`user_id`),
|
||||
`will_attend`= (SELECT COUNT(*) FROM `cache_logs` WHERE `type` IN (8) AND `cache_logs`.`cache_id` = `stat_cache_logs`.`cache_id` AND `cache_logs`.`user_id` = `stat_cache_logs`.`user_id`),
|
||||
`maintenance`= (SELECT COUNT(*) FROM `cache_logs` WHERE `type` IN (9,10,11,13,14) AND `cache_logs`.`cache_id` = `stat_cache_logs`.`cache_id` AND `cache_logs`.`user_id` = `stat_cache_logs`.`user_id`);
|
||||
SET nModified=nModified+ROW_COUNT();
|
||||
|
||||
/* stat_cache_logs.notfound */
|
||||
UPDATE `stat_user`, (SELECT `user_id`, COUNT(*) AS `count` FROM `cache_logs` WHERE `type` IN (2) GROUP BY `user_id`) AS `tblNotFound` SET `stat_user`.`notfound`=`tblNotFound`.`count` WHERE `stat_user`.`user_id`=`tblNotFound`.`user_id`;
|
||||
SET nModified=nModified+ROW_COUNT();
|
||||
|
||||
/* stat_cache_logs.note */
|
||||
UPDATE `stat_user`, (SELECT `user_id`, COUNT(*) AS `count` FROM `cache_logs` WHERE `type` IN (3) GROUP BY `user_id`) AS `tblNote` SET `stat_user`.`note`=`tblNote`.`count` WHERE `stat_user`.`user_id`=`tblNote`.`user_id`;
|
||||
SET nModified=nModified+ROW_COUNT();
|
||||
|
||||
/* stat_cache_logs.will_attend */
|
||||
UPDATE `stat_user`, (SELECT `user_id`, COUNT(*) AS `count` FROM `cache_logs` WHERE `type` IN (8) GROUP BY `user_id`) AS `tblWillAttend` SET `stat_user`.`will_attend`=`tblWillAttend`.`count` WHERE `stat_user`.`user_id`=`tblWillAttend`.`user_id`;
|
||||
SET nModified=nModified+ROW_COUNT();
|
||||
|
||||
/* stat_caches.found and stat_caches.last_found */
|
||||
UPDATE `stat_caches`, (SELECT `cache_id`, COUNT(*) AS `count`, MAX(`date`) AS `last_found` FROM `cache_logs` WHERE `type` IN (1, 7) GROUP BY `cache_id`) AS `tblFound` SET `stat_caches`.`found`=`tblFound`.`count`, `stat_caches`.`last_found`=`tblFound`.`last_found` WHERE `stat_caches`.`cache_id`=`tblFound`.`cache_id`;
|
||||
SET nModified=nModified+ROW_COUNT();
|
||||
|
||||
/* stat_caches.notfound */
|
||||
UPDATE `stat_caches`, (SELECT `cache_id`, COUNT(*) AS `count` FROM `cache_logs` WHERE `type` IN (2) GROUP BY `cache_id`) AS `tblNotFound` SET `stat_caches`.`notfound`=`tblNotFound`.`count` WHERE `stat_caches`.`cache_id`=`tblNotFound`.`cache_id`;
|
||||
SET nModified=nModified+ROW_COUNT();
|
||||
|
||||
/* stat_caches.note */
|
||||
UPDATE `stat_caches`, (SELECT `cache_id`, COUNT(*) AS `count` FROM `cache_logs` WHERE `type` IN (3) GROUP BY `cache_id`) AS `tblNote` SET `stat_caches`.`note`=`tblNote`.`count` WHERE `stat_caches`.`cache_id`=`tblNote`.`cache_id`;
|
||||
SET nModified=nModified+ROW_COUNT();
|
||||
|
||||
/* stat_caches.will_attend */
|
||||
UPDATE `stat_caches`, (SELECT `cache_id`, COUNT(*) AS `count` FROM `cache_logs` WHERE `type` IN (8) GROUP BY `cache_id`) AS `tblWillAttend` SET `stat_caches`.`will_attend`=`tblWillAttend`.`count` WHERE `stat_caches`.`cache_id`=`tblWillAttend`.`cache_id`;
|
||||
SET nModified=nModified+ROW_COUNT();
|
||||
|
||||
/* stat_cache_logs.found */
|
||||
UPDATE `stat_cache_logs`, (SELECT `cache_id`, `user_id`, COUNT(*) AS `count` FROM `cache_logs` WHERE `type` IN (1, 7) GROUP BY `user_id`, `cache_id`) AS `tblFound` SET `stat_cache_logs`.`found`=`tblFound`.`count` WHERE `stat_cache_logs`.`cache_id`=`tblFound`.`cache_id` AND `stat_cache_logs`.`user_id`=`tblFound`.`user_id`;
|
||||
SET nModified=nModified+ROW_COUNT();
|
||||
|
||||
/* stat_cache_logs.notfound */
|
||||
UPDATE `stat_cache_logs`, (SELECT `cache_id`, `user_id`, COUNT(*) AS `count` FROM `cache_logs` WHERE `type` IN (2) GROUP BY `user_id`, `cache_id`) AS `tblNotFound` SET `stat_cache_logs`.`notfound`=`tblNotFound`.`count` WHERE `stat_cache_logs`.`cache_id`=`tblNotFound`.`cache_id` AND `stat_cache_logs`.`user_id`=`tblNotFound`.`user_id`;
|
||||
SET nModified=nModified+ROW_COUNT();
|
||||
|
||||
/* stat_cache_logs.note */
|
||||
UPDATE `stat_cache_logs`, (SELECT `cache_id`, `user_id`, COUNT(*) AS `count` FROM `cache_logs` WHERE `type` IN (3) GROUP BY `user_id`, `cache_id`) AS `tblNote` SET `stat_cache_logs`.`note`=`tblNote`.`count` WHERE `stat_cache_logs`.`cache_id`=`tblNote`.`cache_id` AND `stat_cache_logs`.`user_id`=`tblNote`.`user_id`;
|
||||
SET nModified=nModified+ROW_COUNT();
|
||||
|
||||
/* stat_cache_logs.will_attend */
|
||||
UPDATE `stat_cache_logs`, (SELECT `cache_id`, `user_id`, COUNT(*) AS `count` FROM `cache_logs` WHERE `type` IN (8) GROUP BY `user_id`, `cache_id`) AS `tblWillAttend` SET `stat_cache_logs`.`will_attend`=`tblWillAttend`.`count` WHERE `stat_cache_logs`.`cache_id`=`tblWillAttend`.`cache_id` AND `stat_cache_logs`.`user_id`=`tblWillAttend`.`user_id`;
|
||||
/* stat_user */
|
||||
UPDATE `stat_user` SET
|
||||
`found` = (SELECT COUNT(*) FROM `cache_logs` WHERE `type` IN (1, 7) AND `cache_logs`.`user_id` = `stat_user`.`user_id`),
|
||||
`notfound`= (SELECT COUNT(*) FROM `cache_logs` WHERE `type` IN (2) AND `cache_logs`.`user_id` = `stat_user`.`user_id`),
|
||||
`note`= (SELECT COUNT(*) FROM `cache_logs` WHERE `type` IN (3) AND `cache_logs`.`user_id` = `stat_user`.`user_id`),
|
||||
`will_attend`= (SELECT COUNT(*) FROM `cache_logs` WHERE `type` IN (8) AND `cache_logs`.`user_id` = `stat_user`.`user_id`),
|
||||
`maintenance`= (SELECT COUNT(*) FROM `cache_logs` WHERE `type` IN (9,10,11,13,14) AND `cache_logs`.`user_id` = `stat_user`.`user_id`);
|
||||
SET nModified=nModified+ROW_COUNT();
|
||||
|
||||
CALL sp_refreshall_statpic();
|
||||
@ -729,7 +715,9 @@
|
||||
IF OLD.`status`=5 AND NEW.`status`=1 THEN
|
||||
CALL sp_notify_new_cache(NEW.`cache_id`, NEW.`longitude`, NEW.`latitude`);
|
||||
END IF;
|
||||
|
||||
IF NEW.`status`<>OLD.`status` THEN
|
||||
INSERT INTO `cache_status_modified` (`cache_id`, `date_modified`, `old_state`, `new_state`, `user_id`) VALUES (NEW.`cache_id`, NOW(), OLD.`status`, NEW.`status`, IFNULL(@STATUS_CHANGE_USER_ID,0));
|
||||
END IF;
|
||||
SET @dont_update_listingdate=0;
|
||||
END;");
|
||||
|
||||
@ -915,6 +903,7 @@
|
||||
NEW.`cache_id`!=OLD.`cache_id` OR
|
||||
NEW.`user_id`!=OLD.`user_id` OR
|
||||
NEW.`type`!=OLD.`type` OR
|
||||
NEW.`oc_team_comment`!=OLD.`oc_team_comment` OR
|
||||
NEW.`date`!=OLD.`date` OR
|
||||
NEW.`text`!=OLD.`text` OR
|
||||
NEW.`text_html`!=OLD.`text_html` THEN
|
||||
@ -1253,7 +1242,8 @@
|
||||
NEW.`node`!=OLD.`node` OR
|
||||
NEW.`date_created`!=OLD.`date_created` OR
|
||||
NEW.`username`!=OLD.`username` OR
|
||||
NEW.`pmr_flag`!=OLD.`pmr_flag` THEN
|
||||
NEW.`pmr_flag`!=OLD.`pmr_flag` OR
|
||||
NEW.`description`!=OLD.`description` THEN
|
||||
|
||||
SET NEW.`last_modified`=NOW();
|
||||
END IF;
|
||||
|
@ -10,6 +10,7 @@ CREATE TABLE `cache_logs` (
|
||||
`cache_id` int(10) unsigned NOT NULL,
|
||||
`user_id` int(10) unsigned NOT NULL,
|
||||
`type` tinyint(3) unsigned NOT NULL,
|
||||
`oc_team_comment` tinyint(1) NOT NULL default '0',
|
||||
`date` datetime NOT NULL,
|
||||
`text` mediumtext NOT NULL,
|
||||
`text_html` tinyint(1) NOT NULL default '0',
|
||||
|
@ -10,6 +10,7 @@ CREATE TABLE `cache_logs_archived` (
|
||||
`cache_id` int(10) unsigned NOT NULL,
|
||||
`user_id` int(10) unsigned NOT NULL,
|
||||
`type` tinyint(3) unsigned NOT NULL,
|
||||
`oc_team_comment` tinyint(1) NOT NULL default '0',
|
||||
`date` datetime NOT NULL,
|
||||
`text` mediumtext NOT NULL,
|
||||
`text_html` tinyint(1) NOT NULL,
|
||||
|
@ -5,4 +5,4 @@ CREATE TABLE `cache_logtype` (
|
||||
`log_type_id` tinyint(3) unsigned NOT NULL,
|
||||
PRIMARY KEY (`cache_type_id`,`log_type_id`),
|
||||
KEY `log_type_id` (`log_type_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='obsolete' ;
|
||||
|
@ -12,5 +12,6 @@ CREATE TABLE `cache_reports` (
|
||||
`lastmodified` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `status` (`status`,`adminid`),
|
||||
KEY `status_2` (`adminid`,`status`)
|
||||
KEY `status_2` (`adminid`,`status`),
|
||||
KEY `userid` (`userid`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='submitted reports on caches' ;
|
||||
|
10
htdocs/doc/sql/tables/cache_status_modified.sql
Normal file
@ -0,0 +1,10 @@
|
||||
SET NAMES 'utf8';
|
||||
DROP TABLE IF EXISTS `cache_status_modified`;
|
||||
CREATE TABLE `cache_status_modified` (
|
||||
`cache_id` int(10) unsigned NOT NULL,
|
||||
`date_modified` datetime NOT NULL,
|
||||
`old_state` tinyint(2) unsigned NOT NULL,
|
||||
`new_state` tinyint(2) unsigned NOT NULL,
|
||||
`user_id` int(10) unsigned NOT NULL default '0',
|
||||
UNIQUE KEY `cache_id` (`cache_id`,`date_modified`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
|
@ -5,7 +5,7 @@ CREATE TABLE `countries` (
|
||||
`name` varchar(80) NOT NULL,
|
||||
`trans_id` int(10) NOT NULL,
|
||||
`de` varchar(128) NOT NULL COMMENT 'obsolete',
|
||||
`en` varchar(128) NOT NULL COMMENT 'obsolete',
|
||||
`en` varchar(128) NOT NULL,
|
||||
`list_default_de` int(1) NOT NULL default '0' COMMENT 'obsolete',
|
||||
`sort_de` varchar(128) NOT NULL COMMENT 'obsolete',
|
||||
`list_default_en` int(1) NOT NULL default '0' COMMENT 'obsolete',
|
||||
|
20
htdocs/doc/sql/tables/geodb_coordinates.sql
Normal file
@ -0,0 +1,20 @@
|
||||
SET NAMES 'utf8';
|
||||
DROP TABLE IF EXISTS `geodb_coordinates`;
|
||||
CREATE TABLE `geodb_coordinates` (
|
||||
`loc_id` int(11) NOT NULL default '0',
|
||||
`lon` double default NULL,
|
||||
`lat` double default NULL,
|
||||
`coord_type` int(11) NOT NULL default '0',
|
||||
`coord_subtype` int(11) default NULL,
|
||||
`valid_since` date default NULL,
|
||||
`date_type_since` int(11) default NULL,
|
||||
`valid_until` date NOT NULL default '0000-00-00',
|
||||
`date_type_until` int(11) NOT NULL default '0',
|
||||
KEY `coord_loc_id_idx` (`loc_id`),
|
||||
KEY `coord_lon_idx` (`lon`),
|
||||
KEY `coord_lat_idx` (`lat`),
|
||||
KEY `coord_type_idx` (`coord_type`),
|
||||
KEY `coord_stype_idx` (`coord_subtype`),
|
||||
KEY `coord_since_idx` (`valid_since`),
|
||||
KEY `coord_until_idx` (`valid_until`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='static content' ;
|
32
htdocs/doc/sql/tables/geodb_hierarchies.sql
Normal file
@ -0,0 +1,32 @@
|
||||
SET NAMES 'utf8';
|
||||
DROP TABLE IF EXISTS `geodb_hierarchies`;
|
||||
CREATE TABLE `geodb_hierarchies` (
|
||||
`loc_id` int(11) NOT NULL default '0',
|
||||
`level` int(11) NOT NULL default '0',
|
||||
`id_lvl1` int(11) NOT NULL default '0',
|
||||
`id_lvl2` int(11) default NULL,
|
||||
`id_lvl3` int(11) default NULL,
|
||||
`id_lvl4` int(11) default NULL,
|
||||
`id_lvl5` int(11) default NULL,
|
||||
`id_lvl6` int(11) default NULL,
|
||||
`id_lvl7` int(11) default NULL,
|
||||
`id_lvl8` int(11) default NULL,
|
||||
`id_lvl9` int(11) default NULL,
|
||||
`valid_since` date default NULL,
|
||||
`date_type_since` int(11) default NULL,
|
||||
`valid_until` date NOT NULL default '0000-00-00',
|
||||
`date_type_until` int(11) NOT NULL default '0',
|
||||
KEY `hierarchy_loc_id_idx` (`loc_id`),
|
||||
KEY `hierarchy_level_idx` (`level`),
|
||||
KEY `hierarchy_lvl1_idx` (`id_lvl1`),
|
||||
KEY `hierarchy_lvl2_idx` (`id_lvl2`),
|
||||
KEY `hierarchy_lvl3_idx` (`id_lvl3`),
|
||||
KEY `hierarchy_lvl4_idx` (`id_lvl4`),
|
||||
KEY `hierarchy_lvl5_idx` (`id_lvl5`),
|
||||
KEY `hierarchy_lvl6_idx` (`id_lvl6`),
|
||||
KEY `hierarchy_lvl7_idx` (`id_lvl7`),
|
||||
KEY `hierarchy_lvl8_idx` (`id_lvl8`),
|
||||
KEY `hierarchy_lvl9_idx` (`id_lvl9`),
|
||||
KEY `hierarchy_since_idx` (`valid_since`),
|
||||
KEY `hierarchy_until_idx` (`valid_until`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='static content' ;
|
8
htdocs/doc/sql/tables/geodb_locations.sql
Normal file
@ -0,0 +1,8 @@
|
||||
SET NAMES 'utf8';
|
||||
DROP TABLE IF EXISTS `geodb_locations`;
|
||||
CREATE TABLE `geodb_locations` (
|
||||
`loc_id` int(11) NOT NULL default '0',
|
||||
`loc_type` int(11) NOT NULL default '0',
|
||||
PRIMARY KEY (`loc_id`),
|
||||
KEY `loc_type_idx` (`loc_type`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='static content' ;
|
@ -10,4 +10,4 @@ CREATE TABLE `geodb_search` (
|
||||
KEY `sort` (`sort`),
|
||||
KEY `simple` (`simple`),
|
||||
KEY `simplehash` (`simplehash`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='static content' ;
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='static content, not in use' ;
|
||||
|
22
htdocs/doc/sql/tables/geodb_textdata.sql
Normal file
@ -0,0 +1,22 @@
|
||||
SET NAMES 'utf8';
|
||||
DROP TABLE IF EXISTS `geodb_textdata`;
|
||||
CREATE TABLE `geodb_textdata` (
|
||||
`loc_id` int(11) NOT NULL default '0',
|
||||
`text_val` varchar(255) NOT NULL default '',
|
||||
`text_type` int(11) NOT NULL default '0',
|
||||
`text_locale` varchar(5) default NULL,
|
||||
`is_native_lang` smallint(1) default NULL,
|
||||
`is_default_name` smallint(1) default NULL,
|
||||
`valid_since` date default NULL,
|
||||
`date_type_since` int(11) default NULL,
|
||||
`valid_until` date NOT NULL default '0000-00-00',
|
||||
`date_type_until` int(11) NOT NULL default '0',
|
||||
KEY `text_lid_idx` (`loc_id`),
|
||||
KEY `text_val_idx` (`text_val`),
|
||||
KEY `text_type_idx` (`text_type`),
|
||||
KEY `text_locale_idx` (`text_locale`),
|
||||
KEY `text_native_idx` (`is_native_lang`),
|
||||
KEY `text_default_idx` (`is_default_name`),
|
||||
KEY `text_since_idx` (`valid_since`),
|
||||
KEY `text_until_idx` (`valid_until`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='static content' ;
|
@ -5,9 +5,9 @@ CREATE TABLE `log_types` (
|
||||
`name` varchar(80) NOT NULL,
|
||||
`trans_id` int(10) unsigned NOT NULL,
|
||||
`permission` char(1) NOT NULL COMMENT 'obsolete',
|
||||
`cache_status` tinyint(1) NOT NULL default '0' COMMENT 'obsolete',
|
||||
`cache_status` tinyint(1) NOT NULL default '0',
|
||||
`de` varchar(60) NOT NULL COMMENT 'obsolete',
|
||||
`en` varchar(60) NOT NULL COMMENT 'obsolete',
|
||||
`en` varchar(60) NOT NULL,
|
||||
`icon_small` varchar(255) NOT NULL,
|
||||
`allow_rating` tinyint(1) NOT NULL,
|
||||
`require_password` tinyint(1) NOT NULL,
|
||||
|
@ -8,4 +8,4 @@ CREATE TABLE `npa_areas` (
|
||||
`shape` linestring NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
SPATIAL KEY `shape` (`shape`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='static content' ;
|
||||
|
@ -7,4 +7,4 @@ CREATE TABLE `npa_types` (
|
||||
`no_warning` tinyint(1) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `ordinal` (`ordinal`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='static content' ;
|
||||
|
@ -5,4 +5,4 @@ CREATE TABLE `nuts_codes` (
|
||||
`name` varchar(120) NOT NULL,
|
||||
PRIMARY KEY (`code`),
|
||||
KEY `code` (`code`,`name`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='static content' ;
|
||||
|
@ -9,4 +9,4 @@ CREATE TABLE `nuts_layer` (
|
||||
UNIQUE KEY `code` (`code`),
|
||||
KEY `level` (`level`),
|
||||
SPATIAL KEY `shape` (`shape`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='static content' ;
|
||||
|
@ -3,4 +3,4 @@ DROP TABLE IF EXISTS `pw_dict`;
|
||||
CREATE TABLE `pw_dict` (
|
||||
`pw` varchar(40) NOT NULL,
|
||||
UNIQUE KEY `pw` (`pw`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='static content' ;
|
||||
|
@ -7,5 +7,6 @@ CREATE TABLE `stat_cache_logs` (
|
||||
`notfound` smallint(5) unsigned NOT NULL,
|
||||
`note` smallint(5) unsigned NOT NULL,
|
||||
`will_attend` smallint(5) unsigned NOT NULL,
|
||||
`maintenance` smallint(5) unsigned NOT NULL,
|
||||
PRIMARY KEY (`cache_id`,`user_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='via trigger (cache_logs)' ;
|
||||
|
@ -6,6 +6,7 @@ CREATE TABLE `stat_caches` (
|
||||
`notfound` smallint(5) unsigned NOT NULL,
|
||||
`note` smallint(5) unsigned NOT NULL,
|
||||
`will_attend` smallint(5) unsigned NOT NULL,
|
||||
`maintenance` smallint(5) unsigned NOT NULL,
|
||||
`last_found` date default NULL,
|
||||
`watch` smallint(5) unsigned NOT NULL,
|
||||
`ignore` smallint(5) unsigned NOT NULL,
|
||||
|
@ -7,5 +7,6 @@ CREATE TABLE `stat_user` (
|
||||
`note` smallint(5) unsigned NOT NULL,
|
||||
`hidden` smallint(5) unsigned NOT NULL,
|
||||
`will_attend` smallint(5) unsigned NOT NULL,
|
||||
`maintenance` smallint(5) unsigned NOT NULL,
|
||||
PRIMARY KEY (`user_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='via trigger (user)' ;
|
||||
|
@ -35,6 +35,8 @@ CREATE TABLE `user` (
|
||||
`notify_radius` int(10) unsigned NOT NULL default '0',
|
||||
`admin` tinyint(3) unsigned NOT NULL default '0',
|
||||
`data_license` tinyint(1) NOT NULL default '0',
|
||||
`description` mediumtext NOT NULL,
|
||||
`desc_htmledit` tinyint(1) unsigned NOT NULL default '1',
|
||||
PRIMARY KEY (`user_id`),
|
||||
UNIQUE KEY `username` (`username`),
|
||||
UNIQUE KEY `uuid` (`uuid`),
|
||||
|
@ -45,6 +45,7 @@
|
||||
<li>Element für Bildeigenschaften von <attributes> in <picattr> umbenannt, um Kollisionen mit dem Cache-Attribut-Element zu vermeiden.</li>
|
||||
<li>Vorschaubild-Flag (<em>preview</em>) zu <picattr> hinzugefügt.</li>
|
||||
<li>zusätzliche Logtypen 9 (archiviert), 10 (kann gesucht werden), 11 (momentan nicht verfügbar) und 13 (gesperrt)</li>
|
||||
<li><em>teamcomment</em>-Flag zum <logtype> hinzugefügt</li>
|
||||
</ul>
|
||||
|
||||
<p>Der XML-Doctype lautet in allen Versionen "oc11xml".</p>
|
||||
@ -188,7 +189,7 @@
|
||||
<user id="113"
|
||||
uuid="CAA9E3C5-50DF-4E9E-191F-CECABA6A8A19"><![CDATA[Team
|
||||
Schnitzeljagd]]></user><BR>
|
||||
<logtype id="1" recommended="0"><![CDATA[Gefunden]]></type><br>
|
||||
<logtype id="1" recommended="0" teamcomment="0"><![CDATA[Gefunden]]></type><br>
|
||||
<date>2005-05-18 16:20:00</date><br>
|
||||
<text><![CDATA[Gut gefunden.&lt;br /&gt;<br>
|
||||
Gr&uuml;&szlig;e von&lt;br /&gt;<br>
|
||||
|
@ -391,6 +391,7 @@ function getWaypoints($cacheid)
|
||||
}
|
||||
|
||||
// cache-attributes
|
||||
$attribs_not_ok = false;
|
||||
if (isset($_POST['cache_attribs']))
|
||||
{
|
||||
$cache_attribs = mb_split(';', $_POST['cache_attribs']);
|
||||
@ -415,11 +416,20 @@ function getWaypoints($cacheid)
|
||||
sql_free_result($rs);
|
||||
}
|
||||
|
||||
if (in_array(ATTRIB_ID_SAFARI,$cache_attribs) && $cache_type != 4)
|
||||
{
|
||||
tpl_set_var('safari_message', $safari_not_allowed_message);
|
||||
$error = true;
|
||||
$attribs_not_ok = true;
|
||||
}
|
||||
else
|
||||
tpl_set_var('safari_message', '');
|
||||
|
||||
//try to save to DB?
|
||||
if (isset($_POST['submit'])) // Ocprop
|
||||
{
|
||||
//all validations ok?
|
||||
if (!($hidden_date_not_ok || $lat_not_ok || $lon_not_ok || $name_not_ok || $time_not_ok || $way_length_not_ok || $size_not_ok || $activate_date_not_ok || $status_not_ok || $diff_not_ok))
|
||||
if (!($hidden_date_not_ok || $lat_not_ok || $lon_not_ok || $name_not_ok || $time_not_ok || $way_length_not_ok || $size_not_ok || $activate_date_not_ok || $status_not_ok || $diff_not_ok || $attribs_not_ok))
|
||||
{
|
||||
$cache_lat = $coords_lat_h + $coords_lat_min / 60;
|
||||
if ($coords_latNS == 'S') $cache_lat = -$cache_lat;
|
||||
@ -465,6 +475,7 @@ function getWaypoints($cacheid)
|
||||
|
||||
// save to DB
|
||||
// status update will trigger touching the last_modified date of all depending records
|
||||
sql("SET @STATUS_CHANGE_USER_ID='&1'", $usr['userid']);
|
||||
sql("UPDATE `caches` SET `name`='&1', `longitude`='&2', `latitude`='&3', `type`='&4', `date_hidden`='&5', `country`='&6', `size`='&7', `difficulty`='&8', `terrain`='&9', `status`='&10', `search_time`='&11', `way_length`='&12', `logpw`='&13', `wp_gc`='&14', `wp_nc`='&15', `date_activate` = $activation_date WHERE `cache_id`='&16'", $cache_name, $cache_lon, $cache_lat, $cache_type, date('Y-m-d', mktime(0, 0, 0, $cache_hidden_month, $cache_hidden_day, $cache_hidden_year)), $cache_country, $sel_size, $cache_difficulty, $cache_terrain, $status, $search_time, $way_length, $log_pw, $wp_gc, $wp_nc, $cache_id);
|
||||
|
||||
// do not use slave server for the next time ...
|
||||
@ -744,7 +755,8 @@ function getWaypoints($cacheid)
|
||||
while ($rStatus = sql_fetch_assoc($rsStatus))
|
||||
{
|
||||
$sSelected = ($rStatus['id'] == $status) ? ' selected="selected"' : '';
|
||||
$statusoptions .= '<option value="' . htmlspecialchars($rStatus['id'], ENT_COMPAT, 'UTF-8') . '"' . $sSelected . '>' . htmlspecialchars($rStatus['name'], ENT_COMPAT, 'UTF-8') . '</option>';
|
||||
if ($sSelected != '' || $status_old == 5)
|
||||
$statusoptions .= '<option value="' . htmlspecialchars($rStatus['id'], ENT_COMPAT, 'UTF-8') . '"' . $sSelected . '>' . htmlspecialchars($rStatus['name'], ENT_COMPAT, 'UTF-8') . '</option>';
|
||||
}
|
||||
sql_free_result($rsStatus);
|
||||
}
|
||||
@ -753,6 +765,7 @@ function getWaypoints($cacheid)
|
||||
$statusoptions .= '<option value="7" selected="selected">' . htmlspecialchars(t("Locked, invisible"), ENT_COMPAT, 'UTF-8') . '</option>';
|
||||
}
|
||||
tpl_set_var('statusoptions', $statusoptions);
|
||||
tpl_set_var('statuschange', $status_old == 5 ? '' : mb_ereg_replace('%1',$cache_id,$status_change));
|
||||
|
||||
// show activation form?
|
||||
if($status_old == 5) // status = not yet published
|
||||
|
@ -24,6 +24,7 @@
|
||||
|
||||
//prepare the templates and include all neccessary
|
||||
require_once('./lib/common.inc.php');
|
||||
require_once('./lib/logtypes.inc.php');
|
||||
require($stylepath.'/smilies.inc.php');
|
||||
require_once($opt['rootpath'] . '../lib/htmlpurifier-4.2.0/library/HTMLPurifier.auto.php');
|
||||
|
||||
@ -57,7 +58,8 @@
|
||||
`cache_logs`.`text` AS `text`,
|
||||
`cache_logs`.`date` AS `date`,
|
||||
`cache_logs`.`user_id` AS `user_id`,
|
||||
`cache_logs`.`type` AS `logtype`,
|
||||
`cache_logs`.`type` AS `logtype`,
|
||||
`cache_logs`.`oc_team_comment` AS `oc_team_comment`,
|
||||
`cache_logs`.`text_html` AS `text_html`,
|
||||
`cache_logs`.`text_htmledit` AS `text_htmledit`,
|
||||
`caches`.`name` AS `cachename`,
|
||||
@ -70,6 +72,7 @@
|
||||
$log_id);
|
||||
$log_record = sql_fetch_array($log_rs);
|
||||
sql_free_result($log_rs);
|
||||
|
||||
if ($log_record !== false &&
|
||||
(($log_record['status'] != 6 || ($log_record['cache_user_id'] == $login->userid && $log_record['user_id'] == $login->userid)) &&
|
||||
$log_record['status'] != 7) || $useradmin)
|
||||
@ -101,6 +104,7 @@
|
||||
$log_time_minute = isset($_POST['logminute']) ? trim($_POST['logminute']) : (substr($log_record['date'],11) == "00:00:00" ? "" : date('i', strtotime($log_record['date'])));
|
||||
$top_option = isset($_POST['ratingoption']) ? $_POST['ratingoption']+0 : 0;
|
||||
$top_cache = isset($_POST['rating']) ? $_POST['rating']+0 : 0;
|
||||
$oc_team_comment = isset($_POST['teamcomment']) ? ($_POST['teamcomment'] != 0) : ($log_record['oc_team_comment'] == '1');
|
||||
|
||||
$log_pw = '';
|
||||
$use_log_pw = (($log_record['logpw'] == NULL) || ($log_record['logpw'] == '')) ? false : true;
|
||||
@ -202,7 +206,7 @@
|
||||
$date_ok = false;
|
||||
}
|
||||
|
||||
$logtype_ok = sqlValue("SELECT COUNT(*) FROM cache_logtype WHERE cache_type_id='" . sql_escape($cache_type) . "' AND log_type_id='" . sql_escape($log_type) . "'", 0) > 0;
|
||||
$logtype_ok = logtype_ok($log_record['cache_id'], $log_type, $log_record['logtype']);
|
||||
|
||||
// not a found log? then ignore the rating
|
||||
if ($log_type != 1 && $log_type != 7)
|
||||
@ -217,6 +221,10 @@
|
||||
$all_ok = false;
|
||||
}
|
||||
|
||||
// ignore unauthorized team comments
|
||||
if (!teamcomment_allowed($log_record['cache_id'], $log_type))
|
||||
$oc_team_comment = 0;
|
||||
|
||||
//store?
|
||||
if (isset($_POST['submitform']) && $date_ok && $logtype_ok && $pw_ok)
|
||||
{
|
||||
@ -232,12 +240,14 @@
|
||||
|
||||
//store changed data
|
||||
sql("UPDATE `cache_logs` SET `type`='&1',
|
||||
`date`='&2',
|
||||
`text`='&3',
|
||||
`text_html`='&4',
|
||||
`text_htmledit`='&5'
|
||||
WHERE `id`='&6'",
|
||||
`oc_team_comment`='&2',
|
||||
`date`='&3',
|
||||
`text`='&4',
|
||||
`text_html`='&5',
|
||||
`text_htmledit`='&6'
|
||||
WHERE `id`='&7'",
|
||||
$log_type,
|
||||
$oc_team_comment,
|
||||
$log_date,
|
||||
(($descMode != 1) ? $log_text : nl2br($log_text)),
|
||||
(($descMode != 1) ? 1 : 0),
|
||||
@ -270,23 +280,21 @@
|
||||
exit;
|
||||
}
|
||||
|
||||
//build logtypeoptions
|
||||
// build logtype options
|
||||
$logtype_names = get_logtype_names();
|
||||
$allowed_logtypes = get_cache_log_types($log_record['cache_id'], $log_record['logtype']);
|
||||
$logtypeoptions = '';
|
||||
$rsLogTypes = sql("SELECT `log_types`.`id`, IFNULL(`sys_trans_text`.`text`, `log_types`.`name`) AS `name`
|
||||
FROM `caches`
|
||||
INNER JOIN `cache_type` ON `caches`.`type`=`cache_type`.`id`
|
||||
INNER JOIN `cache_logtype` ON `cache_type`.`id`=`cache_logtype`.`cache_type_id`
|
||||
INNER JOIN `log_types` ON `cache_logtype`.`log_type_id`=`log_types`.`id`
|
||||
LEFT JOIN `sys_trans` ON `log_types`.`trans_id`=`sys_trans`.`id`
|
||||
LEFT JOIN `sys_trans_text` ON `sys_trans`.`id`=`sys_trans_text`.`trans_id` AND `sys_trans_text`.`lang`='" . sql_escape($locale) . "'
|
||||
WHERE `caches`.`cache_id`='" . ($log_record['cache_id']+0) . "'
|
||||
ORDER BY `log_types`.`id` ASC");
|
||||
while ($rLogTypes = sql_fetch_assoc($rsLogTypes))
|
||||
foreach ($allowed_logtypes as $logtype)
|
||||
{
|
||||
$sSelected = ($rLogTypes['id'] == $log_type) ? ' selected="selected"' : '';
|
||||
$logtypeoptions .= '<option value="' . $rLogTypes['id'] . '"' . $sSelected . '>' . htmlspecialchars($rLogTypes['name'], ENT_COMPAT, 'UTF-8') . '</option>' . "\n";
|
||||
$selected = ($log_record['logtype'] == $logtype ? ' selected="selected"' : '');
|
||||
$logtypeoptions .= '<option value="' . $logtype . '"' . $selected . '>' . htmlspecialchars($logtype_names[$logtype], ENT_COMPAT, 'UTF-8') . '</option>' . "\n";
|
||||
}
|
||||
sql_free_result($rsLogTypes);
|
||||
|
||||
if (teamcomment_allowed($log_record['cache_id'],3))
|
||||
tpl_set_var('teamcommentoption',
|
||||
mb_ereg_replace('{chk_sel}', ($oc_team_comment ? 'checked' : ''), $teamcomment_field));
|
||||
else
|
||||
tpl_set_var('teamcommentoption', '');
|
||||
|
||||
//set template vars
|
||||
tpl_set_var('cachename', htmlspecialchars($cache_name, ENT_COMPAT, 'UTF-8'));
|
||||
|
@ -100,7 +100,28 @@
|
||||
|
||||
// get newest caches
|
||||
$tpl->assign_rs('newcaches', $getNew->rsForSmarty('cache'));
|
||||
|
||||
// enable minimap for new caches if url is set
|
||||
if ($opt['logic']['minimapurl'] != '')
|
||||
{
|
||||
// get the correct api key for google maps
|
||||
$gmkey = '';
|
||||
$sHost = strtolower($_SERVER['HTTP_HOST']);
|
||||
if (isset($opt['lib']['google']['mapkey'][$sHost]))
|
||||
$gmkey = $opt['lib']['google']['mapkey'][$sHost];
|
||||
|
||||
// build static maps url by inserting api key
|
||||
$url = $opt['logic']['minimapurl'];
|
||||
$url = mb_ereg_replace('{gmkey}', $gmkey, $url);
|
||||
|
||||
// put into template
|
||||
$tpl->assign('minimap_url', $url);
|
||||
$tpl->assign('minimap_enabled', true);
|
||||
}
|
||||
else
|
||||
{
|
||||
$tpl->assign('minimap_enabled', false);
|
||||
}
|
||||
|
||||
// last 30 days' top ratings
|
||||
$tpl->assign_rs('topratings', $getNew->rsForSmarty('rating'));
|
||||
|
||||
|
@ -30,7 +30,9 @@
|
||||
$way_length_not_ok_message = '<span class="errormsg">' . t('The distance you have entered is invalid. Format aa.aaa') . '</span>';
|
||||
$sizemismatch_message = ' <span class="errormsg">' . t('For virtual and webcam caches, the cache size has to be -no container-!') . '</span>';
|
||||
$status_message = ' <span class="errormsg">' . t('The cache-status does not fit to your publishing options') . '</span>';
|
||||
$status_change = '<br /><div style="margin-top:6px"><img src="lang/de/ocstyle/images/misc/hint.gif" border="0" width="15" height="11" >' . t('To change the state, you need to <a href="log.php?cacheid=%1">log</a> the new state.') . '</div>';
|
||||
$diff_not_ok_message = ' <span class="errormsg">' . t('Choose both valuations!') . '</span>';
|
||||
$safari_not_allowed_message = '<span class="errormsg">' . t('Only virtual caches can be safari caches.') . '</span>';
|
||||
$nopictures = '<tr><td colspan="2">' . t('No pictures available') . '</td></tr>';
|
||||
$pictureline = '<tr><td colspan="2"><a href="{link}">{title}</a> [<a href="picture.php?action=edit&uuid={uuid}">' . t('Edit') . '</a>] [<a href="picture.php?action=delete&uuid={uuid}">' . t('Delete') . '</a>]</td></tr>';
|
||||
// Ocprop: <a href=\"http://.*?\.opencaching\.de/images/uploads/.*?\">(.*?)<\/a>.*?\[<a href=\"picture\.php\?action=[a-z]*?\&uuid=(.*?)\">
|
||||
|
@ -137,7 +137,7 @@ function toggleAttr(id)
|
||||
<td>
|
||||
<select name="status" class="input200">
|
||||
{statusoptions}
|
||||
</select>{status_message}
|
||||
</select>{status_message}{statuschange}
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td class="spacer" colspan="2"></td></tr>
|
||||
@ -250,7 +250,7 @@ function toggleAttr(id)
|
||||
</tr>
|
||||
<tr><td class="spacer" colspan="2"></td></tr>
|
||||
<tr>
|
||||
<td colspan="2">{cache_attrib_list}</td>
|
||||
<td colspan="2">{cache_attrib_list}{safari_message}</td>
|
||||
</tr>
|
||||
<tr><td class="spacer" colspan="2"> </td></tr>
|
||||
|
||||
|
@ -25,4 +25,6 @@
|
||||
$log_pw_field = '<tr><td colspan="2">' . t('passwort to log:') . ' <input class="input100" type="text" name="log_pw" maxlength="20" value="" /> ' . t('(only for found logs)') . '</td></tr>
|
||||
<tr><td class="spacer" colspan="2"></td></tr>';
|
||||
$log_pw_field_pw_not_ok = '<tr><td colspan="2">' . t('passwort to log:') . ' <input type="text" name="log_pw" maxlength="20" size="20" value=""/><span class="errormsg"> ' . t('Invalid password!') . '</span></td></tr><tr><td class="spacer" colspan="2"></td></tr>';
|
||||
|
||||
$teamcomment_field = ' <input type="checkbox" name="teamcomment" value="1" class="checkbox" {chk_sel} id="teamcomment" /> <label for="teamcomment">' . t('OC team comment') . "</label>";
|
||||
?>
|
@ -89,6 +89,7 @@ function _chkFound () {
|
||||
<select name="logtype" onChange="return _chkFound()">
|
||||
{logtypeoptions}
|
||||
</select>
|
||||
{teamcommentoption}
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td class="spacer" colspan="2"></td></tr>
|
||||
|
@ -16,23 +16,7 @@
|
||||
function icon_log_type($icon_small, $text)
|
||||
{
|
||||
global $stylepath;
|
||||
return "<img src='$stylepath/images/$icon_small' width='16' height='16' align='middle' border='0' align='left' alt='$text' title='$text'>";
|
||||
}
|
||||
|
||||
function icon_cache_status($status, $text)
|
||||
{
|
||||
global $stylepath;
|
||||
switch($status)
|
||||
{
|
||||
case 1: $icon = "log/16x16-go.png"; break;
|
||||
case 2: $icon = "log/16x16-stop.png"; break;
|
||||
case 3: $icon = "log/16x16-trash.png"; break;
|
||||
case 4: $icon = "log/16x16-trash.png"; break;
|
||||
case 5: $icon = "log/16x16-stop.png"; break;
|
||||
|
||||
default: $icon = "log/16x16-go.png"; break;
|
||||
}
|
||||
return "<img src='$stylepath/images/$icon' width='16' height='16' align='middle' border='0' align='left' alt='$text' title='$text'>";
|
||||
return "<img src='resource2/ocstyle/images/$icon_small' width='16' height='16' align='middle' border='0' align='left' alt='$text' title='$text'>";
|
||||
}
|
||||
|
||||
function icon_difficulty($what, $difficulty)
|
||||
|
@ -24,9 +24,9 @@
|
||||
$event_log_pw_field = '<tr><td colspan="2">' . t('passwort to log:') . ' <input class="input100" type="text" name="log_pw" maxlength="20" value="" /> (' . t('only for attended-logs') . ')</td></tr><tr><td class="spacer" colspan="2"></td></tr>';
|
||||
$other_log_pw_field = '<tr><td colspan="2">' . t('passwort to log:') . ' <input class="input100" type="text" name="log_pw" maxlength="20" value="" /> ' . t('(only for found-logs)') . '</td></tr><tr><td class="spacer" colspan="2"></td></tr>';
|
||||
$log_pw_field_pw_not_ok = '<tr><td colspan="2">' . t('passwort to log:') . ' <input type="text" name="log_pw" maxlength="20" size="20" value=""/><span class="errormsg"> ' . t('Invalid password!') . '</span></td></tr><tr><td class="spacer" colspan="2"></td></tr>';
|
||||
$teamcomment_field = ' <input type="checkbox" name="teamcomment" value="1" class="checkbox" {chk_sel} id="teamcomment" /> <label for="teamcomment">' . t('OC team comment') . '</label>';
|
||||
|
||||
$listed_only_oc = t('only listed here!');
|
||||
|
||||
$smiley_link = '<a href="javascript:insertSmiley(\'{smiley_text}\')">{smiley_image}</a>';
|
||||
|
||||
?>
|
@ -84,6 +84,7 @@ function _chkFound () {
|
||||
<select name="logtype" onChange="return _chkFound()">
|
||||
{logtypeoptions}
|
||||
</select>
|
||||
{teamcommentoption}
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td class="spacer" colspan="2"></td></tr>
|
||||
|
@ -54,7 +54,8 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title><?php echo $tpl_subtitle; ?>{title}</title>
|
||||
<meta name="KEYWORDS" content="geocaching, opencaching, geocashing, longitude, latitude, utm, coordinates, treasure hunting, treasure, GPS, global positioning system, garmin, magellan, mapping, geo, hiking, outdoors, sport, hunt, stash, cache, geocaching, geocache, cache, treasure, hunting, satellite, navigation, tracking, bugs, travel bugs" />
|
||||
<meta name="keywords" content="Geocaching, Geocache, Cache, Geocashing, Schnitzeljagd, Schatzsuche, GPS, Openstreetmap, kostenlos, GPX, GPX download, Koordinaten, Hobby, Natur" />
|
||||
<meta name="description" content="Geocaching ist ein GPS-Schatzsuche-Spiel: Es werden kleine Behälter versteckt, die anhand der GPS-Koordinaten zu finden sind. Opencaching.de ist das freie Portal, um diese Verstecke mit anderen zu teilen." />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
||||
<meta http-equiv="Content-Style-Type" content="text/css" />
|
||||
|
@ -34,6 +34,7 @@
|
||||
$size_not_ok_message = ' <span class="errormsg">' . t('No cache-size is chosen.') . '</span>';
|
||||
$diff_not_ok_message = ' <span class="errormsg">' . t('Choose both valuations!') . '</span>';
|
||||
$sizemismatch_message = ' <span class="errormsg">' . t('For virtual and webcam caches, the cache size has to be -no container-!') . '</span>';
|
||||
$safari_not_allowed_message = '<span class="errormsg">' . t('Only virtual caches can be safari caches.') . '</span>';
|
||||
|
||||
$cache_submitted = t('Your cache is successfully added to the database. You will be redirected to the cache page, now.');
|
||||
|
||||
|
@ -244,7 +244,7 @@ function toggleAttr(id)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">{cache_attrib_list}</td>
|
||||
<td colspan="2">{cache_attrib_list}{safari_message}</td>
|
||||
</tr>
|
||||
<tr><td class="spacer" colspan="2"> </td></tr>
|
||||
<tr>
|
||||
|
@ -19,7 +19,7 @@
|
||||
<input type="hidden" name="commit" value="1"/>
|
||||
<input type="hidden" name="logid" value="{logid}"/>
|
||||
<table class="table">
|
||||
<tr><td class="header" colspan="2"><img src="lang/de/ocstyle/images/description/22x22-logs.png" border="0" width="32" height="32" alt="" title="" align="middle"> <b>{t}remove log entry for <a href="viewcache.php?cacheid={cacheid}">{cachename}</a>{/t}</b></td></tr>
|
||||
<tr><td class="header" colspan="2"><img src="lang/de/ocstyle/images/description/22x22-logs.png" border="0" width="22" height="22" alt="" title="" align="middle"> <b>{t}remove log entry for <a href="viewcache.php?cacheid={cacheid}">{cachename}</a>{/t}</b></td></tr>
|
||||
|
||||
<tr><td colspan="2">{t}are you sure that this log entry shall be removed?{/t}</td></tr>
|
||||
<tr><td class="spacer"></td></tr>
|
||||
|
@ -23,7 +23,7 @@
|
||||
<input type="hidden" name="commit" value="1"/>
|
||||
<input type="hidden" name="logid" value="{logid}"/>
|
||||
<table class="table">
|
||||
<tr><td class="header" colspan="2"><img src="lang/de/ocstyle/images/description/22x22-logs.png" border="0" width="32" height="32" alt="" title="" align="middle"> <b>{t}remove log entry for <a href="viewcache.php?cacheid={cacheid}">{cachename}</a>{/t}</b></td></tr>
|
||||
<tr><td class="header" colspan="2"><img src="lang/de/ocstyle/images/description/22x22-logs.png" border="0" width="22" height="22" alt="" title="" align="middle"> <b>{t}remove log entry for <a href="viewcache.php?cacheid={cacheid}">{cachename}</a>{/t}</b></td></tr>
|
||||
<tr><td class="spacer"></td></tr>
|
||||
|
||||
<tr><td colspan="2">{t}Are you sure to remove your log entry?{/t}</td></tr>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<td width="45" class="{bgcolor}" style="{line_style}">{distance} </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} <a href="viewcache.php?cacheid={urlencode_cacheid}"><span style="{status_style}">{cachename}</span></a> <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="448" class="{bgcolor}">{new} <span style="{status_style}"><a href="viewcache.php?cacheid={urlencode_cacheid}"><span style="{name_style}">{cachename}</span></a></span> <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} </td>
|
||||
</tr>
|
||||
|
@ -28,10 +28,10 @@
|
||||
|
||||
<div class="content2-container bg-blue02" style="margin-top:20px;">
|
||||
<p class="content-title-noshade-size3">
|
||||
<img src="resource2/ocstyle/images/cacheicon/traditional.gif" width="32" height="32" style="align:left;margin-right:10px;" alt="{t}Search{/t}" />
|
||||
<b>{t}Search result{/t}:</b> {t}{results_count} caches matched.{/t}
|
||||
<img src="resource2/ocstyle/images/cacheicon/traditional.gif" width="32" height="32" style="align:left;" alt="{t}Search{/t}" />
|
||||
{t}{results_count} caches matched{/t}
|
||||
<span style="font-weight:normal;float:right;font-size:80%;" >
|
||||
[<a href="query.php?action=save&queryid={queryid}">{t}Save options{/t}</a>]<br />
|
||||
[<a href="query.php?action=save&queryid={queryid}">{t}Save options{/t}</a>]
|
||||
[<a href="search.php?queryid={queryid}&showresult=0">{t}Edit options{/t}</a>]
|
||||
</span>
|
||||
</p>
|
||||
@ -44,11 +44,9 @@
|
||||
<td class="header-small" colspan="2">
|
||||
<table width="98.5%">
|
||||
<tr>
|
||||
<td>{pages}</td>
|
||||
<td style="width:80px">
|
||||
<b>{t}Downloads{/t}:</b>
|
||||
</td>
|
||||
<td style="width:120px">
|
||||
<td width="100%">{pages}</td>
|
||||
<td>{t}Download{/t}:</td>
|
||||
<td>
|
||||
<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>
|
||||
@ -77,16 +75,17 @@
|
||||
<tr><td class="spacer" colspan="2"> </td></tr>
|
||||
<tr>
|
||||
<td colspan="2" style="padding-left: 0px; padding-right: 0px;">
|
||||
<table border="0" cellspacing="0px" cellpadding="0px" class="null">
|
||||
<tr class="searchresult">
|
||||
<td width="18" height="13" bgcolor="#E6E6E6"> # </td>
|
||||
<td width="45" height="13" bgcolor="#E6E6E6"><b>{distanceunit}</b></td>
|
||||
<td width="32" height="13" bgcolor="#E6E6E6"><b>{t}Type{/t}</b></td>
|
||||
<td width="46" height="13" bgcolor="#E6E6E6"><b>{t}D/T{/t}</b></td>
|
||||
<td width="448" height="13" bgcolor="#E6E6E6"><b>{t}Name{/t}</b></td>
|
||||
<td width="48" height="13" bgcolor="#E6E6E6"><b> </b></td>
|
||||
<td width="126" height="13" bgcolor="#E6E6E6"><b style="display:{displaylastlogs}">{t}Last logs{/t}</b><b style="display:{displayownlogs}">{t}Own logs{/t}</b></td>
|
||||
<table border="0" cellspacing="0px" cellpadding="0px" class="searchtable">
|
||||
<tr>
|
||||
<th width="18" height="13" > # </th>
|
||||
<th width="45" height="13">{distanceunit}</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"> </th>
|
||||
<th width="126" height="13"><span style="display:{displaylastlogs}">{t}Last logs{/t}<span style="display:{displayownlogs}">{t}Own logs{/t}</th>
|
||||
</tr>
|
||||
<tr><td></td></tr>
|
||||
<!--a-->{results}<!--z-->
|
||||
</table>
|
||||
</td>
|
||||
@ -97,26 +96,25 @@
|
||||
</tr>
|
||||
<tr><td class="spacer" colspan="2"> </td></tr>
|
||||
</table>
|
||||
<table class="content">
|
||||
<table class="content" width="100%">
|
||||
<tr>
|
||||
<td><b>{t}Downloads{/t}</b></td>
|
||||
<td><b>{t}Download{/t}:</b></td>
|
||||
<td align="right" style="padding-right:20px;">
|
||||
{t}Results on this page:{/t}
|
||||
<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=txt&startat={startat}" title="{t}Textfile .txt{/t}">TXT</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="help">
|
||||
{t}Download for local application{/t}
|
||||
</td>
|
||||
<td align="right" style="padding-right:20px;">
|
||||
{t}Result {startatp1} to {endat} (as zip):{/t}
|
||||
<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>
|
||||
@ -127,7 +125,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="help" colspan="2" align="right">
|
||||
<td class="help" colspan="2" align="right" style="line-height:2em;">
|
||||
{t}With the download you accept the <a href="articles.php?page=impressum#tos">terms of use</a> from opencaching.de. {/t}
|
||||
</td>
|
||||
</tr>
|
||||
|
141
htdocs/lib/logtypes.inc.php
Normal file
@ -0,0 +1,141 @@
|
||||
<?php
|
||||
/****************************************************************************
|
||||
For license information see doc/license.txt
|
||||
|
||||
Unicode Reminder メモ
|
||||
|
||||
log type definitions and functions
|
||||
replaces the obsolete table `cache_logtype`
|
||||
|
||||
This is included in both, lib1 and lib2 code!
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
// return associative array (id => translated name) of all log types
|
||||
|
||||
function get_logtype_names()
|
||||
{
|
||||
global $locale, $opt;
|
||||
|
||||
if (!isset($locale)) $locale = $opt['template']['locale'];
|
||||
|
||||
$log_types = array();
|
||||
$rs = sql("SELECT `log_types`.`id`,
|
||||
IFNULL(`sys_trans_text`.`text`,`log_types`.`en`) AS `type_name`
|
||||
FROM `log_types`
|
||||
LEFT JOIN `sys_trans_text` ON `sys_trans_text`.`trans_id` = `log_types`.`trans_id` AND `sys_trans_text`.`lang`='" . sql_escape($locale) . "'");
|
||||
while ($r = sql_fetch_array($rs))
|
||||
$log_types[$r['id']] = $r['type_name'];
|
||||
sql_free_result($rs);
|
||||
|
||||
return $log_types;
|
||||
}
|
||||
|
||||
|
||||
// test if the logged in user is working on a report for a certain cache
|
||||
|
||||
function admin_has_open_report($cache_id)
|
||||
{
|
||||
global $login;
|
||||
|
||||
$hasreport = false;
|
||||
|
||||
if ($login->hasAdminPriv(ADMIN_USER))
|
||||
{
|
||||
$rs = sql("SELECT `id` FROM `cache_reports`
|
||||
WHERE `cacheid`='&1' AND `adminid`='&2' AND `status`=2",
|
||||
$cache_id, $login->userid);
|
||||
if ($r = sql_fetch_array($rs))
|
||||
$hasreport = $r['id'] != 0;
|
||||
sql_free_result($rs);
|
||||
}
|
||||
|
||||
return $hasreport;
|
||||
}
|
||||
|
||||
|
||||
// returns ordered array of allowed log types for a cache and the active user:
|
||||
// type_id => translated type name
|
||||
// first entry is default for new logs
|
||||
|
||||
function get_cache_log_types($cache_id, $old_logtype)
|
||||
{
|
||||
global $login;
|
||||
|
||||
// get input data
|
||||
$rs = sql("SELECT `type`, `status`, `user_id` FROM `caches` WHERE `cache_id`='&1'", $cache_id);
|
||||
$rCache = sql_fetch_array($rs);
|
||||
sql_free_result($rs);
|
||||
|
||||
$cache_type = $rCache['type'];
|
||||
$cache_status = $rCache['status'];
|
||||
$owner = $login->userid == ($rCache['user_id']);
|
||||
$admin = admin_has_open_report($cache_id);
|
||||
|
||||
// build result list
|
||||
//
|
||||
// Pay attention to okapi/services/logs/submit.php when changing this!
|
||||
|
||||
$allowed_logtypes = array();
|
||||
if ($owner || $admin)
|
||||
{
|
||||
$allowed_logtypes[] = 3; // note
|
||||
if ($cache_status != 5 && (($cache_status != 4 && $cache_status != 7) || $admin))
|
||||
{
|
||||
$allowed_logtypes[] = 10; // ready for search
|
||||
$allowed_logtypes[] = 11; // temporarily not available
|
||||
$allowed_logtypes[] = 9; // archived
|
||||
$allowed_logtypes[] = 13; // locked
|
||||
}
|
||||
if ($admin || $old_logtype == 14)
|
||||
$allowed_logtypes[] = 14; // locked, invisible
|
||||
}
|
||||
if ($cache_type == 6) // event
|
||||
{
|
||||
$allowed_logtypes[] = 8; // will attend
|
||||
$allowed_logtypes[] = 7; // attended
|
||||
}
|
||||
else
|
||||
{
|
||||
$allowed_logtypes[] = 1; // found
|
||||
$allowed_logtypes[] = 2; // not found
|
||||
}
|
||||
if (!($owner || $admin))
|
||||
{
|
||||
$allowed_logtypes[] = 3; // note
|
||||
}
|
||||
|
||||
return $allowed_logtypes;
|
||||
}
|
||||
|
||||
|
||||
function logtype_ok($cache_id, $logtype_id, $old_logtype)
|
||||
{
|
||||
return in_array($logtype_id, get_cache_log_types($cache_id, $old_logtype));
|
||||
}
|
||||
|
||||
|
||||
function teamcomment_allowed($cache_id, $logtype_id)
|
||||
{
|
||||
global $login, $opt;
|
||||
|
||||
if (!$login->hasAdminPriv(ADMIN_USER))
|
||||
return false;
|
||||
elseif ($logtype_id != 3 && ($logtype_id < 9 || $logtype_id > 14))
|
||||
return false;
|
||||
else
|
||||
{
|
||||
$rs = sql("SELECT `user_id` FROM `caches` WHERE `cache_id`='&1'", $cache_id);
|
||||
if ($r = sql_fetch_array($rs))
|
||||
{
|
||||
$allowed = $login->userid != $r['user_id'] &&
|
||||
(!$opt['logic']['admin']['team_comments_only_for_reports'] || admin_has_open_report($cache_id));
|
||||
}
|
||||
else
|
||||
$allowed = false;
|
||||
sql_free_result($rs);
|
||||
return $allowed;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -142,6 +142,11 @@
|
||||
$gpxLogType[3] = 'Write note';
|
||||
$gpxLogType[7] = 'Attended';
|
||||
$gpxLogType[8] = 'Will attend';
|
||||
$gpxLogType[9] = 'Archive';
|
||||
$gpxLogType[10] = 'Owner Maintenance';
|
||||
$gpxLogType[11] = 'Temporarily Disable Listing';
|
||||
$gpxLogType[13] = 'Archive';
|
||||
$gpxLogType[14] = 'Archive';
|
||||
|
||||
$gpxSymNormal = 'Geocache';
|
||||
$gpxSymFound = 'Geocache Found';
|
||||
|
@ -227,7 +227,9 @@
|
||||
|
||||
// strikeout inavtive caches
|
||||
// see also res_cachestatus_span.tpl
|
||||
$line_style = "";
|
||||
$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
|
||||
@ -235,21 +237,23 @@
|
||||
break;
|
||||
case 3: // archived
|
||||
case 6: // locked
|
||||
$status_style = "text-decoration: line-through; color: grey";
|
||||
$line_style = "color:grey";
|
||||
$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";
|
||||
$line_style = "color:grey";
|
||||
$name_style = "color: #e00000";
|
||||
// $line_style = "color:grey";
|
||||
break;
|
||||
case 5: // not published yet
|
||||
$status_style = "color: #e00000";
|
||||
$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);
|
||||
@ -287,43 +291,34 @@
|
||||
|
||||
tpl_set_var('results', $caches_output);
|
||||
|
||||
//more than one page?
|
||||
if ($startat > 0)
|
||||
{ // Ocprop: queryid=([0-9]+)
|
||||
$pages = t('Seite:') . ' <a href="search.php?queryid=' . $options['queryid'] . '&startat=0"><<</a> <a href="search.php?queryid=' . $options['queryid'] . '&startat=' . ($startat - $caches_per_page) . '"><</a> ';
|
||||
}
|
||||
// more than one page?
|
||||
if ($resultcount <= $caches_per_page)
|
||||
$pages = '';
|
||||
else
|
||||
{
|
||||
$pages = t('Seite:') . ' << < ';
|
||||
}
|
||||
|
||||
$frompage = ($startat / $caches_per_page) - 3;
|
||||
if ($frompage < 1) $frompage = 1;
|
||||
|
||||
$maxpage = ceil($resultcount / $caches_per_page);
|
||||
|
||||
$topage = $frompage + 8;
|
||||
if ($topage > $maxpage) $topage = $maxpage;
|
||||
|
||||
for ($i = $frompage; $i <= $topage; $i++)
|
||||
{
|
||||
if (($startat / $caches_per_page + 1) == $i)
|
||||
{
|
||||
$pages .= ' <b>' . $i . '</b>';
|
||||
}
|
||||
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> ';
|
||||
else
|
||||
{
|
||||
$pages .= ' <a href="search.php?queryid=' . $options['queryid'] . '&startat=' . (($i - 1) * $caches_per_page) . '">' . $i . '</a>';
|
||||
}
|
||||
}
|
||||
$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> ';
|
||||
|
||||
if ($startat / $caches_per_page < ($maxpage - 1))
|
||||
{
|
||||
$pages .= ' <a href="search.php?queryid=' . $options['queryid'] . '&startat=' . ($startat + $caches_per_page) . '">></a> <a href="search.php?queryid=' . $options['queryid'] . '&startat=' . (($maxpage - 1) * $caches_per_page) . '">>></a> ';
|
||||
}
|
||||
else
|
||||
{
|
||||
$pages .= ' > >>';
|
||||
$frompage = ($startat / $caches_per_page) - 3;
|
||||
if ($frompage < 1) $frompage = 1;
|
||||
$maxpage = ceil($resultcount / $caches_per_page);
|
||||
$topage = $frompage + 8;
|
||||
if ($topage > $maxpage) $topage = $maxpage;
|
||||
|
||||
for ($i = $frompage; $i <= $topage; $i++)
|
||||
{
|
||||
if (($startat / $caches_per_page + 1) == $i)
|
||||
$pages .= ' <b>' . $i . '</b>';
|
||||
else
|
||||
$pages .= ' <a href="search.php?queryid=' . $options['queryid'] . '&startat=' . (($i - 1) * $caches_per_page) . '">' . $i . '</a>';
|
||||
}
|
||||
|
||||
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>';
|
||||
}
|
||||
|
||||
//'<a href="search.php?queryid=' . $options['queryid'] . '&startat=20">20</a> 40 60 80 100';
|
||||
|
@ -144,6 +144,9 @@
|
||||
$opt['logic']['license']['disclaimer'] = true; // also in lib2/settings-dist.inc.php
|
||||
$opt['logic']['license']['terms'] = $absolute_server_URI . 'articles.php?page=impressum#datalicense';
|
||||
|
||||
// admin may use OC-team-comment log flag only when processing a cache report
|
||||
$opt['logic']['admin']['team_comments_only_for_reports'] = true;
|
||||
|
||||
// see config2/settings-dist.inc.php
|
||||
$opt['template']['default']['locale'] = 'DE'; // may be overwritten by $opt['domain'][...]['locale']
|
||||
|
||||
|
@ -50,8 +50,8 @@
|
||||
//this in private_db.inc.php, but don't forget the ending /
|
||||
$absolute_server_URI = 'http://www.opencaching.de/';
|
||||
|
||||
// EMail address of the sender
|
||||
if (!isset($emailaddr)) $emailaddr = 'contact@opencaching.de';
|
||||
// 'From' EMail address for admin error messages and log removals
|
||||
if (!isset($emailaddr)) $emailaddr = 'noreply@opencaching.de';
|
||||
|
||||
// location of cache images
|
||||
if (!isset($picdir)) $picdir = $rootpath . 'images/uploads'; // Ocprop
|
||||
@ -142,6 +142,10 @@
|
||||
// fill_gaps = false: continue with the last waypoint
|
||||
$opt['logic']['waypoint_pool']['fill_gaps'] = false;
|
||||
|
||||
// admin may use OC-team-comment log flag only when processing a cache report
|
||||
// see also setting in config2/settings.inc.php!
|
||||
$opt['logic']['admin']['team_comments_only_for_reports'] = true;
|
||||
|
||||
// see config2/settings-dist.inc.php
|
||||
$opt['template']['default']['locale'] = 'DE'; // may be overwritten by $opt['domain'][...]['locale']
|
||||
$opt['template']['default']['country'] = 'DE'; // may be overwritten by $opt['domain'][...]['country']
|
||||
|
@ -32,6 +32,11 @@
|
||||
sql_export_table($f, $table) ... export table to file
|
||||
sql_export_table_to_file($filename, $table)
|
||||
|
||||
sql_table_exists ... tests if a table exists
|
||||
sql_field_exists ... tests if a table and a field in this table exist
|
||||
sql_field_type ... queries the type of a field (uppercase letters)
|
||||
sql_index_exists ... tests if a table and an index of this table exist
|
||||
|
||||
// slave query functions
|
||||
sql_slave_exclude() ... do not use slave servers for the current user
|
||||
until the slaves have replicated to this point
|
||||
@ -1081,4 +1086,50 @@
|
||||
sql_export_structure($f, $table);
|
||||
fclose($f);
|
||||
}
|
||||
|
||||
// test if a database table exists
|
||||
function sql_table_exists($table)
|
||||
{
|
||||
global $opt;
|
||||
|
||||
return sql_value("SELECT COUNT(*)
|
||||
FROM `information_schema`.`tables`
|
||||
WHERE `table_schema`='&1' AND `table_name`='&2'",
|
||||
0, $opt['db']['placeholder']['db'], $table) > 0;
|
||||
}
|
||||
|
||||
// test if a database field exists
|
||||
function sql_field_exists($table, $field)
|
||||
{
|
||||
global $opt;
|
||||
|
||||
return sql_value("SELECT COUNT(*)
|
||||
FROM `information_schema`.`columns`
|
||||
WHERE `table_schema`='&1' AND `table_name`='&2' AND `column_name`='&3'",
|
||||
0, $opt['db']['placeholder']['db'], $table, $field) > 0;
|
||||
}
|
||||
|
||||
// get type of a database field
|
||||
function sql_field_type($table, $field)
|
||||
{
|
||||
global $opt;
|
||||
|
||||
return strtoupper(
|
||||
sql_value("SELECT `data_type`
|
||||
FROM `information_schema`.`columns`
|
||||
WHERE `table_schema`='&1' AND `table_name`='&2' AND `column_name`='&3'",
|
||||
'', $opt['db']['placeholder']['db'], $table, $field) );
|
||||
}
|
||||
|
||||
// test if a database index exists
|
||||
function sql_index_exists($table, $index)
|
||||
{
|
||||
global $opt;
|
||||
|
||||
return sql_value("SELECT COUNT(*)
|
||||
FROM `information_schema`.`statistics`
|
||||
WHERE `table_schema`='&1' AND `table_name`='&2' AND `index_name`='&3'",
|
||||
0, $opt['db']['placeholder']['db'], $table, $index) > 0;
|
||||
}
|
||||
|
||||
?>
|
@ -49,7 +49,7 @@ class attribute
|
||||
{
|
||||
$sAddWhereSql = '';
|
||||
if ($bOnlySelectable == true)
|
||||
$sAddWhereSql = ' AND `cache_attrib`.`selectable`=1';
|
||||
$sAddWhereSql .= ' AND `cache_attrib`.`selectable`=1';
|
||||
|
||||
$rsAttr = sql("SELECT `cache_attrib`.`id`, IFNULL(`tt1`.`text`, `cache_attrib`.`name`) AS `name`,
|
||||
IFNULL(`tt2`.`text`, `cache_attrib`.`html_desc`) AS `html_desc`,
|
||||
|
@ -196,8 +196,10 @@ class cache
|
||||
}
|
||||
function setStatus($value)
|
||||
{
|
||||
$login;
|
||||
if (sql_value("SELECT COUNT(*) FROM `cache_status` WHERE `id`='&1'", 0, $value) == 1)
|
||||
{
|
||||
sql("SET @STATUS_CHANGE_USER_ID='&1'", $login->user_id);
|
||||
return $this->reCache->setValue('status', $value);
|
||||
}
|
||||
else
|
||||
@ -296,13 +298,13 @@ class cache
|
||||
{
|
||||
// admins may view owner-deleted logs
|
||||
$table = 'cache_logs_archived';
|
||||
$delfields = 'IFNULL(`u2`.`username`,"") AS `deleted_by_name`, `deletion_date`';
|
||||
$delfields = 'IFNULL(`u2`.`username`,"") AS `deleted_by_name`, `deletion_date`, "1" AS `deleted`';
|
||||
$addjoin = 'LEFT JOIN `user` `u2` ON `u2`.`user_id`=`cache_logs`.`deleted_by`';
|
||||
}
|
||||
else
|
||||
{
|
||||
$table = 'cache_logs';
|
||||
$delfields = '"" AS `deleted_by_name`, NULL AS `deletion_date`';
|
||||
$delfields = '"" AS `deleted_by_name`, NULL AS `deletion_date`, "0" AS `deleted`';
|
||||
$addjoin = '';
|
||||
}
|
||||
|
||||
@ -313,6 +315,7 @@ class cache
|
||||
`cache_logs`.`date` AS `date`,
|
||||
substr(`cache_logs`.`date`,12) AS `time`, /* 00:00:01 = 00:00 logged, 00:00:00 = no time */
|
||||
`cache_logs`.`type` AS `type`,
|
||||
`cache_logs`.`oc_team_comment` AS `oc_team_comment`,
|
||||
`cache_logs`.`text` AS `text`,
|
||||
`cache_logs`.`text_html` AS `texthtml`,
|
||||
`cache_logs`.`picture`,
|
||||
@ -460,5 +463,59 @@ class cache
|
||||
{
|
||||
sql("DELETE FROM `cache_rating` WHERE `cache_id`='&1' AND `user_id`='&2'", $this->nCacheId, $nUserId);
|
||||
}
|
||||
|
||||
// retrieves admin cache history data and stores it to template variables
|
||||
// for display by adminhistory.tpl and adminreports.tpl
|
||||
function setTplHistoryData($exclude_report_id)
|
||||
{
|
||||
global $opt, $tpl;
|
||||
|
||||
// (other) reports for this cache
|
||||
$rs = sql("SELECT `cr`.`id`, `cr`.`date_created`, `cr`.`lastmodified`,
|
||||
`cr`.`userid`, `cr`.`adminid`,
|
||||
`users`.`username` AS `usernick`,
|
||||
`admins`.`username` AS `adminnick`,
|
||||
IFNULL(`tt`.`text`, `crs`.`name`) AS `status`,
|
||||
IFNULL(`tt2`.`text`, `crr`.`name`) AS `reason`
|
||||
FROM `cache_reports` AS `cr`
|
||||
LEFT JOIN `cache_report_reasons` AS `crr` ON `cr`.`reason`=`crr`.`id`
|
||||
LEFT JOIN `user` AS `users` ON `users`.`user_id`=`cr`.`userid`
|
||||
LEFT JOIN `user` AS `admins` ON `admins`.`user_id`=`cr`.`adminid`
|
||||
LEFT JOIN `cache_report_status` AS `crs` ON `cr`.`status`=`crs`.`id`
|
||||
LEFT JOIN `sys_trans_text` AS `tt` ON `crs`.`trans_id`=`tt`.`trans_id` AND `tt`.`lang`='&2'
|
||||
LEFT JOIN `sys_trans_text` AS `tt2` ON `crr`.`trans_id`=`tt2`.`trans_id` AND `tt2`.`lang`='&2'
|
||||
WHERE `cr`.`cacheid`='&1' AND `cr`.`id`<>'&3'
|
||||
ORDER BY `cr`.`status`,`cr`.`id` DESC", $this->getCacheId(), $opt['template']['locale'], $exclude_report_id);
|
||||
$tpl->assign_rs('reports',$rs);
|
||||
sql_free_result($rs);
|
||||
|
||||
// user; deleted logs
|
||||
$rs = sql("SELECT * FROM `caches` WHERE `cache_id`='&1'", $this->getCacheId());
|
||||
$rCache = sql_fetch_array($rs);
|
||||
$tpl->assign('cache', $rCache);
|
||||
sql_free_result($rs);
|
||||
$tpl->assign('ownername', sql_value("SELECT `username` FROM `user` WHERE `user_id`='&1'", "", $rCache['user_id']));
|
||||
|
||||
$tpl->assign('deleted_logs', $this->getLogsArray($this->getCacheId(), 0, 1000, true));
|
||||
|
||||
// status changes
|
||||
$rs = sql("SELECT `csm`.`date_modified`,
|
||||
`csm`.`old_state` AS `old_status_id`,
|
||||
`csm`.`new_state` AS `new_status_id`,
|
||||
`user`.`username`,
|
||||
IFNULL(`stt_old`.`text`,`cs_old`.`name`) AS `old_status`,
|
||||
IFNULL(`stt_new`.`text`,`cs_new`.`name`) AS `new_status`
|
||||
FROM `cache_status_modified` `csm`
|
||||
LEFT JOIN `cache_status` `cs_old` ON `cs_old`.`id`=`csm`.`old_state`
|
||||
LEFT JOIN `sys_trans_text` `stt_old` ON `stt_old`.`trans_id`=`cs_old`.`trans_id` AND `stt_old`.`lang`='&2'
|
||||
LEFT JOIN `cache_status` `cs_new` ON `cs_new`.`id`=`csm`.`new_state`
|
||||
LEFT JOIN `sys_trans_text` `stt_new` ON `stt_new`.`trans_id`=`cs_new`.`trans_id` AND `stt_new`.`lang`='&2'
|
||||
LEFT JOIN `user` ON `user`.`user_id`=`csm`.`user_id`
|
||||
WHERE `cache_id`='&1'
|
||||
ORDER BY `date_modified` DESC", $this->getCacheId(), $opt['template']['locale']);
|
||||
$tpl->assign_rs('status_changes',$rs);
|
||||
sql_free_result($rs);
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
@ -10,6 +10,7 @@
|
||||
|
||||
require_once($opt['rootpath'] . 'lib2/logic/rowEditor.class.php');
|
||||
require_once($opt['rootpath'] . 'lib2/logic/cache.class.php');
|
||||
require_once($opt['rootpath'] . 'lib/logtypes.inc.php');
|
||||
|
||||
class cachelog
|
||||
{
|
||||
@ -58,6 +59,7 @@ class cachelog
|
||||
$this->reCacheLog->addInt('cache_id', 0, false);
|
||||
$this->reCacheLog->addInt('user_id', 0, false);
|
||||
$this->reCacheLog->addInt('type', 0, false);
|
||||
$this->reCacheLog->addInt('oc_team_comment', 0, false);
|
||||
$this->reCacheLog->addDate('date', time(), false);
|
||||
$this->reCacheLog->addString('text', '', false);
|
||||
$this->reCacheLog->addInt('text_html', 0, false);
|
||||
@ -106,14 +108,24 @@ class cachelog
|
||||
{
|
||||
return $this->reCacheLog->getValue('type');
|
||||
}
|
||||
function setType($value)
|
||||
function setType($value,$force=false)
|
||||
{
|
||||
$nValidLogTypes = $this->getValidLogTypes();
|
||||
if (array_search($value, $nValidLogTypes) === false)
|
||||
return false;
|
||||
|
||||
if (!$force)
|
||||
{
|
||||
$nValidLogTypes = $this->getValidLogTypes();
|
||||
if (array_search($value, $nValidLogTypes) === false)
|
||||
return false;
|
||||
}
|
||||
return $this->reCacheLog->setValue('type', $value);
|
||||
}
|
||||
function getOcTeamComment()
|
||||
{
|
||||
return $this->reCacheLog->getValue('oc_team_comment');
|
||||
}
|
||||
function setOcTeamComment($value)
|
||||
{
|
||||
return $this->reCacheLog->setValue('oc_team_comment', $value);
|
||||
}
|
||||
function getDate()
|
||||
{
|
||||
return $this->reCacheLog->getValue('date');
|
||||
@ -223,7 +235,6 @@ class cachelog
|
||||
return false;
|
||||
}
|
||||
|
||||
/* will depend on userid in future e.g. maintainance-logs etc. */
|
||||
function getValidLogTypes()
|
||||
{
|
||||
$cache = new cache($this->getCacheId());
|
||||
@ -233,14 +244,7 @@ class cachelog
|
||||
// return array();
|
||||
// Logic Error - log types are still valid when no NEW logs are allowed for the cache.
|
||||
// (Would e.g. block admin logs and log-type restoring for locked caches.)
|
||||
|
||||
$nTypes = array();
|
||||
$rs = sql("SELECT `log_type_id` FROM `cache_logtype` WHERE `cache_type_id`='&1'", $cache->getType());
|
||||
while ($r = sql_fetch_assoc($rs))
|
||||
$nTypes[] = $r['log_type_id'];
|
||||
sql_free_result($rs);
|
||||
|
||||
return $nTypes;
|
||||
return get_cache_log_types($this->getCacheId(),$this->getType()); // depends on userid
|
||||
}
|
||||
}
|
||||
?>
|
@ -40,6 +40,8 @@
|
||||
define('ATTRIB_UNSELECTED', 2);
|
||||
define('ATTRIB_UNDEF', 3);
|
||||
|
||||
define('ATTRIB_ID_SAFARI', 61);
|
||||
|
||||
define('OBJECT_CACHELOG', 1);
|
||||
define('OBJECT_CACHE', 2);
|
||||
define('OBJECT_CACHEDESC', 3);
|
||||
|
@ -103,6 +103,8 @@ class getNew
|
||||
`caches`.`name` `name`,
|
||||
`caches`.`date_created` `date_created`,
|
||||
`caches`.`type`,
|
||||
`caches`.`longitude` `longitude`,
|
||||
`caches`.`latitude` `latitude`,
|
||||
IFNULL(`sys_trans_text`.`text`,`cache_location`.`adm1`) AS `adm1`,
|
||||
`cache_location`.`adm2`,
|
||||
`cache_location`.`adm3`,
|
||||
|
@ -21,6 +21,7 @@
|
||||
|
||||
//prepare the templates and include all neccessary
|
||||
require_once('./lib/common.inc.php');
|
||||
require_once('./lib/logtypes.inc.php');
|
||||
require($stylepath.'/smilies.inc.php');
|
||||
require_once($opt['rootpath'] . '../lib/htmlpurifier-4.2.0/library/HTMLPurifier.auto.php');
|
||||
|
||||
@ -114,6 +115,7 @@
|
||||
$log_time_minute = isset($_POST['logminute']) ? trim($_POST['logminute']) : "";
|
||||
$top_option = isset($_POST['ratingoption']) ? $_POST['ratingoption']+0 : 0;
|
||||
$top_cache = isset($_POST['rating']) ? $_POST['rating']+0 : 0;
|
||||
$oc_team_comment = isset($_POST['teamcomment']) ? ($_POST['teamcomment'] != 0) : 0;
|
||||
|
||||
// check if user has exceeded his top5% limit
|
||||
$user_founds = sqlValue("SELECT IFNULL(`stat_user`.`found`, 0) FROM `user` LEFT JOIN `stat_user` ON `user`.`user_id`=`stat_user`.`user_id` WHERE `user`.`user_id`='" . sql_escape($usr['userid']) . "'", 0);
|
||||
@ -169,6 +171,10 @@
|
||||
$log_text = nl2br(htmlspecialchars($log_text, ENT_COMPAT, 'UTF-8'));
|
||||
}
|
||||
|
||||
// ignore unauthorized team comments
|
||||
if (!teamcomment_allowed($cache_id, $log_type))
|
||||
$oc_team_comment = 0;
|
||||
|
||||
// validate data
|
||||
if (is_numeric($log_date_month) && is_numeric($log_date_day) && is_numeric($log_date_year) &&
|
||||
("$log_time_hour$log_time_minute"=="" || is_numeric($log_time_hour)) &&
|
||||
@ -187,7 +193,7 @@
|
||||
else
|
||||
$date_ok = false;
|
||||
|
||||
$logtype_ok = sqlValue("SELECT COUNT(*) FROM cache_logtype WHERE cache_type_id='" . sql_escape($cache_type) . "' AND log_type_id='" . sql_escape($log_type) . "'", 0) > 0;
|
||||
$logtype_ok = logtype_ok($cache_id, $log_type, 0); // depends on userid
|
||||
|
||||
// not a found log? then ignore the rating
|
||||
if ($log_type != 1 && $log_type != 7)
|
||||
@ -229,26 +235,22 @@
|
||||
|
||||
if (!$already_exists)
|
||||
{
|
||||
sql("INSERT INTO `cache_logs` (`id`, `cache_id`, `user_id`, `type`, `date`, `text`, `text_html`, `text_htmledit`, `node`)
|
||||
VALUES ('', '&1', '&2', '&3', '&4', '&5', '&6', '&7', '&8')",
|
||||
$cache_id, $usr['userid'], $log_type, $log_date, $log_text, (($descMode != 1) ? 1 : 0), (($descMode == 3) ? 1 : 0), $oc_nodeid);
|
||||
// update cache_status
|
||||
$new_cache_status = sqlValue("SELECT `cache_status` FROM `log_types` WHERE `id`='" . sql_escape($log_type) . "'", 0);
|
||||
if ($new_cache_status > 0)
|
||||
{
|
||||
sql("SET @STATUS_CHANGE_USER_ID='&1'", $usr['userid']);
|
||||
$rs = sql("UPDATE `caches` SET `status`='&1' WHERE `cache_id`='&2'", $new_cache_status, $cache_id);
|
||||
}
|
||||
|
||||
// insert log
|
||||
sql("INSERT INTO `cache_logs` (`id`, `cache_id`, `user_id`, `type`, `oc_team_comment`, `date`, `text`, `text_html`, `text_htmledit`, `node`)
|
||||
VALUES ('', '&1', '&2', '&3', '&4', '&5', '&6', '&7', '&8', '&9')",
|
||||
$cache_id, $usr['userid'], $log_type, $oc_team_comment, $log_date, $log_text, (($descMode != 1) ? 1 : 0), (($descMode == 3) ? 1 : 0), $oc_nodeid);
|
||||
|
||||
// do not use slave server for the next time ...
|
||||
db_slave_exclude();
|
||||
|
||||
// update cache_status
|
||||
$rs = sql("SELECT `log_types`.`cache_status` FROM `log_types` WHERE `id`='&1'", $log_type);
|
||||
if ($record = sql_fetch_array($rs))
|
||||
{
|
||||
$cache_status = $record['cache_status'];
|
||||
if ($cache_status != 0)
|
||||
$rs = sql("UPDATE `caches` SET `status`='&1' WHERE `cache_id`='&2'", $cache_status, $cache_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
die("OPS!");
|
||||
}
|
||||
|
||||
// update top-list
|
||||
if ($top_option)
|
||||
if ($top_cache)
|
||||
@ -268,29 +270,19 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
//build logtypeoptions
|
||||
// build logtype options
|
||||
$logtype_names = get_logtype_names();
|
||||
$allowed_logtypes = get_cache_log_types($cache_id, 0);
|
||||
$default_log_type = isset($_REQUEST['logtype']) ? $_REQUEST['logtype']+0 : 0;
|
||||
if (!logtype_ok($cache_id, $default_log_type, 0))
|
||||
$default_log_type = $allowed_logtypes[0];
|
||||
|
||||
$logtypeoptions = '';
|
||||
if ($cache_type == 6) // event
|
||||
$logtypeorder = 'DESC';
|
||||
else
|
||||
$logtypeorder = 'ASC';
|
||||
$rsLogTypes = sql("SELECT `log_types`.`id`, IFNULL(`sys_trans_text`.`text`, `log_types`.`name`) AS `name`
|
||||
FROM `caches`
|
||||
INNER JOIN `cache_type` ON `caches`.`type`=`cache_type`.`id`
|
||||
INNER JOIN `cache_logtype` ON `cache_type`.`id`=`cache_logtype`.`cache_type_id`
|
||||
INNER JOIN `log_types` ON `cache_logtype`.`log_type_id`=`log_types`.`id`
|
||||
LEFT JOIN `sys_trans` ON `log_types`.`trans_id`=`sys_trans`.`id`
|
||||
LEFT JOIN `sys_trans_text` ON `sys_trans`.`id`=`sys_trans_text`.`trans_id` AND `sys_trans_text`.`lang`='" . sql_escape($locale) . "'
|
||||
WHERE `caches`.`cache_id`='" . ($cache_id+0) . "'
|
||||
ORDER BY `log_types`.`id` " . $logtypeorder);
|
||||
$log_type = ($record['user_id'] == $usr['userid'] ? 3 : 1);
|
||||
while ($rLogTypes = sql_fetch_assoc($rsLogTypes))
|
||||
if (!$adminlog || $rLogTypes['id'] == 3)
|
||||
{
|
||||
$sSelected = ($rLogTypes['id'] == $log_type) ? ' selected="selected"' : '';
|
||||
$logtypeoptions .= '<option value="' . $rLogTypes['id'] . '"' . $sSelected . '>' . htmlspecialchars($rLogTypes['name'], ENT_COMPAT, 'UTF-8') . '</option>' . "\n";
|
||||
}
|
||||
sql_free_result($rsLogTypes);
|
||||
foreach ($allowed_logtypes as $logtype)
|
||||
{
|
||||
$selected = ($logtype == $default_log_type ? ' selected="selected"' : '');
|
||||
$logtypeoptions .= '<option value="' . $logtype . '"' . $selected . '>' . htmlspecialchars($logtype_names[$logtype], ENT_COMPAT, 'UTF-8') . '</option>' . "\n";
|
||||
}
|
||||
|
||||
//set tpl vars
|
||||
tpl_set_var('cachename', htmlspecialchars($cachename, ENT_COMPAT, 'UTF-8'));
|
||||
@ -305,6 +297,13 @@
|
||||
tpl_set_var('submit', $submit);
|
||||
tpl_set_var('date_message', '');
|
||||
|
||||
$oc_team_comment = isset($_REQUEST['teamcomment']) ? ($_REQUEST['teamcomment'] != 0) : 0;
|
||||
if (teamcomment_allowed($cache_id,3))
|
||||
tpl_set_var('teamcommentoption',
|
||||
mb_ereg_replace('{chk_sel}', ($oc_team_comment ? 'checked' : ''), $teamcomment_field));
|
||||
else
|
||||
tpl_set_var('teamcommentoption', '');
|
||||
|
||||
// Text / normal HTML / HTML editor
|
||||
tpl_set_var('use_tinymce', (($descMode == 3) ? 1 : 0));
|
||||
|
||||
|
@ -5,9 +5,11 @@
|
||||
* Unicode Reminder メモ
|
||||
***************************************************************************/
|
||||
|
||||
require_once('./lib2/web.inc.php');
|
||||
require_once('./lib2/logic/user.class.php');
|
||||
require_once('./lib2/logic/useroptions.class.php');
|
||||
require_once('lib2/web.inc.php');
|
||||
require_once('lib2/logic/user.class.php');
|
||||
require_once('lib2/logic/useroptions.class.php');
|
||||
require_once('lang/de/ocstyle/smilies.inc.php');
|
||||
require_once('../lib/htmlpurifier-4.2.0/library/HTMLPurifier.auto.php');
|
||||
|
||||
$tpl->name = 'mydetails';
|
||||
$tpl->menuitem = MNU_MYPROFILE_DETAILS;
|
||||
@ -16,28 +18,26 @@
|
||||
if ($login->userid == 0)
|
||||
$tpl->redirect_login();
|
||||
|
||||
if (isset($_REQUEST['cancel']))
|
||||
$tpl->redirect('mydetails.php');
|
||||
|
||||
$action = isset($_REQUEST['action']) ? mb_strtolower($_REQUEST['action']) : 'view';
|
||||
if ($action != 'change' && $action != 'view') $action = 'view';
|
||||
if ($action != 'change' && $action != 'changetext' && $action != 'view') $action = 'view';
|
||||
|
||||
if ($action == 'change')
|
||||
{
|
||||
$tpl->menuitem = MNU_MYPROFILE_DETAILS_EDIT;
|
||||
change();
|
||||
}
|
||||
else if ($action == 'changetext')
|
||||
changetext();
|
||||
else
|
||||
{
|
||||
display();
|
||||
}
|
||||
|
||||
exit;
|
||||
|
||||
|
||||
function change()
|
||||
{
|
||||
global $tpl, $login, $opt;
|
||||
|
||||
if (isset($_REQUEST['cancel']))
|
||||
$tpl->redirect('mydetails.php');
|
||||
|
||||
$useroptions = new useroptions($login->userid);
|
||||
|
||||
if (isset($_REQUEST['save']))
|
||||
@ -56,7 +56,7 @@ function change()
|
||||
if ($vis != 1) $vis = 0;
|
||||
|
||||
$useroptions->setOptVisible($id, $vis);
|
||||
if (strlen($value) > 2000 && $opt['logic']['enableHTMLInUserDescription'] != true)
|
||||
if (strlen($value) > 2000)
|
||||
{
|
||||
$errorlen .= $useroptions->getOptName($id);
|
||||
$bErrorlen = true;
|
||||
@ -89,21 +89,43 @@ function change()
|
||||
$tpl->redirect('mydetails.php');
|
||||
}
|
||||
|
||||
assignFromDB($login->userid);
|
||||
assignFromDB($login->userid,false);
|
||||
$tpl->assign('edit', true);
|
||||
$tpl->display();
|
||||
}
|
||||
|
||||
|
||||
function changetext()
|
||||
{
|
||||
global $tpl, $login;
|
||||
|
||||
if (isset($_REQUEST['save']))
|
||||
{
|
||||
$purifier = new HTMLPurifier();
|
||||
$desctext = isset($_REQUEST['desctext']) ? $purifier->purify($_REQUEST['desctext']) : "";
|
||||
sql("UPDATE `user` SET `description`='&2' WHERE `user_id`='&1'", $login->userid, $desctext);
|
||||
$tpl->redirect('mydetails.php');
|
||||
}
|
||||
else
|
||||
{
|
||||
$tpl->name = 'mydescription';
|
||||
assignFromDB($login->userid,true);
|
||||
$tpl->display();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function display()
|
||||
{
|
||||
global $tpl, $login;
|
||||
assignFromDB($login->userid);
|
||||
assignFromDB($login->userid,false);
|
||||
$tpl->display();
|
||||
}
|
||||
|
||||
function assignFromDB($userid)
|
||||
|
||||
function assignFromDB($userid,$include_editor)
|
||||
{
|
||||
global $tpl, $opt;
|
||||
global $tpl, $opt, $smilies, $_REQUEST;
|
||||
|
||||
$rs = sql("SELECT `p`.`id`, IFNULL(`tt`.`text`, `p`.`name`) AS `name`, `p`.`default_value`, `p`.`check_regex`, `p`.`option_order`, `u`.`option_visible`, `p`.`internal_use`, `p`.`option_input`, IFNULL(`u`.`option_value`, `p`.`default_value`) AS `option_value`
|
||||
FROM `profile_options` AS `p`
|
||||
@ -116,5 +138,31 @@ function assignFromDB($userid)
|
||||
$opt['template']['locale']);
|
||||
$tpl->assign_rs('useroptions', $rs);
|
||||
sql_free_result($rs);
|
||||
|
||||
if (isset($_REQUEST['desctext']))
|
||||
$tpl->assign('desctext', $_REQUEST['desctext']);
|
||||
else
|
||||
$tpl->assign('desctext',
|
||||
sql_value("SELECT `description` FROM `user` WHERE `user_id`='&1'", '', $userid+0));
|
||||
|
||||
// Use the same descmode values here like in log and cachedesc editor:
|
||||
if ($include_editor)
|
||||
{
|
||||
if (isset($_REQUEST['descMode']))
|
||||
$descMode = min(3,max(2,$_REQUEST['descMode']+0));
|
||||
else
|
||||
{
|
||||
if (sql_value("SELECT `desc_htmledit` FROM `user` WHERE `user_id`='&1'", 0, $userid+0))
|
||||
$descMode = 3;
|
||||
else
|
||||
$descMode = 2;
|
||||
}
|
||||
if ($descMode == 3)
|
||||
{
|
||||
$tpl->add_header_javascript('resource2/tinymce/tiny_mce_gzip.js');
|
||||
$tpl->add_header_javascript('resource2/tinymce/config/user.js.php?lang='.strtolower($opt['template']['locale']));
|
||||
}
|
||||
$tpl->assign('descMode',$descMode);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@ -16,28 +16,24 @@
|
||||
$login->verify();
|
||||
|
||||
$action = isset($_REQUEST['action']) ? mb_strtolower($_REQUEST['action']) : 'view';
|
||||
if ($action != 'change' && $action != 'view')
|
||||
if ($action != 'change' && $action != 'changeemail' && $action != 'view')
|
||||
$action = 'view';
|
||||
|
||||
if ($action == 'change')
|
||||
$tpl->menuitem = MNU_MYPROFILE_DATA_EDIT;
|
||||
|
||||
if ($login->userid == 0)
|
||||
{
|
||||
if ($action == 'change')
|
||||
if ($action == 'change' || $action == 'changeemail')
|
||||
$tpl->redirect('login.php?target=' . urlencode('myprofile.php?action=change'));
|
||||
else
|
||||
$tpl->redirect('login.php?target=myprofile.php');
|
||||
}
|
||||
|
||||
if ($action == 'change')
|
||||
{
|
||||
if ($action == 'changeemail')
|
||||
$tpl->redirect('newemail.php');
|
||||
else if ($action == 'change')
|
||||
change();
|
||||
}
|
||||
else
|
||||
{
|
||||
display();
|
||||
}
|
||||
|
||||
exit;
|
||||
|
||||
function change()
|
||||
|
19
htdocs/mystatpic.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
/***************************************************************************
|
||||
* For license information see doc/license.txt
|
||||
*
|
||||
* Unicode Reminder メモ
|
||||
***************************************************************************/
|
||||
|
||||
require_once('./lib2/web.inc.php');
|
||||
|
||||
$tpl->name = 'mystatpic';
|
||||
$tpl->menuitem = MNU_MYPROFILE_DATA_STATPIC;
|
||||
|
||||
$login->verify();
|
||||
if ($login->userid == 0)
|
||||
$tpl->redirect('login.php?target=mystatpic.php');
|
||||
|
||||
$tpl->display();
|
||||
|
||||
?>
|
@ -39,7 +39,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
$rs = sql("SELECT `cache_rating`.`cache_id` AS `cacheid`, `caches`.`wp_oc` AS `wp`, `caches`.`name` AS `cachename`, `caches`.`type` AS `type`, `caches`.`status` AS `status`
|
||||
$rs = sql("SELECT `cache_rating`.`cache_id` AS `cacheid`, `cache_rating`.`rating_date`, `caches`.`wp_oc` AS `wp`, `caches`.`name` AS `cachename`, `caches`.`type` AS `type`, `caches`.`status` AS `status`
|
||||
FROM `cache_rating`, `caches`
|
||||
WHERE `cache_rating`.`cache_id`=`caches`.`cache_id`
|
||||
AND `cache_rating`.`user_id`='&1'
|
||||
|
@ -60,6 +60,7 @@
|
||||
tpl_set_var('size_message', '');
|
||||
tpl_set_var('type_message', '');
|
||||
tpl_set_var('diff_message', '');
|
||||
tpl_set_var('safari_message', '');
|
||||
|
||||
$sel_type = isset($_POST['type']) ? $_POST['type'] : 0; // Ocprop
|
||||
if (!isset($_POST['size']))
|
||||
@ -768,8 +769,19 @@
|
||||
$diff_not_ok = true;
|
||||
}
|
||||
|
||||
// attributes
|
||||
$attribs_not_ok = false;
|
||||
if (in_array(ATTRIB_ID_SAFARI,$cache_attribs) && $sel_type != 4)
|
||||
{
|
||||
tpl_set_var('safari_message', $safari_not_allowed_message);
|
||||
$error = true;
|
||||
$attribs_not_ok = true;
|
||||
}
|
||||
else
|
||||
tpl_set_var('safari_message', '');
|
||||
|
||||
//no errors?
|
||||
if (!($tos_not_ok || $name_not_ok || $hidden_date_not_ok || $activation_date_not_ok || $lon_not_ok || $lat_not_ok || $time_not_ok || $way_length_not_ok || $size_not_ok || $type_not_ok || $diff_not_ok))
|
||||
if (!($tos_not_ok || $name_not_ok || $hidden_date_not_ok || $activation_date_not_ok || $lon_not_ok || $lat_not_ok || $time_not_ok || $way_length_not_ok || $size_not_ok || $type_not_ok || $diff_not_ok || $attribs_not_ok))
|
||||
{
|
||||
//sel_status
|
||||
$now = getdate();
|
||||
|
@ -11,7 +11,7 @@
|
||||
require('./lib2/web.inc.php');
|
||||
require_once('./lib2/logic/user.class.php');
|
||||
$tpl->name = 'newemail';
|
||||
$tpl->menuitem = MNU_MYPROFILE_DATA_EMAIL;
|
||||
$tpl->menuitem = MNU_MYPROFILE_DATA;
|
||||
|
||||
$login->verify();
|
||||
|
||||
|
@ -44,7 +44,8 @@
|
||||
`caches`.`name` AS `cachename`,
|
||||
`caches`.`wp_oc`,
|
||||
`caches`.`country` AS `country`,
|
||||
`cache_logs`.`type`,
|
||||
`cache_logs`.`type`,
|
||||
`cache_logs`.`oc_team_comment`,
|
||||
`cacheloguser`.`user_id`,
|
||||
`cacheloguser`.`username`,
|
||||
`cache_logs`.`cache_id`,
|
||||
|
@ -202,10 +202,17 @@ class OkapiExceptionHandler
|
||||
$exception_info .= (isset($_SERVER['REQUEST_URI']) ? "--- OKAPI method called ---\n".
|
||||
preg_replace("/([?&])/", "\n$1", $_SERVER['REQUEST_URI'])."\n\n" : "");
|
||||
$exception_info .= "--- OKAPI revision ---\n".Okapi::$revision."\n\n";
|
||||
$exception_info .= "--- Request headers ---\n".implode("\n", array_map(
|
||||
function($k, $v) { return "$k: $v"; },
|
||||
array_keys(getallheaders()), array_values(getallheaders())
|
||||
));
|
||||
|
||||
# This if-condition will solve some (but not all) problems when trying to execute
|
||||
# OKAPI code from command line;
|
||||
# see http://code.google.com/p/opencaching-api/issues/detail?id=243.
|
||||
if (function_exists('getallheaders'))
|
||||
{
|
||||
$exception_info .= "--- Request headers ---\n".implode("\n", array_map(
|
||||
function($k, $v) { return "$k: $v"; },
|
||||
array_keys(getallheaders()), array_values(getallheaders())
|
||||
));
|
||||
}
|
||||
|
||||
return $exception_info;
|
||||
}
|
||||
@ -799,7 +806,7 @@ class Okapi
|
||||
{
|
||||
public static $data_store;
|
||||
public static $server;
|
||||
public static $revision = 798; # This gets replaced in automatically deployed packages
|
||||
public static $revision = 810; # This gets replaced in automatically deployed packages
|
||||
private static $okapi_vars = null;
|
||||
|
||||
/** Get a variable stored in okapi_vars. If variable not found, return $default. */
|
||||
@ -1644,6 +1651,7 @@ class Okapi
|
||||
if ($id == 10) return "Ready to search";
|
||||
if ($id == 11) return "Temporarily unavailable";
|
||||
if ($id == 12) return "OC Team comment";
|
||||
if ($id == 13 || $id == 14) return "Locked";
|
||||
|
||||
# Important: This set is not closed. Other types may be introduced
|
||||
# in the future. This has to be documented in the public method
|
||||
|
@ -3,6 +3,7 @@
|
||||
namespace okapi\services\caches\geocaches;
|
||||
|
||||
use Exception;
|
||||
use ArrayObject;
|
||||
use okapi\Okapi;
|
||||
use okapi\Db;
|
||||
use okapi\Settings;
|
||||
@ -208,7 +209,7 @@ class WebService
|
||||
");
|
||||
}
|
||||
|
||||
$results = array();
|
||||
$results = new ArrayObject();
|
||||
$cacheid2wptcode = array();
|
||||
$owner_ids = array();
|
||||
while ($row = mysql_fetch_assoc($rs))
|
||||
@ -1058,7 +1059,7 @@ class WebService
|
||||
# See issue#97. PHP dictionaries (assoc arrays) are ordered structures,
|
||||
# so we just have to rewrite it (sequentially).
|
||||
|
||||
$ordered_results = array();
|
||||
$ordered_results = new ArrayObject();
|
||||
foreach ($cache_codes as $cache_code)
|
||||
$ordered_results[$cache_code] = $results[$cache_code];
|
||||
|
||||
|
@ -24,7 +24,7 @@ class WebService
|
||||
|
||||
private static $valid_field_names = array(
|
||||
'uuid', 'cache_code', 'date', 'user', 'type', 'was_recommended', 'comment',
|
||||
'images', 'internal_id',
|
||||
'images', 'internal_id', 'oc_team_entry',
|
||||
);
|
||||
|
||||
public static function call(OkapiRequest $request)
|
||||
@ -50,9 +50,14 @@ class WebService
|
||||
if (!in_array($field, self::$valid_field_names))
|
||||
throw new InvalidParam('fields', "'$field' is not a valid field code.");
|
||||
|
||||
if (Settings::get('OC_BRANCH') == 'oc.de')
|
||||
$teamentry_field = 'cl.oc_team_comment';
|
||||
else
|
||||
$teamentry_field = '(cl.type=12)';
|
||||
$rs = Db::query("
|
||||
select
|
||||
cl.id, c.wp_oc as cache_code, cl.uuid, cl.type,
|
||||
".$teamentry_field." as oc_team_entry,
|
||||
unix_timestamp(cl.date) as date, cl.text,
|
||||
u.uuid as user_uuid, u.username, u.user_id,
|
||||
if(cr.user_id is null, 0, 1) as was_recommended
|
||||
@ -89,6 +94,8 @@ class WebService
|
||||
'images' => array(),
|
||||
'internal_id' => $row['id'],
|
||||
);
|
||||
if (in_array('oc_team_entry',$fields))
|
||||
$results[$row['uuid']]['oc_team_entry'] = $row['oc_team_entry'] ? true : false;
|
||||
$log_id2uuid[$row['id']] = $row['uuid'];
|
||||
}
|
||||
mysql_free_result($rs);
|
||||
|
@ -50,6 +50,7 @@
|
||||
<li>"Ready to search" - the cache can be found again.</li>
|
||||
<li>"Archived" - the cache cannot be found and probably won't be
|
||||
repaired.</li>
|
||||
<li>"Locked" - the cache has been archived and can no longer be logged.</li>
|
||||
</ul>
|
||||
|
||||
<p>Other types (used only by some Opencaching installations):</p>
|
||||
@ -66,7 +67,14 @@
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<p><b>was_recommended</b> - true, if the author included his recommendation
|
||||
<p><b>oc_team_entry</b> - <b>true</b> if the log entry has been made by an
|
||||
official OC team member and marked as administrative log; <b>false</b> if it has
|
||||
not been marked.</p>
|
||||
<p>Note: <b>false</b> does NOT mean that it is no administrative log,
|
||||
because this flag can be missing for (mostly old) admin logs.</p>
|
||||
</li>
|
||||
<li>
|
||||
<p><b>was_recommended</b> - <b>true</b>, if the author included his recommendation
|
||||
in this log entry,</p>
|
||||
</li>
|
||||
<li><b>comment</b> - HTML string, text entered with the log entry,</li>
|
||||
|
@ -24,7 +24,7 @@
|
||||
if ($rCache === false)
|
||||
$tpl->error(ERROR_CACHE_NOT_EXISTS);
|
||||
|
||||
$rs = sql("SELECT COUNT(`caches`.`cache_id`) / (SELECT `toprating` FROM `stat_caches` WHERE `cache_id`='&1')*100 AS `quote`, `caches`.`cache_id` AS `cacheid`, `caches`.`wp_oc` AS `wp`, `caches`.`name` AS `name`, `user`.`user_id` AS `cacheuserid`, `user`.`username` AS `cacheusername`
|
||||
$rs = sql("SELECT COUNT(`caches`.`cache_id`) / (SELECT `toprating` FROM `stat_caches` WHERE `cache_id`='&1')*100 AS `quote`, `caches`.`cache_id` AS `cacheid`, `caches`.`wp_oc` AS `wp`, `caches`.`name` AS `name`, `user`.`user_id` AS `cacheuserid`, `user`.`username` AS `cacheusername`, `caches`.`status`
|
||||
FROM `cache_rating` AS `r1`
|
||||
INNER JOIN `cache_rating` AS `r2` ON `r1`.`user_id`=`r2`.`user_id`
|
||||
INNER JOIN `caches` ON `r2`.`cache_id`=`caches`.`cache_id`
|
||||
|
@ -45,7 +45,7 @@
|
||||
else
|
||||
{
|
||||
$log_rs = sql("SELECT `cache_logs`.`node` AS `node`, `cache_logs`.`uuid` AS `uuid`, `cache_logs`.`cache_id` AS `cache_id`, `caches`.`user_id` AS `cache_owner_id`,
|
||||
`caches`.`name` AS `cache_name`, `cache_logs`.`text` AS `log_text`, `cache_logs`.`text_html`, `cache_logs`.`type` AS `log_type`,
|
||||
`caches`.`name` AS `cache_name`, `cache_logs`.`text` AS `log_text`, `cache_logs`.`text_html`, `cache_logs`.`type` AS `log_type`, `cache_logs`.`oc_team_comment` AS `oc_team_comment`,
|
||||
`cache_logs`.`user_id` AS `log_user_id`, `cache_logs`.`date` AS `log_date`,
|
||||
`log_types`.`icon_small` AS `icon_small`,
|
||||
`user`.`username` as `log_username`,
|
||||
@ -238,7 +238,12 @@
|
||||
tpl_set_var('logid_urlencode', htmlspecialchars(urlencode($log_id), ENT_COMPAT, 'UTF-8'));
|
||||
tpl_set_var('logid', htmlspecialchars($log_id, ENT_COMPAT, 'UTF-8'));
|
||||
|
||||
tpl_set_var('logimage', icon_log_type($log_record['icon_small'], ""));
|
||||
if ($log_record['oc_team_comment'])
|
||||
$teamimg = '<img src="resource2/ocstyle/images/oclogo/oc-team-comment.png" title="' . t('OC team comment') . '" /> ';
|
||||
else
|
||||
$teamimg = "";
|
||||
tpl_set_var('logimage', $teamimg . icon_log_type($log_record['icon_small'], ""));
|
||||
|
||||
tpl_set_var('date', htmlspecialchars(strftime($dateformat, strtotime($log_record['log_date'])), ENT_COMPAT, 'UTF-8'));
|
||||
tpl_set_var('time', substr($log_record['log_date'],11)=="00:00:00" ? "" : ", " . substr($log_record['log_date'],11,5));
|
||||
tpl_set_var('userid', htmlspecialchars($log_record['log_user_id'] + 0, ENT_COMPAT, 'UTF-8'));
|
||||
|
@ -325,13 +325,17 @@ div.changelog ul li ul {font-size: 90%; margin:0}
|
||||
.table {font-size: 10px; line-height: 1.8em; clear: left; padding: 0px; margin: 0.5em 0px 0.2em 0px; border: solid 0px rgb(150,150,150); empty-cells: show; border-collapse: collapse; background-color: rgb(255,255,255);}
|
||||
.table tr {margin: 0px; padding:0; }
|
||||
.table td {padding: 2px 7px 5px 7px; border: solid 0px rgb(150,150,150); text-align: left; font-size: 120%;}
|
||||
.table th {margin: 0px; background-color: rgb(127,162,202); padding: 2px 7px 2px 7px; border: solid 0px rgb(150,150,150); empty-cells: show; text-align: left; font-size: 120%; color: rgb(255,255,255); }
|
||||
/* .table th {margin: 0px; background-color: #e6e6e6;color: #404040; padding: 2px 7px 2px 7px; border-top: solid 1px #404040; border-bottom: solid 1px #404040; empty-cells: show; text-align: left; font-size: 120%; } */
|
||||
/* .table th {margin: 0px; background-color: #7fa2ca;color: #f8f8f8; padding: 2px 7px 2px 7px; border: solid 0px rgb(150,150,150); empty-cells: show; text-align: left; font-size: 120%; } */
|
||||
.table th, .searchtable th {margin: 0px; background-color: #d8e5c9;color: #404040; padding: 2px 7px 2px 7px; border-top: solid 1px #404040; border-bottom: solid 1px #404040; empty-cells: show; text-align: left; font-size: 120%; }
|
||||
.searchtable th {margin: 0px; background-color: #d8e5c9;color: #404040; padding: 4px 0px 4px 0px; border-top: solid 1px #404040; border-bottom: solid 1px #404040; empty-cells: show; text-align: left; font-size: 12px; }
|
||||
.searchtable td { padding-top:2px; }
|
||||
.table-caption {margin: 0.5em 0px 1.0em 30px; padding: 0px; clear: both; text-align: left; font-size: 120%;}
|
||||
|
||||
.narrowtable {font-size: 10px; line-height: 2.0em; clear: left; padding: 0px; margin: 0.5em 0px 0.2em 0px; border: solid 0px rgb(150,150,150); empty-cells: show; border-collapse: collapse; background-color: rgb(255,255,255);}
|
||||
.narrowtable tr {margin: 0px; padding: 0px;}
|
||||
.narrowtable td {padding: 0 7px 0 7px; border: solid 0px rgb(150,150,150); text-align: left; font-size: 120%;}
|
||||
.narrowtable th {margin: 0px; background-color: rgb(127,162,202); padding: 0 7px 0 7px; border: solid 0px rgb(150,150,150); empty-cells: show; text-align: left; font-size: 120%; color: rgb(255,255,255); }
|
||||
.narrowtable th {margin: 0px; background-color: #d8e5c9;color: #404040; padding: 2px 7px 2px 7px; border-top: solid 1px #404040; border-bottom: solid 1px #404040; empty-cells: show; text-align: left; font-size: 120%; }
|
||||
.narrowtable-caption {margin: 0.5em 0px 1.0em 30px; padding: 0px; clear: both; text-align: left; font-size: 120%;}
|
||||
|
||||
td.listicon {
|
||||
@ -345,6 +349,9 @@ td.listicon {
|
||||
|
||||
.printwptable td { line-height:1.4em; font-size:12px; }
|
||||
|
||||
td.listcolor1 { background:#fff; line-height:1.7em; }
|
||||
td.listcolor2 { background:#eee; line-height:1.7em; }
|
||||
|
||||
/* Images */
|
||||
.img-left-noborder-notopmargin {float: left; margin: 0px 10px 0px 0px;}
|
||||
.img-left-noborder-topmargin {float: left; margin: 3px 10px 0px 0px;}
|
||||
@ -701,6 +708,7 @@ input.formbutton_active {
|
||||
textarea.cachedesc { width:750px; height:500px; } /* only cacheeditor */
|
||||
textarea.hint { width:750px; height:100px; } /* only cacheditor */
|
||||
textarea.logs { width:640px; height:300px; } /* only logeditor */
|
||||
textarea.userdesc { width:750px; height:400px; } /* only user desc editor */
|
||||
textarea.removelogs { width:620px; height:200px; } /* log removal */
|
||||
|
||||
.show_deleted { text-decoration: line-through; }
|
||||
@ -776,6 +784,14 @@ p.main-totalstats {
|
||||
-webkit-box-shadow: 1px 2px 2px #555;
|
||||
}
|
||||
|
||||
.img-minimap {
|
||||
border: 1px solid #a9a9a9;
|
||||
padding: 2px;
|
||||
box-shadow: 1px 2px 2px #555;
|
||||
-moz-box-shadow: 1px 2px 2px #555;
|
||||
-webkit-box-shadow: 1px 2px 2px #555;
|
||||
}
|
||||
|
||||
form#register label {
|
||||
text-align: right;
|
||||
width: 14em;
|
||||
@ -1342,10 +1358,10 @@ div.logs {
|
||||
}
|
||||
|
||||
td.odd {
|
||||
background: #fff;
|
||||
background: #fff; padding-top:2px;
|
||||
}
|
||||
td.even {
|
||||
background: #dbe6f1;
|
||||
background: #eee; padding-top:2px;
|
||||
}
|
||||
|
||||
tr.searchresult td {
|
||||
@ -1431,9 +1447,15 @@ div#havefound {
|
||||
-moz-border-radius: 5px;
|
||||
margin: 3px;
|
||||
padding: 6px 6px 6px 8px;
|
||||
min-width: 600px;
|
||||
min-width: 640px;
|
||||
}
|
||||
|
||||
.wide_textblock {
|
||||
width: 740px;
|
||||
}
|
||||
|
||||
.boldtext { font-weight:bold; color:#505050; }
|
||||
|
||||
|
||||
/* RSS feeds */
|
||||
#blog div.newsblock { margin-left:20px }
|
||||
|
Before Width: | Height: | Size: 800 B After Width: | Height: | Size: 800 B |
BIN
htdocs/resource2/ocstyle/images/attributes/safari-disabled.png
Normal file
After Width: | Height: | Size: 826 B |
BIN
htdocs/resource2/ocstyle/images/attributes/safari-no.png
Normal file
After Width: | Height: | Size: 840 B |
BIN
htdocs/resource2/ocstyle/images/attributes/safari.png
Normal file
After Width: | Height: | Size: 1013 B |
Before Width: | Height: | Size: 639 B After Width: | Height: | Size: 639 B |
Before Width: | Height: | Size: 800 B After Width: | Height: | Size: 800 B |
Before Width: | Height: | Size: 710 B After Width: | Height: | Size: 710 B |
BIN
htdocs/resource2/ocstyle/images/log/16x16-locked-invisible.png
Normal file
After Width: | Height: | Size: 736 B |
BIN
htdocs/resource2/ocstyle/images/log/16x16-locked.png
Normal file
After Width: | Height: | Size: 466 B |
Before Width: | Height: | Size: 677 B |
Before Width: | Height: | Size: 545 B |
Before Width: | Height: | Size: 639 B |
Before Width: | Height: | Size: 736 B |
Before Width: | Height: | Size: 710 B |
BIN
htdocs/resource2/ocstyle/images/misc/32x32-ignore.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
htdocs/resource2/ocstyle/images/oclogo/oc-team-comment.png
Normal file
After Width: | Height: | Size: 493 B |
BIN
htdocs/resource2/ocstyle/images/viewcache/14x19-gps-device.png
Normal file
After Width: | Height: | Size: 931 B |
BIN
htdocs/resource2/ocstyle/images/viewcache/16x16-maintenance.png
Normal file
After Width: | Height: | Size: 643 B |
42
htdocs/resource2/tinymce/config/user.js.php
Normal file
@ -0,0 +1,42 @@
|
||||
<?php
|
||||
if (isset($_REQUEST['lang']))
|
||||
$lang = $_REQUEST['lang'];
|
||||
else
|
||||
$lang = 'de';
|
||||
?>
|
||||
|
||||
tinyMCE_GZ.init({
|
||||
plugins : 'advhr,contextmenu,emotions,insertdatetime,paste,table',
|
||||
themes : 'advanced',
|
||||
languages : '<?php echo $lang; ?>',
|
||||
disk_cache : true,
|
||||
debug : false
|
||||
});
|
||||
tinyMCE.init({
|
||||
mode : "textareas",
|
||||
theme : "advanced",
|
||||
|
||||
plugins : "advhr,contextmenu,emotions,insertdatetime,paste,table",
|
||||
|
||||
theme_advanced_buttons1 : "cut,copy,paste,pasteword,pastetext,removeformat,separator,undo,redo,separator,link,unlink,image,separator,fontselect,fontsizeselect",
|
||||
theme_advanced_buttons2 : "bold,italic,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,bullist,numlist,separator,insertdate,inserttime,separator,forecolor,backcolor,charmap,emotions",
|
||||
theme_advanced_buttons3 : "visualaid,tablecontrols,separator,advhr",
|
||||
|
||||
theme_advanced_toolbar_location : "top",
|
||||
theme_advanced_toolbar_align : "left",
|
||||
theme_advanced_path_location : "bottom",
|
||||
plugin_insertdate_dateFormat : "%Y-%m-%d",
|
||||
plugin_insertdate_timeFormat : "%H:%M:%S",
|
||||
file_browser_callback : "",
|
||||
|
||||
theme_advanced_resize_horizontal : false,
|
||||
theme_advanced_resizing : true,
|
||||
editor_deselector : "mceNoEditor",
|
||||
language : "<?php echo $lang; ?>",
|
||||
preformatted : true,
|
||||
remove_linebreaks : false,
|
||||
oninit : "postInit",
|
||||
|
||||
content_css : "resource2/tinymce/config/content.css"
|
||||
});
|
||||
|