Skip to content
Permalink
Browse files

added masslog warning from following, updates #217, updates #206

  • Loading branch information...
bohrsty authored and following5 committed Jun 20, 2013
1 parent c6fa97b commit bd33e67c9000d3c855b10d311d756c3895f7c291
Showing with 51 additions and 3 deletions.
  1. +41 −1 htdocs/lib2/logic/cachelog.class.php
  2. +2 −1 htdocs/log.php
  3. +8 −1 htdocs/templates2/ocstyle/log_cache.tpl
@@ -292,5 +292,45 @@ static function isDuplicate($cacheId, $userId, $logType, $logDate, $logText)
0,
$cacheId, $userId, $logType, $logDate, $logText) != 0);
}
static function isMasslogging($userId)
{
// check for wrong-dated mass logs
$rs = sql("
SELECT `date`, `text`
FROM `cache_logs`
WHERE `id`= (
SELECT `id`
FROM `cache_logs`
WHERE `user_id`='&1'
ORDER BY `date_created` DESC,
`id` DESC
LIMIT 1)",
$userId);
$rLastLog = sql_fetch_array($rs);
sql_free_result($rs);
if ($rLastLog)
{
$rs = sql("
SELECT COUNT(*) as `masslogs`
FROM `cache_logs`
WHERE `user_id`='&1'
AND `date`='&2'
AND `text`='&3'",
$userId,
$rLastLog['date'],
$rLastLog['text']);
$r = sql_fetch_array($rs);
$masslogs = $r['masslogs'];
sql_free_result($rs);
}
else
$masslogs = 0;
return ($masslogs > 20);
}
}
?>
?>
@@ -243,7 +243,8 @@
$tpl->assign('octeamcommentallowed', $cache->teamcommentAllowed(3));
$tpl->assign('octeamcomment', ($ocTeamComment || (!$cache->allowLog() && $useradmin)) ? true : false);
$tpl->assign('octeamcommentclass', (!$cache->allowLog() && $useradmin) ? 'redtext' : '');
// masslogs
$tpl->assign('masslog', cachelog::isMasslogging($user->getUserId()));
}
else
@@ -56,7 +56,14 @@ function _chkFound () {
<img src="resource2/{$opt.template.style}/images/description/22x22-logs.png" style="align: left; margin-right: 10px;" width="22" height="22" alt="{t}New log-entry{/t}" />
{t}Add log-entry for the cache{/t} <a href="viewcache.php?cacheid={$cacheid}">{$cachename|escape}</a>
</div>
{if $masslog==true}
<p class="redtext">
{t}You submitted more than 20 identical logs. Please make sure that you are entering the date of your cache visit, not the current date - also when "late logging" old finds.{/t}
</p>
<p>
{t}Wrong log dates can adversly affect several OC functions like searching by last log date. Also, the owner and other caches may think that the cache has been currently found date and type of the last log are shown in the owner's caches list!), which can adversely affect cache maintenance and lead to more DNFs.{/t}
</p>
{/if}
<form action="log.php" method="post" enctype="application/x-www-form-urlencoded" name="logform" dir="ltr">
<input type="hidden" name="cacheid" value="{$cacheid}"/>
<input type="hidden" name="version3" value="1"/>

0 comments on commit bd33e67

Please sign in to comment.
You can’t perform that action at this time.