first init

This commit is contained in:
Metrax 2012-05-09 20:05:43 +02:00
commit e05b7bb8f0
6205 changed files with 395435 additions and 0 deletions

183
bin/clear-webcache.php Normal file
View File

@ -0,0 +1,183 @@
#!/usr/bin/php
<?php
/* refresh cached files and translations
*
* stop/start apache
* delete/recreate cached files
*
* TODO: quick&dirty to test functionality
*/
$opt['rootpath'] = '../htdocs/';
require($opt['rootpath'] . 'lib2/web.inc.php');
// stop apache
system($opt['httpd']['stop']);
echo "Delete cached files\n";
clearCache();
echo "Create translation files for gettext()\n";
$translationHandler->createMessageFiles();
echo "Create menu cache file\n";
createMenuCache();
echo "Create label cache file\n";
createLabelCache();
echo "Precompiling template files\n";
precompileAllTemplates();
// start apache
system($opt['httpd']['start']);
function precompileAllTemplates()
{
global $opt;
if ($hDir = opendir($opt['stylepath']))
{
while (($sFilename = readdir($hDir)) !== false)
{
if (substr($sFilename, -4) == '.tpl')
{
//echo substr($sFilename, 0, strlen($sFilename) - 4) . "\n";
precompileTemplate(substr($sFilename, 0, strlen($sFilename) - 4));
}
}
closedir($hDir);
}
// fix file ownership
$sCompileDir = $opt['rootpath'] . 'cache2/smarty/compiled/';
if ($hDir = opendir($sCompileDir))
{
while (($sFilename = readdir($hDir)) !== false)
{
if (filetype($sCompileDir . $sFilename) == 'file')
{
chown($sCompileDir . $sFilename, $opt['httpd']['user']);
chgrp($sCompileDir . $sFilename, $opt['httpd']['group']);
}
}
closedir($hDir);
}
}
function precompileTemplate($sTemplate)
{
global $opt;
foreach ($opt['locale'] AS $sLanguage => $v)
{
precompileTemplateWithLanguage($sTemplate, $sLanguage);
}
}
function precompileTemplateWithLanguage($sTemplate, $sLanguage)
{
global $opt, $translate;
// cheating a little bit
$opt['template']['locale'] = $sLanguage;
setlocale(LC_MONETARY, $opt['locale'][$opt['template']['locale']]['locales']);
setlocale(LC_TIME, $opt['locale'][$opt['template']['locale']]['locales']);
if (defined('LC_MESSAGES'))
setlocale(LC_MESSAGES, $opt['locale'][$opt['template']['locale']]['locales']);
if ($translate->t('INTERNAL_LANG', 'all', 'OcSmarty.class.php', '') != $sLanguage)
{
die("setlocale() failed to set language to " . $sLanguage . ". Is the translation of INTERNAL_LANG correct?\n");
}
$preTemplate = new OcSmarty();
$preTemplate->name = $sTemplate;
$preTemplate->compile($sTemplate . '.tpl', $preTemplate->get_compile_id());
}
function createMenuCache()
{
global $opt, $translate;
foreach ($opt['locale'] AS $sLanguage => $v)
{
// cheating a little bit
$opt['template']['locale'] = $sLanguage;
setlocale(LC_MONETARY, $opt['locale'][$opt['template']['locale']]['locales']);
setlocale(LC_TIME, $opt['locale'][$opt['template']['locale']]['locales']);
if (defined('LC_MESSAGES'))
setlocale(LC_MESSAGES, $opt['locale'][$opt['template']['locale']]['locales']);
if ($translate->t('INTERNAL_LANG', 'all', 'OcSmarty.class.php', '') != $sLanguage)
{
die("setlocale() failed to set language to " . $sLanguage . ". Is the translation of INTERNAL_LANG correct?\n");
}
// this will create the cache file
$menu = new Menu();
// change to file owner
chown($menu->sMenuFilename, $opt['httpd']['user']);
chgrp($menu->sMenuFilename, $opt['httpd']['group']);
}
}
function createLabelCache()
{
global $opt;
foreach ($opt['locale'] AS $sLanguage => $v)
{
// cheating a little bit
$opt['template']['locale'] = $sLanguage;
labels::CreateCacheFile();
// change to file owner
$sFilename = $opt['rootpath'] . 'cache2/labels-' . $opt['template']['locale'] . '.inc.php';
chown($sFilename, $opt['httpd']['user']);
chgrp($sFilename, $opt['httpd']['group']);
}
}
function clearCache()
{
global $tpl, $translang, $translate;
unlinkFiles('cache2', 'php');
unlinkFiles('cache2/smarty/cache', 'tpl');
unlinkFiles('cache2/smarty/compiled', 'inc');
unlinkFiles('cache2/smarty/compiled', 'php');
unlinkFiles('cache2/captcha', 'jpg');
unlinkFiles('cache2/captcha', 'txt');
}
function unlinkFiles($relbasedir, $ext)
{
global $opt;
if (substr($relbasedir, -1, 1) != '/')
$relbasedir .= '/';
if ($opt['rootpath'] . $relbasedir)
{
if ($dh = opendir($opt['rootpath'] . $relbasedir))
{
while (($file = readdir($dh)) !== false)
{
if ($file != '.' && $file != '..' && is_file($opt['rootpath'] . $relbasedir . $file))
{
if (substr($file, -(strlen($ext)+1), strlen($ext)+1) == '.' . $ext)
{
unlink($opt['rootpath'] . $relbasedir . $file);
}
}
}
}
closedir($dh);
}
}
?>

57
htdocs/activation.php Normal file
View File

@ -0,0 +1,57 @@
<?php
/***************************************************************************
* You can find the license in the docs directory
*
* Unicode Reminder メモ
***************************************************************************/
require('./lib2/web.inc.php');
$email = isset($_REQUEST['email']) ? trim($_REQUEST['email']) : '';
$code = isset($_REQUEST['code']) ? trim($_REQUEST['code']) : '';
$tpl->name = 'activation';
$tpl->menuitem = MNU_START_REGISTER_ACTIVATION;
$tpl->assign('errorEMail', false);
$tpl->assign('errorCode', false);
$tpl->assign('errorAlreadyActivated', false);
$tpl->assign('sucess', false);
if (isset($_REQUEST['submit']))
{
$email_not_ok = is_valid_email_address($email) ? false : true;
if ($email_not_ok == false)
{
$rs = sql("SELECT `user_id` `id`, `activation_code` `code` FROM `user` WHERE `email`='&1'", $email);
if ($r = sql_fetch_array($rs))
{
if (($r['code'] == $code) && ($code != ''))
{
// ok, account aktivieren
sql("UPDATE `user` SET `is_active_flag`=1, `activation_code`='' WHERE `user_id`='&1'", $r['id']);
$tpl->assign('sucess', true);
}
else
{
if ($r['code'] == '')
$tpl->assign('errorAlreadyActivated', true);
else
$tpl->assign('errorCode', true);
}
}
else
$tpl->assign('errorCode', true);
sql_free_result($rs);
}
else
$tpl->assign('errorEMail', true);
}
$tpl->assign('email', $email);
$tpl->assign('code', $code);
$tpl->display();
?>

172
htdocs/adminreports.php Normal file
View File

@ -0,0 +1,172 @@
<?php
/***************************************************************************
* You can find the license in the docs directory
*
* Unicode Reminder メモ
***************************************************************************/
require('./lib2/web.inc.php');
require_once('./lib2/logic/cache.class.php');
$tpl->name = 'adminreports';
$tpl->menuitem = MNU_ADMIN_REPORTS;
$error = 0;
$login->verify();
if ($login->userid == 0)
$tpl->redirect_login();
if (($login->admin & ADMIN_USER) != ADMIN_USER)
$tpl->error(ERROR_NO_ACCESS);
$id = isset($_REQUEST['id']) ? $_REQUEST['id']+0 : 0;
$rid = isset($_REQUEST['rid']) ? $_REQUEST['rid']+0 : 0;
$cacheid = isset($_REQUEST['cacheid']) ? $_REQUEST['cacheid']+0 : 0;
$ownerid = isset($_REQUEST['ownerid']) ? $_REQUEST['ownerid']+0 : 0;
$adminid = sql_value("SELECT `adminid` FROM `cache_reports` WHERE `id`=&1", 0, $rid);
if (isset($_REQUEST['assign']) && $rid > 0 && $adminid == 0)
{
sql("UPDATE `cache_reports` SET `status`=2, `adminid`=&2 WHERE `id`=&1", $rid, $login->userid);
$tpl->redirect('adminreports.php?id='.$rid);
}
elseif (isset($_REQUEST['contact']) && $ownerid > 0)
{
$tpl->redirect('mailto.php?userid=' . urlencode($ownerid));
}
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);
$tpl->redirect('adminreports.php?id='.$rid);
}
elseif (isset($_REQUEST['assign']) && ($adminid == 0 || $adminid != $login->userid))
{
$error = 1;
if ($rid > 0)
{
$id = $rid;
}
else
{
$id = 0;
}
}
elseif (isset($_REQUEST['assign']) && $adminid == $login->userid)
{
$error = 2;
$id = $rid;
}
elseif (isset($_REQUEST['statusActive']) ||
isset($_REQUEST['statusTNA']) ||
isset($_REQUEST['statusArchived']) ||
isset($_REQUEST['done']) ||
isset($_REQUEST['statusLockedVisible']) ||
isset($_REQUEST['statusLockedInvisible']))
{
if ($adminid == 0)
{
$id = $rid;
$error = 4;
}
elseif ($adminid != $login->userid)
{
$id = $rid;
$error = 3;
}
}
if ($id == 0)
{
// no details, show list of reported caches
$rs = sql("SELECT `cr`.`id`,
IF(`cr`.`status`=1,'(*) ', '') AS `new`,
`c`.`name`,
`u`.`username`
FROM `cache_reports` `cr`
INNER JOIN `caches` `c` ON `c`.`cache_id` = `cr`.`cacheid`
INNER JOIN `user` `u` ON `u`.`user_id` = `cr`.`userid`
WHERE `cr`.`status` < 3
AND (`cr`.`adminid` IS NULL OR `cr`.`adminid`=&1)
ORDER BY `cr`.`status` DESC, `cr`.`lastmodified` DESC",
$login->userid);
$tpl->assign_rs('reportedcaches', $rs);
sql_free_result($rs);
$tpl->assign('list', true);
}
else
{
// show details of a report
$rs = sql("SELECT `cr`.`id`, `cr`.`cacheid`, `cr`.`userid`,
`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`,
`cr`.`lastmodified`, `c`.`name` AS `cachename`,
`c`.`user_id` AS `ownerid`
FROM `cache_reports` AS `cr`
LEFT JOIN `cache_report_reasons` AS `crr` ON `cr`.`reason`=`crr`.`id`
LEFT JOIN `caches` AS `c` ON `c`.`cache_id`=`cr`.`cacheid`
LEFT JOIN `user` AS `u1` ON `u1`.`user_id`=`cr`.`userid`
LEFT JOIN `user` AS `u2` ON `u2`.`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`.`id`=&1",
$id, $opt['template']['locale']);
if ($record = sql_fetch_assoc($rs))
{
$tpl->assign('id', $record['id']);
$tpl->assign('cacheid', $record['cacheid']);
$tpl->assign('userid', $record['userid']);
$tpl->assign('usernick', $record['usernick']);
$tpl->assign('adminid', $record['adminid']);
$tpl->assign('adminnick', $record['adminnick']);
$tpl->assign('reason', $record['reason']);
$tpl->assign('note', $record['note']);
$tpl->assign('status', $record['status']);
$tpl->assign('lastmodified', $record['lastmodified']);
$tpl->assign('cachename', $record['cachename']);
$tpl->assign('ownerid', $record['ownerid']);
}
sql_free_result($rs);
$tpl->assign('list', false);
}
$tpl->assign('error', $error);
$tpl->display();
?>

127
htdocs/adminuser.php Normal file
View File

@ -0,0 +1,127 @@
<?php
/***************************************************************************
* You can find the license in the docs directory
*
* Unicode Reminder メモ
***************************************************************************/
require('./lib2/web.inc.php');
require('./lib2/logic/user.class.php');
$tpl->name = 'adminuser';
$tpl->menuitem = MNU_ADMIN_USER;
$login->verify();
if ($login->userid == 0)
$tpl->redirect_login();
if (($login->admin & ADMIN_USER) != ADMIN_USER)
$tpl->error(ERROR_NO_ACCESS);
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'display';
if ($action == 'searchuser')
{
searchUser();
}
else if ($action == 'sendcode')
{
sendCode();
}
else if ($action == 'formaction')
{
formAction();
}
else if ($action == 'display')
$tpl->display();
$tpl->error(ERROR_UNKNOWN);
function sendCode()
{
global $tpl;
$userid = isset($_REQUEST['userid']) ? $_REQUEST['userid']+0 : 0;
$user = new user($userid);
if ($user->exist() == false)
$tpl->error(ERROR_UNKNOWN);
// send a new confirmation
$user->sendRegistrationCode();
$tpl->redirect('adminuser.php?action=searchuser&msg=sendcodecommit&username=' . urlencode($user->getUsername()));
}
function formAction()
{
global $tpl, $login;
$commit = isset($_REQUEST['chkcommit']) ? $_REQUEST['chkcommit']+0 : 0;
$delete = isset($_REQUEST['chkdelete']) ? $_REQUEST['chkdelete']+0 : 0;
$disable = isset($_REQUEST['chkdisable']) ? $_REQUEST['chkdisable']+0 : 0;
$userid = isset($_REQUEST['userid']) ? $_REQUEST['userid']+0 : 0;
$user = new user($userid);
if ($user->exist() == false)
$tpl->error(ERROR_UNKNOWN);
$username = $user->getUsername();
if ($delete == 1 && $disable == 1)
$tpl->error('You cannot delete and disable the same time!');
if ($commit == 0)
$tpl->error('You have to check that you are sure!');
if ($disable == 1)
{
if ($user->disable() == false)
$tpl->error(ERROR_UNKNOWN);
}
else if ($delete == 1)
{
if ($user->delete() == false)
$tpl->error(ERROR_UNKNOWN);
}
$tpl->redirect('adminuser.php?action=searchuser&username=' . urlencode($username));
}
function searchUser()
{
global $tpl;
$username = isset($_REQUEST['username']) ? $_REQUEST['username'] : '';
$msg = isset($_REQUEST['msg']) ? $_REQUEST['msg'] : '';
$tpl->assign('username', $username);
$tpl->assign('msg', $msg);
$rs = sql("SELECT `user_id`, `username`, `email`, `date_created`, `last_modified`, `is_active_flag`, `activation_code`, `first_name`, `last_name` FROM `user` WHERE `username`='&1' OR `email`='&1'", $username);
$r = sql_fetch_assoc($rs);
sql_free_result($rs);
if ($r == false)
{
$tpl->assign('error', 'userunknown');
$tpl->display();
}
$tpl->assign('showdetails', true);
$r['hidden'] = sql_value("SELECT COUNT(*) FROM `caches` WHERE `user_id`='&1'", 0, $r['user_id']);
$r['hidden_active'] = sql_value("SELECT COUNT(*) FROM `caches` WHERE `user_id`='&1' AND `status`=1", 0, $r['user_id']);
$r['logentries'] = sql_value("SELECT COUNT(*) FROM `cache_logs` WHERE `user_id`='&1'", 0, $r['user_id']);
$r['last_known_login'] = sql_value("SELECT MAX(`last_login`) FROM `sys_sessions` WHERE `user_id`='&1'", 0, $r['user_id']);
$tpl->assign('user', $r);
$user = new user($r['user_id']);
if (!$user->exist())
$tpl->error(ERROR_UNKNOWN);
$tpl->assign('candisable', $user->canDisable());
$tpl->assign('candelete', $user->canDelete());
$tpl->display();
}
?>

202
htdocs/adoptcache.php Normal file
View File

@ -0,0 +1,202 @@
<?php
/***************************************************************************
* You can find the license in the docs directory
*
* Unicode Reminder メモ
***************************************************************************/
require('./lib2/web.inc.php');
require_once('./lib2/logic/cache.class.php');
$tpl->name = 'adoptcache';
$tpl->menuitem = MNU_CACHES_ADOPT;
$login->verify();
if ($login->userid == 0)
$tpl->redirect_login();
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'listbyuser';
$tpl->assign('action', $action);
$tpl->assign('error', '');
if ($action == 'listbycache')
{
$cacheid = isset($_REQUEST['cacheid']) ? $_REQUEST['cacheid']+0 : 0;
listRequestsByCacheId($cacheid);
}
else if ($action == 'add')
{
$tpl->assign('action', 'listbycache');
$cacheid = isset($_REQUEST['cacheid']) ? $_REQUEST['cacheid']+0 : 0;
$tou = isset($_REQUEST['tou']) ? $_REQUEST['tou']+0 : 0;
$submit = isset($_REQUEST['submit']) ? $_REQUEST['submit']+0 : 0;
$username = isset($_REQUEST['username']) ? $_REQUEST['username'] : '';
$tpl->assign('adoptusername', $username);
if ($submit == 1)
{
$userid = sql_value("SELECT `user_id` FROM `user` WHERE `username`='&1'", 0, $username);
if ($userid == 0)
$tpl->assign('error', 'userunknown');
else if ($tou != 1)
$tpl->assign('error', 'tou');
else
addRequest($cacheid, $userid);
}
listRequestsByCacheId($cacheid);
}
else if ($action == 'cancel')
{
$cacheid = isset($_REQUEST['cacheid']) ? $_REQUEST['cacheid']+0 : 0;
$userid = isset($_REQUEST['userid']) ? $_REQUEST['userid']+0 : 0;
cancelRequest($cacheid, $userid);
}
else if ($action == 'commit')
{
$cacheid = isset($_REQUEST['cacheid']) ? $_REQUEST['cacheid']+0 : 0;
$submit = isset($_REQUEST['submit']) ? $_REQUEST['submit']+0 : 0;
$tou = isset($_REQUEST['tou']) ? $_REQUEST['tou']+0 : 0;
if ($submit == 1 && $tou == 1)
commitRequest($cacheid);
else
showAdoptScreen($cacheid, $submit);
}
else // if ($action == 'listbyuser')
{
$tpl->assign('action', 'listbyuser');
listRequestsByUserId();
}
$tpl->error(ERROR_UNKNOWN);
function showAdoptScreen($cacheid, $touerror)
{
global $tpl, $login;
$rs = sql("SELECT `caches`.`name`, `user`.`username`, `cache_adoption`.`date_created`
FROM `caches`
INNER JOIN `user` ON `caches`.`user_id`=`user`.`user_id`
INNER JOIN `cache_adoption` ON `caches`.`cache_id`=`cache_adoption`.`cache_id`
WHERE `caches`.`cache_id`='&1'
AND `cache_adoption`.`user_id`='&2'",
$cacheid, $login->userid);
$r = sql_fetch_assoc($rs);
if ($r === false)
$tpl->error(ERROR_NO_ACCESS);
$tpl->assign('cache', $r);
sql_free_result($rs);
if ($touerror != 0)
$tpl->assign('error', 'tou');
$tpl->display();
}
function listRequestsByCacheId($cacheid)
{
global $tpl, $login;
// cache exists?
$cache = new cache($cacheid);
if ($cache->exist() == false)
$tpl->error(ERROR_CACHE_NOT_EXISTS);
// is the current user the owner of the cache?
if ($cache->getUserId() != $login->userid)
$tpl->error(ERROR_NO_ACCESS);
$rs = sql("SELECT `caches`.`cache_id` AS `id`, `user`.`user_id` AS `userid`, `user`.`username` AS `username`, `cache_adoption`.`date_created`
FROM `caches`
INNER JOIN `cache_adoption` ON `caches`.`cache_id` = `cache_adoption`.`cache_id`
INNER JOIN `user` ON `cache_adoption`.`user_id`=`user`.`user_id`
WHERE `caches`.`cache_id`='&1'",
$cacheid);
$tpl->assign_rs('adoptions', $rs);
sql_free_result($rs);
$tpl->assign('cachename', $cache->getName());
$tpl->display();
}
function listRequestsByUserId()
{
global $tpl, $login;
$tpl->menuitem = MNU_MYPROFILE_ADOPT;
$rs = sql("SELECT `caches`.`cache_id` AS `id`, `caches`.`name` AS `cachename`, `user`.`user_id` AS `ownerid`, `user`.`username` AS `ownername`, `cache_adoption`.`date_created`
FROM `caches`
INNER JOIN `cache_adoption` ON `caches`.`cache_id` = `cache_adoption`.`cache_id`
INNER JOIN `user` ON `caches`.`user_id`=`user`.`user_id`
WHERE `cache_adoption`.`user_id`='&1'",
$login->userid);
$tpl->assign_rs('adoptions', $rs);
sql_free_result($rs);
$tpl->display();
}
function addRequest($cacheid, $userid)
{
global $tpl;
// cache exists?
$cache = new cache($cacheid);
if ($cache->exist() == false)
$tpl->error(ERROR_CACHE_NOT_EXISTS);
if ($cache->allowEdit() == false)
$tpl->error(ERROR_NO_ACCESS);
if ($cache->getUserId() == $userid)
{
$tpl->assign('error', 'sameuser');
$tpl->display();
}
else
{
if ($cache->addAdoption($userid) == false)
$tpl->error(ERROR_UNKNOWN);
$tpl->redirect('adoptcache.php?action=listbycache&cacheid=' . $cacheid);
}
}
function commitRequest($cacheid)
{
global $tpl, $login;
// cache exists?
$cache = new cache($cacheid);
if ($cache->exist() == false)
$tpl->error(ERROR_CACHE_NOT_EXISTS);
if ($cache->commitAdoption($login->userid) == false)
$tpl->error(ERROR_UNKNOWN);
$tpl->redirect('viewcache.php?cacheid=' . $cacheid);
}
function cancelRequest($cacheid, $userid)
{
global $tpl, $login;
// cache exists?
$cache = new cache($cacheid);
if ($cache->exist() == false)
$tpl->error(ERROR_CACHE_NOT_EXISTS);
if ($cache->allowEdit() == false && $login->userid != $userid)
$tpl->error(ERROR_NO_ACCESS);
if ($cache->cancelAdoption($userid) == false)
$tpl->error(ERROR_UNKNOWN);
$tpl->redirect('adoptcache.php');
}
?>

View File

@ -0,0 +1,41 @@
<?php
$opt['rootpath'] = '../../';
header('Content-type: text/html; charset=utf-8');
require($opt['rootpath'] . 'lib2/web.inc.php');
$bFirstRow = true;
$rs = sql("SELECT SQL_BUFFER_RESULT `caches`.`wp_oc` , `caches`.`name` , `user`.`user_id` , `user`.`username` FROM `caches` INNER JOIN `user` ON `caches`.`user_id` = `user`.`user_id` INNER JOIN `cache_status` ON `caches`.`status` = `cache_status`.`id` WHERE `cache_status`.`allow_user_view` =1 ORDER BY `caches`.`date_created` DESC LIMIT 3");
while ($r = sql_fetch_assoc($rs))
{
if ($bFirstRow == true)
{
$bFirstCol = true;
foreach ($r AS $k => $v)
{
if ($bFirstCol == false) echo ';';
echo str_getcsv($k);
$bFirstCol = false;
}
echo "\n";
$bFirstRow = false;
}
$bFirstCol = true;
foreach ($r AS $k => $v)
{
if ($bFirstCol == false) echo ';';
echo str_getcsv($v);
$bFirstCol = false;
}
echo "\n";
}
sql_free_result($rs);
function str_getcsv($str)
{
return '"' . mb_ereg_replace('"', '\"', $str) . '"';
}
?>

90
htdocs/articles.php Normal file
View File

@ -0,0 +1,90 @@
<?php
/***************************************************************************
* You can find the license in the docs directory
*
* Unicode Reminder メモ
***************************************************************************/
require('./lib2/web.inc.php');
//get the article name to display
$article = '';
$language = $opt['template']['locale'];
if (isset($_REQUEST['page']) &&
(mb_strpos($_REQUEST['page'], '.') === false) &&
(mb_strpos($_REQUEST['page'], '/') === false) &&
(mb_strpos($_REQUEST['page'], '\\') === false))
{
$article = $_REQUEST['page'];
}
if ($article == '')
{
//no article specified
$tpl->redirect('index.php');
}
else if (!file_exists($opt['stylepath'] . '/articles/' . $language . '/' . $article . '.tpl'))
{
// does article exist in default-language?
if (file_exists($opt['stylepath'] . '/articles/' . $opt['template']['default']['locale'] . '/' . $article . '.tpl'))
{
$language = $opt['template']['default']['locale'];
}
elseif (file_exists($opt['stylepath'] . '/articles/EN/' . $article . '.tpl'))
{
$language = 'EN';
}
else
{
// use any
$language = false;
if ($hDir = opendir($opt['stylepath'] . '/articles/'))
{
while ((($sFile = readdir($hDir)) !== false) && ($language === false))
{
if (($sFile != '.') && ($sFile != '..') && (is_dir($opt['stylepath'] . '/articles/' . $sFile)))
{
if (file_exists($opt['stylepath'] . '/articles/' . $sFile . '/' . $article . '.tpl'))
{
$language = $sFile;
}
}
}
closedir($hDir);
}
//article doesn't exists
if ($language === false)
{
$tpl->redirect('index.php');
}
}
}
$tpl->name = 'articles';
$tpl->caching = true;
$tpl->cache_id = 'articles|' . $language . '|' . $article;
$tpl->cache_lifetime = 43200;
if (!$tpl->is_cached())
{
$tpl->menuitem = sql_value("SELECT `id` FROM `sys_menu` WHERE `href`='&1' LIMIT 1", 0, 'articles.php?page=' . urlencode($article));
if ($tpl->menuitem == 0)
$tpl->redirect('index.php');
$tpl->assign('article', $article);
$tpl->assign('language', $language);
/* prepare smarty vars for special pages ...
*/
if ($article == 'cacheinfo')
{
require_once($opt['rootpath'] . 'lib2/logic/attribute.class.php');
$attributes = attribute::getSelectableAttrbutesListArray();
$tpl->assign('attributes', $attributes);
}
}
$tpl->display();
?>

0
htdocs/cache/captcha/index.html vendored Normal file
View File

0
htdocs/cache/index.html vendored Normal file
View File

2
htdocs/cache2/.cvsignore Normal file
View File

@ -0,0 +1,2 @@
menu-de.inc.php
menu-en.inc.php

4
htdocs/cache2/.htaccess Normal file
View File

@ -0,0 +1,4 @@
<FilesMatch ".*">
Order Deny,Allow
Deny from All
</FilesMatch>

View File

@ -0,0 +1,4 @@
<FilesMatch ".*">
Order Deny,Allow
Deny from All
</FilesMatch>

View File

View File

@ -0,0 +1,4 @@
<FilesMatch ".*">
Order Deny,Allow
Allow from all
</FilesMatch>

View File

0
htdocs/cache2/index.html Normal file
View File

View File

@ -0,0 +1,4 @@
<FilesMatch ".*">
Order Deny,Allow
Deny from All
</FilesMatch>

