This commit is contained in:
following
2013-03-23 21:31:44 +01:00
parent 916ad9aac2
commit e281cfadc1
20 changed files with 89 additions and 49 deletions

View File

@ -60,4 +60,4 @@ date commit ID change
2013-03-24 9644465b added table 'pw_dict' 2013-03-24 9644465b added table 'pw_dict'
2013-03-25 21d92feb added field cache_reports.date_created + trigger 2013-03-25 21d92feb added field cache_reports.date_created + trigger
2013-03-27 467aae47 added fields cache_attrib.gc_id, .gc_inc and .gc_name 2013-03-27 467aae47 added fields cache_attrib.gc_id, .gc_inc and .gc_name
2013-03-28 made cache_attrib.gc_id unsigned 2013-04-06 changed cach_logs.date and cach_logs_archived.date type to datetime

View File

@ -2430,6 +2430,8 @@ INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1966', 'as of',
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1967', 'all log entries \© their authors', '2013-02-23 19:00:04'); INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1967', 'all log entries \© their authors', '2013-02-23 19:00:04');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1968', 'more', '2013-02-23 19:00:04'); INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1968', 'more', '2013-02-23 19:00:04');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1969', 'Only the <span class=\"public-setting\">green entries</span> are visible to other users.', '2013-02-23 19:00:04'); INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1969', 'Only the <span class=\"public-setting\">green entries</span> are visible to other users.', '2013-02-23 19:00:04');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1970', 'Date / time:', '2013-02-23 19:00:04');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1971', 'date or time is invalid', '2013-02-23 19:00:04');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1973', 'Generally, spoiler pictures should not be logged. In the case that en exception from this rule makes sense, e.g. to document your finding or problems with the stash, please mark the picture als spoiler so that it won\'t appear in galleries.', '2013-02-23 19:00:04'); INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1973', 'Generally, spoiler pictures should not be logged. In the case that en exception from this rule makes sense, e.g. to document your finding or problems with the stash, please mark the picture als spoiler so that it won\'t appear in galleries.', '2013-02-23 19:00:04');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1974', 'If you do not see any E-Mail, please check the spam folder of your mailbox.', '2013-02-23 19:00:04'); INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1974', 'If you do not see any E-Mail, please check the spam folder of your mailbox.', '2013-02-23 19:00:04');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1975', 'Do not use easy-to-guess number and letter sequences like \'123456\' or \'qwerty\'', '2013-02-23 19:00:04'); INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('1975', 'Do not use easy-to-guess number and letter sequences like \'123456\' or \'qwerty\'', '2013-02-23 19:00:04');
@ -6141,6 +6143,8 @@ INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUE
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1967', 'DE', 'alle Logeinträge \&copy; jeweiliger Autor', '2013-02-19 05:48:07'); INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1967', 'DE', 'alle Logeinträge \&copy; jeweiliger Autor', '2013-02-19 05:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1968', 'DE', 'mehr', '2013-02-19 05:48:07'); INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1968', 'DE', 'mehr', '2013-02-19 05:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1969', 'DE', 'Nur die <span class=\"public-setting\">grünen Einträge</span> sind für andere Benutzer sichtbar.', '2013-02-19 05:48:07'); INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1969', 'DE', 'Nur die <span class=\"public-setting\">grünen Einträge</span> sind für andere Benutzer sichtbar.', '2013-02-19 05:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1970', 'DE', 'Datum / Uhrzeit:', '2013-02-19 05:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1971', 'DE', 'Datum oder Uhrzeit ist ungültig', '2013-02-19 05:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1973', 'DE', 'Es sollten möglichst keine Spoilerbilder geloggt werden. In Ausnahmefällen, wo es sinnvoll erscheint \&ndash; z.B. um den Fund nachzuweisen oder Probleme mit dem Versteck zu dokumentieren \&ndash; kennzeichne sie bitte als Spoiler, damit sie nicht in Bildgalerien erscheinen.', '2013-02-19 05:48:07'); INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1973', 'DE', 'Es sollten möglichst keine Spoilerbilder geloggt werden. In Ausnahmefällen, wo es sinnvoll erscheint \&ndash; z.B. um den Fund nachzuweisen oder Probleme mit dem Versteck zu dokumentieren \&ndash; kennzeichne sie bitte als Spoiler, damit sie nicht in Bildgalerien erscheinen.', '2013-02-19 05:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1974', 'DE', 'Falls du keine E-Mail sehen solltest, prüfe bitte ob sie im Spam-Ordner deines Postfachs einsortiert wurde.', '2013-02-19 05:48:07'); INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1974', 'DE', 'Falls du keine E-Mail sehen solltest, prüfe bitte ob sie im Spam-Ordner deines Postfachs einsortiert wurde.', '2013-02-19 05:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1975', 'DE', 'Verwende keine einfach erratbaren Ziffern- oder Buchstabenkombinationen wie \&bdquo;123456\&ldquo; oder \&bdquo;qwertz\&ldquo;.', '2013-02-19 05:48:07'); INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1975', 'DE', 'Verwende keine einfach erratbaren Ziffern- oder Buchstabenkombinationen wie \&bdquo;123456\&ldquo; oder \&bdquo;qwertz\&ldquo;.', '2013-02-19 05:48:07');