1
htdocs/cache2/smarty/cache/.cvsignore vendored Normal file
View File

@ -0,0 +1 @@
*

4
htdocs/cache2/smarty/cache/.htaccess vendored Normal file
View File

@ -0,0 +1,4 @@
<FilesMatch ".*">
Order Deny,Allow
Deny from All
</FilesMatch>

0
htdocs/cache2/smarty/cache/index.html vendored Normal file
View File

View File

@ -0,0 +1 @@
*

View File

@ -0,0 +1,4 @@
<FilesMatch ".*">
Order Deny,Allow
Deny from All
</FilesMatch>

View File

View File

View File

@ -0,0 +1,4 @@
<FilesMatch ".*">
Order Deny,Allow
Deny from All
</FilesMatch>

View File

71
htdocs/cachemaps.php Normal file
View File

@ -0,0 +1,71 @@
<?php
/***************************************************************************
* You can find the license in the docs directory
*
* Unicode Reminder メモ
***************************************************************************/
require('./lib2/web.inc.php');
redirect_na();
exit;
$wp = isset($_REQUEST['wp']) ? mb_trim($_REQUEST['wp']) : '';
$rs = sql("SELECT `caches`.`cache_id` `cache_id`, `caches`.`wp_oc` `wp_oc`, `caches`.`longitude` `longitude`, `caches`.`latitude` `latitude`, IF(ISNULL(`cache_maps`.`cache_id`) OR `caches`.`last_modified`>`cache_maps`.`last_refresh`, 1, 0) AS `refresh` FROM `caches` INNER JOIN `cache_status` ON `caches`.`status`=`cache_status`.`id` LEFT JOIN `cache_maps` ON `caches`.`cache_id`=`cache_maps`.`cache_id` WHERE `cache_status`.`allow_user_view`=1 AND `caches`.`wp_oc`='&1'", $wp);
$r = sql_fetch_assoc($rs);
sql_free_result($rs);
if ($r !== false)
{
$d1 = mb_substr($r['wp_oc'], 2, 1);
$d2 = mb_substr($r['wp_oc'], 3, 1);
$file = $opt['logic']['cachemaps']['dir'] . $d1 . '/' . $d2 . '/' . $r['wp_oc'] . '.jpg';
if (($r['refresh'] == 1) || !is_file($file))
{
$url = $opt['logic']['cachemaps']['wmsurl'];
$url = mb_ereg_replace('{min_lon}', $r['longitude'] - $opt['logic']['cachemaps']['size']['lon'] / 2, $url);
$url = mb_ereg_replace('{max_lon}', $r['longitude'] + $opt['logic']['cachemaps']['size']['lon'] / 2, $url);
$url = mb_ereg_replace('{min_lat}', $r['latitude'] - $opt['logic']['cachemaps']['size']['lat'] / 2, $url);
$url = mb_ereg_replace('{max_lat}', $r['latitude'] + $opt['logic']['cachemaps']['size']['lat'] / 2, $url);
$url = mb_ereg_replace('{wp_oc}', $r['wp_oc'], $url);
if (!is_dir($opt['logic']['cachemaps']['dir'] . $d1)) mkdir($opt['logic']['cachemaps']['dir'] . $d1);
if (!is_dir($opt['logic']['cachemaps']['dir'] . $d1 . '/' . $d2)) mkdir($opt['logic']['cachemaps']['dir'] . $d1 . '/' . $d2);
if (@copy($url, $file))
{
$im = imagecreatefromjpeg($file);
if (!$im) redirect_na(); // bild ist kein lesbares jpg
$white = imagecolorallocate($im, 255, 255, 255);
$green = imagecolorallocate($im, 100, 255, 100);
imageline($im, ($opt['logic']['cachemaps']['pixel']['x'] / 2) - 10, ($opt['logic']['cachemaps']['pixel']['y'] / 2) - 1, ($opt['logic']['cachemaps']['pixel']['x'] / 2) + 10, ($opt['logic']['cachemaps']['pixel']['y'] / 2) - 1, $green);
imageline($im, ($opt['logic']['cachemaps']['pixel']['x'] / 2) - 1, ($opt['logic']['cachemaps']['pixel']['y'] / 2) - 10, ($opt['logic']['cachemaps']['pixel']['x'] / 2) - 1, ($opt['logic']['cachemaps']['pixel']['y'] / 2) + 10, $green);
imageline($im, ($opt['logic']['cachemaps']['pixel']['x'] / 2), ($opt['logic']['cachemaps']['pixel']['y'] / 2) - 10, ($opt['logic']['cachemaps']['pixel']['x'] / 2), ($opt['logic']['cachemaps']['pixel']['y'] / 2) + 10, $white);
imageline($im, ($opt['logic']['cachemaps']['pixel']['x'] / 2) - 10, ($opt['logic']['cachemaps']['pixel']['y'] / 2), ($opt['logic']['cachemaps']['pixel']['x'] / 2) + 10, ($opt['logic']['cachemaps']['pixel']['y'] / 2), $white);
imagecolordeallocate($im, $white);
imagecolordeallocate($im, $green);
imagejpeg($im, $file);
imagedestroy($im);
sql("INSERT INTO `cache_maps` (`cache_id`, `last_refresh`) VALUES ('&1', NOW()) ON DUPLICATE KEY UPDATE `last_refresh`=NOW()", $r['cache_id']);
}
else
redirect_na(); // download fehlgeschlagen
}
$tpl->redirect($opt['logic']['cachemaps']['url'] . $d1 . '/' . $d2 . '/' . $r['wp_oc'] . '.jpg');
}
else
redirect_na(); // wp existiert nicht
function redirect_na()
{
global $tpl;
$tpl->redirect('images/cachemaps/na.gif');
}
?>

58
htdocs/change_statpic.php Normal file
View File

@ -0,0 +1,58 @@
<?php
/***************************************************************************
* You can find the license in the docs directory
*
* Unicode Reminder メモ
***************************************************************************/
require('./lib2/web.inc.php');
require_once('./lib2/logic/statpic.class.php');
$login->verify();
$tpl->name = 'change_statpic';
$tpl->menuitem = MNU_MYPROFILE_DATA_STATPIC;
if ($login->userid == 0)
$tpl->redirect('login.php?target=change_statpic.php');
if (isset($_REQUEST['cancel']))
$tpl->redirect('myprofile.php');
$sp = new statpic($login->userid);
if (isset($_REQUEST['ok']))
{
$bError = false;
if (isset($_REQUEST['statpic_text']))
{
if (!$sp->setText($_REQUEST['statpic_text']))
{
$bError = true;
$tpl->assign('statpic_text_error', 1);
}
}
if (isset($_REQUEST['statpic_style']))
$sp->setStyle($_REQUEST['statpic_style']);
if (!$bError)
{
$sp->save();
$tpl->redirect('myprofile.php');
}
}
$tpl->assign('statpic_text', isset($_REQUEST['statpic_text']) ? $_REQUEST['statpic_text'] : $sp->getText());
$tpl->assign('statpic_style', isset($_REQUEST['statpic_style']) ? $_REQUEST['statpic_style'] : $sp->getStyle());
$rs = sql("SELECT `statpics`.`id`, `statpics`.`previewpath`, IFNULL(`sys_trans_text`.`text`, `statpics`.`description`) AS `description`
FROM `statpics`
LEFT JOIN `sys_trans_text` ON `statpics`.`trans_id`=`sys_trans_text`.`trans_id` AND `sys_trans_text`.`lang`='&1'
ORDER BY `statpics`.`id` ASC",
$opt['template']['locale']);
$tpl->assign_rs('statpics', $rs);
sql_free_result($rs);
$tpl->display();
?>

34
htdocs/childwp.php Normal file
View File

@ -0,0 +1,34 @@
<?php
require('./lib2/web.inc.php');
$tpl->name = 'childwp';
$tpl->menuitem = MNU_CACHES_HIDE;
$login->verify();
if ($login->userid == 0)
$tpl->redirect_login();
$isSubmit = isset($_POST['submitform']);
$redirect = isset($_POST['back']);
$cacheManager = new Cache_Manager();
$handler = new ChildWp_Handler();
$controller = new ChildWp_Controller();
$presenter = $controller->createPresenter($tpl, $cacheManager, $handler);
if ($isSubmit && $presenter->validate())
{
$presenter->doSubmit();
$redirect = true;
}
if ($redirect)
$tpl->redirect('editcache.php?cacheid=' . $presenter->getCacheId());
$presenter->prepare($tpl);
$tpl->display();
?>

View File

@ -0,0 +1 @@
settings.inc.php

4
htdocs/config2/.htaccess Normal file
View File

@ -0,0 +1,4 @@
<FilesMatch ".*">
Order Deny,Allow
Deny from All
</FilesMatch>

View File

View File

@ -0,0 +1,206 @@
<?php
/***************************************************************************
* You can find the license in the docs directory
*
* Unicode Reminder メモ
*
* Default settings for all options in settings.inc.php
* Do not modify this file - use settings.inc.php!
***************************************************************************/
/* Locale definitions
*
*/
$opt['template']['locales']['DE']['show'] = true;
$opt['template']['locales']['DE']['flag'] = 'images/flags/de.gif';
$opt['template']['locales']['DE']['name'] = 'Deutsch';
$opt['template']['locales']['FR']['show'] = true;
$opt['template']['locales']['FR']['flag'] = 'images/flags/fr.gif';
$opt['template']['locales']['FR']['name'] = 'Français';
$opt['template']['locales']['NL']['show'] = true;
$opt['template']['locales']['NL']['flag'] = 'images/flags/nl.gif';
$opt['template']['locales']['NL']['name'] = 'Nederlands';
$opt['template']['locales']['EN']['show'] = true;
$opt['template']['locales']['EN']['flag'] = 'images/flags/en.gif';
$opt['template']['locales']['EN']['name'] = 'English';
$opt['template']['locales']['PL']['show'] = true;
$opt['template']['locales']['PL']['flag'] = 'images/flags/pl.gif';
$opt['template']['locales']['PL']['name'] = 'Polski';
$opt['template']['locales']['IT']['show'] = true;
$opt['template']['locales']['IT']['flag'] = 'images/flags/it.gif';
$opt['template']['locales']['IT']['name'] = 'Italiano';
$opt['template']['locales']['RU']['show'] = true;
$opt['template']['locales']['RU']['flag'] = 'images/flags/ru.gif';
$opt['template']['locales']['RU']['name'] = 'Русский';
$opt['template']['locales']['ES']['show'] = true;
$opt['template']['locales']['ES']['flag'] = 'images/flags/es.gif';
$opt['template']['locales']['ES']['name'] = 'Español';
$opt['template']['locales']['SV']['show'] = true; // sv_SE
$opt['template']['locales']['SV']['flag'] = 'images/flags/se.gif';
$opt['template']['locales']['SV']['name'] = 'Svenska';
$opt['template']['locales']['NO']['show'] = true; // no_NO
$opt['template']['locales']['NO']['flag'] = 'images/flags/no.gif';
$opt['template']['locales']['NO']['name'] = 'Norsk';
$opt['template']['locales']['DA']['show'] = true; // da_DK
$opt['template']['locales']['DA']['flag'] = 'images/flags/dk.gif';
$opt['template']['locales']['DA']['name'] = 'Danske';
$opt['template']['locales']['PT']['show'] = true; // pt_PT
$opt['template']['locales']['PT']['flag'] = 'images/flags/pt.gif';
$opt['template']['locales']['PT']['name'] = 'Portuguesa';
$opt['template']['locales']['JA']['show'] = true; // ja_JP
$opt['template']['locales']['JA']['flag'] = 'images/flags/jp.gif';
$opt['template']['locales']['JA']['name'] = '日本語';
// geokrety language key association
$opt['geokrety']['locales']['DE'] = 'de_DE.UTF-8';
$opt['geokrety']['locales']['EN'] = 'en_EN';
$opt['geokrety']['locales']['FR'] = 'fr_FR.UTF-8';
$opt['geokrety']['locales']['NL'] = 'en_EN';
$opt['geokrety']['locales']['PL'] = 'pl_PL.UTF-8';
$opt['geokrety']['locales']['IT'] = 'en_EN';
$opt['geokrety']['locales']['RU'] = 'en_EN';
$opt['geokrety']['locales']['ES'] = 'es_ES.UTF-8';
$opt['geokrety']['locales']['SV'] = 'sv_SE.UTF-8';
$opt['geokrety']['locales']['NO'] = 'no_NO.UTF-8';
$opt['geokrety']['locales']['DA'] = 'da_DK.UTF-8';
$opt['geokrety']['locales']['PT'] = 'pt_PT.UTF-8';
$opt['geokrety']['locales']['JA'] = 'ja_JP.UTF-8';
$opt['locale']['DE']['locales'] = array('de_DE.utf8', 'de_DE@euro', 'de_DE', 'de', 'ge');
$opt['locale']['EN']['locales'] = array('en_US.utf8', 'en_US', 'en');
$opt['locale']['FR']['locales'] = array('fr_FR.utf8', 'fr_FR@euro', 'fr_FR', 'french', 'fr');
$opt['locale']['PL']['locales'] = array('pl_PL.utf8', 'pl_PL', 'pl');
$opt['locale']['NL']['locales'] = array('nl_NL.utf8', 'nl_NL', 'nl');
$opt['locale']['IT']['locales'] = array('it_IT.utf8', 'it_IT', 'it');
$opt['locale']['RU']['locales'] = array('ru_RU.utf8', 'ru_RU', 'ru');
$opt['locale']['ES']['locales'] = array('es_ES.utf8', 'es_ES', 'es');
$opt['locale']['SV']['locales'] = array('sv_SE.utf8', 'sv_SE', 'se');
$opt['locale']['NO']['locales'] = array('no_NO.utf8', 'no_NO', 'no');
$opt['locale']['DA']['locales'] = array('da_DK.utf8', 'da_DK', 'dk');
$opt['locale']['PT']['locales'] = array('pt_PT.utf8', 'pt_PT', 'pt');
$opt['locale']['JA']['locales'] = array('ja_JP.utf8', 'ja_JP', 'jp');
$opt['locale']['EN']['format']['date'] = '%x';
$opt['locale']['EN']['format']['datelong'] = '%d. %B %Y';
$opt['locale']['EN']['format']['datetime'] = '%x %I:%M %p';
$opt['locale']['EN']['format']['datetimesec'] = '%x %X';
$opt['locale']['EN']['format']['time'] = '%I:%M %p';
$opt['locale']['EN']['format']['timesec'] = '%X';
$opt['locale']['EN']['country'] = 'UK';
$opt['locale']['DE']['format']['date'] = '%x';
$opt['locale']['DE']['format']['datelong'] = '%d. %B %Y';
$opt['locale']['DE']['format']['datetime'] = '%x %H:%M';
$opt['locale']['DE']['format']['datetimesec'] = '%x %X';
$opt['locale']['DE']['format']['time'] = '%H:%M';
$opt['locale']['DE']['format']['timesec'] = '%X';
$opt['locale']['DE']['country'] = 'DE';
$opt['locale']['DE']['page']['subtitle1'] = 'Geocaching in Deutschland,';
$opt['locale']['DE']['page']['subtitle2'] = 'Österreich und der Schweiz';
$opt['locale']['FR']['format']['date'] = '%x';
$opt['locale']['FR']['format']['datelong'] = '%d. %B %Y';
$opt['locale']['FR']['format']['datetime'] = '%x %H:%M';
$opt['locale']['FR']['format']['datetimesec'] = '%x %X';
$opt['locale']['FR']['format']['time'] = '%H:%M';
$opt['locale']['FR']['format']['timesec'] = '%X';
$opt['locale']['FR']['country'] = 'FR';
$opt['locale']['PL']['format']['date'] = '%x';
$opt['locale']['PL']['format']['datelong'] = '%d. %B %Y';
$opt['locale']['PL']['format']['datetime'] = '%x %H:%M';
$opt['locale']['PL']['format']['datetimesec'] = '%x %X';
$opt['locale']['PL']['format']['time'] = '%H:%M';
$opt['locale']['PL']['format']['timesec'] = '%X';
$opt['locale']['PL']['country'] = 'PL';
$opt['locale']['NL']['format']['date'] = '%x';
$opt['locale']['NL']['format']['datelong'] = '%d. %B %Y';
$opt['locale']['NL']['format']['datetime'] = '%x %H:%M';
$opt['locale']['NL']['format']['datetimesec'] = '%x %X';
$opt['locale']['NL']['format']['time'] = '%H:%M';
$opt['locale']['NL']['format']['timesec'] = '%X';
$opt['locale']['NL']['page']['subtitle1'] = 'Geocaching met Opencaching';
$opt['locale']['NL']['page']['subtitle2'] = '';
$opt['locale']['NL']['country'] = 'NL';
$opt['locale']['IT']['format']['date'] = '%x';
$opt['locale']['IT']['format']['datelong'] = '%d. %B %Y';
$opt['locale']['IT']['format']['datetime'] = '%x %H:%M';
$opt['locale']['IT']['format']['datetimesec'] = '%x %X';
$opt['locale']['IT']['format']['time'] = '%H:%M';
$opt['locale']['IT']['format']['timesec'] = '%X';
$opt['locale']['IT']['country'] = 'IT';
$opt['locale']['IT']['page']['subtitle1'] = 'Geocaching con Opencaching';
$opt['locale']['IT']['page']['subtitle2'] = '';
$opt['locale']['RU']['format']['date'] = '%x';
$opt['locale']['RU']['format']['datelong'] = '%d. %B %Y';
$opt['locale']['RU']['format']['datetime'] = '%x %H:%M';
$opt['locale']['RU']['format']['datetimesec'] = '%x %X';
$opt['locale']['RU']['format']['time'] = '%H:%M';
$opt['locale']['RU']['format']['timesec'] = '%X';
$opt['locale']['RU']['country'] = 'RU';
$opt['locale']['ES']['format']['date'] = '%x';
$opt['locale']['ES']['format']['datelong'] = '%d. %B %Y';
$opt['locale']['ES']['format']['datetime'] = '%x %H:%M';
$opt['locale']['ES']['format']['datetimesec'] = '%x %X';
$opt['locale']['ES']['format']['time'] = '%H:%M';
$opt['locale']['ES']['format']['timesec'] = '%X';
$opt['locale']['ES']['country'] = 'ES';
$opt['locale']['ES']['page']['subtitle1'] = 'Geocaching con Opencaching';
$opt['locale']['ES']['page']['subtitle2'] = '';
$opt['locale']['SV']['format']['date'] = '%Y-%m-%d';
$opt['locale']['SV']['format']['datelong'] = '%Y-%m-%d';
$opt['locale']['SV']['format']['datetime'] = '%x %H:%M';
$opt['locale']['SV']['format']['datetimesec'] = '%x %X';
$opt['locale']['SV']['format']['time'] = '%H:%M';
$opt['locale']['SV']['format']['timesec'] = '%X';
$opt['locale']['SV']['country'] = 'SE';
$opt['locale']['SV']['page']['subtitle1'] = 'Geocaching med Opencaching';
$opt['locale']['SV']['page']['subtitle2'] = '';
$opt['locale']['NO']['format']['date'] = '%Y-%m-%d';
$opt['locale']['NO']['format']['datelong'] = '%Y-%m-%d';
$opt['locale']['NO']['format']['datetime'] = '%x %H:%M';
$opt['locale']['NO']['format']['datetimesec'] = '%x %X';
$opt['locale']['NO']['format']['time'] = '%H:%M';
$opt['locale']['NO']['format']['timesec'] = '%X';
$opt['locale']['NO']['country'] = 'NO';
$opt['locale']['NO']['page']['subtitle1'] = 'Geocaching med Opencaching';
$opt['locale']['NO']['page']['subtitle2'] = '';
$opt['locale']['DA']['format']['date'] = '%Y-%m-%d';
$opt['locale']['DA']['format']['datelong'] = '%Y-%m-%d';
$opt['locale']['DA']['format']['datetime'] = '%x %H:%M';
$opt['locale']['DA']['format']['datetimesec'] = '%x %X';
$opt['locale']['DA']['format']['time'] = '%H:%M';
$opt['locale']['DA']['format']['timesec'] = '%X';
$opt['locale']['DA']['country'] = 'DK';
$opt['locale']['DA']['page']['subtitle1'] = 'Geocaching med Opencaching';
$opt['locale']['DA']['page']['subtitle2'] = '';
$opt['locale']['PT']['format']['date'] = '%Y-%m-%d';
$opt['locale']['PT']['format']['datelong'] = '%Y-%m-%d';
$opt['locale']['PT']['format']['datetime'] = '%x %H:%M';
$opt['locale']['PT']['format']['datetimesec'] = '%x %X';
$opt['locale']['PT']['format']['time'] = '%H:%M';
$opt['locale']['PT']['format']['timesec'] = '%X';
$opt['locale']['PT']['country'] = 'PT';
$opt['locale']['PT']['page']['subtitle1'] = 'Geocaching com Opencaching';
$opt['locale']['PT']['page']['subtitle2'] = '';
$opt['locale']['JA']['format']['date'] = '%Y-%m-%d';
$opt['locale']['JA']['format']['datelong'] = '%Y-%m-%d';
$opt['locale']['JA']['format']['datetime'] = '%x %H:%M';
$opt['locale']['JA']['format']['datetimesec'] = '%x %X';
$opt['locale']['JA']['format']['time'] = '%H:%M';
$opt['locale']['JA']['format']['timesec'] = '%X';
$opt['locale']['JA']['country'] = 'JP';
$opt['locale']['JA']['page']['subtitle1'] = 'Opencachingとジオキャッシング';
$opt['locale']['JA']['page']['subtitle2'] = '';
?>

View File

@ -0,0 +1,12 @@
site_title Opencaching.de
site_url http://www.opencaching.de
site_contact http://opencaching.wikispaces.com/Kontakt
faq_login http://cms.opencaching.de/index.php?id=login
faq_npa http://cms.opencaching.de/index.php?id=140
faq_htmltag http://www.opencaching.de/articles.php?page=htmltags
terms_of_service articles.php?page=impressum#tos
faq_cacheinfo articles.php?page=cacheinfo
terms_privacy articles.php?page=dsb
faq_logpw articles.php?page=cacheinfo#logpw
faq_searchtime articles.php?page=cacheinfo#time

View File

@ -0,0 +1,9 @@
site_contact http://opencachingno.wikispaces.com/Kontakt
faq_login http://opencachingno.wikispaces.com/Sp%C3%B8rsm%C3%A5l+og+svar
faq_npa http://opencachingno.wikispaces.com
faq_htmltag http://opencachingno.wikispaces.com
terms_of_service http://opencachingno.wikispaces.com/Bruksvilkar
faq_cacheinfo http://opencachingno.wikispaces.com/Cache-egenskaper
terms_privacy articles.php?page=dsb
faq_logpw http://opencachingno.wikispaces.com
faq_searchtime http://opencachingno.wikispaces.com

View File

@ -0,0 +1,11 @@
site_title OPENCACHING.no/se
site_url http://www.opencaching.se
site_contact http://opencaching.wikispaces.com/Kontakt
faq_login http://opencaching.wikispaces.com/FAQ
faq_npa http://opencaching.wikispaces.com
faq_htmltag http://opencaching.wikispaces.com
terms_of_service http://opencaching.wikispaces.com/Anv%C3%A4ndarvillkor
faq_cacheinfo http://opencaching.wikispaces.com/Cache+egenskaper
terms_privacy articles.php?page=dsb
faq_logpw http://opencaching.wikispaces.com
faq_searchtime http://opencaching.wikispaces.com

View File