View File

@ -9,7 +9,7 @@ CREATE TABLE `cache_logs` (
`cache_id` int(10) unsigned NOT NULL, `cache_id` int(10) unsigned NOT NULL,
`user_id` int(10) unsigned NOT NULL, `user_id` int(10) unsigned NOT NULL,
`type` tinyint(3) unsigned NOT NULL, `type` tinyint(3) unsigned NOT NULL,
`date` date NOT NULL, `date` datetime NOT NULL,
`text` mediumtext NOT NULL, `text` mediumtext NOT NULL,
`text_html` tinyint(1) NOT NULL default '0', `text_html` tinyint(1) NOT NULL default '0',
`text_htmledit` tinyint(1) NOT NULL default '0', `text_htmledit` tinyint(1) NOT NULL default '0',

View File

@ -9,7 +9,7 @@ CREATE TABLE `cache_logs_archived` (
`cache_id` int(10) unsigned NOT NULL, `cache_id` int(10) unsigned NOT NULL,
`user_id` int(10) unsigned NOT NULL, `user_id` int(10) unsigned NOT NULL,
`type` tinyint(3) unsigned NOT NULL, `type` tinyint(3) unsigned NOT NULL,
`date` date NOT NULL, `date` datetime NOT NULL,
`text` mediumtext NOT NULL, `text` mediumtext NOT NULL,
`text_html` tinyint(1) NOT NULL, `text_html` tinyint(1) NOT NULL,
`text_htmledit` tinyint(1) NOT NULL, `text_htmledit` tinyint(1) NOT NULL,

View File

@ -92,9 +92,11 @@
$cache_user_id = $log_record['cache_user_id']; $cache_user_id = $log_record['cache_user_id'];
$log_type = isset($_POST['logtype']) ? $_POST['logtype'] : $log_record['logtype']; $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_day = isset($_POST['logday']) ? trim($_POST['logday']) : date('d', strtotime($log_record['date']));
$log_date_month = isset($_POST['logmonth']) ? $_POST['logmonth'] : date('m', strtotime($log_record['date'])); $log_date_month = isset($_POST['logmonth']) ? trim($_POST['logmonth']) : date('m', strtotime($log_record['date']));
$log_date_year = isset($_POST['logyear']) ? $_POST['logyear'] : date('Y', strtotime($log_record['date'])); $log_date_year = isset($_POST['logyear']) ? trim($_POST['logyear']) : date('Y', strtotime($log_record['date']));
$log_time_hour = isset($_POST['loghour']) ? trim($_POST['loghour']) : (substr($log_record['date'],11) == "00:00:00" ? "" : date('H', strtotime($log_record['date'])));
$log_time_minute = isset($_POST['logminute']) ? trim($_POST['logminute']) : (substr($log_record['date'],11) == "00:00:00" ? "" : date('i', strtotime($log_record['date'])));
$top_option = isset($_POST['ratingoption']) ? $_POST['ratingoption']+0 : 0; $top_option = isset($_POST['ratingoption']) ? $_POST['ratingoption']+0 : 0;
$top_cache = isset($_POST['rating']) ? $_POST['rating']+0 : 0; $top_cache = isset($_POST['rating']) ? $_POST['rating']+0 : 0;
@ -183,15 +185,19 @@
//validate date //validate date
$date_ok = false; $date_ok = false;
if (is_numeric($log_date_day) && is_numeric($log_date_month) && is_numeric($log_date_year)) if (is_numeric($log_date_month) && is_numeric($log_date_day) && is_numeric($log_date_year) &&
("$log_time_hour$log_time_minute"=="" || is_numeric($log_time_hour)) &&
($log_time_minute=="" || is_numeric($log_time_minute)))
{ {
if (checkdate($log_date_month, $log_date_day, $log_date_year) && $date_ok = checkdate($log_date_month, $log_date_day, $log_date_year)
$log_date_year >= 2000) && ($log_date_year >= 2000)
$date_ok = true; && ($log_time_hour>=0) && ($log_time_hour<=23)
&& ($log_time_minute>=0) && ($log_time_minute<=59);
if ($date_ok) if ($date_ok)
if (isset($_POST['submitform'])) if (isset($_POST['submitform']))
if (mktime(0, 0, 0, $log_date_month, $log_date_day, $log_date_year) >= mktime()) if (mktime($log_time_hour+0, $log_time_minute+0, 0,
$date_ok = false; $log_date_month, $log_date_day, $log_date_year) >= mktime())
$date_ok = false;
} }
$logtype_ok = sqlValue("SELECT COUNT(*) FROM cache_logtype WHERE cache_type_id='" . sql_escape($cache_type) . "' AND log_type_id='" . sql_escape($log_type) . "'", 0) > 0; $logtype_ok = sqlValue("SELECT COUNT(*) FROM cache_logtype WHERE cache_type_id='" . sql_escape($cache_type) . "' AND log_type_id='" . sql_escape($log_type) . "'", 0) > 0;
@ -212,7 +218,15 @@
//store? //store?
if (isset($_POST['submitform']) && $date_ok && $logtype_ok && $pw_ok) if (isset($_POST['submitform']) && $date_ok && $logtype_ok && $pw_ok)
{ {
$log_date = date('Y-m-d', mktime(0, 0, 0, $log_date_month, $log_date_day, $log_date_year)); // 00:00:01 = "00:00 was logged"
// 00:00:00 = "no time was logged"
if ("$log_time_hour$log_time_minute" != "" &&
$log_time_hour == 0 && $log_time_minute == 0)
$log_time_second = 1;
else
$log_time_second = 0;
$log_date = date('Y-m-d H:i:s', mktime($log_time_hour+0, $log_time_minute+0, $log_time_second, $log_date_month, $log_date_day, $log_date_year));
//store changed data //store changed data
sql("UPDATE `cache_logs` SET `type`='&1', sql("UPDATE `cache_logs` SET `type`='&1',
@ -278,6 +292,8 @@
tpl_set_var('logday', htmlspecialchars($log_date_day, ENT_COMPAT, 'UTF-8')); 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('logmonth', htmlspecialchars($log_date_month, ENT_COMPAT, 'UTF-8'));
tpl_set_var('logyear', htmlspecialchars($log_date_year, ENT_COMPAT, 'UTF-8')); tpl_set_var('logyear', htmlspecialchars($log_date_year, ENT_COMPAT, 'UTF-8'));
tpl_set_var('loghour', htmlspecialchars($log_time_hour, ENT_COMPAT, 'UTF-8'));
tpl_set_var('logminute', htmlspecialchars($log_time_minute, ENT_COMPAT, 'UTF-8'));
tpl_set_var('cachename', htmlspecialchars($cache_name, 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('cacheid', $log_record['cache_id']);
tpl_set_var('reset', $reset); tpl_set_var('reset', $reset);

View File

@ -19,7 +19,7 @@
$error_wrong_node = t('This log entry has been created on another Opencaching website. The cache can only be edited there.'); $error_wrong_node = t('This log entry has been created on another Opencaching website. The cache can only be edited there.');
$date_message = '<span class="errormsg">' . t('date is invalid') . '</span>'; $date_message = '<span class="errormsg">' . t('date or time is invalid') . '</span>';
$smiley_link = '<a href="javascript:insertSmiley(\'{smiley_text}\')">{smiley_image}</a>'; $smiley_link = '<a href="javascript:insertSmiley(\'{smiley_text}\')">{smiley_image}</a>';
$log_pw_field = '<tr><td colspan="2">' . t('passwort to log:') . ' <input class="input100" type="text" name="log_pw" maxlength="20" value="" /> ' . t('(only for found logs)') . '</td></tr> $log_pw_field = '<tr><td colspan="2">' . t('passwort to log:') . ' <input class="input100" type="text" name="log_pw" maxlength="20" value="" /> ' . t('(only for found logs)') . '</td></tr>

View File

@ -94,12 +94,15 @@ function _chkFound () {
<tr><td class="spacer" colspan="2"></td></tr> <tr><td class="spacer" colspan="2"></td></tr>
<tr> <tr>
<td width="180px">{t}Date:{/t}</td> <td width="180px">{t}Date / time:{/t}</td>
<td align="left"> <td align="left">
<input class="input20" type="text" name="logday" maxlength="2" value="{logday}"/>. <input class="input20" type="text" name="logday" maxlength="2" value="{logday}"/>.
<input class="input20" type="text" name="logmonth" maxlength="2" value="{logmonth}"/>. <input class="input20" type="text" name="logmonth" maxlength="2" value="{logmonth}"/>.
<input class="input40" type="text" name="logyear" maxlength="4" value="{logyear}"/> <input class="input40" type="text" name="logyear" maxlength="4" value="{logyear}"/>
{date_message} &nbsp;&nbsp;&nbsp;
<input class="input20" type="text" name="loghour" maxlength="2" value="{loghour}" /> :
<input class="input20" type="text" name="logminute" maxlength="2" value="{logminute}" />
&nbsp;&nbsp;{date_message}
</td> </td>
</tr> </tr>
<tr><td class="spacer" colspan="2"></td></tr> <tr><td class="spacer" colspan="2"></td></tr>

View File

@ -18,7 +18,7 @@
****************************************************************************/ ****************************************************************************/
$submit = t('Log this cache'); $submit = t('Log this cache');
$date_message = '<span class="errormsg">' . t('date is invalid') . '</span>'; $date_message = '<span class="errormsg">' . t('date or time is invalid') . '</span>';
// Ocprop: <td colspan=\"2\">\s*Kennwort zum Loggen:\s*<input // Ocprop: <td colspan=\"2\">\s*Kennwort zum Loggen:\s*<input
$log_pw_field = '<tr><td colspan="2">' . t('passwort to log:') . ' <input class="input100" type="text" name="log_pw" maxlength="20" value="" /> ' . t('(only for found-logs)') . '</td></tr><tr><td class="spacer" colspan="2"></td></tr>'; $log_pw_field = '<tr><td colspan="2">' . t('passwort to log:') . ' <input class="input100" type="text" name="log_pw" maxlength="20" value="" /> ' . t('(only for found-logs)') . '</td></tr><tr><td class="spacer" colspan="2"></td></tr>';

View File

@ -77,7 +77,7 @@ function _chkFound () {
<input type="hidden" name="version3" value="1"/> <input type="hidden" name="version3" value="1"/>
<input id="descMode" type="hidden" name="descMode" value="1" /> <input id="descMode" type="hidden" name="descMode" value="1" />
<table class="table"> <table class="table">
<tr><td colspan="2">&nbsp;</td></tr> <tr><td colspan="2"></td></tr>
<tr> <tr>
<td width="180px">{t}Type of log-entry:{/t}</td> <td width="180px">{t}Type of log-entry:{/t}</td>
<td> <td>
@ -88,12 +88,15 @@ function _chkFound () {
</tr> </tr>
<tr><td class="spacer" colspan="2"></td></tr> <tr><td class="spacer" colspan="2"></td></tr>
<tr> <tr>
<td width="180px">{t}Date:{/t}</td> <td width="180px">{t}Date / time:{/t}</td>
<td> <td>
<input class="input20" type="text" name="logday" maxlength="2" value="{logday}"/>. <input class="input20" type="text" name="logday" maxlength="2" value="{logday}"/>.
<input class="input20" type="text" name="logmonth" maxlength="2" value="{logmonth}"/>. <input class="input20" type="text" name="logmonth" maxlength="2" value="{logmonth}"/>.
<input class="input40" type="text" name="logyear" maxlength="4" value="{logyear}"/> <input class="input40" type="text" name="logyear" maxlength="4" value="{logyear}"/>
{date_message} &nbsp;&nbsp;&nbsp;
<input class="input20" type="text" name="loghour" maxlength="2" value="{loghour}" /> :
<input class="input20" type="text" name="logminute" maxlength="2" value="{logminute}" />
&nbsp;&nbsp;{date_message}
</td> </td>
</tr> </tr>
<tr><td class="spacer" colspan="2"></td></tr> <tr><td class="spacer" colspan="2"></td></tr>

View File

@ -28,7 +28,7 @@
<tr> <tr>
<td>&nbsp;&nbsp;&nbsp;</td> <td>&nbsp;&nbsp;&nbsp;</td>
<td> <td>
{logimage} {date} {typetext} {logimage} {date}{time} &nbsp; {typetext}
</td> </td>
</tr> </tr>
<tr><td class="spacer"></td></tr> <tr><td class="spacer"></td></tr>

View File

@ -32,7 +32,7 @@
<tr> <tr>
<td>&nbsp;&nbsp;&nbsp;</td> <td>&nbsp;&nbsp;&nbsp;</td>
<td> <td>
{logimage} {date} {typetext} {logimage} {date}{time} &nbsp; {typetext}
</td> </td>
</tr> </tr>
<tr><td class="spacer"></td></tr> <tr><td class="spacer"></td></tr>

View File

@ -73,18 +73,6 @@
$module, $eventid, $userid, $objectid1, $objectid2, $logtext, serialize($details)); $module, $eventid, $userid, $objectid1, $objectid2, $logtext, serialize($details));
} }
function setLastFound($cacheid)
{
$rs = sql("SELECT MAX(`date`) `date` FROM `cache_logs` WHERE `cache_id`=&1 AND `type`=1", $cacheid);
$r = sql_fetch_array($rs);
mysql_free_result($rs);
if ($r['date'] == null)
sql("UPDATE `caches` SET `last_found`=null WHERE `cache_id`=&1", $cacheid);
else
sql("UPDATE `caches` SET `last_found`='&1' WHERE `cache_id`=&2", $r['date'], $cacheid);
}
// read a file and return it as a string // read a file and return it as a string
// WARNING: no huge files! // WARNING: no huge files!
function read_file($file='') function read_file($file='')

View File

@ -254,7 +254,11 @@ Logeinträge:
$thislog = $txtLogs; $thislog = $txtLogs;
$thislog = mb_ereg_replace('{id}', $rLog['id'], $thislog); $thislog = mb_ereg_replace('{id}', $rLog['id'], $thislog);
$thislog = mb_ereg_replace('{date}', date('d.m.Y', strtotime($rLog['date'])), $thislog); if (substr($rLog['date'],11) == "00:00:00")
$dateformat = "d.m.Y";
else
$dateformat = "d.m.Y H:i";
$thislog = mb_ereg_replace('{date}', date($dateformat, strtotime($rLog['date'])), $thislog);
$thislog = mb_ereg_replace('{username}', $rLog['username'], $thislog); $thislog = mb_ereg_replace('{username}', $rLog['username'], $thislog);
$logtype = $rLog['type']; $logtype = $rLog['type'];

View File

@ -42,8 +42,6 @@
</cache> </cache>
"; ";
$txtLogs = "";
//prepare the output //prepare the output
$caches_per_page = 20; $caches_per_page = 20;

View File

@ -295,6 +295,7 @@ class cache
`cache_logs`.`id` AS `id`, `cache_logs`.`id` AS `id`,
`cache_logs`.`uuid` AS `uuid`, `cache_logs`.`uuid` AS `uuid`,
`cache_logs`.`date` AS `date`, `cache_logs`.`date` AS `date`,
substr(`cache_logs`.`date`,12) AS `time`, /* 00:00:01 = 00:00 logged, 00:00:00 = no time */
`cache_logs`.`type` AS `type`, `cache_logs`.`type` AS `type`,
`cache_logs`.`text` AS `text`, `cache_logs`.`text` AS `text`,
`cache_logs`.`text_html` AS `texthtml`, `cache_logs`.`text_html` AS `texthtml`,

View File

@ -96,9 +96,11 @@
$all_ok = false; $all_ok = false;
$log_text = isset($_POST['logtext']) ? ($_POST['logtext']) : ''; $log_text = isset($_POST['logtext']) ? ($_POST['logtext']) : '';
$log_type = isset($_POST['logtype']) ? ($_POST['logtype']+0) : 1; $log_type = isset($_POST['logtype']) ? ($_POST['logtype']+0) : 1;
$log_date_day = isset($_POST['logday']) ? ($_POST['logday']+0) : date('d'); $log_date_day = isset($_POST['logday']) ? trim($_POST['logday']) : date('d');
$log_date_month = isset($_POST['logmonth']) ? ($_POST['logmonth']+0) : date('m'); $log_date_month = isset($_POST['logmonth']) ? trim($_POST['logmonth']) : date('m');
$log_date_year = isset($_POST['logyear']) ? ($_POST['logyear']+0) : date('Y'); $log_date_year = isset($_POST['logyear']) ? trim($_POST['logyear']) : date('Y');
$log_time_hour = isset($_POST['loghour']) ? trim($_POST['loghour']) : "";
$log_time_minute = isset($_POST['logminute']) ? trim($_POST['logminute']) : "";
$top_option = isset($_POST['ratingoption']) ? $_POST['ratingoption']+0 : 0; $top_option = isset($_POST['ratingoption']) ? $_POST['ratingoption']+0 : 0;
$top_cache = isset($_POST['rating']) ? $_POST['rating']+0 : 0; $top_cache = isset($_POST['rating']) ? $_POST['rating']+0 : 0;
@ -156,14 +158,19 @@
$log_text = nl2br(htmlspecialchars($log_text, ENT_COMPAT, 'UTF-8')); $log_text = nl2br(htmlspecialchars($log_text, ENT_COMPAT, 'UTF-8'));
} }
//validate data // validate data
if (is_numeric($log_date_month) && is_numeric($log_date_day) && is_numeric($log_date_year)) if (is_numeric($log_date_month) && is_numeric($log_date_day) && is_numeric($log_date_year) &&
("$log_time_hour$log_time_minute"=="" || is_numeric($log_time_hour)) &&
($log_time_minute=="" || is_numeric($log_time_minute)))
{ {
$date_ok = checkdate($log_date_month, $log_date_day, $log_date_year) $date_ok = checkdate($log_date_month, $log_date_day, $log_date_year)
&& ($log_date_year >= 2000); && ($log_date_year >= 2000)
&& ($log_time_hour>=0) && ($log_time_hour<=23)
&& ($log_time_minute>=0) && ($log_time_minute<=59);
if ($date_ok) if ($date_ok)
if (isset($_POST['submitform'])) if (isset($_POST['submitform']))
if (mktime(0, 0, 0, $log_date_month, $log_date_day, $log_date_year) >= mktime()) if (mktime($log_time_hour+0, $log_time_minute+0, 0,
$log_date_month, $log_date_day, $log_date_year) >= mktime())
$date_ok = false; $date_ok = false;
} }
else else
@ -191,7 +198,15 @@
if (isset($_POST['submitform']) && ($all_ok == true)) if (isset($_POST['submitform']) && ($all_ok == true))
{ {
$log_date = date('Y-m-d', mktime(0, 0, 0, $log_date_month, $log_date_day, $log_date_year)); // 00:00:01 = "00:00 was logged"
// 00:00:00 = "no time was logged"
if ("$log_time_hour$log_time_minute" != "" &&
$log_time_hour == 0 && $log_time_minute == 0)
$log_time_second = 1;
else
$log_time_second = 0;
$log_date = date('Y-m-d H:i:s', mktime($log_time_hour+0, $log_time_minute+0, $log_time_second, $log_date_month, $log_date_day, $log_date_year));
// add logentry to db if not already exists (e.g. by multiple sending the form // add logentry to db if not already exists (e.g. by multiple sending the form
// or by ocprop errors) // or by ocprop errors)
@ -270,6 +285,8 @@
tpl_set_var('logday', htmlspecialchars($log_date_day, ENT_COMPAT, 'UTF-8')); 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('logmonth', htmlspecialchars($log_date_month, ENT_COMPAT, 'UTF-8'));
tpl_set_var('logyear', htmlspecialchars($log_date_year, ENT_COMPAT, 'UTF-8')); tpl_set_var('logyear', htmlspecialchars($log_date_year, ENT_COMPAT, 'UTF-8'));
tpl_set_var('loghour', htmlspecialchars($log_time_hour, ENT_COMPAT, 'UTF-8'));
tpl_set_var('logminute', htmlspecialchars($log_time_minute, ENT_COMPAT, 'UTF-8'));
tpl_set_var('logtypeoptions', $logtypeoptions); tpl_set_var('logtypeoptions', $logtypeoptions);
tpl_set_var('reset', $reset); tpl_set_var('reset', $reset);
tpl_set_var('submit', $submit); tpl_set_var('submit', $submit);

View File

@ -219,6 +219,7 @@
tpl_set_var('logimage', icon_log_type($log_record['icon_small'], "")); tpl_set_var('logimage', icon_log_type($log_record['icon_small'], ""));
tpl_set_var('date', htmlspecialchars(strftime($dateformat, strtotime($log_record['log_date'])), ENT_COMPAT, 'UTF-8')); tpl_set_var('date', htmlspecialchars(strftime($dateformat, strtotime($log_record['log_date'])), ENT_COMPAT, 'UTF-8'));
tpl_set_var('time', substr($log_record['log_date'],11)=="00:00:00" ? "" : ", " . substr($log_record['log_date'],11,5));
tpl_set_var('userid', htmlspecialchars($log_record['log_user_id'] + 0, ENT_COMPAT, 'UTF-8')); tpl_set_var('userid', htmlspecialchars($log_record['log_user_id'] + 0, ENT_COMPAT, 'UTF-8'));
tpl_set_var('username', htmlspecialchars($log_record['log_username'], ENT_COMPAT, 'UTF-8')); tpl_set_var('username', htmlspecialchars($log_record['log_username'], ENT_COMPAT, 'UTF-8'));
tpl_set_var('typetext', htmlspecialchars($sLogTypeText, ENT_COMPAT, 'UTF-8')); tpl_set_var('typetext', htmlspecialchars($sLogTypeText, ENT_COMPAT, 'UTF-8'));

View File

@ -674,3 +674,5 @@ div.gsc-resultsRoot, div.gsc-branding-text, img.gsc-branding-img {
.garmintext { .garmintext {
font-size: 1.1em; font-size: 1.1em;
} }
p.editlog { display:none; }

View File

@ -1422,3 +1422,5 @@ div#havefound {
#forum div.rsstext {margin: 0px 30px 0.5em 0px; padding: 0px; line-height: 1.3em; font-family: arial, sans serif; font-size: 12px; } #forum div.rsstext {margin: 0px 30px 0.5em 0px; padding: 0px; line-height: 1.3em; font-family: arial, sans serif; font-size: 12px; }
.quoteheader, .topslice_quote, .bbc_standard_quote { display:none; } .quoteheader, .topslice_quote, .bbc_standard_quote { display:none; }
#forum div.rsstext img {max-width:200px; max-height:120px;} #forum div.rsstext img {max-width:200px; max-height:120px;}
p.editlog { font-weight: 400; display:inline; }

View File

@ -5,12 +5,12 @@
***************************************************************************} ***************************************************************************}
<div class="content-txtbox-noshade"> {* Ocprop: <div class="content-txtbox-noshade">(.*?)<\/div> *} <div class="content-txtbox-noshade"> {* Ocprop: <div class="content-txtbox-noshade">(.*?)<\/div> *}
<div class="logs" id="log{$logItem.id}"> <div class="logs" id="log{$logItem.id}">
<p class="content-title-noshade-size1" style="display:inline;"> <p class="content-title-noshade-size1" style="display:inline; margin-right:0">
{include file="res_logtype.tpl" type=$logItem.type} {include file="res_logtype.tpl" type=$logItem.type}
{if $logItem.recommended==1} {if $logItem.recommended==1} {* Ocprop: rating-star\.gif *}
<img src="images/rating-star.gif" border="0" alt="{t}Recommended{/t}" width="17px" height="16px" /> <img src="images/rating-star.gif" border="0" alt="{t}Recommended{/t}" width="17px" height="16px" />
{/if} {/if}
{$logItem.date|date_format:$opt.format.datelong} {$logItem.date|date_format:$opt.format.datelong}{if $logItem.time!="00:00:00"}, {$logItem.time|substr:0:5}{/if}
{capture name=username} {capture name=username}
<a href="viewprofile.php?userid={$logItem.userid}">{$logItem.username|escape}</a> <a href="viewprofile.php?userid={$logItem.userid}">{$logItem.username|escape}</a>
@ -31,8 +31,9 @@
{/if} {/if}
</p> </p>
{* Ocprop: /\?logid=([0-9a-f\-]+)" *}
{if $cache.userid==$login.userid || $logItem.userid==$login.userid} {if $cache.userid==$login.userid || $logItem.userid==$login.userid}
<p style="font-weight: 400;display:inline;"><img src="images/trans.gif" border="0" width="16" height="16" alt="" title="" /> <p class="editlog"><img src="images/trans.gif" border="0" width="16" height="16" alt="" title="" />
{if $logItem.userid==$login.userid && ($cache.userid==$login.userid || $cache.status!=6)} {if $logItem.userid==$login.userid && ($cache.userid==$login.userid || $cache.status!=6)}
<a href="editlog.php?logid={$logItem.id|urlencode}"><img src="resource2/{$opt.template.style}/images/action/16x16-properties.png" border="0" align="middle" border="0" width="16" height="16" alt="" /></a> <a href="editlog.php?logid={$logItem.id|urlencode}"><img src="resource2/{$opt.template.style}/images/action/16x16-properties.png" border="0" align="middle" border="0" width="16" height="16" alt="" /></a>
[<a href="editlog.php?logid={$logItem.id|urlencode}">{t}Edit{/t}</a>] [<a href="editlog.php?logid={$logItem.id|urlencode}">{t}Edit{/t}</a>]