@ -0,0 +1,476 @@
<?php
/***************************************************************************
* You can find the license in the docs directory
*
* Unicode Reminder メモ
*
* Default settings for all options in settings.inc.php
* Do not modify this file - use settings.inc.php!
***************************************************************************/
require('locale.inc.php');
/* PHP settings
*
* PHP_DEBUG_SKIP
*
* dont use ini_set()
*
* PHP_DEBUG_OFF
*
* use the following php.ini-settings
* display_errors = On
* error_reporting = E_ALL & ~E_NOTICE
* mysql.trace_mode = Off
*
* strongly recommended settings
* register_globals = Off
*
* PHP_DEBUG_ON
*
* use the following php.ini-settings
* display_errors = On
* error_reporting = E_ALL
* mysql.trace_mode = On
*/
$opt['php']['debug'] = PHP_DEBUG_SKIP;
/* settings for the template engine
*
*/
// database connection
/* hostname or IP Address
* to connect to mysql socket use ':/path/to/mysql.sock';
*/
$opt['db']['servername'] = 'localhost';
$opt['db']['username'] = '';
$opt['db']['password'] = '';
$opt['db']['pconnect'] = false;
// begin throotling when more than 80%
// of max_connections is reached on db server
$opt['db']['throttle_connection_count'] = 240;
// log the last N seconds for throttling
$opt['db']['throttle_access_time'] = 300;
// throttle users that have more than N access log
// entries in the last [throttle_access_time] seconds
$opt['db']['throttle_access_count'] = 200;
/* replicated slave databases
*/
$opt['db']['slaves'] = array();
/*
$opt['db']['slaves'][0]['server'] = 'slave-ip-or-socket';
// if a slave is no active, the slave will not be tracked
// by online-check or purge of master logs!
// Therefore you might have to initialize the replication again,
// after activating a slave.
$opt['db']['slaves'][0]['active'] = true;
// relative weight compared to other slaves
// see doc2/replicaiton.txt (!)
$opt['db']['slaves'][0]['weight'] = 100;
$opt['db']['slaves'][0]['username'] = '';
$opt['db']['slaves'][0]['password'] = '';
$opt['db']['slaves'][1]...
*/
// maximum time (sec) a slave is allowed to be behind
// the state of the master database before no connection
// is redirected to this slave
$opt['db']['slave']['max_behind'] = 180;
// TODO: use this slave when a specific slave must be connected
// (e.g. xml-interface and mapserver-results)
// you can use -1 to use the master (not recommended, because replicated to slaves)
$opt['db']['slave']['primary'] = -1;
// ... how long a query can take without warning (0 <= disabled)
$opt['db']['warn']['time'] = 0;
$opt['db']['warn']['mail'] = 'developer@devel.opencaching.de'; // set '' to disable
$opt['db']['warn']['subject'] = 'sql_warn';
// display mysql error messages on the website - not recommended for productive use!
$opt['db']['error']['display'] = false;
$opt['db']['error']['mail'] = 'developer@devel.opencaching.de'; // set '' to disable
$opt['db']['error']['subject'] = 'sql_error';
// database placeholder
// productive database with opencaching-tables
$opt['db']['placeholder']['db'] = ''; // selected by default
// empty database for temporary table creation
$opt['db']['placeholder']['tmpdb'] = '';
// date format
$opt['db']['dateformat'] = 'Y-m-d H:i:s';
/* cookie or session
*
* SAVE_COOKIE = only use cookies
* SAVE_SESSION = use php sessions
*
* to use SESSIONS set php.ini to session default values:
*
* session.auto_start = 0
* session.use_cookies = 1
* session.use_only_cookies = 0
* session.cookie_lifetime = 0
* session.cookie_path = "/"
* session.cookie_domain = ""
* session.cookie_secure = off
* session.use_trans_sid = 0
*
* set session.safe_path to a secure place
*
* other parameters may be customized
*/
$opt['session']['mode'] = SAVE_COOKIE;
$opt['session']['cookiename'] = 'oc_devel'; // only with SAVE_COOKIE
$opt['session']['path'] = '/';
$opt['session']['domain'] = ''; // may be overwritten by $opt['domain'][...]['cookiedomain']
/* maximum session lifetime
*/
$opt['session']['expire']['cookie'] = 31536000; // when cookies used (default 1 year)
$opt['session']['expire']['url'] = 1800; // when no cookies used (default 30 min since last call), attention to session.js
/* If the Referer was sent by the client and the substring was not found,
* the embedded session id will be marked as invalid.
* Only used with session.mode = SAVE_SESSION
*/
$opt['session']['check_referer'] = true;
/* Debug level (combine with OR | )
* DEBUG_NO = productive use
* DEBUG_DEVELOPER = developer system
* DEBUG_TEMPLATES = no template caching
* DEBUG_OUTOFSERVICE = only admin login (includes DEBUG_TEMPLATES)
* DEBUG_TESTING = display warning (includes DEBUG_TEMPLATES)
* DEBUG_SQLDEBUGGER = sql debugger (use &sqldebug=1 when calling the site)
* DEBUG_TRANSLATE = read translate messages (use &trans=1 when calling the site, includes DEBUG_TEMPLATES)
* DEBUG_FORCE_TRANSLATE = force read of translate messages (includes DEBUG_TRANSLATE)
* DEBUG_CLI = print debug messages of cli scripts
*/
$opt['debug'] = DEBUG_DEVELOPER;
/* Default locale and style
*
*/
$opt['template']['default']['locale'] = 'DE'; // may be overwritten by $opt['domain'][...]['locale']
$opt['template']['default']['style'] = 'ocstyle'; // may be overwritten by $opt['domain'][...]['style']
$opt['template']['default']['country'] = 'DE'; // may be overwritten by $opt['domain'][...]['country']
// smiley path
$opt['template']['smiley'] = 'resource2/tinymce/plugins/emotions/img/';
/* other template options
*
*/
$opt['page']['subtitle1'] = 'Geocaching with Opencaching';
$opt['page']['subtitle2'] = '';
$opt['page']['title'] = 'OPENCACHING';
$opt['page']['absolute_url'] = 'http://devel.opencaching.de/'; // may be overwritten by $opt['domain'][...]['uri']
$opt['page']['max_logins_per_hour'] = 25;
$opt['page']['showdonations'] = false; // Show donations button
/* Sponsoring advertisements
* (plain HTML)
*/
// example: $opt['page']['sponsor']['topright'] = '<div class="site-slogan" style="background-image: url(resource2/ocstyle/images/darkbluetransparent.png);"><div style="width: 100%; text-align: left;"><p class="search"><a href="http://www.wanderjugend.de" target="_blank"><img border="0" align="right" style="margin-left: 10px;" src="resource2/ocstyle/images/dwj.gif" width="40px" height="20px" alt="... die outdoororientierte Jugendorganisation des Deutschen Wanderverbandes" /></a> Unterst&uuml;tzt und gef&ouml;rdert durch<br />die Deutsche Wanderjugend</p> </div></div>';
$opt['page']['sponsor']['topright'] = '';
// sponsor link on e.g. print preview and garmin-plugin
$opt['page']['sponsor']['popup'] = '';
$opt['page']['sponsor']['bottom'] = 'Driven by the Opencaching Community';
/* disable or enable https access to the main site
* if false and connection is https, redirect to $opt['page']['absolute_url']
* access to /xml/ocapi10 (SOAP interface) is allowed nevertheless
*/
$opt['page']['allowhttps'] = false;
// require SSL for SOAP access
$opt['page']['nusoap_require_https'] = false;
/* multi-domain settings
*
* if one of the domains matches $_SERVER['SERVER_NAME'], the default values will be overwritten
* can be used to host more than one locale on one server with multiple default-locales
*/
//$opt['domain']['www.opencaching.de']['url'] = 'http://www.opencaching.de/';
//$opt['domain']['www.opencaching.de']['locale'] = 'DE';
//$opt['domain']['www.opencaching.de']['style'] = 'ocstyle';
//$opt['domain']['www.opencaching.de']['cookiedomain'] = '.opencaching.de';
//$opt['domain']['www.opencaching.de']['country'] = 'DE';
//$opt['domain']['www.opencaching.pl']['url'] = 'http://www.opencaching.pl/';
//$opt['domain']['www.opencaching.pl']['locale'] = 'PL';
//$opt['domain']['www.opencaching.pl']['style'] = 'ocstyle';
//$opt['domain']['www.opencaching.pl']['cookiedomain'] = '.opencaching.pl';
//$opt['domain']['www.opencaching.pl']['country'] = 'PL';
/* settings for business layer
*
*/
$opt['logic']['rating']['percentageOfFounds'] = 10;
/* Well known node id's - required for synchronization
* 1 Opencaching Deutschland (www.opencaching.de)
* 2 Opencaching Polen (www.opencaching.pl)
* 3 Opencaching Tschechien (www.opencaching.cz)
* 4 Local Development
* 5 Opencaching Entwicklung Deutschland (devel.opencaching.de)
*/
$opt['logic']['node']['id'] = 4;
/* location of uploaded images
*/
$opt['logic']['pictures']['dir'] = $opt['rootpath'] . 'images/uploads';
$opt['logic']['pictures']['url'] = 'http://devel.opencaching.de/images/uploads';
$opt['logic']['pictures']['maxsize'] = 153600;
$opt['logic']['pictures']['extensions'] = 'jpg;jpeg;gif;png;bmp';
/* Thumbnail sizes
*/
$opt['logic']['pictures']['thumb_max_width'] = 175;
$opt['logic']['pictures']['thumb_max_height'] = 175;
$opt['logic']['pictures']['thumb_url'] = $opt['logic']['pictures']['url'] . '/thumbs';
$opt['logic']['pictures']['thumb_dir'] = $opt['rootpath'] . 'images/uploads/thumbs';
/* location of uploaded podcasts
*/
$opt['logic']['podcasts']['dir'] = $opt['rootpath'] . 'podcasts/uploads';
$opt['logic']['podcasts']['url'] = 'http://devel.opencaching.de/podcasts/uploads';
$opt['logic']['podcasts']['maxsize'] = 1536000;
$opt['logic']['podcasts']['extensions'] = 'mp3';
/* cachemaps (old, see cachemaps.php)
*/
$opt['logic']['cachemaps']['url'] = 'images/cachemaps/';
$opt['logic']['cachemaps']['dir'] = $opt['rootpath'] . $opt['logic']['cachemaps']['url'];
$opt['logic']['cachemaps']['wmsurl'] = 'http://www.opencaching.de/cachemaps.php?wp={wp_oc}';
$opt['logic']['cachemaps']['size']['lat'] = 0.2;
$opt['logic']['cachemaps']['size']['lon'] = 0.2;
$opt['logic']['cachemaps']['pixel']['y'] = 200;
$opt['logic']['cachemaps']['pixel']['x'] = 200;
/* cachemaps (new)
* how to display the cache map on viewcache.php (200x200 pixel)
*
* option 1) via <img> tag (e.g. google maps)
* 2) via <iframe> tag (e.g. own mapserver)
*
* placeholders:
* {userzoom} = user zoomlevel (see myprofile.php)
* {latitude} = latitude of the cache
* {longitude} = longitude of the cache
*/
$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';
$opt['logic']['cachemaps']['iframe'] = false;
/* target vars
* all _REQUEST-vars that identifiy the current page for target redirection after login
*/
$opt['logic']['targetvars'] = array('cacheid', 'userid', 'logid', 'desclang', 'descid', 'wp', 'uuid', 'id', 'action', 'rid', 'ownerid');
/* cracklib-check for users passwords enabled?
* (requires php extension crack_check)
*/
$opt['logic']['cracklib'] = false;
/* password authentication method
* (true means extra hash on the digested password)
*/
$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;
/* opencaching prefixes in database available to search for
*/
$opt['logic']['ocprefixes'] = 'oc';
/* Database charset
* frontend and php charsets are UTF-8
* here you can set a different charset for the MySQL-Engine
* usefull if your database is not UTF-8.
* Should only be used for step by step migration.
*
* Both charsets must be the same!
*/
$opt['charset']['iconv'] = 'UTF-8'; // 'ISO-8859-1'; // use iconv compatible charset-name
$opt['charset']['mysql'] = 'utf8'; // use mysql compatible charset-name
/* cronjob
*/
$opt['cron']['pidfile'] = $opt['rootpath'] . 'cache2/runcron.pid';
/* phpbb news integration (index.php)
*
* Set url='' to disable the cronjob task and hide the section on start page.
* Topics from different subforum will be merged and sorted by date.
* forumids defines what subforums to query
* count defines number of postings shown
* maxcontentlength defines where to strip to content
*/
/* example $opt['cron']['phpbbtopics']['url'] = 'http://www.geoclub.de/feed.php?f={id}';
$opt['cron']['phpbbtopics']['forumids'] = array(125, 126, 127);
$opt['cron']['phpbbtopics']['name'] = 'geoclub.de';
$opt['cron']['phpbbtopics']['link'] = 'http://www.geoclub.de/viewforum.php?f=52';
*/
$opt['cron']['phpbbtopics']['url'] = '';
$opt['cron']['phpbbtopics']['forumids'] = array();
$opt['cron']['phpbbtopics']['name'] = '';
$opt['cron']['phpbbtopics']['link'] = '';
$opt['cron']['phpbbtopics']['count'] = 5;
$opt['cron']['phpbbtopics']['maxcontentlength'] = 230;
/* generate sitemap.xml and upload to search engines
*
* NOTE
*
* testing server: disbale submit and add OC-source-directory to robots.txt (disallow /)
* productive server: enable submit and add "Sitemap: sitemap.xml" to you robots.txt
*/
$opt['cron']['sitemaps']['generate'] = true;
$opt['cron']['sitemaps']['submit'] = false;
/* E-Mail settings
*
*/
// outgoing mails
$opt['mail']['from'] = 'noreply@devel.opencaching.de';
$opt['mail']['subject'] = '[devel.opencaching.de] ';
// email address for user contact emails
// has to be an autoresponder informing about wrong mail usage
$opt['mail']['usermail'] = 'usermail@devel.opencaching.de';
// contact address
$opt['mail']['contact'] = 'contact@devel.opencaching.de';
/* News configuration
*
* filename to the include file containing the newscontent
* (e.g. prepared blog-feed in HTML format)
* if no filename is given, the own news-code is used
* (table news and newstopic.php)
* You can use '{style}' as placeholder for the current style-name
*/
$opt['news']['include'] = '';
// redirect news.php to the following url
$opt['news']['redirect'] = '';
// maximum size of the include file
$opt['news']['maxsize'] = 25*1024;
// E-Mail for notification about news (newstopic.php)
$opt['news']['mail'] = 'news@devel.opencaching.de';
// show news block in start page
$opt['news']['onstart'] = true;
/* 3rd party library options
*/
// key provided from garmin (communicator api)
$opt['lib']['garmin']['key'] = '00112233445566778899AABBCCDDEEFF00';
// domain registered to this key. If the domain does not match the request
// a redirect to redirect-setting will be done
// (use exact same url with slashes etc. as registered by garmin)
$opt['lib']['garmin']['domain'] = 'www.site.org';
$opt['lib']['garmin']['url'] = 'http://' . $opt['lib']['garmin']['domain'] . '/';
// if the plugin is not called from the correct domain, redirect to this site
// (e.g. domain called without www. prefix) - must match domain of $opt['lib']['garmin']['url']
$opt['lib']['garmin']['redirect'] = 'http://www.site.org/garmin.php?redirect=1&cacheid={cacheid}';
// Google Maps API key
// http://code.google.com/intl/de/apis/maps/signup.html
$opt['lib']['google']['mapkey'] = array();
//$opt['lib']['google']['mapkey']['www.opencaching.xy'] = 'EEFFGGHH...';
/* config of map.php
*/
// search result cache behaviour
$opt['map']['maxcacheage'] = 3600;
// execute cleanup when the size of table map2_data is greater than maxcachesize (in bytes)
$opt['map']['maxcachesize'] = 20 * 1048576; // = 20MB
// cache size after deleting old entries
$opt['map']['maxcachereducedsize'] = 10 * 1048576; // = 10MB
// max number of caches displayed in google maps
$opt['map']['maxrecords'] = 180;
// the full screen mode requires a GIS server at the moment
// has to be migrated to map2.php
$opt['map']['disablefullscreen'] = true;
/* external binaries
*/
$opt['bin']['cs2cs'] = 'cs2cs';
/* Opencaching Node Daemon
*
*/
// temporary file to collect status info of all child forks
$opt['ocnd']['statusfile'] = '/tmp/ocndaemon.tmp';
// polling behaviour of status option
$opt['ocnd']['timeout'] = 10; // seconds
// IP address to listen
$opt['ocnd']['ip'] = '0.0.0.0';
// TCP port to listen
$opt['ocnd']['port'] = 15000;
// maximum connects buffer (see php manual of socket_listen() )
$opt['ocnd']['connectbuffer'] = 10;
// print out every line sent and received
$opt['ocnd']['debugtcp'] = true;
// do not check openssl version (version check is available in php 5.2+)
$opt['ocnd']['noopensslcheck'] = false;
/* commands to start and stop apache process
* required to clear the webcache
*/
$opt['httpd']['stop'] = '/etc/rc.d/init.d/httpd stop';
$opt['httpd']['start'] = '/etc/rc.d/init.d/httpd start';
/* owner and group of files created by apache daemon
* (used to change ownership in shell scripts)
*/
$opt['httpd']['user'] = 'apache';
$opt['httpd']['group'] = 'apache';
/* CMS links for external pages
*/
// explanation of common login errors
$opt['cms']['login'] = 'http://blog.geocaching.de/?page_id=268';
// explanation of nature protection areas
$opt['cms']['npa'] = 'http://blog.geocaching.de/?page_id=274';
?>

View File

@ -0,0 +1,163 @@
<?php
/***************************************************************************
* You can find the license in the docs directory
*
* Unicode Reminder メモ
*
* All settings to run the website.
***************************************************************************/
/* PHP settings
*
* PHP_DEBUG_SKIP
*
* dont use ini_set()
*
* PHP_DEBUG_OFF
*
* use the following php.ini-settings
* display_errors = On
* error_reporting = E_ALL & ~E_NOTICE
* mysql.trace_mode = Off
*
* strongly recommended settings
* register_globals = Off
*
* PHP_DEBUG_ON
*
* use the following php.ini-settings
* display_errors = On
* error_reporting = E_ALL
* mysql.trace_mode = On
*/
$opt['php']['debug'] = PHP_DEBUG_ON;
/* settings for the template engine
*
*/
$opt['db']['servername'] = 'localhost';
$opt['db']['username'] = '<db>';
$opt['db']['password'] = '<pw>';
$opt['db']['pconnect'] = true;
// ... how long a query can take without warning (0 <= disabled)
$opt['db']['warn']['time'] = 1;
$opt['db']['warn']['mail'] = '<admin email>';
$opt['db']['warn']['subject'] = 'sql_warn';
// display mysql error messages on the website - not recommended for productive use!
$opt['db']['error']['display'] = true;
$opt['db']['error']['mail'] = '<admin email>';
$opt['db']['error']['subject'] = 'sql_error';
// database placeholder
$opt['db']['placeholder']['db'] = 'ocde';
$opt['db']['placeholder']['tmpdb'] = 'ocdetmp';
$opt['db']['placeholder']['hist'] = 'ocdehist';
/* cookie or session
*
* SAVE_COOKIE = only use cookies
* SAVE_SESSION = use php sessions
*
* to use SESSIONS set php.ini to session default values:
*
* session.auto_start = 0
* session.use_cookies = 1
* session.use_only_cookies = 0
* session.cookie_lifetime = 0
* session.cookie_path = "/"
* session.cookie_domain = ""
* session.cookie_secure = off
* session.use_trans_sid = 0
*
* other parameters may be customized
*/
$opt['session']['mode'] = SAVE_COOKIE;
$opt['session']['cookiename'] = '<cookiename>'; // only with SAVE_COOKIE
$opt['session']['path'] = '/';
$opt['session']['domain'] = ''; // may be overwritten by $opt['domain'][...]['cookiedomain']
/* If the Referer was sent by the client and the substring was not found,
* the embedded session id will be marked as invalid.
* Only used with session.mode = SAVE_SESSION
*/
$opt['session']['check_referer'] = true;
/* Debug level (combine with OR | )
* DEBUG_NO = productive use
* DEBUG_DEVELOPER = developer system
* DEBUG_TEMPLATES = no template caching
* DEBUG_OUTOFSERVICE = only admin login (includes DEBUG_TEMPLATES)
* DEBUG_TESTING = display warning (includes DEBUG_TEMPLATES)
* DEBUG_SQLDEBUGGER = sql debugger (use &sqldebug=1 when calling the site)
* DEBUG_TRANSLATE = read translate messages (use &trans=1 when calling the site)
* DEBUG_FORCE_TRANSLATE = force read of translate messages
* DEBUG_CLI = print debug messages of cli scripts
*/
$opt['debug'] = DEBUG_DEVELOPER|DEBUG_TEMPLATES|DEBUG_SQLDEBUGGER|DEBUG_TRANSLATE|DEBUG_FORCE_TRANSLATE;
//$opt['debug'] = DEBUG_DEVELOPER|DEBUG_TEMPLATES|DEBUG_SQLDEBUGGER;
//$opt['debug'] = DEBUG_DEVELOPER|DEBUG_SQLDEBUGGER;
/* other template options
*
*/
$opt['page']['absolute_url'] = 'http://<domain>';
$opt['mail']['from'] = '<admin email>';
/* location of uploaded images
*/
$opt['logic']['pictures']['dir'] = '/srv/www/html/images/uploads';
$opt['logic']['pictures']['url'] = 'http://<domain>/images/uploads';
$opt['logic']['pictures']['thumb_url'] = $opt['logic']['pictures']['url'] . '/thumbs';
/* location of uploaded mp3
*/
$opt['logic']['podcasts']['url'] = 'http://<domain>/podcasts/uploads';
/* cachemaps
*/
$opt['logic']['cachemaps']['wmsurl'] = 'http://www.opencaching.de/cachemaps.php?wp={wp_oc}';
/* password authentication method
* (true means extra hash on the digested password)
*/
$opt['logic']['password_hash'] = false;
/* E-Mail for notification about news (newstopic.php)
*/
$opt['news']['mail'] = '<admin email>';
$opt['mail']['subject'] = '[<domain>] ';
/* 3rd party library options
* see https://my.garmin.com/api/communicator/key-generator.jsp
*/
$opt['lib']['garmin']['key'] = '00112233445566778899AABBCCDDEEFF00';
$opt['lib']['garmin']['url'] = 'http://www.site.org/';
$opt['logic']['node']['id'] = 4;
$opt['logic']['theme'] = 'seasons'; // leave blank to disable theme
$opt['logic']['lowresfriendly'] = false;
function post_config()
{
global $opt, $menuitem, $tpl;
$domain = isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : '';
if ($domain == '')
return;
switch (mb_strtolower($domain))
{
case 'www.opencaching.it':
config_domain_www_opencaching_it();
break;
case 'www.opencachingspain.es':
config_domain_www_opencachingspain_es();
break;
default:
$tpl->redirect($opt['page']['absolute_url'] . 'index.php');
}
}
?>

View File

@ -0,0 +1,26 @@
<?php
/***************************************************************************
* You can find the license in the docs directory
*
* Unicode Reminder メモ
*
* !!! IMPORTANT !!!
*
* Only use this file on development systems!
* NOT for productive use!
*
* !!! IMPORTANT !!!
*
* Default settings for all options in sqlroot.inc.php
* Do not modify this file - use settings.inc.php!
***************************************************************************/
if ($opt['debug'] == DEBUG_NO)
die('sqlroot.inc.php cannot be included on productive systems, set $opt[\'debug\'] != DEBUG_NO');
/* creditials for db-root
* needs all privileges to all oc-databases
*/
$opt['sqlroot']['username'] = 'root';
$opt['sqlroot']['password'] = 'secret';
?>

48
htdocs/coordinates.php Normal file
View File

@ -0,0 +1,48 @@
<?php
/***************************************************************************
* You can find the license in the docs directory
*
* Unicode Reminder メモ
***************************************************************************/
require('./lib2/web.inc.php');
require_once('./lib2/logic/coordinate.class.php');
$tpl->name = 'coordinates';
$tpl->popup = true;
$lat_float = 0;
if (isset($_REQUEST['lat']))
$lat_float += $_REQUEST['lat'];
$lon_float = 0;
if (isset($_REQUEST['lon']))
$lon_float += $_REQUEST['lon'];
$coord = new coordinate($lat_float, $lon_float);
$tpl->assign('coordDeg', $coord->getDecimal());
$tpl->assign('coordDegMin', $coord->getDecimalMinutes());
$tpl->assign('coordDegMinSec', $coord->getDecimalMinutesSeconds());
$tpl->assign('coordUTM', $coord->getUTM());
$tpl->assign('coordGK', $coord->getGK());
$tpl->assign('coordRD', $coord->getRD());
$tpl->assign('coordQTH', $coord->getQTH());
$tpl->assign('coordSwissGrid', $coord->getSwissGrid());
// wp gesetzt?
$wp = isset($_REQUEST['wp']) ? $_REQUEST['wp'] : '';
if ($wp != '')
{
$rs = sql("SELECT `caches`.`name`, `user`.`username` FROM `caches` INNER JOIN `cache_status` ON `caches`.`status`=`cache_status`.`id` INNER JOIN `user` ON `user`.`user_id`=`caches`.`user_id` WHERE `cache_status`.`allow_user_view`=1 AND `caches`.`wp_oc`='&1'", $wp);
if ($r = sql_fetch_array($rs))
{
$tpl->assign('owner', $r['username']);
$tpl->assign('cachename', $r['name']);
}
sql_free_result($rs);
}
$tpl->assign('wp', $wp);
$tpl->display();
?>

70
htdocs/dbmaintain.php Normal file
View File

@ -0,0 +1,70 @@
<?php
/***************************************************************************
* You can find the license in the docs directory
*
* Unicode Reminder メモ
***************************************************************************/
require('./lib2/web.inc.php');
$tpl->name = 'dbmaintain';
$tpl->menuitem = MNU_ADMIN_DBMAINTAIN;
$login->verify();
if ($login->userid == 0)
$tpl->redirect('login.php?target=dbmaintain.php');
if (($login->admin & ADMIN_MAINTAINANCE) != ADMIN_MAINTAINANCE)
$tpl->error(ERROR_NO_ACCESS);
$procedures = array();
$procedures[] = 'sp_updateall_caches_descLanguages';
$procedures[] = 'sp_updateall_logstat';
$procedures[] = 'sp_updateall_hiddenstat';
$procedures[] = 'sp_updateall_watchstat';
$procedures[] = 'sp_updateall_ignorestat';
$procedures[] = 'sp_updateall_topratingstat';
$procedures[] = 'sp_updateall_cache_picturestat';
$procedures[] = 'sp_updateall_cachelog_picturestat';
$tpl->assign('procedures', $procedures);
if (isset($_REQUEST['ok']))
{
$proc = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
// if (sql_connect_root() == false)
// $tpl->error(ERROR_DB_NO_ROOT);
$bError = false;
if ($proc == 'sp_updateall_caches_descLanguages')
sql("CALL sp_updateall_caches_descLanguages(@c)");
else if ($proc == 'sp_updateall_logstat')
sql("CALL sp_updateall_logstat(@c)");
else if ($proc == 'sp_updateall_hiddenstat')
sql("CALL sp_updateall_hiddenstat(@c)");
else if ($proc == 'sp_updateall_watchstat')
sql("CALL sp_updateall_watchstat(@c)");
else if ($proc == 'sp_updateall_ignorestat')
sql("CALL sp_updateall_ignorestat(@c)");
else if ($proc == 'sp_updateall_topratingstat')
sql("CALL sp_updateall_topratingstat(@c)");
else if ($proc == 'sp_updateall_cache_picturestat')
sql("CALL sp_updateall_cache_picturestat(@c)");
else if ($proc == 'sp_updateall_cachelog_picturestat')
sql("CALL sp_updateall_cachelog_picturestat(@c)");
else
{
$bError = true;
}
if ($bError == false)
{
$count = sql_value("SELECT @c", 0);
$tpl->assign('executed', true);
$tpl->assign('proc', $proc);
$tpl->assign('count', $count);
}
}
$tpl->display();
?>

339
htdocs/doc/xml/xml11.htm Normal file
View File

@ -0,0 +1,339 @@
<html>
<head>
<title>Dokumentation Opencaching XML-Interface Version 1.1</title>
<meta name="vs_showGrid" content="True">
</head>
<body>
<h1>Dokumentation Opencaching XML-Interface Version 1.1</h1>
<p>
Das XML-Interface dient zum automatisierten abfragen aller Caches, Logeinträ,
Benutzer und/oder Bilder. Dieses Interface ist nicht fübenutzer gedacht,
sondern primäfüsite-Entwickler.
</p>
<h2>Ausgabeformat</h2>
<p>
Die Ausgabe ist eine oder mehrere xml,zip,gz&nbsp;oder bz2-Dateien. Es stehen 2
Üertragungsmodi bereit: in Paketen zu&nbsp;je 500 Datensäen&nbsp;oder in
einer Datei.
<P>Die folgenden XML-Abschnitte stehen zur Verfü Sie werden immer in dieser
Reihenfolge ausgegeben:
<ol>
<li>
user (Benutzerdaten)
<li>
caches (Caches)
<li>
cachedesc (Cachebeschreibungen)
<li>
cachelog (Logeinträ)
<li>
picture (Bilder)
<li>
removedobject (gelöte Objekte)</li>
</ol>
<P></P>
<h3>Allgemeine XML-Elemente</h3>
<h4>lastmodified</h4>
<p>Datum an dem dieser Datensatz zuletzt geäert wurde. Es werden keine
Abhäigkeiten berühtigt. D.h. Wenn eine Cachebeschreibung geäert wird,
äert sich nur deren lastmodified, nicht jedoch das des Caches. Datumsangaben
sind immer in der Form "yyyy-mm-dd hh:mm:ss" oder "yyyy-mm-dd"</p>
<h4>datecreated</h4>
<p>Datum an dem dieser Datensatz angelegt wurde.</p>
<h4>id</h4>
<p>Zu unterscheiden ist die id (identifier) und die uuid (universal unique
identifier). Die id (Zahl) ist ein nur auf der jeweiligen Webseite gür
identifier, wäend die uuid (alphanumerische Folge) auf jeder Seite die
Opencaching-Daten verwendet güsein sollte. Beispiel: bei dem Datenabgleich
von www.opencaching.de und devel.opencaching.de wird auf devel.opencaching.de
eine neue id fü Datensatz erzeugt und die uuid beibhalten.</p>
<h3>Attributliste</h3>
<p>&lt;attrlist&gt;<br />
&nbsp; &lt;attr id="1" icon_large="http://www.opencaching.de/images/attributes/night.gif"<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; icon_no="http://www.opencaching.de/images/attributes/night-no.gif"<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; icon_undef="http://www.opencaching.de/images/attributes/night-undef.gif"&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;![CDATA[Nachtcache]]&gt;<br />
&nbsp; &lt;/attr&gt;<br />
&nbsp; &lt;attr id="6" icon_large="http://www.opencaching.de/images/attributes/oconly.gif"<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; icon_no="http://www.opencaching.de/images/attributes/oconly-no.gif"<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; icon_undef="http://www.opencaching.de/images/attributes/oconly-undef.gif"&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;![CDATA[Nur bei Opencaching]]&gt;<br />
&nbsp; &lt;/attr&gt;<br />
&nbsp; &lt;attr id="7" icon_large="http://www.opencaching.de/images/attributes/wwwlink.gif"<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; icon_no="http://www.opencaching.de/images/attributes/wwwlink-no.gif"<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; icon_undef="http://www.opencaching.de/images/attributes/wwwlink-undef.gif"&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;![CDATA[Nur Hyperlink]]&gt;<br />
&nbsp; &lt;/attr&gt;<br />
&nbsp; &lt;attr id="8" icon_large="http://www.opencaching.de/images/attributes/letterbox.gif"<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; icon_no="http://www.opencaching.de/images/attributes/letterbox-no.gif"<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; icon_undef="http://www.opencaching.de/images/attributes/letterbox-undef.gif"&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;![CDATA[Letterbox (benöt Stempel)]]&gt;<br />
&nbsp; &lt;/attr&gt;<br />
&lt;/attrlist&gt;<br />
</p>
<h3>user (Benutzerdaten)</h3>
<p>&lt;user&gt;<br>
&nbsp; &lt;id id="12345"&gt;4CE405E5-C110-CE00-9E88-8907F2212C73&lt;/id&gt;<br>
&nbsp; &lt;username&gt;&lt;![CDATA[Joe Geocacher]]&gt;&lt;/username&gt;<br>
&nbsp; &lt;pmr&gt;0&lt;/pmr&gt;<br>
&nbsp; &lt;datecreated&gt;2005-12-24 11:22:34&lt;/datecreated&gt;<br>
&nbsp; &lt;lastmodified&gt;2005-12-29 15:38:01&lt;/lastmodified&gt;<br>
&lt;/user&gt;</p>
<h4>username</h4>
<p>Benutzername</p>
<h4>pmr</h4>
<p>1: Der Benutzer hat angegeben ein PMR-Funkgeräauf Kanal 2 mit auf Tour zu
nehmen.<br>
0: Keine Angabe</p>
<h3>cache (Caches)</h3>
<P>&lt;cache&gt;<BR>
&nbsp; &lt;id id="270"&gt;D455C916-7737-8210-F7FF-C6872E561CEB&lt;/id&gt;<br>
&nbsp; &lt;user id="113" uuid=
"CAA9E3C5-50DF-4E9E-191F-CECABA6A8A19"&gt;&lt;![CDATA[TeamSchnitzeljagd]]&gt;&lt;/user&gt;<br>
&nbsp; &lt;name&gt;&lt;![CDATA[Pegeluhr]]&gt;&lt;/name&gt;<br>
&nbsp; &lt;longitude&gt;8.45058&lt;/longitude&gt;<br>
&nbsp; &lt;latitude&gt;49.46393&lt;/latitude&gt;<br>
&nbsp; &lt;type id="2" short="Trad."&gt;&lt;![CDATA[normaler
Cache]]&gt;&lt;/type&gt;<br>
&nbsp; &lt;status id="2"&gt;&lt;![CDATA[Momentan nicht
verfü]&gt;&lt;/status&gt;<br>
&nbsp; &lt;country id="DE"&gt;&lt;![CDATA[Deutschland]]&gt;&lt;/country&gt;<br>
&nbsp; &lt;size id="2"&gt;&lt;![CDATA[mikro]]&gt;&lt;/size&gt;<br>
&nbsp; &lt;desclanguages&gt;DE&lt;/desclanguages&gt;<br>
&nbsp; &lt;difficulty&gt;4&lt;/difficulty&gt;<br>
&nbsp; &lt;terrain&gt;2&lt;/terrain&gt;<BR>
&nbsp;&nbsp;&lt;rating waylength="1.5" needtime= "0.5"&gt;&lt;/rating&gt;<br>
&nbsp; &lt;waypoints gccom= "" nccom="" oc="OCR2D2"&gt;&lt;/waypoints&gt;<br>
&nbsp; &lt;datehidden&gt;2005-08-01&lt;/datehidden&gt;<br>
&nbsp; &lt;datecreated&gt;2005-09-08 15:45:02&lt;/datecreated&gt;<br>
&nbsp; &lt;lastmodified&gt;2005-12-20 20:58:41&lt;/lastmodified&gt;<br>
&nbsp; &lt;attributes&gt;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&lt;attribute id="6"&gt;&lt;![CDATA[ Nur bei Opencaching]]&gt;&lt;/attribute&gt;<br>
&nbsp; &lt;/attributes&gt;<br>
&lt;/cache&gt;</P>
<h3>cachedesc (Cachebeschreibungen)</h3>
<p>
&lt;cachedesc&gt;<br>
&nbsp; &lt;id id="5697"&gt;9BA489ED-AC62-B26D-6EC8-4D52DF3CD008&amp;&lt;/id&gt;<br>
&nbsp; &lt;cacheid
id="4927"&gt;AB551E31-8633-0CD1-26AD-324355D4E920&lt;/cacheid&gt;<br>
&nbsp; &lt;language id="EN"&gt;&lt;![CDATA[Englisch]]&gt;&lt;/language&gt;<br>
&nbsp; &lt;shortdesc&gt;&lt;![CDATA[Drive-In-Cache especially for
motorcyclists]]&gt;&lt;/shortdesc&gt;<br>
&nbsp; &lt;desc html="1"&gt;&lt;![CDATA[This MoCache is intended to connect the
MoCache series to other<br>
motorcycle-friendly caches on The Alb. Furthermore this great road<br>
between Erpfingen and Undingen was really worth it... &amp;lt;br /&amp;gt;<br>
&nbsp; &amp;lt;br /&amp;gt;<br>
&nbsp; &amp;lt;a
href=&amp;quot;http://people.freenet.de/6x7/mocaches.html&amp;quot;&amp;gt;Other
MoCaches&lt;/a&amp;gt;<br>
&nbsp; ]]&gt;&lt;/desc&gt;<br>
&nbsp; &lt;hint&gt;&lt;![CDATA[guard rail pole]]&gt;&lt;/hint&gt;<br>
&nbsp; &lt;lastmodified&gt;2005-12-24 14:38:13&lt;/lastmodified&gt;<br>
&lt;/cachedesc&gt;
</p>
<h3>cachelog (Logeinträ)</h3>
<p>
&lt;cachelog&gt;<br>
&nbsp; &lt;id id="13037"&gt;F0DAC335-0FA6-3479-45AF-03E2F6BC28B9&lt;/id&gt;<br>
&nbsp; &lt;cacheid
id="3439"&gt;048A8BF3-AA75-0741-CF60-6FBAE239EE11&lt;/cacheid&gt;<br>
&nbsp; &lt;user id="113"
uuid="CAA9E3C5-50DF-4E9E-191F-CECABA6A8A19"&gt;&lt;![CDATA[Team
Schnitzeljagd]]&gt;&lt;/user&gt;<BR>
&nbsp; &lt;logtype id="1" recommended="0"&gt;&lt;![CDATA[Gefunden]]&gt;&lt;/type&gt;<br>
&nbsp; &lt;date&gt;2005-05-18&lt;/date&gt;<br>
&nbsp; &lt;text&gt;&lt;![CDATA[Gut gefunden.&amp;lt;br /&amp;gt;<br>
Gr&amp;uuml;&amp;szlig;e von&amp;lt;br /&amp;gt;<br>
Volker]]&gt;&lt;/text&gt;<br>
&nbsp; &lt;datecreated&gt;2005-12-24 06:24:07&lt;/datecreated&gt;<br>
&nbsp; &lt;lastmodified&gt;2005-12-24 06:24:07&lt;/lastmodified&gt;<br>
&lt;/cachelog&gt;
</p>
<h3>picture (Bilder)</h3>
<p>
&lt;picture&gt;<br>
&nbsp; &lt;id id="4619"&gt;558990D1-4DE2-50AF-B53A-135E87704D70&lt;/id&gt;<br>
&nbsp;
&lt;url&gt;http://www.opencaching.de/images/uploads/558990D1-4DE2-50AF-B53A-135E87704D70.jpg&lt;/url&gt;<br>
&nbsp; &lt;title&gt;&lt;![CDATA[Schlurfende Gestalten]]&gt;&lt;/title&gt;<br>
&nbsp; &lt;desc html="0"&gt;&lt;/desc&gt;<br>
&nbsp; &lt;object id="73240" type="1" typename=
"cachelog"&gt;4FE4B999-315D-43C1-11C2-2B81E68168CD&lt;/object&gt;<BR>
<SPAN class="m">&nbsp; &lt;</SPAN><SPAN class="t">attributes</SPAN>
<SPAN class="t">spoiler</SPAN><SPAN class="m">="</SPAN>0<SPAN class="m">"</SPAN><SPAN class="t"> display</SPAN><SPAN class="m">="</SPAN>1<SPAN class="m">"</SPAN><SPAN class="m"> /&gt;&lt; /SPAN&gt;
<br>
&nbsp; &lt;datecreated&gt;2005-12-24 01:01:38&lt;/datecreated&gt;<br>
&nbsp; &lt;lastmodified&gt;2005-12-24 01:01:38&lt;/lastmodified&gt;<br>
&lt;/picture&gt;
</p>
<h3>removedobject (gelöte Objekte)</h3>
<p>
&lt;removedobject&gt;<br>
&nbsp; &lt;id id="748" /&gt;<br>
&nbsp; &lt;object id="2388" type="6"
typename="picture"&gt;3C5A2147-BC21-CC96-B240-E3BEA829D936&lt;/object&gt;<br>
&nbsp; &lt;removeddate&gt;2005-12-24 15:11:23&lt;/removeddate&gt;<br>
&lt;/removedobject&gt;
</p>
<h2>Datenauswahl</h2>
<p>Die Auswahl erfolgt zum einen durch den Paramter modifiedsince, mit dem
inkrementelle Updates gesteuert werden, zum anderen üine Gebietsauswahl.</p>
<h3>Zu üagende Daten auswäen</h3>
<P>Folgende Parameter stehen zur Verfüum die zu üagenden Daten
auszuwäen.</P>
<P>Die Werte dü1 oder 0 sein, Default ist 0.<BR>
0=Datensäe nicht üagen<BR>
1=Datensäe üagen</P>
<UL>
<LI>
user
<LI>
cache
<LI>
cachedesc
<LI>
cachelog
<LI>
picture
<LI>
removedobject</LI></UL>
<h3>modifiedsince</h3>
<p>Alle Datensä üagen, die nach diesem Datum angelegt oder modifiziert
wurden. Das Datumsformat ist yyyymmddhhnnss</p>
<h3>Gebietsauswahl</h3>
<p>Es muss keine Gebietsauswahl getroffen werden. Eine Kombination von Land,
Koordinaten oder cacheid ist nicht möch.</p>
<h4>Nach Land</h4>
<p>Parameter country ... wird dieser Parameter angegeben, werden nur Datensä
üagen, die mit Caches in Zusammenhang stehen, die in diesem Land versteckt
wurden. User-Records werden nicht üagen, removedobjects werden alle
ügen.</p>
<P>Füder muss dabei angegeben werden, ob nur Bilder üagen werden die
von Caches stammen oder auch von Cachelogs:<BR>
Paramter: picturefromcachelog = 0/1, default 0</P>
<h4>Nach Koordinaten</h4>
<P>Parameter&nbsp;lat, lon, distance&nbsp;... werden diese Parameter angegeben,
werden nur Datensä üagen, die mit Caches in Zusammenhang stehen, die in
diesem&nbsp;Gebiet versteckt wurden. User-Records werden nicht üagen,
removedobjects werden alle ügen.</P>
<h4>Nach cacheid</h4>
<P>Parameter&nbsp;cacheid&nbsp;... wird dieser Parameter angegeben,
werden nur Datensä üagen, die mit Cache in Zusammenhang stehen.
User-Records werden nicht üagen,
removedobjects werden alle ügen.</P>
<P>Füder muss dabei angegeben werden, ob nur Bilder üagen werden die
von Caches stammen oder auch von Cachelogs:<BR>
Paramter: picturefromcachelog = 0/1, default 0</P>
<h4>Nach Wegpunkt</h4>
<p>Paramter wp ... wie cacheid, ausser dass statt der cacheid der Opencaching Wegpunkt verwendet wird.</p>
<h4>Nach uuid</h4>
<p>Paramter uuid ... wie cacheid, ausser dass statt der cacheid die UUID des Caches verwendet wird.</p>
<h3>Beispiele</h3>
<p>1. Alle Daten inkrementell abrufen<BR>
<A>http://www.opencaching.de/xml/ocxml11.php?modifiedsince=&lt;date&gt;&amp;user=1&amp;cache=1&amp;cachedesc=1&amp;cachelog=1&amp;picture=1&amp;removedobject=1</A></p>
<P>2. Alle Daten von Deutschland inkrementell abrufen<BR>
<A>http://www.opencaching.de/xml/ocxml11.php?modifiedsince=&lt;date&gt;&amp;cache=1&amp;cachedesc=1&amp;cachelog=1&amp;picture=1&amp;removedobject=1&amp;country=DE&amp;picturefromcachelog=1</A></P>
<P>3. Alle Caches ohne Logs von Deutschland inkrementell abrufen<BR>
<A>http://www.opencaching.de/xml/ocxml11.php?modifiedsince=&lt;date&gt;&amp;cache=1&amp;cachedesc=1&amp;picture=1&amp;removedobject=1&amp;country=DE</A></P>
<P>4. Alle Daten im Umkreis von 100 km abrufen<BR>
<A>http://www.opencaching.de/xml/ocxml11.php?modifiedsince=&lt;date&gt;&amp;cache=1&amp;cachedesc=1&amp;cachelog=1&amp;picture=1&amp;removedobject=1&amp;lat=48&amp;lon=9&amp;distance=100&amp;picturefromcachelog=1</A></P>
<P>5. Alle Bilder abrufen<BR>
<A>http://www.opencaching.de/xml/ocxml11.php?modifiedsince=&lt;date&gt;&amp;picture=1</A></P>
<P>6. Alle Bilder von Caches abrufen die in Deutschland versteckt sind<BR>
<A>http://www.opencaching.de/xml/ocxml11.php?modifiedsince=&lt;date&gt;&amp;picture=1&amp;country=DE</A></P>
<P>7. Alle Bilder von Caches und deren Logs abrufen die in Deutschland versteckt
sind<BR>
<A>http://www.opencaching.de/xml/ocxml11.php?modifiedsince=&lt;date&gt;&amp;picture=1&amp;country=DE</A>&amp;picturefromcachelog=1</P>
<P>Diese Anfragen werden mit einem kurzen XML-Stream beantwortet, der die
XML-Session-Id zurüt. Mit dieser Id kön dann die Daten abgerufen
werden.</P>
<P>&lt;?xml version="1.0"?&gt;<BR>
&lt;ocxmlsession&gt;<BR>
&nbsp; &lt;sessionid&gt;12345&lt;/sessionid&gt;<BR>
&nbsp; &lt;records user="193" cache="211" cachedesc="235" cachelog="439"
picture="108" removeobject="19" /&gt;<BR>
&lt;/ocxmlsession&gt;</P>
<P>Die Sessionid ist 24h gü danach muss eine neue sessionid angefordert
werden. Die Anzahl der Datensä muss nicht exakt mit den üagenen
ünstimmen - mehr Datensäe werden jedoch auf keinen Fall üagen. Die
Summe der Datensäe ist in diesem Beispiel 1205 - es werden also 3 Aufrufe
benöt (500, 500, 205 Datensäe).</P>
<P>Die Daten kön dann mit folgender Anfrage abgerufen werden:<BR>
<A>http://www.opencaching.de/xml/ocxml11.php?sessionid=12345&amp;file=1</A><BR>
<A>http://www.opencaching.de/xml/ocxml11.php?sessionid=12345&amp;file=2</A><BR>
<A>http://www.opencaching.de/xml/ocxml11.php?sessionid=12345&amp;file=3</A></P>
<H3>Alle Ergebnisse mit einem Aufruf abfragen</H3>
<P>Um alle Ergebnisse in einer Datei abzurufen muss bei dem Aufruf der Paramter
session auf 0 gesetzt werden.</P>
<P>Beispeil:<BR>
<A>http://www.opencaching.de/xml/ocxml11.php?modifiedsince=&lt;date&gt;&amp;user=1&amp;cache=1&amp;cachedesc=1&amp;cachelog=1&amp;picture=1&amp;removedobject=1&amp;session=0</A></P>
<H3>Dateikomprimierung einstellen</H3>
<P>Dei Dateikomprimierung kann mit dem Paramter zip eingestellt weren. Möche
Werte sind 0, zip, bzip2, gzip. Null bedeutet hier keine Kompression. Wird
keine Kompression angegeben, wird zip verwendet.</P>
<P>Beispeil:<BR>
<A>http://www.opencaching.de/xml/ocxml11.php?modifiedsince=&lt;date&gt;&amp;user=1&amp;cache=1&amp;cachedesc=1&amp;cachelog=1&amp;picture=1&amp;removedobject=1&amp;session=0&amp;zip=bzip2</A><BR>
<A>http://www.opencaching.de/xml/ocxml11.php?sessionid=12345&amp;file=1&amp;zip=gzip</A></P>
<H3>XML-Optionen</H3>
<P>Die folgenden XML-Optionen mübei jedem Aufruf üben
werden.</P>
<P>xmldecl ... 0 = keine Xml-Deklaration / (Default) 1=Xml-Deklaration<br>
doctype ... 0 = keine Xml-Document-Type-Definition /
(Default) 1=Xml-Document-Type-Definition<br>
ocxmltag ... 0 = kein oc11xml-Tag zu Beginn / (Default) 1=oc11xml-Tag
zu Beginn<br>
cdata ... 0=XML-Steuerzeichen in Texten maskieren (z.B. &amp; =&gt;
&amp;amp;) / (Default) 1=Texte in CDATA-Abschnitte einfassen<br>
charset ... (Default) iso-8859-1 / utf-8<br />
attrlist ... (Default) 0 = keine Attributliste &uuml;bertragen / 1 = Attributliste &uuml;bertragen</P>
<h4><a>Beispiele</a></h4>
<P>http://www.opencaching.de/xml/ocxml11.php?modifiedsince=20060320000000&amp;user=1&amp;cache=1&amp;cachelog=1&amp;cachedesc=1&amp;picture=1&amp;removedobject=1&amp;session=1&amp;charset=utf-8&amp;cdata=1&amp;xmldecl=0&amp;ocxmltag=0&amp;doctype=0<br>
http://www.opencaching.de/xml/ocxml11.php?sessionid=4711&amp;file=1&amp;charset=utf-8&amp;cdata=1&amp;xmldecl=0&amp;ocxmltag=0&amp;doctype=0</P>
<H3>Sonstige Bemerkungen</H3>
<UL>
<LI>
Fü ersten Aufruf des Interface muss als modifiedsince das Datum 1.8.2005
um 00:00:00 Uhr angegeben werden. Es gibt keine Datensäe die vor diesem Datum
angelegt wurden.
<LI>
Um Probleme wegen Differenzen der Uhrzeit zwischen Client und Server zu
umgehen, muss fü nästen Inkrementellen Abruf der Daten das Datum um Kopf
der XML-Datei minus 1 Sekunde angeben werden:<BR>
<SPAN class="m"><BR>&lt;?</SPAN><SPAN class="pi">xml version="1.0" encoding="iso-8859-1"
standalone="no" </SPAN><SPAN class="m">?&gt;</SPAN>
<BR>
<SPAN><SPAN class="d">&lt;!DOCTYPE oc11xml<I>...</I>&gt;</SPAN>&nbsp;<BR></SPAN>&nbsp;
<SPAN class="m">&lt;</SPAN><SPAN class="t">oc11xml</SPAN><SPAN class="t">
version</SPAN><SPAN class="m">="</SPAN>1.1<SPAN class="m">"</SPAN><SPAN class="t">
date</SPAN><SPAN class="m">="</SPAN><STRONG>2006-03-10 18:37:34</STRONG><SPAN class="m">"</SPAN><SPAN class="t"> since</SPAN><SPAN class="m">="</SPAN>2006-03-08
22:02:42<SPAN class="m">"</SPAN><SPAN class="m">&gt;</SPAN>
<LI>
Zeitverschiebungen / unterschiedliche Zeitzonen zwischen Client und Server
werden nicht unterstü <LI>
Das XML-Dokument enthä folgende DTD (Document Type Definition):
http://www.opencaching.de/xml/ocxml11.dtd
<LI>
Äderungen werden des XML-Interface werden im Entwicklerforum bekanntgegeben:
http://develforum.opencaching.de/viewforum.php?f=2
<LI>
Fragen zum Interface kön ebenfalls im Entwicklerforum&nbsp;gestellt werden: <A href="http://develforum.opencaching.de/viewforum.php?f=2">
http://develforum.opencaching.de/viewforum.php?f=2</A>
<LI>
Der Quellcode des Interface kann hier downgeloadet werden: <A href="http://devel.opencaching.de/viewcvs/viewcvs.cgi/html/xml/ocxml11.php?rev=1.2&amp;content-type=text/vnd.viewcvs-markup">
http://devel.opencaching.de/viewcvs/viewcvs.cgi/html/xml/ocxml11.php?rev=1.2&amp;content-type=text/vnd.viewcvs-markup</A>
<LI>
Eine Referenzimplementierung kann hier downgeloadet werden: <A href="http://devel.opencaching.de/viewcvs/viewcvs.cgi/html/util/ocxml11client/">
http://devel.opencaching.de/viewcvs/viewcvs.cgi/html/util/ocxml11client/</A></LI></UL>
<P>Lizenz:</P>
<UL>
<LI>
der Quellcode steht unter der GNU Gerneral Public Licenses
<LI>
Fuer die Nutzung des XML-Interface ist eine gesonderte Nutzungserlaubnis durch den Betreiber von opencaching.de notwendig. Darin wird geregelt, auf welche Art und Weise die bezogenen Daten genutzt werden duerfen.
</LI></UL>
<P>&nbsp;</P>
</SPAN>
</body>
</html>

982
htdocs/doc2/install.html Normal file
View File

@ -0,0 +1,982 @@
<html>
<head>
<title>Installationsanleitung Opencaching Quellcode</title>
<style type="text/css">
<!--
td
{
vertical-align:top;
}
.code
{
border:2px black solid;
padding:10px;
background-color:#EFEFEF;
font-family:monospace;
}
-->
</style>
</head>
<body>
<h1>
Installationsanleitung Opencaching Quellcode</h1>
<h2>
Inhalt</h2>
<h2>
Voraussetzungen<br />
</h2>
<ul>
<li>
Installiertes Linux System (mit root-Berechtigungen)</li>
<li>
Apache Webserver</li>
<li>MySQL Datenbank</li>
<li>PHP</li>
</ul>
<p>
Die Komponenten mülauffäg sein. Auf deren Konfiguration wird nur eingegangen,
wenn diese von der Standardkonfiguration abweicht.</p>
<h3>
Empfohlene Versionen</h3>
<ul>
<li>Apache 2.2.x </li>
<li>PHP 5.2.2</li>
<li>MySQL 5.0.27</li>
</ul>
Möcherweise funktioniert der Quellcode auch mit äeren Releases, dann sind jedoch
fü Produktiveinsatz stäere Tests erforderlich.<br />
<br />
<h3>
PHP Module</h3>
<p>
Folgende PHP Module werden von den Quellcodes verwendet:</p>
<ul>
<li>mysql</li>
<li>gd</li>
<li>zlib</li>
<li>freetype</li>
<li>jpeg</li>
<li>png</li>
<li>mbstring</li>
<li>gettext</li>
<li>iconv</li>
<li>mcrypt</li>
<li>tokenizer</li>
</ul>
<p>
PHP muss mit CLI (Command Line Interface) installiert werden.<br />
Zusälich wird noch eine pecl-Extension empfohlen, siehe "Konfiguration Cracklib".</p>
<h3>
Empfohlene Software</h3>
<ul>
<li>phpMyAdmin (jeweils aktuelle Version)</li>
<li>CVS Client</li>
</ul>
<h2>
Installation und Konfiguration Grundlagen</h2>
<h3>
Konfiguration Apache, PHP</h3>
<p class="code">
User wwwrun<br />
Group www<br />
<br />
&lt;Directory /wwwroot&gt;<br />
&nbsp; &nbsp;
AllowOverride AuthConfig<br />
&nbsp; &nbsp;
Options -FollowSymLinks -SymLinksIfOwnerMatch<br />
&nbsp; &nbsp; ...<br />
&lt;/Directory&gt;<br />
<br />
&lt;VirtualHost ...&gt;<br />
&nbsp; &nbsp; ...<br />
&nbsp; &nbsp; DocumentRoot /wwwroot<br />
&nbsp; &nbsp;
DirectoryIndex index.php index.htm index.html<br />
&nbsp; &nbsp;
RewriteEngine On # vgl. "Konfiguration Statistikbilder"<br />
&lt;/VirtualHost&gt;
</p>
Der Pfad /wwwroot kann beliebig gewät werden, ebenso User und Group.<h4>
Konfigration safe_mode</h4>
<p>
PHP kann im safe_mode ausgefüerden, ist fü Entwicklung jedoch oft hinderlich.</p>
<p>
open_basedir muss dann neben /wwwroot auch den upload_tmp_dir enthalten</p>
<p>
safe_mode_exec_dir muss definiert werden (vgl. "Installation phpzip")</p>
<h3>
Download der CVS Quellcodes</h3>
<p>
Alle Quellcodes werden mit CVS verwaltet. Füeberechtigungen ist kein Benutzeraccount
notwendig. Sollen spär geäerte Quellcodes in das CVS gespeichert werden, richten
wir gernen einen Benutzeraccount ein (bitte im Entwicklerforum melden).</p>
<p>
Auf der Linux-Kommandozeile:</p>
<p class="code">
cd /wwwroot<br />
export CVSROOT=:pserver:anoncvs@devel.opencaching.de:2401/opencaching<br />
cvs co html</p>
<p>
Der Download kann eine Weile dauern, die Repository ist mittlerweile etwas grö.
Die Opencaching Quellcodes befinden sich daraufhin im Unterverzeichnis html</p>
<p>
Um Äderungen zu inspizieren haben wir einen WebCVS eingerichtet:</p>
<p>
http://devel.opencaching.de/viewcvs/viewcvs.cgi/html/</p>
<h3>
Konfiguration MySQL</h3>
<p>
Die Quellcodes benöen die MyISAM- und InnoDB-Engines und etwa 350 MB (Stand:
Sept. 2007) um alle Opencaching-Daten zu laden.</p>
<p>
Charset füe Datenbanken, Tabellen und Felder ist immer
UTF8. Die Namen der
Datenbanken und Benutzer kann frei gewät werden.</p>
<h4>
Datenbankem anlegen</h4>
<p>
Es werden
2 Datenbanken benöt: Eine fü eigentlichen Daten und eine fü Erstellung
von temporän Tabellen.</p>
<p class="code">
CREATE DATABASE `opencaching` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;<br />
CREATE DATABASE `oc_tmpdb` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;<br />
</p>
<h4>
<span class="syntax"><span class="syntax_punct syntax_punct_queryend"><span class="syntax_punct syntax_punct_queryend">
</span>Benutzer anlegen</span></span></h4>
<p>
<span class="syntax"><span class="syntax_punct syntax_punct_queryend">Es werden 2
Benutzer benöt:</span></span></p>
<p>
1. Mit geringen Berechtigungen fümale Ausfü</p>
<p>
Im einzelnen:</p>
<p>
<table>
<tr>
<td>
<strong>Datenbank</strong></td>
<td>
<strong>Berechtigungen</strong></td>
</tr>
<tr>
<td>
opencaching</td>
<td>
SELECT, INSERT, UPDATE, DELETE<br />
<br />
Solange das alte Template System nochgenutzt wird:<br />
CREATE, ALTER, INDEX, DROP, CREATE TEMPORARY TABLES</td>
</tr>
<tr>
<td>
oc_tmpdb</td>
<td>
SELECT, INSERT, UPDATE, DELETE<br />
CREATE, ALTER, INDEX, DROP, CREATE TEMPORARY TABLES</td>
</tr>
</table>
</p>
<p>
2. Mit SUPER-Berechtigungen, um Trigger und Stored Procedures anlegen zu kön</p>
<p>
<table>
<tr>
<td>
<strong>Datenbank</strong></td>
<td>
<strong>Berechtigungen</strong></td>
</tr>
<tr>
<td>
&lt;ALLGEMEIN&gt;</td>
<td>
SUPER</td>
</tr>
<tr>
<td>
opencaching</td>
<td>
SELECT, INSERT, UPDATE, DELETE<br />
CREATE, ALTER, INDEX, DROP, CREATE TEMPORARY TABLES, CREATE VIEW, SHOW VIEW, CREATE
ROUTINE, ALTER ROUTINE, EXECUTE</td>
</tr>
<tr>
<td>
oc_tmpdb</td>
<td>
SELECT, INSERT, UPDATE, DELETE<br />
CREATE, ALTER, INDEX, DROP, CREATE TEMPORARY TABLES</td>
</tr>
</table>
<p>
SUPER-Berechtigungen entsprechen root-Berechtigungen fü Datenbank. Das Passwort
wird spär als Klartext in einer php-Datei gespeichert. Wem das zu unsicher ist,
kann auch den normalen root-Account nehmen und das Passwort in die php-Datei nur
bei Bedarf schreiben und danach wieder löen.</p>
<h3>
Anlegen der Tabellen</h3>
<p>
Alle Tabellen sind als SQL-Datei im Verzeichnis doc/sql/tables abgelegt. Datensäe
füe leere Datenbank in doc/sql/static-data.<br />
Trigger und Stored Procedures werden spär per PHP-Script angelegt.</p>
<p class="code">
cd doc/sql/tables<br />
find . -maxdepth 1 -type f -name \*.sql -exec cat {} \; | mysql -uroot -p opencaching<br />
<br />
cd ../static-data<br />
find . -maxdepth 1 -type f -name \*.sql -exec cat {} \; | mysql -uroot -p opencaching</p>
<p>
Alternativ köe auch jede Datei einzeln geöet werden und mit phpMyAdmin eingespielt
werden.</p>
<h3>
Verzeichnisrechte vergeben</h3>
<p>
Generell sollten so wenig Rechte wie möch vergeben werden. In diesem Beispiel
gehen wir davon aus, dass die Dateien nicht von Hand editiert werden sollen. Füdie Entwicklung muss der Entwickler natü Schreibrechte fü Dateien haben.</p>
<p class="code">
cd /wwwroot<br />
chown -R wwwrun:www .<br />
<br />
find . -type f -exec chmod 440 {} \;<br />
find . -type d -exec chmod 550 {} \;<br />
<br />
find cache -type f -exec chmod 660 {} \;<br />
find cache -type d -exec chmod 770 {} \;<br />
<br />
find cache2 -type f -exec chmod 660 {} \;<br />
find cache2 -type d -exec chmod 770 {} \;<br />
</p>
<p>
Ein späres CVS-Update muss mit dem wwwrun-Benutzer ausgefüerden, da sonst
der Dateibesitzer evtl. wieder wechselt!<br />
Ausserdem müdann die Dateien und Verzeichnisse beschreibbar sein (im ersten
Schritt 660 und 770 verwenden).</p>
<h3>
Konfiguration der Quellcodes</h3>
<p>
Die Konfiguration der Quellcodes ist derzeit noch 2x notwendig (Stand: September
2007):</p>
<p>
Das alte Template-System verwendet Verzeichnisse ohne 2 am Ende.<br />
Das neue Template-System verwendet Verzeichnisse mit 2 am Ende.</p>
<p>
Derzeit werden alle Skripte aus dem alten Template-System fü neue System umgeschrieben.<br />
Skripts die bereits umgestellt wurden, kön in den Quellcodes an require('./lib2/...');
erkannt werden und im Browser an den Flaggen oben links.</p>
<h4>
Altes Templatesystem</h4>
<p>
Datei lib/settings-dist.inc.php nach nach lib/settings.inc.php kopieren.<br />
Datei-Owner und Berechtigungen beachten!<br />
Die Kopie kann bearbeitet werden, ohne dass bei einem spären CVS-Commit falsche
Daten zurüpielt werden.</p>
<p>
Die Parameter sind soweit nö kommentiert. Besonderes Augenmerk sollte man folgenden
Paramtern widmen:</p>
<p class="code">
$oc_nodeid<br />
$absolute_server_URI<br />
$dbusername<br />
$dbname<br />
$dbserver<br />
$dbpasswd<br />
$tmpdbname</p>
<p>
Sowie die diversen E-Mail-Adressen.<br />
Sollte die Website aus dem Internet erreichbar sein, MUSS das Impressum abgeäert
werden (templates2/stdstyle/articles/DE/impressum.tpl).</p>
<h4>
Neues Templatesystem</h4>
<p>
Datei config2/settings-dist.inc.php nach nach config2/settings.inc.php kopieren.<br />
Datei-Owner und Berechtigungen beachten!<br />
Die Kopie kann bearbeitet werden, ohne dass bei einem spären CVS-Commit falsche
Daten zurüpielt werden.</p>
<p>
Es werden jedoch beide Dateien von den Quellcodes verwendet: Zuerst werden Vorgabewerte
mit settings-dist.inc.php gesetzt und diese dann (wo nö) mit settings.inc.php
ührieben. Falls also ein Vorgabewert in den Einstellungen beibehalten werden
soll, kann die entsprechende Zeile aus settings.inc.php gelöt werden. Ädert
sich spär der Vorgabewert im CVS ist keine manuelle Anpassung notwendig.</p>
<p>
Die Parameter sind soweit nö kommentiert. Besonderes Augenmerk sollte man folgenden
Paramtern widmen:</p>
<p class="code">
$opt['db']['servername']<br />
$opt['db']['username']<br />
$opt['db']['password']<br />
$opt['db']['placeholder']['db']<br />
$opt['db']['placeholder']['tmpdb']<br />
$opt['debug']<br />
$opt['page']['absolute_url']<br />
$opt['logic']['node']['id']<br />
$opt['logic']['pictures']['url']</p>
<p>
Sowie die diversen E-Mail-Adressen.<br />
WICHTIG: die Paramtert im lib/settings.inc.php und config2/settings.inc.php mü ünstimmen. Insbesondere die Cookie-Einstellungen und die node-id.</p>
<p>
Sollte die Website aus dem Internet erreichbar sein, MUSS das Impressum abgeäert
werden (templates2/stdstyle/articles/DE/impressum.tpl).</p>
<h3>
Anlegen der Trigger und Stored Procedures</h3>
<p>
Zunäst müdie Zugangsdaten fü Benutzer mit SUPER-Privilegien hinterlegt
werden. Dazu muss im Datei util/mysql_root/settings-dist.inc.php nach &nbsp;util/mysql_root/settings.inc.php
kopiert werden. Die Kopie muss angepasst werden.</p>
<p>
Anschließn muss doc/sql/stored-proc/maintain.php als CLI-Skript (oder aus dem Browser)
aufgerufen werden.</p>
<p>
Um zu prüb das Skript erfolgreich ausgefüurde, kann der SQL-Befehl SHOW
TRIGGERS und SHOW PROCEDURE STATUS verwendet werden. Beide Befehle mümehere
Zeilen zurüen.</p>
<h3>
Testen der Installation</h3>
<p>
Die Startseite (neues Templatesystem) und die Suchseite (altes Tempalte System,
Stand 6. September 2007) sollten nun im Browser aufrufbar sein.<br />
Viele Kleinigkeiten funktionieren noch nicht, da dazu weitere Vorbereitungen notwendig
sind u.A. die PLZ-Suche, Ortssuche, der Benutzerlogin (noch keine Benutzer) ...</p>
<h4>
Fehlersuche</h4>
<p>
Wichtig: vor jeder Fehlersuche $opt['debug'] = DEBUG_DEVELOPER | DEBUG_TEMPLATES;
setzen. Ansonsten werden die falschen Ausgaben gecacht und auch ausgegeben wenn
der Fehler evtl. schon behoben ist.</p>
<h5>
Die Seiten werden nur auf Englisch angezeigt</h5>
<p>
Dann liegt ein Fehler bei gettext vor. Zunäst einmal das Caching abschalten. Dann
mit locale -a prüb z.B. de_DE vorhanden ist. Fehlt das, muss es nachinstalliert
werden. Unter Debian z.B. apt-get install locales-all. Danach Apache neu starten!</p>
<h5>
Das Menü nur auf Englisch angezeigt</h5>
<p>
Wenn die Inhalte bereits richtig ützt werden, das Menü noch auf Englisch
angezeigt wird, muss die Datei cache2/menu-DE.inc.php gelöt werden. Mit dem nästen
Aufruf wird diese neu erstellt und dabei mit gettext das Menüsetzt.</p>
<h3>
Laden der Opencaching-Daten</h3>
<p>
Damit die Opencaching.de-Daten in die Datenbank gelangen, muss der XML-Client konfiguriert
werden. Die dann geladenen Daten kön als Testdaten verwendet werden. Die Installation
kann auch in ein anderes Verzeichnis gemacht werden, damit die geäerten Dateien
nicht vom CVS-Client moniert werden.</p>
<p>
Voraussetzung ist die "Installation von phpzip"</p>
<p>
1. In das Verzeichnis util/ocxml11client wechseln und settings-dist.php nach settings.php
kopieren und bearbeiten.</p>
<p>
2. Folgende Parameter besonders beachten:</p>
<p class="code">
$opt['unzip']<br />
$opt['pictures']['download']<br />
$opt['pictures']['url']</p>
<p>
3. Die Verzeichnisse tmp und data-files rekursiv mit Schreibrechten versehen.</p>
<p>
4. Nun noch den Pfad zu dem php-Binary im Header von index.php abäern und der
Datei Ausfürechte geben.</p>
<p>
Die Synchronisation kann nun mit ./index.php gestartet werden. Der Start kann ein
paar Sekunden dauern, da erst auf dem opencching.de-Server die entsprechenden Daten
aufbereitet werden. Der Download und das Einspielen in die Datenbank dauert bis
zu meherern Stunden.</p>
<p>
Wird die Synchronisation nach dem Download abgebrochen, kann durch auskommentieren
der entsprechenden Funktionsaufrufe in index.php mit den bereits heruntergeladenen
Daten weitergearbeitet werden.</p>
<h3>
Eigene Zugangsdaten hinterlegen</h3>
<p>
Damit man selbst auf der Webseite einloggen kann, muss nach dem Laden der Daten
von Opencaching.de nur util/ocxml10client/newuser.php aufgerufen und bestägt werden.</p>
<h4>
Ich bin root und ich darf alles</h4>
<p>
Füche Funkionen sind admin-Rechte auf der Webseite notwendig. Die kön gesetzt
werden, indem in der user-Tabelle der admin-Wert fü entsprechenden Benutzer
auf 255 gesetzt wird. Einzelne Admin-Rechte kön aus lib2/logic/const.inc.php
entnommen werden (Stand: September 2007: noch in Entwicklung).</p>
<h2>
Konfiguration von einzelnen Komponenten</h2>
<h3>
Konfiguration Statistikbilder</h3>
<p>
Fü Statistikbilder wird benöt:</p>
<ul>
<li>rewrite-Modul des Apache</li>
<li>GD-Modul fü</li>
</ul>
<p>
Konfiguration:</p>
<p>
1. Schreibrechte füages/statpics</p>
<p>
2. Funnktion des PHP-Skript prüocstats.php?userid=1 aufrufen. Statt der userid
kann eine beliebige andere verwendet werden. Nun muss ein Bild in /images/statpics
erstellt werden und auf dieses Weitergeleitet.</p>
<p>
3. Rewrite-Rule konfigurieren, damit das Bild als statische Datei referenziert werden
kann (füen). In der Apache-Konfiguration:</p>
<p class="code">
&lt;VirtualHost ...&gt;<br />
&nbsp;&nbsp; ...<br />
&nbsp;&nbsp; RewriteEngine On<br />
&nbsp;&nbsp; ...<br />
&nbsp; &lt;Directory /var/www/html/statpics&gt;<br />
&nbsp; &nbsp; &nbsp; AllowOverride FileInfo<br />
&nbsp; &nbsp; &nbsp;
Options FollowSymLinks SymLinksIfOwnerMatch<br />
&nbsp; &lt;/Directory&gt;<br />
&lt;/VirtualHost&gt;</p>
<p>Und die Datei /statpics/htaccess-dist nach .htaccess kopieren, sowie /ocstats.php
den absoluten (http-)Pfad voranstellen.</p>
<p class="code">
RewriteRule ^([0-9]+)\.jpg$ /html/ocstats.php?userid=$1 [R,L]</p>
Nun sollte beim Aufruf von /statpics/1.jpg auf ocstats.php weitergeleitet werden,
das Bild erstellt und gleich weiter zu /images/statpics geleitet werden. Der Umweg
ist notwenig, damit das Statistikbild ertellt und aktualisiert werden kann.<h3>
Installation Cracklib</h3>
<p>
Das neue Templatesystem kann prüob Passwör bestimmten Sicherheitsanforderungen
genüazu ist eine pecl-Extension fücklib erforderlich. Je nach System fät
die Installation allerdings unterschiedlich aus. Sollte die pecl-Extension nicht
verfüsein, wird diese Prünicht durchgefüFüian kann folgendes
verwendet werden:</p>
<p class="code">
apt-get install cracklib2<br />
apt-get install php-pear<br />
apt-get install php5-dev<br />
</p>
<p>
Falls nicht als RPM verfü kön auch von http://sourceforge.net/projects/cracklib
die Sourcen verwendet werden.<br />
Auf jeden Fall sollte das kleine Wörbuch verwendet werden, da sonst die Passwör
benutzerunfreundlich ausfallen mü</p>
<p class="code">
cd /usr/src<br />
mkdir crack-0.4<br />
wget http://pecl.php.net/get/crack-0.4.tgz<br />
tar zxf crack-0.4.tgz<br />
cd crack-0.4<br />
phpize<br />
./configure<br />
make<br />
copy crack.so to your php-extension directory</p>
<p>
Wurde die Extension korrekt installiert, schlä eine Registrierung mit dem Passwort
123456 fehl.</p>
<p>
In den Cracklib-Sourcen befindet sich auch eine Wörbuchdatei (cracklib-small).
Diese kann mit mkdict präriert werden und in der php.ini als Default-Wörbuch
hinterlegt werden:</p>
<p class="code">
[Crack]<br />
crack.default_dictionary = "/usr/local/share/cracklib/pw_dict"
</p>
<p>
Weiter Informationen zur cracklib-Konfiguration kön hier gefunden werden:<br />
http://www.php.net/manual/de/function.crack-check.php<br />
http://www.phpbar.de/w/PECL<br />
http://pecl.php.net/package/crack
</p>
<h3>
Installation phpzip</h3>
<p>
Um ZIP, BZ2 und GZIP-Dateien zu erstellen werden die entsprechenden Unix-Programme
verwendet. Da diese jedoch nicht den Einschräungen des safe_mode unterliegen,
köe damit leicht /etc/passwd oder schlimmeres gezipt und heruntergeladen werden,
falls in den (Opencaching-)Quellcodes ein Sicherheitsloch ist. Deshalb werden die
Programme üinen Wrapper aufgerufen, der die übenen Pfadangaben prü phpzip wird fü XML-Client, das XML-Interface und fü Download von Suchergebnissen
benöt.</p>
<p>
1. Ein Verzeichnis suchen das nicht üas HTTP erreichbar ist z.B. /srv/www/bin</p>
<p>
2. Die Dateien util/safemode_zip/phpzip.php und util/safemode_zip/phpunzip.php dort
hinein kopieren</p>
<p>
3. Owner und Group auf root setzen</p>
<p>
4. Dateiberechtigungen auf der Dateien auf 755 setzen, der Webserver darf keinesfalls
Schreibberechtigungen besitzen!</p>
<p>
5. Im Kopf der beiden Dateien den Pfad fü php-Binary setzen (PHP muss mit --enable-cli
kompiliert sein). Den Pfad bekommt man mit "which php".<br />
Z.B. #!/usr/bin/php -q</p>
<p>
6. Sicherstellen, dass gzip, bzip2 und zip auf dem System installiert sind</p>
<p>
7. phpzip.php und phpunzip.php öen und $basedir auf das root-Verzeichnis der
Opencaching-Quellcodes setzen. Z.B. /var/www/html</p>
<p>
8. Wird nun phpzip.php aufgerufen mit ./phpzip.php muss die Ausgabe "wrong parameter"
erscheinen.</p>
<p>
9. Den Pfad in safe_mode_exec_dir in der apache/php-Konfiguration aufnehmen</p>
<p>
10. Die Parameter $safemode_zip, $zip_basedir und $zip_wwwdir in lib/settings.inc.php
setzen</p>
<h3>
Laden der gns-Datenbank</h3>
<p>
Die GNS-Datenbank enthä Koordinaten füe rund um die Welt und wird fü
Suchfunktion verwendet. Auf Opencaching.de sind die Dateien fütschland (GM),
Öterreich (AU) und die Schweiz (SZ) geladen.</p>
<p>
1. Download der Dateien von http://earth-info.nga.mil/gns/html/namefiles.htm nach
util/gns</p>
<p>
2. Entpacken der ZIP-Dateien (gleiches Verzeichnis)</p>
<p>
3. Sollen andere Dateien als sz.txt, gm.txt und au.txt importiert werden, muss gns_import.php
entsprechend angepasst werden.</p>
<p>
4. Importieren der Dateien mit "php gns_import.php"</p>
<p>
Die CSV-Dateien werden daraufhin in die Tabelle gns_locations importiert.</p>
<h4>
Suchindex aufbauen</h4>
<p>
Damit die Suche nach Ortsnamen zum einen schnell, zum anderen gegen Vertipper resistent
ist, wird ein Suchindex aufgebaut (gns_search).<br />
Nach dem Laden oder Aktualisieren der GNS-Daten muss dazu "php mksearchindex.php"
ausgefüerden.</p>
<p>
Bleibt der Import-Prozess mit einem Integer + Ortsname stehen, muss der Matching-Algorithmus
an die neuen Daten
angepasst werden, bitte im Forum melden.</p>
<h4>
Administrations-Texte aufbauen</h4>
<p>
Um bei der Ortssuche den Landkreis, Regierungsbezirk und das Land anzeigen zu kön
muss der Befehel "php mkadmtxt.php" ausgefüerden. Hierzu muss allerdings er
die geodb geladen werden (siehe näster Abschnitt).</p>
<h3>
Laden der geodb-Datenbank</h3>
<p>
1.
Download der Daten von http://sourceforge.net/projects/opengeodb<br />
Package Data<br />
opengeodb-0.2.4d-UTF8-mysql.zip (ggf. eine neuere Version, falls Datenstruktur gleich)</p>
<p>
2. Entpacken</p>
<p>
3. Importieren</p>
<p class="code">
cat opengeodb-0.2.4d-UTF8-mysql.sql | mysql -uroot -p opencaching</p>
<h4>
Suchindex aufbauen</h4>
<p>
Damit die Suche nach Ortsnamen zum einen schnell, zum anderen gegen Vertipper resistent
ist, wird ein Suchindex aufgebaut (geodb_search).<br />
Nach dem Laden oder Aktualisieren der geodb-Daten muss dazu "php index.php" im Verzeichnis
util/geodb_searchindex ausgefüerden.</p>
<p>
Bleibt der Import-Prozess mit einem Integer + Ortsname stehen, muss der Matching-Algorithmus
an die neuen Daten angepasst werden, bitte im Forum melden.</p>
<h3>
Volltext-Suchindex aufbauen</h3>
<p>
Fü Volltextsuche von Cachebeschreibungen und Logeinträn ist die Tabelle search_index
zustäig. Diese wird mit "php util/search_index/fill_search_index.php" inkrementell
gefüDie erste Fü dauert allerdings einige Zeit.</p>
<h3>
cronjob fühe_location einrichten</h3>
<p>
In cache_location wird Land &gt; Regierungsbezirk &gt; Landkreis fü Anzeige
gespeichert. Gefüird die Tabelle mit "php util/cron/runcron.php". Üer dieses
Skript kön auch weitere Skripte angesteuert werden, die regelmäg ausgefü werden (Unterverzeichnis modules).</p>
<h3>
Konfiguration XML-Interface</h3>
<p>
Das aktuelle XML-Interface ist /xml/ocxml11.php (Stand: September 2007).<br />
phpzip muss vorher installiert werden.<br />
<br />
TODO: phpzip-Konfiguration stimmt hier nicht ... falscher basedir!<br />
<br />
Schreibrechte fünload/zip/ocxml11 fü Webserver-Prozess erteilen.</p>
<h2>
Üersetzen von neuen Templates</h2>
<p>
Templates werden immer in Englisch geschrieben. Die Üersetzung erfolgt durch translate.php
(Adminrechte fü Benutzer erforderlich).<br />
<br />
TODO</p>
<h2>
Update der Quellcodes</h2>
<p>
Werden Quellcodes per CVS aktualisiert, sollte immer die CVS-Clientausgabe inspiziert
werden. Gibt es Äderungen im Verzeichnis /doc/sql oder /util/ocxml11client mü diese entsprechend nachgepflegt werden.</p>
<h2>
Anhang</h2>
<h3>
PHP-CLI</h3>
<p>
CLI (Command Line Interface) ist eine Erweiterung von PHP, damit PHP-Skripte wie
Bash-Skripte von der Kommandozeile aus aufgerufen werden kön. Entweder muss im
Header der Skripte dazu das php-Binary angegeben werden z.B. #!/usr/bin/php -q oder
man ruft die PHP mit dem Skript als Argument auf "php skript.php".</p>
<p>
Vorteil: CLI-Skripte haben kein Timeout. Apache und PHP haben verschiedene (einstellbare)
Timeouts, die Skripte mit läeren Laufzeiten (&gt;30 Sek.) behindern.</p>
<p>
Nachteil: werden CLI-Skripte als cronjob aufgerufen, mürelative Pfade durch
absolute Pfade ersetzt werden.</p>
<h3>
Konfiguration füwicklung</h3>
<ul>
<li>
(php.ini) display_errors = true</li>
<li>
(php.ini) error_reporting = E_ALL</li>
<li>
(php.ini) mysql.trace_mode = true</li>
</ul>
<p>
Alle angezeigten Meldungen von dem Commit beseitigen!</p>
<h3>
Bearbeiten der Quellcodes</h3>
<p>
Um die Quellcodes zu bearbeiten ist ein UTF-8 fäger Texteditor zu benutzen. Dies
kann man erkennen, indem in den PHP-Dateien in den ersten Zeilen hinter dem Unicode
Reminder japanische Textzeichen zu sehen sind. Sind diese nicht zu erkennen, sollte
der Texteditor nicht zur Bearbeitung verwendet werden.</p>
<p>
Um die Quellcodes korrekt zu speichern, kann in vielen Editoren unter "Speichern
unter ..." der Zeichensatz ausgewät werden.<br />
Hier ist wichtig, dass Unicode (UTF-8 ohne Signatur) - Codepage 65001 o.äverwendet
wird.</p>
<p>
Signatur bedeutet, dass der Editor 3 Bytes zu Beginn der Textdatei schreibt, die
die Datei als Unicode-Datei identifizieren. Mit PHP füdiese Bytes jedoch zu
falschen Browserausgaben.</p>
<p>
Wer kein Texteditor hat, kann unter Windows Visual Studio 2005 Express Edition verwenden
(kostenlos bei Microsoft). Dort Datei &gt; Speichern unter ... &gt; Speichern (auf
den Pfeil nach unten) &gt; Mit Codierung speichern &gt; Codierung: Unicode (UTF-8
ohne Signatur) - Codepage 65001, Zeilenende: Unix (LF)</p>
<h3>
Neues Skript anlegen</h3>
<p>
Zuerst muss in der Tabelle sys_menu ein neuer Menüag definiert werden und der
(Menühe gelöt werden.</p>
<p>
Folgender Header kann dann verwendet werden füe PHP-Dateien verwendet werden:</p>
<p class="code">&lt;?php<br />
/***************************************************************************<br />
&nbsp;* You can find the license in the docs directory &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;
*<br />
&nbsp;* Unicode Reminder .. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;
*<br />
&nbsp;* Display some status information about the server and Opencaching &nbsp;
&nbsp; &nbsp; &nbsp;*<br />
&nbsp;***************************************************************************/
<br />
$opt['rootpath'] = './';<br />
require($opt['rootpath'] . '/lib2/web.inc.php');<br />
$tpl->name = 'neuestemplate';<br />
$tpl->menuitem = MNU_NEU;<br />
...<br />
[eigene Quellcodes]<br />
...<br />
$tpl-&gt;display();</p>
<p>
Befindet sich das Skript in Basisverzeichnis der Quellcodes, muss $opt['rootpath']
nicht definiert werden.<br />
$tpl-&gt;name gibt den Namen des Template im Verzeichnis /template2/design an. Diese
Templates enden mit .tpl (muss bei $tpl-&gt;name weggelassen werden).</p>
<h4>
Methoden von $tpl</h4>
<p>
$tpl ist eine Klasse vom Typ OcSmarty, die von Smarty vererbt ist.</p>
<p>
Üer die Funktionen von Smarty hinaus gibt es folgende (wichtigen) Funktionen:</p>
<p>
<table>
<tr>
<td style="width: 198px; height: 21px">
<strong>Name</strong></td>
<td style="width: 768px; height: 21px">
<strong>Funktion</strong></td>
</tr>
<tr>
<td style="width: 198px; height: 21px">
error($id)</td>
<td style="width: 768px; height: 21px">
Zeigt ein Template mit der Fehlermeldung an. $id ist eine Konstant die in lib2/error.inc.php
definiert ist. In /template2/design/error.tpl muss der Text fü Fehlermeldung
definiert sein.</td>
</tr>
<tr>
<td style="width: 198px">
redirect($page)</td>
<td style="width: 768px">
Leitet den Browser an das angegebene Skript weiter und beendet die Skriptausfü.<br />
Kann ein absoluter oder relativer Pfad (zum Quellcode-Basisverzeichnis) sein.<br />
Paramter müurlencode() codiert sein.<br />
Beispiel: $tpl-&gt;redirect('viewcache.php?wp=' . urlencode($wp));</td>
</tr>
<tr>
<td style="width: 198px; height: 21px">
assign_rs($name, $rs)</td>
<td style="width: 768px; height: 21px">
Erstellt ein 2-Dimensionales Array in das alle Datensäe des Recordset $rs gespeichert
werden und weist der Smarty-Variable $name dieses Array zu.</td>
</tr>
</table>
</p>
<h4>
Attribute von $sql</h4>
<p>
<table>
<tr>
<td style="width: 197px">
<strong>Name</strong></td>
<td style="width: 769px">
<strong>Funktion</strong></td>
</tr>
<tr>
<td style="width: 197px">
$name</td>
<td style="width: 769px">
Name der .tpl-Datei im Verzeichnis /template2/design/</td>
</tr>
<tr>
<td style="width: 197px">
$main_template</td>
<td style="width: 769px">
Normalerweise immer sys_main.tpl</td>
</tr>
<tr>
<td style="width: 197px">
$title</td>
<td style="width: 769px">
Seitentitel (wird auch durch menuitem gesetzt)</td>
</tr>
<tr>
<td style="width: 197px; height: 4px">
$menuitem</td>
<td style="width: 769px; height: 4px">
siehe oben "Neues Skript anlegen"</td>
</tr>
<tr>
<td style="width: 197px">
$popup</td>
<td style="width: 769px">
Ist popup=false, wird die Menütur usw. nicht angezeigt.<br />
Beispiel siehe "weitere Koodinatensysteme" auf viewcache.php</td>
</tr>
<tr>
<td style="width: 197px">
$target</td>
<td style="width: 769px">
Ziel fü Login. Wird üerweise automatisch gesetzt.</td>
</tr>
</table>
</p>
<h3>
SQL-Abfragen</h3>
<p>
Alle SQL-Abfragen müdurch die Framework-Funktionen abgesetzt werden. Die Datenbankverbindung
wird automatisch mit dem ersten SQL-Befehl aufgebaut.</p>
<p>
Wichtige Funktionen (vollstäige Liste siehe lib2/db.inc.php):</p>
<p>
<table>
<tr>
<td style="width: 246px">
<strong>Name</strong></td>
<td style="width: 720px">
<strong>Funktion</strong></td>
</tr>
<tr>
<td style="width: 246px">
sql($sql, [parameters])</td>
<td style="width: 720px">
Wrapper füql_query()<br />
Parameter werden mit sql_escape() bearbeitet, dadurch sind bei konsquenter Verwendung
keine SQL-Injections möch. Parameter kön entweder als Array angegeben werden,
oder als normale Parameter beim Funktionsaufruf.<br />
<br />
Gibt ein Recordset zurür />
<br />
Aufrufbeispiel:<br />
sql("SELECT id FROM table WHERE a='&amp;1' AND b='&amp;2'", 12345, 'abc');</td>
</tr>
<tr>
<td style="width: 246px">
sql_value($sql, default, [parameters])</td>
<td style="width: 720px">
Gleich wie sql(), es wird jedoch nur die erste Zelle der ersten Zeile zurüeben.<br />
Default gibt den Wert an, der verwendet wird wenn die erste Zelle NULL ist oder
das Ergebnis der Abfrage keine Zeile zurüt.</td>
</tr>
<tr>
<td style="width: 246px">
sql_escape($value)</td>
<td style="width: 720px">
Ruft mysql_real_escape auf.</td>
</tr>
<tr>
<td style="width: 246px">
sql_escape_backtick($value)</td>
<td style="width: 720px">
Escape fükticks. Kann verwendet werden um Feldname dynamisch zu setzen.<br />
<br />
Beispiel:<br />
sql("SELECT id FROM table WHERE `" . sql_escape_backtick('a') . "`='&amp;1' AND
b='&amp;2'", 12345, 'abc');</td>
</tr>
<tr>
<td style="width: 246px">
sql_fetch_assoc($rs)</td>
<td style="width: 720px">
Wrapper füql_fetch_assoc($rs)</td>
</tr>
<tr>
<td style="width: 246px">
sql_temp_table($table)</td>
<td style="width: 720px">
Reserviert einen Namen füe Temporä Tabelle. Wird mysql_pconnect() verwendet
um die Datenbankverbindung aufzubauen (siehe config2/settings.inc.php), werden diese
Tabellen korrekt gelöt. Ansonsten besteht die Möchkeit, dass temporä Tabellen
üehere Skriptaufrufe existent bleiben.<br />
<br />
Beispiel siehe /tops.php</td>
</tr>
<tr>
<td style="width: 246px">
sql_drop_temp_table($table)</td>
<td style="width: 720px">
Löt die temporä Tabelle</td>
</tr>
<tr>
<td style="width: 246px">
sql_free_result($rs)</td>
<td style="width: 720px">
Wrapper füql_free_result()</td>
</tr>
<tr>
<td style="width: 246px">
sql_affected_rows()</td>
<td style="width: 720px">
Wrapper füql_affected_rows()</td>
</tr>
<tr>
<td style="width: 246px">
sql_insert_id()</td>
<td style="width: 720px">
Wrapper füql_insert_id()</td>
</tr>
<tr>
<td style="width: 246px">
sql_num_rows($rs)</td>
<td style="width: 720px">
Wrapper füql_num_rows()</td>
</tr>
<tr>
<td style="width: 246px">
sqlf()</td>
<td style="width: 720px">
wie sql(), die SQL-Befehle werden jedoch im SQL-Debugger unter Framework angezeigt.</td>
</tr>
<tr>
<td style="width: 246px">
sqlf_value()</td>
<td style="width: 720px">
wie sql_value(), die SQL-Befehle werden jedoch im SQL-Debugger unter Framework angezeigt.</td>
</tr>
<tr>
<td style="width: 246px; height: 21px">
sqll()</td>
<td style="width: 720px; height: 21px">
wie sql(), die SQL-Befehle werden jedoch im SQL-Debugger unter Business Layer angezeigt.</td>
</tr>
<tr>
<td style="width: 246px">
sqll_value()</td>
<td style="width: 720px">
wie sql_value(), die SQL-Befehle werden jedoch im SQL-Debugger unter Business Layer
angezeigt.</td>
</tr>
</table>
</p>
<h4>
SQL-Debugging</h4>
<p>
Um die Abarbeitung von SQL-Befehlen zu kontrollieren, muss in $opt['debug'] DEBUG_SQLDEBUGGER
gesetzt sein. Wird daraufhin eine URL mit dem Parameter &amp;sqldebug=1 aufgerufen,
werden alle beteiligten SQL-Befehle angezeigt. Die Ausgabe entspricht EXPLAIN EXTENDED
SELECT ... andere SQL-Befehle z.B. UPDATE und DELETE werden ebenfalls analysiert.</p>
<h3>
Sonstige globale Objekte</h3>
<p>
<table>
<tr>
<td style="width: 166px">
<strong>Name</strong></td>
<td style="width: 808px">
<strong>Funktion</strong></td>
</tr>
<tr>
<td style="width: 166px; height: 21px">
$cookie</td>
<td style="width: 808px; height: 21px">
Speichert einen Wert im Cookie. Generell sollten die Cookies so klein wie möch
gehalten werden.<br />
<br />
Lesen mit get($name, $default='')<br />
Setzen mit set($name, $value, $default=null)<br />
Löen mit un_set($name)<br />
Prüit is_set($name)</td>
</tr>
<tr>
<td style="width: 166px">
$login</td>
<td style="width: 808px">
Aktueller Benutzer<br />
<br />
$userid gibt die Userid zurüalls nicht eingeloggt ist $userid=0<br />
$username ist der Benutzername<br />
$admin gibt an, welche Admin-Rechte der Benutzer hat.</td>
</tr>
<tr>
<td style="width: 166px">
$translate</td>
<td style="width: 808px">
Funktion t($value) ützt Strings<br />
Wann immer möch direkt in den Templates ützen!<br />
Nicht im Quellcode!</td>
</tr>
</table>
</p>
<h3>
Programmierkonventionen</h3>
<ul>
<li>immer mb-String Funktionen einsetzen</li>
</ul>
<h3>
Einsatz auf Produktivsystemen</h3>
<p>
Sollten die Quellcodes auf Produktivsystem eingesetzt werden, sollten einige Sicherheitsmaßahmen
beachtet werden. Unter anderen:</p>
<ul>
<li>safe_mode von PHP aktivieren</li>
<li>Lesezugriff füzeichnisse sperren. Unter anderem: doc (insb. doc/sql), doc2,
util (mit Ausnahmen z.B. util/google_earth), util2, cache, cache2 (ohne cache2/captcha),
config2, lang, lib (ohne lib/tinymce), lib2, templates2 (wenn das neue Templatesystem
fertig ist, wird das Verfahren vereinfacht).</li>
<li>$opt['debug'] auf DEBUG_NO setzen</li>
</ul>
</body>
</html>

View File

View File

View File

877
htdocs/editcache.php Normal file
View File

@ -0,0 +1,877 @@
<?php
/***************************************************************************
./editcache.php
-------------------
begin : July 5 2004
copyright : (C) 2004 The OpenCaching Group
forum contact at : http://www.opencaching.com/phpBB2
***************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
/****************************************************************************
Unicode Reminder メモ
edit a cache listing
used template(s): editcache
GET/POST Parameter: cacheid
****************************************************************************/
//prepare the templates and include all neccessary
require_once('./lib/common.inc.php');
require_once('./lib2/logic/const.inc.php');
function getWaypoints($cacheid)
{
global $waypointline;
global $waypointlines;
global $nowaypoints;
$wphandler = new ChildWp_Handler();
$waypoints = $wphandler->getChildWps($cacheid);
$ret = '';
if (!empty($waypoints))
{
$formatter = new Coordinate_Formatter();
foreach ($waypoints as $waypoint)
{
$tmpline = $waypointline;
$tmpline = mb_ereg_replace('{wp_image}', htmlspecialchars($waypoint['image'], ENT_COMPAT, 'UTF-8'), $tmpline);
$tmpline = mb_ereg_replace('{wp_type}', htmlspecialchars($waypoint['name'], ENT_COMPAT, 'UTF-8'), $tmpline);
$htmlcoordinate = $formatter->formatHtml($waypoint['coordinate'], '</td></tr><tr><td>');
$tmpline = mb_ereg_replace('{wp_coordinate}', $htmlcoordinate, $tmpline);
$tmpline = mb_ereg_replace('{wp_description}', htmlspecialchars($waypoint['description'], ENT_COMPAT, 'UTF-8'), $tmpline);
$tmpline = mb_ereg_replace('{cacheid}', htmlspecialchars($cacheid, ENT_COMPAT, 'UTF-8'), $tmpline);
$tmpline = mb_ereg_replace('{childid}', htmlspecialchars($waypoint['childid'], ENT_COMPAT, 'UTF-8'), $tmpline);
$ret .= $tmpline;
}
$ret = mb_ereg_replace('{lines}', $ret, $waypointlines);
return $ret;
}
return $nowaypoints;
}
//Preprocessing
if ($error == false)
{
//cacheid
$cache_id = 0;
if (isset($_REQUEST['cacheid']))
{
$cache_id = $_REQUEST['cacheid'];
}
if ($usr === false)
{
$tplname = 'login';
tpl_set_var('username', '');
tpl_set_var('target', 'editcache.php?cacheid=' . urlencode($cache_id));
tpl_set_var('message_start', "");
tpl_set_var('message_end', "");
tpl_set_var('message', $login_required);
}
else
{
$cache_rs = sql("SELECT `caches`.`uuid`, `caches`.`user_id`, `caches`.`name`, `stat_caches`.`picture`, `caches`.`type`, `caches`.`size`, `caches`.`date_hidden`, `caches`.`date_activate`, `caches`.`longitude`, `caches`.`latitude`, `caches`.`country`, `caches`.`terrain`, `caches`.`difficulty`, `caches`.`desc_languages`, `caches`.`status`, `caches`.`search_time`, `caches`.`way_length`, `caches`.`logpw`, `caches`.`wp_gc`, `caches`.`wp_nc`, `caches`.`node`, `user`.`username` FROM `caches` INNER JOIN `user` ON `caches`.`user_id`=`user`.`user_id` LEFT JOIN `stat_caches` ON `caches`.`cache_id`=`stat_caches`.`cache_id` WHERE `caches`.`cache_id`='&1'", $cache_id);
$cache_record = sql_fetch_array($cache_rs);
sql_free_result($cache_rs);
if ($cache_record !== false)
{
if ($cache_record['user_id'] == $usr['userid'])
{
$tplname = 'editcache';
require($stylepath . '/editcache.inc.php');
if ($cache_record['node'] != $oc_nodeid)
{
tpl_errorMsg('editcache', $error_wrong_node);
exit;
}
//here we read all used information from the form if submitted, otherwise from DB
$cache_name = isset($_POST['name']) ? $_POST['name'] : $cache_record['name'];
$cache_type = isset($_POST['type']) ? $_POST['type'] : $cache_record['type'];
if (!isset($_POST['size']))
{
if ($cache_type == 4 || $cache_type == 5)
{
$sel_size = 7;
}
else
{
$sel_size = $cache_record['size'];
}
}
else
{
$sel_size = isset($_POST['size']) ? $_POST['size'] : $cache_record['size'];
}
$cache_hidden_day = isset($_POST['hidden_day']) ? $_POST['hidden_day'] : date('d', strtotime($cache_record['date_hidden']));
$cache_hidden_month = isset($_POST['hidden_month']) ? $_POST['hidden_month'] : date('m', strtotime($cache_record['date_hidden']));
$cache_hidden_year = isset($_POST['hidden_year']) ? $_POST['hidden_year'] : date('Y', strtotime($cache_record['date_hidden']));
if(is_null($cache_record['date_activate']))
{
$cache_activate_day = isset($_POST['activate_day']) ? $_POST['activate_day'] : date('d');
$cache_activate_month = isset($_POST['activate_month']) ? $_POST['activate_month'] : date('m');
$cache_activate_year = isset($_POST['activate_year']) ? $_POST['activate_year'] : date('Y');
$cache_activate_hour = isset($_POST['activate_hour']) ? $_POST['activate_hour'] : date('H');
}
else
{
$cache_activate_day = isset($_POST['activate_day']) ? $_POST['activate_day'] : date('d', strtotime($cache_record['date_activate']));
$cache_activate_month = isset($_POST['activate_month']) ? $_POST['activate_month'] : date('m', strtotime($cache_record['date_activate']));
$cache_activate_year = isset($_POST['activate_year']) ? $_POST['activate_year'] : date('Y', strtotime($cache_record['date_activate']));
$cache_activate_hour = isset($_POST['activate_hour']) ? $_POST['activate_hour'] : date('H', strtotime($cache_record['date_activate']));
}
$cache_difficulty = isset($_POST['difficulty']) ? $_POST['difficulty'] : $cache_record['difficulty'];
$cache_terrain = isset($_POST['terrain']) ? $_POST['terrain'] : $cache_record['terrain'];
$cache_country = isset($_POST['country']) ? $_POST['country'] : $cache_record['country'];
$show_all_countries = isset($_POST['show_all_countries']) ? $_POST['show_all_countries'] : 0;
$status = isset($_POST['status']) ? $_POST['status'] : $cache_record['status'];
$status_old = $cache_record['status'];
$search_time = isset($_POST['search_time']) ? $_POST['search_time'] : $cache_record['search_time'];
$way_length = isset($_POST['way_length']) ? $_POST['way_length'] : $cache_record['way_length'];
if($status_old == 5 && $status == 5)
{
if(isset($_POST['publish']))
{
$publish = $_POST['publish'];
if(!($publish == 'now' || $publish == 'later' || $publish == 'notnow'))
{
// somebody messed up the POST-data, so we do not publish the cache, since he isn't published right now (status=5)
$publish = 'notnow';
}
}
else
{
if(is_null($cache_record['date_activate']))
{
$publish = 'notnow';
}
else
{
$publish = 'later';
}
}
}
else
{
$publish = isset($_POST['publish']) ? $_POST['publish'] : 'now';
if(!($publish == 'now' || $publish == 'later' || $publish == 'notnow'))
{
// somebody messed up the POST-data, so the cache has to be published (status<5)
$publish = 'now';
}
}
$bAdmin = sqlValue("SELECT `admin` FROM `user` WHERE `user_id` = &1", 0, $usr['userid']);
if ($status == 7 && ($bAdmin & ADMIN_USER) != ADMIN_USER)
{
$status = $status_old;
}
if ($status_old == 7) // cache is locked
{
// only admins can change status of locked caches
if (($bAdmin & ADMIN_USER) != ADMIN_USER)
{
// no status change allowed for normal user
$status = $status_old;
}
}
$search_time = mb_ereg_replace(',', '.', $search_time);
$way_length = mb_ereg_replace(',', '.', $way_length);
if (mb_strpos($search_time, ':') == mb_strlen($search_time) - 3)
{
$st_hours = mb_substr($search_time, 0, mb_strpos($search_time, ':'));
$st_minutes = mb_substr($search_time, mb_strlen($st_hours) + 1);
if (is_numeric($st_hours) && is_numeric($st_minutes))
{
if (($st_minutes >= 0) && ($st_minutes < 60))
{
$search_time = $st_hours + $st_minutes / 60;
}
}
}
$log_pw = isset($_POST['log_pw']) ? mb_substr($_POST['log_pw'], 0, 20) : $cache_record['logpw'];
$wp_gc = isset($_POST['wp_gc']) ? $_POST['wp_gc'] : $cache_record['wp_gc'];
$wp_nc = isset($_POST['wp_nc']) ? $_POST['wp_nc'] : $cache_record['wp_nc'];
// name
$name_not_ok = false;
if(isset($_POST['name']))
{
if($_POST['name'] == "")
$name_not_ok = true;
}
if (isset($_POST['latNS']))
{
//get coords from post-form
$coords_latNS = $_POST['latNS'];
$coords_lonEW = $_POST['lonEW'];
$coords_lat_h = $_POST['lat_h'];
$coords_lon_h = $_POST['lon_h'];
$coords_lat_min = $_POST['lat_min'];
$coords_lon_min = $_POST['lon_min'];
}
else
{
//get coords from DB
$coords_lon = $cache_record['longitude'];
$coords_lat = $cache_record['latitude'];
if ($coords_lon < 0)
{
$coords_lonEW = 'W';
$coords_lon = -$coords_lon;
}
else
{
$coords_lonEW = 'E';
}
if ($coords_lat < 0)
{
$coords_latNS = 'S';
$coords_lat = -$coords_lat;
}
else
{
$coords_latNS = 'N';
}
$coords_lat_h = floor($coords_lat);
$coords_lon_h = floor($coords_lon);
$coords_lat_min = sprintf("%02.3f", round(($coords_lat - $coords_lat_h) * 60, 3));
$coords_lon_min = sprintf("%02.3f", round(($coords_lon - $coords_lon_h) * 60, 3));
}
//here we validate the data
//coords
$lon_not_ok = false;
if (!mb_ereg_match('^[0-9]{1,3}$', $coords_lon_h))
{
$lon_not_ok = true;
}
else
{
$lon_not_ok = (($coords_lon_h >= 0) && ($coords_lon_h < 180)) ? false : true;
}
if (is_numeric($coords_lon_min))
{
// important: use here |=
$lon_not_ok |= (($coords_lon_min >= 0) && ($coords_lon_min < 60)) ? false : true;
}
else
{
$lon_not_ok = true;
}
//same with lat
$lat_not_ok = false;
if (!mb_ereg_match('^[0-9]{1,3}$', $coords_lat_h))
{
$lat_not_ok = true;
}
else
{
$lat_not_ok = (($coords_lat_h >= 0) && ($coords_lat_h < 180)) ? false : true;
}
if (is_numeric($coords_lat_min))
{
// important: use here |=
$lat_not_ok |= (($coords_lat_min >= 0) && ($coords_lat_min < 60)) ? false : true;
}
else
{
$lat_not_ok = true;
}
//check effort
$time_not_ok = true;
tpl_set_var('effort_message', '');
if (is_numeric($search_time) || ($search_time == ''))
{
$time_not_ok = false;
}
if ($time_not_ok)
{
tpl_set_var('effort_message', $time_not_ok_message);
$error = true;
}
$way_length_not_ok =true;
if (is_numeric($way_length) || ($way_length == ''))
{
$way_length_not_ok = false;
}
if ($way_length_not_ok)
{
tpl_set_var('effort_message', $way_length_not_ok_message);
$error = true;
}
//check hidden_since
$hidden_date_not_ok = true;
if (is_numeric($cache_hidden_day) && is_numeric($cache_hidden_month) && is_numeric($cache_hidden_year))
{
$hidden_date_not_ok = (checkdate($cache_hidden_month, $cache_hidden_day, $cache_hidden_year) == false);
}
//check date_activate
if($status == 5)
{
$activate_date_not_ok = true;
if (is_numeric($cache_activate_day) && is_numeric($cache_activate_month) && is_numeric($cache_activate_year) && is_numeric($cache_activate_hour))
{
$activate_date_not_ok = ((checkdate($cache_activate_month, $cache_activate_day, $cache_activate_year) == false) || $cache_activate_hour < 0 || $cache_activate_hour > 23);
}
}
else
{
$activate_date_not_ok = false;
}
//check status and publish options
if(($status == 5 && $publish == 'now') || ($status != 5 && ($publish == 'later' || $publish == 'notnow')))
{
tpl_set_var('status_message', $status_message);
$status_not_ok = true;
}
else
{
tpl_set_var('status_message', '');
$status_not_ok = false;
}
//check cache size
$size_not_ok = false;
if ($sel_size != 7 && ($cache_type == 4 || $cache_type == 5))
{
$error = true;
$size_not_ok = true;
}
//difficulty / terrain
$diff_not_ok = false;
tpl_set_var('diff_message', '');
if ($cache_difficulty < 2 || $cache_difficulty > 10 || $cache_terrain < 2 || $cache_terrain > 10)
{
tpl_set_var('diff_message', $diff_not_ok_message);
$error = true;
$diff_not_ok = true;
}
// cache-attributes
if (isset($_POST['cache_attribs']))
{
$cache_attribs = mb_split(';', $_POST['cache_attribs']);
}
else
{
// get attribs for this cache from db
$rs = sql("SELECT `attrib_id` FROM `caches_attributes` WHERE `cache_id`='&1'", $cache_id);
if(mysql_num_rows($rs) > 0)
{
unset($cache_attribs);
while($record = sql_fetch_array($rs))
{
$cache_attribs[] = $record['attrib_id'];
}
unset($record);
}
else
{
$cache_attribs = array();
}
sql_free_result($rs);
}
//try to save to DB?
if (isset($_POST['submit']))
{
//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))
{
$cache_lat = $coords_lat_h + $coords_lat_min / 60;
if ($coords_latNS == 'S') $cache_lat = -$cache_lat;
$cache_lon = $coords_lon_h + $coords_lon_min / 60;
if ($coords_lonEW == 'W') $cache_lon = -$cache_lon;
if($publish == 'now')
{
$activation_date = 'NULL';
}
elseif($publish == 'later')
{
$status = 5;
$activation_date = "'".sql_escape(date('Y-m-d H:i:s', mktime($cache_activate_hour, 0, 0, $cache_activate_month, $cache_activate_day, $cache_activate_year)))."'";
}
elseif($publish == 'notnow')
{
$status = 5;
$activation_date = 'NULL';
}
else
{
// should never happen
$activation_date = 'NULL';
}
//save to DB
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 ...
db_slave_exclude();
// delete old cache-attributes
sql("DELETE FROM `caches_attributes` WHERE `cache_id`='&1'", $cache_id);
// insert new cache-attributes
for($i=0; $i<count($cache_attribs); $i++)
{
if(($cache_attribs[$i]+0) > 0)
{
sql("INSERT IGNORE INTO `caches_attributes` (`cache_id`, `attrib_id`) VALUES('&1', '&2')", $cache_id, $cache_attribs[$i]+0);
}
}
//call eventhandler
require_once($opt['rootpath'] . 'lib/eventhandler.inc.php');
event_edit_cache($cache_id, $usr['userid']+0);
// if old status is not yet published and new status is published => notify-event
if ($status_old == 5 && $status != 5)
{
touchCache($cache_id);
// send new cache event
event_notify_new_cache($cache_id);
}
//display cache-page
tpl_redirect('viewcache.php?cacheid=' . urlencode($cache_id));
exit;
}
}
elseif (isset($_POST['show_all_countries_submit']))
{
$show_all_countries = 1;
}
//here we only set up the template variables
//build countrylist
$countriesoptions = '';
//check if selected country is in list_default
if ($show_all_countries == 0)
{
$rs = sql("SELECT `show` FROM `countries_list_default` WHERE `show`='&1' AND `lang`='&2'", $cache_country, $locale);
if (mysql_num_rows($rs) == 0) $show_all_countries = 1;
sql_free_result($rs);
}
//get the record
if ($show_all_countries == 0)
$rs = sql("SELECT `countries`.`short`, IFNULL(`sys_trans_text`.`text`, `countries`.`name`) AS `name` FROM `countries` INNER JOIN `countries_list_default` ON `countries_list_default`.`show`=`countries`.`short` LEFT JOIN `sys_trans` ON `countries`.`trans_id`=`sys_trans`.`id` LEFT JOIN `sys_trans_text` ON `sys_trans`.`id`=`sys_trans_text`.`trans_id` AND `sys_trans_text`.`lang`='&1' WHERE `countries_list_default`.`lang`='&1' ORDER BY `name` ASC", $locale);
else
$rs = sql("SELECT `countries`.`short`, IFNULL(`sys_trans_text`.`text`, `countries`.`name`) AS `name` FROM `countries` LEFT JOIN `sys_trans` ON `countries`.`trans_id`=`sys_trans`.`id` LEFT JOIN `sys_trans_text` ON `sys_trans`.`id`=`sys_trans_text`.`trans_id` AND `sys_trans_text`.`lang`='&1' ORDER BY `name` ASC", $locale);
while ($record = sql_fetch_assoc($rs))
{
$sSelected = ($record['short'] == $cache_country) ? ' selected="selected"' : '';
$countriesoptions .= '<option value="' . htmlspecialchars($record['short'], ENT_COMPAT, 'UTF-8') . '"' . $sSelected . '>' . htmlspecialchars($record['name'], ENT_COMPAT, 'UTF-8') . '</option>' . "\n";
}
tpl_set_var('countryoptions', $countriesoptions);
sql_free_result($rs);
// cache-attributes
$bBeginLine = true;
$nPrevLineAttrCount = 0;
$nLineAttrCount = 0;
$cache_attrib_list = '';
$cache_attrib_array = '';
$cache_attribs_string = '';
$rsAttrGroup = sql("SELECT `attribute_groups`.`id`, IFNULL(`sys_trans_text`.`text`, `attribute_groups`.`name`) AS `name`, `attribute_categories`.`color`
FROM `attribute_groups`
INNER JOIN `attribute_categories` ON `attribute_groups`.`category_id`=`attribute_categories`.`id`
LEFT JOIN `sys_trans` ON `attribute_groups`.`trans_id`=`sys_trans`.`id`
LEFT JOIN `sys_trans_text` ON `sys_trans`.`id`=`sys_trans_text`.`trans_id` AND `sys_trans_text`.`lang`='&1'
ORDER BY `attribute_groups`.`category_id` ASC, `attribute_groups`.`id` ASC", $locale);
while ($rAttrGroup = sql_fetch_assoc($rsAttrGroup))
{
$group_line = '';
$rs = sql("SELECT `cache_attrib`.`id`, IFNULL(`ttname`.`text`, `cache_attrib`.`name`) AS `name`, `cache_attrib`.`icon_undef`, `cache_attrib`.`icon_large`,
IFNULL(`ttdesc`.`text`, `cache_attrib`.`html_desc`) AS `html_desc`
FROM `cache_attrib`
LEFT JOIN `caches_attributes` ON `cache_attrib`.`id`=`caches_attributes`.`attrib_id` AND `caches_attributes`.`cache_id`='&1'
LEFT JOIN `sys_trans` AS `tname` ON `cache_attrib`.`trans_id`=`tname`.`id` AND `cache_attrib`.`name`=`tname`.`text`
LEFT JOIN `sys_trans_text` AS `ttname` ON `tname`.`id`=`ttname`.`trans_id` AND `ttname`.`lang`='&1'
LEFT JOIN `sys_trans` AS `tdesc` ON `cache_attrib`.`html_desc_trans_id`=`tdesc`.`id` AND `cache_attrib`.`html_desc`=`tdesc`.`text`
LEFT JOIN `sys_trans_text` AS `ttdesc` ON `tdesc`.`id`=`ttdesc`.`trans_id` AND `ttdesc`.`lang`='&1'
WHERE `cache_attrib`.`group_id`='&3' AND
NOT IFNULL(`cache_attrib`.`hidden`, 0)=1 AND
(`cache_attrib`.`selectable`!=0 OR `caches_attributes`.`cache_id`='&2')
ORDER BY `cache_attrib`.`group_id` ASC, `cache_attrib`.`id` ASC", $locale, $cache_id, $rAttrGroup['id']);
while($record = sql_fetch_array($rs))
{
$line = $cache_attrib_pic;
$line = mb_ereg_replace('{attrib_id}', $record['id'], $line);
$line = mb_ereg_replace('{attrib_text}', escape_javascript($record['name']), $line);
if (in_array($record['id'], $cache_attribs))
$line = mb_ereg_replace('{attrib_pic}', $record['icon_large'], $line);
else
$line = mb_ereg_replace('{attrib_pic}', $record['icon_undef'], $line);
$line = mb_ereg_replace('{html_desc}', escape_javascript($record['html_desc']), $line);
$line = mb_ereg_replace('{name}', escape_javascript($record['name']), $line);
$line = mb_ereg_replace('{color}', $rAttrGroup['color'], $line);
$group_line .= $line;
$nLineAttrCount++;
$line = $cache_attrib_js;
$line = mb_ereg_replace('{id}', $record['id'], $line);
if (in_array($record['id'], $cache_attribs))
$line = mb_ereg_replace('{selected}', 1, $line);
else
$line = mb_ereg_replace('{selected}', 0, $line);
$line = mb_ereg_replace('{img_undef}', $record['icon_undef'], $line);
$line = mb_ereg_replace('{img_large}', $record['icon_large'], $line);
if ($cache_attrib_array != '') $cache_attrib_array .= ',';
$cache_attrib_array .= $line;
if (in_array($record['id'], $cache_attribs))
{
if ($cache_attribs_string != '') $cache_attribs_string .= ';';
$cache_attribs_string .= $record['id'];
}
}
sql_free_result($rs);
if ($group_line != '')
{
$group_img = $cache_attrib_group;
$group_img = mb_ereg_replace('{color}', $rAttrGroup['color'], $group_img);
$group_img = mb_ereg_replace('{attribs}', $group_line, $group_img);
$group_img = mb_ereg_replace('{name}', htmlspecialchars($rAttrGroup['name'], ENT_COMPAT, 'UTF-8'), $group_img);
if ($bBeginLine == true)
{
$cache_attrib_list .= '<div id="attribs1">';
$bBeginLine = false;
}
$cache_attrib_list .= $group_img;
$nPrevLineAttrCount += $nLineAttrCount;
$nLineAttrCount = 0;
}
}
sql_free_result($rsAttrGroup);
if ($bBeginLine == false)
$cache_attrib_list .= '</div>';
tpl_set_var('cache_attrib_list', $cache_attrib_list);
tpl_set_var('jsattributes_array', $cache_attrib_array);
tpl_set_var('cache_attribs', $cache_attribs_string);
//difficulty
$difficulty_options = '';
for ($i = 2; $i <= 10; $i++)
{
if ($cache_difficulty == $i)
{
$difficulty_options .= '<option value="' . $i . '" selected="selected">' . $i / 2 . '</options>';
}
else
{
$difficulty_options .= '<option value="' . $i . '">' . $i / 2 . '</options>';
}
$difficulty_options .= "\n";
}
tpl_set_var('difficultyoptions', $difficulty_options);
//build terrain options
$terrain_options = '';
for ($i = 2; $i <= 10; $i++)
{
if ($cache_terrain == $i)
{
$terrain_options .= '<option value="' . $i . '" selected="selected">' . $i / 2 . '</options>';
}
else
{
$terrain_options .= '<option value="' . $i . '">' . $i / 2 . '</options>';
}
$terrain_options .= "\n";
}
tpl_set_var('terrainoptions', $terrain_options);
//build typeoptions
$types = '';
$rsTypes = sql("SELECT `cache_type`.`id`, IFNULL(`sys_trans_text`.`text`, `cache_type`.`name`) AS `name`
FROM `cache_type`
LEFT JOIN `sys_trans` ON `cache_type`.`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) . "'
ORDER BY `cache_type`.`ordinal` ASC");
while ($rType = sql_fetch_assoc($rsTypes))
{
$sSelected = ($rType['id'] == $cache_type) ? ' selected="selected"' : '';
$types .= '<option value="' . $rType['id'] . '"' . $sSelected . '>' . htmlspecialchars($rType['name'], ENT_COMPAT, 'UTF-8') . '</option>';
}
sql_free_result($rsTypes);
tpl_set_var('typeoptions', $types);
//build sizeoptions
$sizes = '';
$rsSizes = sql("SELECT `cache_size`.`id`, IFNULL(`sys_trans_text`.`text`, `cache_size`.`name`) AS `name`
FROM `cache_size`
LEFT JOIN `sys_trans` ON `cache_size`.`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) . "'
ORDER BY `cache_size`.`ordinal` ASC");
while ($rSize = sql_fetch_assoc($rsSizes))
{
$sSelected = ($rSize['id'] == $sel_size) ? ' selected="selected"' : '';
$sizes .= '<option value="' . $rSize['id'] . '"' . $sSelected . '>' . htmlspecialchars($rSize['name'], ENT_COMPAT, 'UTF-8') . '</option>';
}
sql_free_result($rsSizes);
tpl_set_var('sizeoptions', $sizes);
//Cachedescs
$desclangs = mb_split(',', $cache_record['desc_languages']);
$cache_descs = '';
$gc_com_refs = false;
foreach ($desclangs AS $desclang)
{
if (count($desclangs) > 1)
{
$remove_url = 'removedesc.php?cacheid=' . urlencode($cache_id) . '&desclang=' . urlencode($desclang);
$removedesc = '&nbsp;[<a href="' . htmlspecialchars($remove_url, ENT_COMPAT, 'UTF-8') . '">' . $remove . '</a>]';
}
else
{
$removedesc = '';
}
$resp = sql("SELECT `desc` FROM `cache_desc` WHERE `cache_id`='&1' AND `language`='&2'", $cache_id, $desclang);
$row = sql_fetch_array($resp);
if(mb_strpos($row['desc'], "http://img.groundspeak.com/") !== false)
$gc_com_refs = true;
sql_free_result($resp);
$edit_url = 'editdesc.php?cacheid=' . urlencode($cache_id) . '&desclang=' . urlencode($desclang);
$cache_descs .= '<tr><td colspan="2">' . htmlspecialchars(db_LanguageFromShort($desclang), ENT_COMPAT, 'UTF-8') . ' [<a href="' . htmlspecialchars($edit_url, ENT_COMPAT, 'UTF-8') . '">' . $edit . '</a>]' . $removedesc . '</td></tr>';
}
tpl_set_var('cache_descs', $cache_descs);
if($gc_com_refs)
{
tpl_set_var('gc_com_refs_start', "");
tpl_set_var('gc_com_refs_end', "");
}
else
{
tpl_set_var('gc_com_refs_start', "<!--");
tpl_set_var('gc_com_refs_end', "-->");
}
//Status
$statusoptions = '';
if ($status_old != 7)
{
$rsStatus = sql("SELECT `cache_status`.`id`, IFNULL(`sys_trans_text`.`text`, `cache_status`.`name`) AS `name`
FROM `cache_status`
LEFT JOIN `sys_trans` ON `cache_status`.`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 `cache_status`.`id` NOT IN (4, 5, 7) OR `cache_status`.`id`='" . sql_escape($status_old+0) . "'
ORDER BY `cache_status`.`id` ASC");
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>';
}
sql_free_result($rsStatus);
}
else
{
$statusoptions .= '<option value="7" selected="selected">' . htmlspecialchars(t("Locked, invisible"), ENT_COMPAT, 'UTF-8') . '</option>';
}
tpl_set_var('statusoptions', $statusoptions);
// show activation form?
if($status_old == 5) // status = not yet published
{
$tmp = $activation_form;
$tmp = mb_ereg_replace('{activate_day}', htmlspecialchars($cache_activate_day, ENT_COMPAT, 'UTF-8'), $tmp);
$tmp = mb_ereg_replace('{activate_month}', htmlspecialchars($cache_activate_month, ENT_COMPAT, 'UTF-8'), $tmp);
$tmp = mb_ereg_replace('{activate_year}', htmlspecialchars($cache_activate_year, ENT_COMPAT, 'UTF-8'), $tmp);
$tmp = mb_ereg_replace('{publish_now_checked}', ($publish == 'now') ? 'checked' : '', $tmp);
$tmp = mb_ereg_replace('{publish_later_checked}', ($publish == 'later') ? 'checked' : '', $tmp);
$tmp = mb_ereg_replace('{publish_notnow_checked}', ($publish == 'notnow') ? 'checked' : '', $tmp);
$activation_hours = '';
for ($i = 0; $i <= 23; $i++)
{
if ($cache_activate_hour == $i)
{
$activation_hours .= '<option value="' . $i . '" selected="selected">' . $i . '</options>';
}
else
{
$activation_hours .= '<option value="' . $i . '">' . $i . '</options>';
}
$activation_hours .= "\n";
}
$tmp = mb_ereg_replace('{activation_hours}', $activation_hours, $tmp);
if($activate_date_not_ok)
{
$tmp = mb_ereg_replace('{activate_on_message}', $date_message, $tmp);
}
else
{
$tmp = mb_ereg_replace('{activate_on_message}', '', $tmp);
}
tpl_set_var('activation_form', $tmp);
}
else
{
tpl_set_var('activation_form', '');
}
if ($cache_record['picture'] > 0)
{
$pictures = '';
$rspictures = sql("SELECT `url`, `title`, `uuid` FROM `pictures` WHERE `object_id`='&1' AND `object_type`=2", $cache_id);
for ($i = 0; $i < mysql_num_rows($rspictures); $i++)
{
$tmpline = $pictureline;
$pic_record = sql_fetch_array($rspictures);
$tmpline = mb_ereg_replace('{link}', htmlspecialchars($pic_record['url'], ENT_COMPAT, 'UTF-8'), $tmpline);
$tmpline = mb_ereg_replace('{title}', htmlspecialchars($pic_record['title'], ENT_COMPAT, 'UTF-8'), $tmpline);
$tmpline = mb_ereg_replace('{uuid}', htmlspecialchars($pic_record['uuid'], ENT_COMPAT, 'UTF-8'), $tmpline);
$pictures .= $tmpline;
}
$pictures = mb_ereg_replace('{lines}', $pictures, $picturelines);
mysql_free_result($rspictures);
tpl_set_var('pictures', $pictures);
}
else
tpl_set_var('pictures', $nopictures);
tpl_set_var('waypoints', getWaypoints($cache_id));
tpl_set_var('cacheid', htmlspecialchars($cache_id, ENT_COMPAT, 'UTF-8'));
tpl_set_var('name', htmlspecialchars($cache_name, ENT_COMPAT, 'UTF-8'));
tpl_set_var('ownername', htmlspecialchars($cache_record['username'], ENT_COMPAT, 'UTF-8'));
tpl_set_var('date_day', htmlspecialchars($cache_hidden_day, ENT_COMPAT, 'UTF-8'));
tpl_set_var('date_month', htmlspecialchars($cache_hidden_month, ENT_COMPAT, 'UTF-8'));
tpl_set_var('date_year', htmlspecialchars($cache_hidden_year, ENT_COMPAT, 'UTF-8'));
tpl_set_var('selLatN', ($coords_latNS == 'N') ? ' selected="selected"' : '');
tpl_set_var('selLatS', ($coords_latNS == 'S') ? ' selected="selected"' : '');
tpl_set_var('selLonE', ($coords_lonEW == 'E') ? ' selected="selected"' : '');
tpl_set_var('selLonW', ($coords_lonEW == 'W') ? ' selected="selected"' : '');
tpl_set_var('lat_h', htmlspecialchars($coords_lat_h, ENT_COMPAT, 'UTF-8'));
tpl_set_var('lat_min', htmlspecialchars($coords_lat_min, ENT_COMPAT, 'UTF-8'));
tpl_set_var('lon_h', htmlspecialchars($coords_lon_h, ENT_COMPAT, 'UTF-8'));
tpl_set_var('lon_min', htmlspecialchars($coords_lon_min, ENT_COMPAT, 'UTF-8'));
tpl_set_var('name_message', ($name_not_ok == true) ? $name_message : '');
tpl_set_var('lon_message', ($lon_not_ok == true) ? $coords_message : '');
tpl_set_var('lat_message', ($lat_not_ok == true) ? $coords_message : '');
tpl_set_var('date_message', ($hidden_date_not_ok == true) ? $date_message : '');
tpl_set_var('size_message', ($size_not_ok == true) ? $sizemismatch_message : '');
if($lon_not_ok || $lat_not_ok || $hidden_date_not_ok || $name_not_ok)
tpl_set_var('general_message', $error_general);
else
tpl_set_var('general_message', "");
tpl_set_var('cacheid_urlencode', htmlspecialchars(urlencode($cache_id), ENT_COMPAT, 'UTF-8'));
tpl_set_var('cacheuuid_urlencode', htmlspecialchars(urlencode($cache_record['uuid']), ENT_COMPAT, 'UTF-8'));
tpl_set_var('show_all_countries', $show_all_countries);
tpl_set_var('show_all_countries_submit', ($show_all_countries == 0) ? $all_countries_submit: '');
$st_hours = floor($search_time);
$st_minutes = sprintf('%02.0F', ($search_time - $st_hours) * 60);
tpl_set_var('search_time', $st_hours . ':' . $st_minutes);
tpl_set_var('way_length', $way_length);
tpl_set_var('log_pw', htmlspecialchars($log_pw, ENT_COMPAT, 'UTF-8'));
tpl_set_var('wp_gc', htmlspecialchars($wp_gc, ENT_COMPAT, 'UTF-8'));
tpl_set_var('wp_nc', htmlspecialchars($wp_nc, ENT_COMPAT, 'UTF-8'));
tpl_set_var('reset', $reset);
tpl_set_var('submit', $submit);
}
else
{
//TODO: not the owner
}
}
else
{
//TODO: cache not exist
}
}
}
//make the template and send it out
tpl_BuildTemplate();
?>

306
htdocs/editdesc.php Normal file
View File

@ -0,0 +1,306 @@
<?php
/***************************************************************************
./editdesc.php
-------------------
begin : July 7 2004
copyright : (C) 2004 The OpenCaching Group
forum contact at : http://www.opencaching.com/phpBB2
***************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
/****************************************************************************
Unicode Reminder メモ
edit a cache listing
used template(s): editcache
GET/POST Parameter: cacheid, desclang
****************************************************************************/
//prepare the templates and include all neccessary
require_once('./lib/common.inc.php');
require_once($opt['rootpath'] . '../lib/htmlpurifier-4.2.0/library/HTMLPurifier.auto.php');
//Preprocessing
if ($error == false)
{
require($stylepath . '/editdesc.inc.php');
// check for old-style parameters
if (isset($_REQUEST['cacheid']) && isset($_REQUEST['desclang']) && !isset($_REQUEST['descid']))
{
$cache_id = $_REQUEST['cacheid'];
$desc_lang = $_REQUEST['desclang'];
$rs = sql("SELECT `id` FROM `cache_desc` WHERE `cache_id`='&1' AND `language`='&2'", $cache_id, $desc_lang);
if (mysql_num_rows($rs) == 1)
{
$r = sql_fetch_array($rs);
$descid = $r['id'];
}
else
{
tpl_errorMsg('editdesc', $error_desc_not_found);
}
sql_free_result($rs);
}
else
{
$descid = isset($_REQUEST['descid']) ? $_REQUEST['descid'] : 0;
if (is_numeric($descid) == false)
$descid = 0;
}
if ($usr === false)
{
$tplname = 'login';
tpl_set_var('username', '');
tpl_set_var('target', htmlspecialchars('editdesc.php?descid=' . urlencode($descid), ENT_COMPAT, 'UTF-8'));
tpl_set_var('message_start', "");
tpl_set_var('message_end', "");
tpl_set_var('message', $login_required);
}
else
{
$desc_rs = sql("SELECT `cache_desc`.`cache_id` `cache_id`, `cache_desc`.`node` `node`, `cache_desc`.`language` `language`, `caches`.`name` `name`, `caches`.`user_id` `user_id`, `cache_desc`.`desc` `desc`, `cache_desc`.`hint` `hint`, `cache_desc`.`short_desc` `short_desc`, `cache_desc`.`desc_html` `desc_html`, `cache_desc`.`desc_htmledit` `desc_htmledit` FROM `caches`, `cache_desc` WHERE (`caches`.`cache_id` = `cache_desc`.`cache_id`) AND `cache_desc`.`id`='&1'", $descid);
$desc_record = sql_fetch_array($desc_rs);
sql_free_result($desc_rs);
if ($desc_record !== false)
{
$desc_lang = $desc_record['language'];
$cache_id = $desc_record['cache_id'];
if ($desc_record['node'] != $oc_nodeid)
{
tpl_errorMsg('editdesc', $error_wrong_node);
exit;
}
if ($desc_record['user_id'] == $usr['userid'])
{
$tplname = 'editdesc';
tpl_set_var('desc_err', '');
$show_all_langs = false;
//save to DB?
if (isset($_POST['post']))
{
//here we read all used information from the form if submitted
$descMode = isset($_POST['descMode']) ? $_POST['descMode'] : 1;
// fuer alte Versionen von OCProp
if (isset($_POST['submit']) && !isset($_POST['version2']))
{
$descMode = (isset($_POST['desc_html']) && ($_POST['desc_html']==1)) ? 2 : 1;
$_POST['submitform'] = $_POST['submit'];
}
switch ($descMode)
{
case 2:
$desc_htmledit = 0;
$desc_html = 1;
break;
case 3:
$desc_htmledit = 1;
$desc_html = 1;
break;
default:
$desc_htmledit = 0;
$desc_html = 0;
break;
}
$short_desc = $_POST['short_desc'];
$hint = htmlspecialchars($_POST['hints'], ENT_COMPAT, 'UTF-8');
$desclang = $_POST['desclang'];
$show_all_langs = isset($_POST['show_all_langs_value']) ? $_POST['show_all_langs_value'] : 0;
if (!is_numeric($show_all_langs)) $show_all_langs = 0;
// fuer alte Versionen von OCProp
if (isset($_POST['submit']) && !isset($_POST['version2']))
{
$short_desc = iconv("ISO-8859-1", "UTF-8", $short_desc);
$hint = iconv("ISO-8859-1", "UTF-8", $hint);
}
if ($desc_html == 1)
{
// Text from textarea
$desc = $_POST['desc'];
// fuer alte Versionen von OCProp
if (isset($_POST['submit']) && !isset($_POST['version2']))
{
$desc = iconv("ISO-8859-1", "UTF-8", $desc);
}
// Filter Input
$purifier = new HTMLPurifier();
$desc = $purifier->purify($desc);
}
else
{
// escape text
$desc = htmlspecialchars($_POST['desc'], ENT_COMPAT, 'UTF-8');
// fuer alte Versionen von OCProp
if (isset($_POST['submit']) && !isset($_POST['version2']))
{
$desc = iconv("ISO-8859-1", "UTF-8", $desc);
}
}
if (isset($_POST['submitform']))
{
// prüfen, ob sprache nicht schon vorhanden
$rs = sql("SELECT COUNT(*) `count` FROM `cache_desc` WHERE `cache_id`='&1' AND `id` != '&2' AND `language`='&3'", $desc_record['cache_id'], $descid, $desclang);
$r = sql_fetch_array($rs);
if ($r['count'] > 0)
tpl_errorMsg('editdesc', $error_desc_exists);
mysql_free_result($rs);
sql("UPDATE `cache_desc` SET
`desc_html`='&1',
`desc_htmledit`='&2',
`desc`='&3',
`short_desc`='&4',
`hint`='&5',
`language`='&6'
WHERE `id`='&7'",
(($desc_html == 1) ? '1' : '0'),
(($desc_htmledit == 1) ? '1' : '0'),
(($desc_html == 1) ? $desc : nl2br($desc)),
$short_desc,
nl2br($hint),
$desclang,
$descid);
// do not use slave server for the next time ...
db_slave_exclude();
// redirect to cachepage
tpl_redirect('editcache.php?cacheid=' . urlencode($desc_record['cache_id']));
exit;
}
else if (isset($_POST['show_all_langs']))
{
$show_all_langs = true;
}
}
else
{
//here we read all used information from the DB
$short_desc = strip_tags($desc_record['short_desc']);
$hint = strip_tags($desc_record['hint']);
$desc_htmledit = $desc_record['desc_htmledit'];
$desc_html = $desc_record['desc_html'];
$desc_lang = $desc_record['language'];
if ($desc_html == 1)
$desc = $desc_record['desc'];
else{
$desc = strip_tags($desc_record['desc']);
}
}
//here we only set up the template variables
if ($desc_html == 1)
tpl_set_var('desc', htmlspecialchars($desc, ENT_COMPAT, 'UTF-8'), true);
else
tpl_set_var('desc', $desc, true);
// ok ... die desclang zusammenbauen
if ($show_all_langs == false)
{
$rs = sql("SELECT `show` FROM `languages_list_default` WHERE `show`='&1' AND `lang`='&2'", $desc_lang, $locale);
if (mysql_num_rows($rs) == 0) $show_all_langs = true;
sql_free_result($rs);
}
$languages = '';
$rsLanguages = sql("SELECT `languages`.`short`, IFNULL(`sys_trans_text`.`text`, `languages`.`name`) AS `name`
FROM `languages`
LEFT JOIN `languages_list_default` ON `languages`.`short`=`languages_list_default`.`show` AND `languages_list_default`.`lang`='&3'
LEFT JOIN `sys_trans` ON `languages`.`trans_id`=`sys_trans`.`id`
LEFT JOIN `sys_trans_text` ON `sys_trans`.`id`=`sys_trans_text`.`trans_id` AND `sys_trans_text`.`lang`='&3'
WHERE `languages`.`short`
NOT IN (SELECT `language` FROM `cache_desc` WHERE `cache_id`='&1' AND `language`!='&2') AND
('&4'=1 OR `languages_list_default`.`show`=`languages`.`short`)
ORDER BY `name` ASC",
$desc_record['cache_id'],
$desc_lang,
$locale,
($show_all_langs == true) ? 1 : 0);
while ($rLanguage = sql_fetch_assoc($rsLanguages))
{
$sSelected = ($rLanguage['short'] == $desc_lang) ? ' selected="selected"' : '';
$languages .= '<option value="' . $rLanguage['short'] . '"' . $sSelected . '>' . htmlspecialchars($rLanguage['name'], ENT_COMPAT, 'UTF-8') . '</option>' . "\n";
}
sql_free_result($rsLanguages);
tpl_set_var('desclangs', $languages);
if ($show_all_langs == false)
tpl_set_var('show_all_langs_submit', $show_all_langs_submit);
else
tpl_set_var('show_all_langs_submit', '');
tpl_set_var('show_all_langs_value', (($show_all_langs == false) ? 0 : 1));
tpl_set_var('short_desc', htmlspecialchars($short_desc, ENT_COMPAT, 'UTF-8'));
tpl_set_var('hints', $hint);
tpl_set_var('descid', $descid);
tpl_set_var('cacheid', htmlspecialchars($desc_record['cache_id'], ENT_COMPAT, 'UTF-8'));
tpl_set_var('desclang', htmlspecialchars($desc_lang, ENT_COMPAT, 'UTF-8'));
tpl_set_var('desclang_name', htmlspecialchars(db_LanguageFromShort($desc_lang), ENT_COMPAT, 'UTF-8'));
tpl_set_var('cachename', htmlspecialchars($desc_record['name'], ENT_COMPAT, 'UTF-8'));
tpl_set_var('reset', $reset);
tpl_set_var('submit', $submit);
// Text / normal HTML / HTML editor
tpl_set_var('use_tinymce', (($desc_htmledit == 1) ? 1 : 0));
if (($desc_html == 1) && ($desc_htmledit == 1))
{
// TinyMCE
$headers = tpl_get_var('htmlheaders') . "\n";
$headers .= '<script language="javascript" type="text/javascript" src="resource2/tinymce/tiny_mce_gzip.js"></script>' . "\n";
$headers .= '<script language="javascript" type="text/javascript" src="resource2/tinymce/config/desc.js.php?cacheid=' . ($desc_record['cache_id']+0) . '&lang=' . strtolower($locale) . '"></script>' . "\n";
tpl_set_var('htmlheaders', $headers);
tpl_set_var('descMode', 3);
}
else if ($desc_html == 1)
tpl_set_var('descMode', 2);
else
tpl_set_var('descMode', 1);
}
else
{
//TODO: not the owner
}
}
else
tpl_errorMsg('editdesc', $error_desc_not_found);
}
}
//make the template and send it out
tpl_BuildTemplate();
?>

417
htdocs/editlog.php Normal file
View File

@ -0,0 +1,417 @@
<?php
/***************************************************************************
./editlog.php
-------------------
begin : July 5 2004
copyright : (C) 2004 The OpenCaching Group
forum contact at : http://www.opencaching.com/phpBB2
***************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
/****************************************************************************
Unicode Reminder メモ
edit a log listing
used template(s): editlog
GET/POST Parameter: logid
Note: when changing recommendation, the last_modified-date of log-record
has to be updated to trigger resync via xml-interface
****************************************************************************/
//prepare the templates and include all neccessary
require_once('./lib/common.inc.php');
require($stylepath.'/smilies.inc.php');
require_once($opt['rootpath'] . '../lib/htmlpurifier-4.2.0/library/HTMLPurifier.auto.php');
//Preprocessing
if ($error == false)
{
//logid
$log_id = 0;
if (isset($_REQUEST['logid']))
{
$log_id = $_REQUEST['logid'];
}
if ($usr === false)
{
$tplname = 'login';
tpl_set_var('username', '');
tpl_set_var('message_start', '');
tpl_set_var('message_end', '');
tpl_set_var('target', 'editlog.php?logid=' . urlencode($log_id));
tpl_set_var('message', $login_required);
}
else
{
//does log with this logid exist?
$log_rs = sql("SELECT `cache_logs`.`cache_id` AS `cache_id`, `cache_logs`.`node` AS `node`, `cache_logs`.`text` AS `text`, `cache_logs`.`date` AS `date`, `cache_logs`.`user_id` AS `user_id`, `cache_logs`.`type` AS `logtype`, `cache_logs`.`text_html` AS `text_html`, `cache_logs`.`text_htmledit` AS `text_htmledit`, `caches`.`name` AS `cachename`, `caches`.`type` AS `cachetype`, `caches`.`user_id` AS `cache_user_id`, `caches`.`logpw` as `logpw`, `caches`.`status` as `status` FROM `cache_logs` INNER JOIN `caches` ON (`caches`.`cache_id`=`cache_logs`.`cache_id`) WHERE `id`='&1'", $log_id);
$log_record = sql_fetch_array($log_rs);
sql_free_result($log_rs);
if ($log_record !== false && $log_record['status'] != 6 && $log_record['status'] != 7)
{
require($stylepath . '/editlog.inc.php');
require($stylepath.'/rating.inc.php');
if ($log_record['node'] != $oc_nodeid)
{
tpl_errorMsg('editlog', $error_wrong_node);
exit;
}
//is this log from this user?
if ($log_record['user_id'] == $usr['userid'])
{
$tplname = 'editlog';
//load settings
$cache_name = $log_record['cachename'];
$cache_type = $log_record['cachetype'];
$cache_user_id = $log_record['cache_user_id'];
$log_type = isset($_POST['logtype']) ? $_POST['logtype'] : $log_record['logtype'];
$log_date_day = isset($_POST['logday']) ? $_POST['logday'] : date('d', strtotime($log_record['date']));
$log_date_month = isset($_POST['logmonth']) ? $_POST['logmonth'] : date('m', strtotime($log_record['date']));
$log_date_year = isset($_POST['logyear']) ? $_POST['logyear'] : date('Y', strtotime($log_record['date']));
$top_cache = isset($_POST['rating']) ? $_POST['rating']+0 : 0;
$log_pw = '';
$use_log_pw = (($log_record['logpw'] == NULL) || ($log_record['logpw'] == '')) ? false : true;
if (($use_log_pw) && $log_record['logtype']==1)
$use_log_pw = false;
if ($use_log_pw)
$log_pw = $log_record['logpw'];
// check if user has exceeded his top5% limit
$is_top = sqlValue("SELECT COUNT(`cache_id`) FROM `cache_rating` WHERE `user_id`='" . sql_escape($usr['userid']) . "' AND `cache_id`='" . sql_escape($log_record['cache_id']) . "'", 0);
$user_founds = sqlValue("SELECT IFNULL(`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);
$user_tops = sqlValue("SELECT COUNT(`user_id`) FROM `cache_rating` WHERE `user_id`='" . sql_escape($usr['userid']) . "'", 0);
if ($is_top == 0)
{
if (($user_founds * rating_percentage/100) < 1)
{
$top_cache = 0;
$anzahl = (1 - ($user_founds * rating_percentage/100)) / (rating_percentage/100);
if ($anzahl > 1)
{
$rating_msg = mb_ereg_replace('{anzahl}', $anzahl, $rating_too_few_founds);
}
else
{
$rating_msg = mb_ereg_replace('{anzahl}', $anzahl, $rating_too_few_founds);
}
}
elseif ($user_tops < floor($user_founds * rating_percentage/100))
{
$rating_msg = mb_ereg_replace('{chk_sel}', '', $rating_allowed.'<br />'.$rating_stat);
$rating_msg = mb_ereg_replace('{max}', floor($user_founds * rating_percentage/100), $rating_msg);
$rating_msg = mb_ereg_replace('{curr}', $user_tops, $rating_msg);
}
else
{
$top_cache = 0;
$anzahl = ($user_tops + 1 - ($user_founds * rating_percentage/100)) / (rating_percentage/100);
if ($anzahl > 1)
{
$rating_msg = mb_ereg_replace('{anzahl}', $anzahl, $rating_too_few_founds);
}
else
{
$rating_msg = mb_ereg_replace('{anzahl}', $anzahl, $rating_too_few_founds);
}
$rating_msg .= '<br />'.$rating_maxreached;
}
}
else
{
$rating_msg = mb_ereg_replace('{chk_sel}', ' checked', $rating_allowed.'<br />'.$rating_stat);
$rating_msg = mb_ereg_replace('{max}', floor($user_founds * rating_percentage/100), $rating_msg);
$rating_msg = mb_ereg_replace('{curr}', $user_tops, $rating_msg);
}
tpl_set_var('rating_message', mb_ereg_replace('{rating_msg}', $rating_msg, $rating_tpl));
if (isset($_POST['descMode']))
{
$descMode = $_POST['descMode']+0;
if (($descMode < 1) || ($descMode > 3)) $descMode = 3;
}
else
{
if ($log_record['text_html'] == 1)
if ($log_record['text_htmledit'] == 1)
$descMode = 3;
else
$descMode = 2;
else
$descMode = 1;
}
// fuer alte Versionen von OCProp
if (isset($_POST['submit']) && !isset($_POST['version2']))
{
$descMode = 1;
$_POST['submitform'] = $_POST['submit'];
}
if ($descMode != 1)
{
// Text from textarea
$log_text = isset($_POST['logtext']) ? ($_POST['logtext']) : ($log_record['text']);
// fuer alte Versionen von OCProp
if (isset($_POST['submit']) && !isset($_POST['version2']))
{
$log_text = iconv("ISO-8859-1", "UTF-8", $log_text);
}
// check input
$purifier = new HTMLPurifier();
$log_text = $purifier->purify($log_text);
}
else
{
// escape text
$log_text = isset($_POST['logtext']) ? htmlspecialchars($_POST['logtext'], ENT_COMPAT, 'UTF-8') : strip_tags($log_record['text']);
// fuer alte Versionen von OCProp
if (isset($_POST['submit']) && !isset($_POST['version2']))
{
$log_text = iconv("ISO-8859-1", "UTF-8", $log_text);
}
}
//validate date
$date_not_ok = true;
if (is_numeric($log_date_day) && is_numeric($log_date_month) && is_numeric($log_date_year))
{
if (checkdate($log_date_month, $log_date_day, $log_date_year) == true)
{
$date_not_ok = false;
}
if($date_not_ok == false)
{
if(isset($_POST['submitform']))
{
if(mktime(0, 0, 0, $log_date_month, $log_date_day, $log_date_year)>=mktime())
{
$date_not_ok = true;
}
else
{
$date_not_ok = false;
}
}
}
}
if ($cache_type == 6)
{
switch($log_type)
{
case 1:
case 2:
$logtype_not_ok = true;
break;
default:
$logtype_not_ok = false;
break;
}
}
else
{
switch($log_type)
{
case 7:
case 8:
$logtype_not_ok = true;
break;
default:
$logtype_not_ok = false;
break;
}
}
// not a found log? then ignore the rating
if ($log_type != 1 && $log_type != 7)
{
$top_cache = 0;
}
$pw_not_ok = false;
if (($use_log_pw) && $log_type == 1)
{
if (isset($_POST['log_pw']))
{
if (mb_strtolower($log_pw) != mb_strtolower($_POST['log_pw']))
{
$pw_not_ok = true;
$all_ok = false;
}
}
else
{
$pw_not_ok = true;
$all_ok = false;
}
}
//store?
if (isset($_POST['submitform']) && $date_not_ok == false && $logtype_not_ok == false && $pw_not_ok == false)
{
//store changed data
sql("UPDATE `cache_logs` SET `type`='&1',
`date`='&2',
`text`='&3',
`text_html`='&4',
`text_htmledit`='&5'
WHERE `id`='&6'",
$log_type,
date('Y-m-d', mktime(0, 0, 0, $log_date_month, $log_date_day, $log_date_year)),
(($descMode != 1) ? $log_text : nl2br($log_text)),
(($descMode != 1) ? 1 : 0),
(($descMode == 3) ? 1 : 0),
$log_id);
//update user-stat if type changed
if ($log_record['logtype'] != $log_type)
{
//call eventhandler
require_once($opt['rootpath'] . 'lib/eventhandler.inc.php');
event_change_log_type($log_record['cache_id'], $usr['userid']+0);
}
// update top-list
if ($top_cache == 1)
sql("INSERT IGNORE INTO `cache_rating` (`user_id`, `cache_id`) VALUES('&1', '&2')", $usr['userid'], $log_record['cache_id']);
else
sql("DELETE FROM `cache_rating` WHERE `user_id`='&1' AND `cache_id`='&2'", $usr['userid'], $log_record['cache_id']);
// do not use slave server for the next time ...
db_slave_exclude();
//display cache page
tpl_redirect('viewcache.php?cacheid=' . urlencode($log_record['cache_id']));
exit;
}
//build logtypeoptions
$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))
{
$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);
//set template vars
tpl_set_var('cachename', htmlspecialchars($cache_name, ENT_COMPAT, 'UTF-8'));
tpl_set_var('logtypeoptions', $logtypeoptions);
tpl_set_var('logday', htmlspecialchars($log_date_day, ENT_COMPAT, 'UTF-8'));
tpl_set_var('logmonth', htmlspecialchars($log_date_month, ENT_COMPAT, 'UTF-8'));
tpl_set_var('logyear', htmlspecialchars($log_date_year, ENT_COMPAT, 'UTF-8'));
tpl_set_var('cachename', htmlspecialchars($cache_name, ENT_COMPAT, 'UTF-8'));
tpl_set_var('cacheid', $log_record['cache_id']);
tpl_set_var('reset', $reset);
tpl_set_var('submit', $submit);
tpl_set_var('logid', $log_id);
tpl_set_var('date_message', ($date_not_ok == true) ? $date_message : '');
if ($descMode != 1)
tpl_set_var('logtext', htmlspecialchars($log_text, ENT_COMPAT, 'UTF-8'), true);
else
tpl_set_var('logtext', $log_text);
// Text / normal HTML / HTML editor
tpl_set_var('use_tinymce', (($descMode == 3) ? 1 : 0));
if ($descMode == 1)
tpl_set_var('descMode', 1);
else if ($descMode == 2)
tpl_set_var('descMode', 2);
else
{
// TinyMCE
$headers = tpl_get_var('htmlheaders') . "\n";
$headers .= '<script language="javascript" type="text/javascript" src="resource2/tinymce/tiny_mce_gzip.js"></script>' . "\n";
$headers .= '<script language="javascript" type="text/javascript" src="resource2/tinymce/config/log.js.php?logid=0"></script>' . "\n";
tpl_set_var('htmlheaders', $headers);
tpl_set_var('descMode', 3);
}
if ($use_log_pw == true && $log_pw != '')
{
if ($pw_not_ok == true && isset($_POST['submitform']))
{
tpl_set_var('log_pw_field', $log_pw_field_pw_not_ok);
}
else
{
tpl_set_var('log_pw_field', $log_pw_field);
}
}
else
{
tpl_set_var('log_pw_field', '');
}
// build smilies
$smilies = '';
if ($descMode != 3)
{
for($i=0; $i<count($smileyshow); $i++)
{
if($smileyshow[$i] == '1')
{
$tmp_smiley = $smiley_link;
$tmp_smiley = mb_ereg_replace('{smiley_image}', $smileyimage[$i], $tmp_smiley);
$smilies = $smilies.mb_ereg_replace('{smiley_text}', ' '.$smileytext[$i].' ', $tmp_smiley).'&nbsp;';
}
}
}
tpl_set_var('smilies', $smilies);
}
else
{
//TODO: show error
}
}
else
{
//TODO: show error
}
}
}
//make the template and send it out
tpl_BuildTemplate();
?>

View File

@ -0,0 +1,36 @@
<?php
/***************************************************************************
* You can find the license in the docs directory
*
* Unicode Reminder メモ
***************************************************************************/
require('./lib2/web.inc.php');
$tpl->name = 'event_attendance';
$tpl->popup = true;
// id gesetzt?
$cache_id = isset($_REQUEST['id']) ? $_REQUEST['id']+0 : 0;
if ($cache_id != 0)
{
$rs = sql("SELECT `caches`.`name`, `user`.`username`, `caches`.`date_hidden`
FROM `caches`
INNER JOIN `cache_status` ON `caches`.`status`=`cache_status`.`id`
INNER JOIN `user` ON `user`.`user_id`=`caches`.`user_id`
WHERE `cache_status`.`allow_user_view`=1 AND
`caches`.`cache_id`='&1'", $cache_id);
if ($r = sql_fetch_assoc($rs))
{
$tpl->assign('owner', $r['username']);
$tpl->assign('cachename', $r['name']);
$tpl->assign('event_date', $r['date_hidden']);
}
sql_free_result($rs);
$rs = sql("SELECT DISTINCT `user`.`username` FROM `cache_logs` INNER JOIN `caches` ON `cache_logs`.`cache_id`=`caches`.`cache_id` INNER JOIN `cache_status` ON `caches`.`status`=`cache_status`.`id` INNER JOIN `user` ON `user`.`user_id`=`cache_logs`.`user_id` WHERE `cache_status`.`allow_user_view`=1 AND `cache_logs`.`type`=8 AND `cache_logs`.`cache_id`='&1' ORDER BY `user`.`username`", $cache_id);
$tpl->assign_rs('attendants', $rs);
sql_free_result($rs);
}
$tpl->display();
?>

BIN
htdocs/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

123
htdocs/garmin.php Normal file
View File

@ -0,0 +1,123 @@
<?php
/****************************************************************************
Unicode Reminder メモ
****************************************************************************/
require('./lib2/web.inc.php');
require_once('./lib2/logic/labels.inc.php');
require_once('./lib2/logic/cache.class.php');
$tpl->name = 'garmin';
$tpl->popup = 1;
$tpl->assign('popup', true);
$tpl->assign('garmin', true);
// get cacheid
$cacheid = 0;
if (isset($_REQUEST['cacheid']))
$cacheid = $_REQUEST['cacheid']+0;
else if (isset($_REQUEST['uuid']))
$cacheid = cache::cacheIdFromUUID($_REQUEST['uuid']);
else if (isset($_REQUEST['wp']))
$cacheid = cache::cacheIdFromWP($_REQUEST['wp']);
// important: when the domain does not fit the api key, you must be redirected to the correct domain
if (($opt['lib']['garmin']['domain'] != $_SERVER['HTTP_HOST']) && !isset($_REQUEST['redirect']))
{
$redirect = $opt['lib']['garmin']['redirect'];
$redirect = str_replace('{cacheid}', $cacheid, $redirect);
$tpl->redirect($redirect);
exit;
}
$cache = new cache($cacheid);
if ($cache->exist() == false)
$tpl->error(ERROR_CACHE_NOT_EXISTS);
if ($cache->allowView() == false)
$tpl->error(ERROR_NO_ACCESS);
$bCrypt = isset($_REQUEST['nocrypt']) ? ($_REQUEST['nocrypt']!=1) : true;
$tpl->assign('crypt', $bCrypt);
if (isset($_REQUEST['desclang']))
$sPreferedDescLang = $_REQUEST['desclang'] . ',' . $opt['template']['locale'] . ',EN';
else
$sPreferedDescLang = $opt['template']['locale'] . ',EN';
//get cache record
$rs = sql("SELECT `caches`.`cache_id` AS `cacheid`,
`caches`.`user_id` AS `userid`,
`caches`.`status` AS `status`,
`caches`.`latitude` AS `latitude`,
`caches`.`longitude` AS `longitude`,
`caches`.`name` AS `name`,
`caches`.`type` AS `type`,
`caches`.`size` AS `size`,
`caches`.`search_time` AS `searchtime`,
`caches`.`way_length` AS `waylength`,
`caches`.`country` AS `countryCode`,
IFNULL(`ttCountry`.`text`, `countries`.`name`) AS `country`,
`caches`.`logpw` AS `logpw`,
`caches`.`date_hidden` AS `datehidden`,
`caches`.`wp_oc` AS `wpoc`,
`caches`.`wp_gc` AS `wpgc`,
`caches`.`wp_nc` AS `wpnc`,
`caches`.`date_created` AS `datecreated`,
`caches`.`difficulty` AS `difficulty`,
`caches`.`terrain` AS `terrain`,
`cache_desc`.`language` AS `desclanguage`,
`cache_desc`.`short_desc` AS `shortdesc`,
`cache_desc`.`desc` AS `desc`,
`cache_desc`.`hint` AS `hint`,
`cache_desc`.`desc_html` AS `deschtml`,
IFNULL(`stat_caches`.`found`, 0) AS `found`,
IFNULL(`stat_caches`.`notfound`, 0) AS `notfound`,
IFNULL(`stat_caches`.`note`, 0) AS `note`,
IFNULL(`stat_caches`.`will_attend`, 0) AS `willattend`,
IFNULL(`stat_caches`.`watch`, 0) AS `watcher`,
`caches`.`desc_languages` AS `desclanguages`,
IFNULL(`stat_caches`.`ignore`, 0) AS `ignorercount`,
IFNULL(`stat_caches`.`toprating`, 0) AS `topratings`,
IFNULL(`cache_visits`.`count`, 0) AS `visits`,
`user`.`username` AS `username`,
IFNULL(`cache_location`.`code1`, '') AS `code1`,
IFNULL(`cache_location`.`adm1`, '') AS `adm1`,
IFNULL(`cache_location`.`adm2`, '') AS `adm2`,
IFNULL(`cache_location`.`adm3`, '') AS `adm3`,
IFNULL(`cache_location`.`adm4`, '') AS `adm4`
FROM `caches`
INNER JOIN `user` ON `caches`.`user_id`=`user`.`user_id`
INNER JOIN `cache_desc` ON `caches`.`cache_id`=`cache_desc`.`cache_id` AND `cache_desc`.`language`=PREFERED_LANG(`caches`.`desc_languages`, '&3')
LEFT JOIN `countries` ON `caches`.`country`=`countries`.`short`
LEFT JOIN `sys_trans` AS `tCountry` ON `countries`.`trans_id`=`tCountry`.`id` AND `countries`.`name`=`tCountry`.`text`
LEFT JOIN `sys_trans_text` AS `ttCountry` ON `tCountry`.`id`=`ttCountry`.`trans_id` AND `ttCountry`.`lang`='&2'
LEFT JOIN `cache_visits` ON `cache_visits`.`cache_id`=`caches`.`cache_id` AND `user_id_ip`='0'
LEFT JOIN `stat_caches` ON `caches`.`cache_id`=`stat_caches`.`cache_id`
LEFT JOIN `cache_location` ON `caches`.`cache_id` = `cache_location`.`cache_id`
WHERE `caches`.`cache_id`='&1'", $cacheid, $opt['template']['locale'], $sPreferedDescLang, $login->userid);
$rCache = sql_fetch_assoc($rs);
sql_free_result($rs);
if ($rCache === false)
$tpl->error(ERROR_CACHE_NOT_EXISTS);
// not published?
if ($rCache['status'] == 5)
{
$tpl->caching = false;
$login->verify();
if ($rCache['userid'] != $login->userid)
$tpl->error(ERROR_CACHE_NOT_PUBLISHED);
}
$rCache['sizeName'] = labels::getLabelValue('cache_size', $rCache['size']);
$rCache['statusName'] = labels::getLabelValue('cache_status', $rCache['status']);
$rCache['typeName'] = labels::getLabelValue('cache_type', $rCache['type']);
$tpl->assign('cache', $rCache);
$tpl->title = $rCache['name'];
$tpl->display();
?>

0
htdocs/html/index.html Normal file
View File

View File

@ -0,0 +1,38 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- Unicode Reminder メモ -->
<head>
<title>Opencaching.de momentan ausser Betrieb</title>
<meta http-equiv="content-type" content="text/xhtml; charset=UTF-8" />
<meta http-equiv="Content-Language" content="de" />
<meta http-equiv="gallerimg" content="no" />
<!-- Favicon noch nicht vorhanden <link rel="shortcut icon" href="favicon.ico" />-->
<link rel="stylesheet" type="text/css" href="lang/de/ocstyle/css/main.css" />
</head>
<body>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr>
<td width="80px">
<a href="/index.php"><img src="images/logo_new_small.gif" alt="oc-Logo" style="border:0px;"/></a>
</td>
<td width="100%">
&nbsp;
</td>
<td valign="bottom">
&nbsp;
</td>
</tr>
</table>
<div id="content">
<h1>Opencaching.de momentan ausser Betrieb</h1>
<p>Opencaching.de wird gerade umgebaut und um Fehler in der Datenverarbeitung zu vermeiden, haben wir die
gesamte Seite gerade ausser Betrieb genommen.</p>
<p>Wir bitten um etwas Geduld und bem&uuml;hen uns die Seite wieder m&ouml;glichst schnell
funktionsbereit zu machen.</p>
<p>Vielen Dank,<br/>das Opencaching.de-Team</p>
</div>
<div id="footBox">
<a href="/articles.php?page=contact">Kontakt</a>
</div>
</body>
</html>

37
htdocs/htmlprev.php Normal file
View File

@ -0,0 +1,37 @@
<?php
/***************************************************************************
* You can find the license in the docs directory
*
* Unicode Reminder メモ
***************************************************************************/
require('./lib2/web.inc.php');
require_once($opt['rootpath'] . '../lib/htmlpurifier-4.2.0/library/HTMLPurifier.auto.php');
$tpl->name = 'htmlprev';
$tpl->menuitem = MNU_CACHES_HIDE_PREVIEW;
$the_text = isset($_REQUEST['thetext']) ? $_REQUEST['thetext'] : '';
$the_html = isset($_REQUEST['thehtml']) ? $_REQUEST['thehtml'] : '';
$step = isset($_REQUEST['step']) ? $_REQUEST['step']+0 : 1;
if (isset($_REQUEST['toStep2']))
{
$tpl->assign('step', 2);
if ($step == 1)
$the_html = nl2br(htmlspecialchars($the_text, ENT_COMPAT, 'UTF-8'));
}
else if (isset($_REQUEST['toStep3']))
$tpl->assign('step', 3);
else
$tpl->assign('step', 1);
$purifier = new HTMLPurifier();
$the_html = $purifier->purify($the_html);
$tpl->assign('thetext', $the_text);
$tpl->assign('thehtml', $the_html);
$tpl->display();
?>

40
htdocs/ignore.php Normal file
View File

@ -0,0 +1,40 @@
<?php
/***************************************************************************
* You can find the license in the docs directory
*
* Unicode Reminder メモ
*
* Display some status information about the server and Opencaching
***************************************************************************/
require('./lib2/web.inc.php');
$cache_id = isset($_GET['cacheid']) ? $_GET['cacheid']+0 : 0;
$action = isset($_GET['action']) ? $_GET['action'] : '';
$login->verify();
// user valid
if ($login->userid == 0)
$tpl->redirect('login.php?target=ignore.php');
// cache_id valid?
if (sql_value("SELECT COUNT(*) FROM `caches` WHERE `cache_id`='&1'", 0, $cache_id) == 0)
$tpl->error(ERROR_CACHE_NOT_EXISTS);
// action valid
if (($action != 'addignore') && ($action != 'removeignore'))
$tpl->error(ERROR_INVALID_OPERATION);
switch ($action)
{
case 'addignore':
sql("INSERT IGNORE INTO `cache_ignore` (`cache_id`, `user_id`) VALUES ('&1', '&2')", $cache_id, $login->userid);
break;
case 'removeignore':
sql("DELETE FROM `cache_ignore` WHERE `cache_id`='&1' AND `user_id`='&2'", $cache_id, $login->userid);
break;
}
$tpl->redirect('viewcache.php?cacheid=' . ($cache_id+0));
?>

34
htdocs/imagebrowser.php Normal file
View File

@ -0,0 +1,34 @@
<?php
/***************************************************************************
* You can find the license in the docs directory
*
* Unicode Reminder メモ
*
* Display some status information about the server and Opencaching
***************************************************************************/
require('./lib2/web.inc.php');
$tpl->name = 'imagebrowser';
$tpl->popup = true;
$login->verify();
$cacheid = isset($_REQUEST['cacheid']) ? $_REQUEST['cacheid']+0 : 0;
$rs = sql("SELECT `caches`.`name` FROM `caches` INNER JOIN `cache_status` ON `caches`.`status`=`cache_status`.`id` WHERE `caches`.`user_id`='&1' AND `cache_id`='&2'", $login->userid, $cacheid);
$r = sql_fetch_assoc($rs);
sql_free_result($rs);
if ($r === false)
$tpl->error(ERROR_NO_ACCESS);
$tpl->assign('cachename', $r['name']);
$rsPictures = sql('SELECT `uuid`, `url`, `title` FROM `pictures` WHERE `object_id`=&1 AND `object_type`=2', $cacheid);
$tpl->assign_rs('pictures', $rsPictures);
sql_free_result($rsPictures);
$tpl->assign('thumbwidth', $opt['logic']['pictures']['thumb_max_width']);
$tpl->display();
?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 490 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 507 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 495 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 815 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 827 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 899 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 945 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 549 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 514 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 497 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 157 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 903 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 475 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 466 B

BIN
htdocs/images/banner.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 636 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
htdocs/images/diff-10.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 554 B

BIN
htdocs/images/diff-15.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 590 B

BIN
htdocs/images/diff-20.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 646 B

BIN
htdocs/images/diff-25.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 643 B

BIN
htdocs/images/diff-30.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
htdocs/images/diff-35.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 696 B

BIN
htdocs/images/diff-40.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Some files were not shown because too many files have changed in this diff Show More