added OConly statistics to user profile
This commit is contained in:
@@ -693,6 +693,7 @@ INSERT INTO `profile_options` (`id`, `name`, `trans_id`, `internal_use`, `defaul
|
||||
INSERT INTO `profile_options` (`id`, `name`, `trans_id`, `internal_use`, `default_value`, `check_regex`, `option_order`, `option_input`, `optionset`) VALUES ('9', 'Cache icons', '1872', '1', '1', '^[1-9]$', '140', 'select:1=classic OC,', '2');
|
||||
INSERT INTO `profile_options` (`id`, `name`, `trans_id`, `internal_use`, `default_value`, `check_regex`, `option_order`, `option_input`, `optionset`) VALUES ('10', 'Show %1preview pictures</a><br />(% of map area, 0=off)', '1928', '1', '7', '^[0-5]?[0-9]$', '150', 'text', '2');
|
||||
INSERT INTO `profile_options` (`id`, `name`, `trans_id`, `internal_use`, `default_value`, `check_regex`, `option_order`, `option_input`, `optionset`) VALUES ('11', 'Show picture stats and gallery', '1944', '1', '1', '^[0-1]$', '60', 'checkbox', '1');
|
||||
INSERT INTO `profile_options` (`id`, `name`, `trans_id`, `internal_use`, `default_value`, `check_regex`, `option_order`, `option_input`, `optionset`) VALUES ('13', 'Show OConly-81 stats', '2135', '1', '0', '^[0-1]$', '65', 'checkbox', '1');
|
||||
|
||||
-- Table replication_overwritetypes
|
||||
SET NAMES 'utf8';
|
||||
@@ -2555,6 +2556,10 @@ INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2131', 'If you
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2132', 'You can offer this Geocache to more than one user. The first user committing the adoption will get the new owner of this Geocache. With the adoption, you will give the committing user an unlimited right to use, modifiy, publish and sublicense content of this Geocache.', '2010-08-28 11:48:04');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2133', 'Copy EN', '2010-08-28 11:48:04');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2134', 'I know what I am doing, do not show this advice again today.', '2010-09-07 20:19:07');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2135', 'Show OConly-81 stats', '2010-09-07 20:19:07');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2136', 'OConly statistics', '2010-09-07 20:19:07');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2137', 'The user has found %1 of 81 theoretically possible terrain/difficulty combinations.', '2010-09-07 20:19:07');
|
||||
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2138', 'Finds by region', '2010-09-07 20:19:07');
|
||||
|
||||
-- Table sys_trans_ref
|
||||
SET NAMES 'utf8';
|
||||
@@ -6568,6 +6573,10 @@ INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUE
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2132', 'DE', 'Du kannst einen Geocache mehreren Benutzern zur Adoption anbieten. Der erste Benutzer, der die Adoption bestätigt, wird der neue Besitzer des Geocaches. Mit der Adoption gibst du dem Benutzer ein unbeschränktes Recht, urheberrechtlich geschützte Inhalte dieses Geocaches zu nutzen, zu modifizieren und weiterzugeben.', '2010-08-28 11:48:07');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2133', 'DE', 'EN kopieren', '2010-08-28 11:48:07');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2134', 'DE', 'Ich weiß was ich tue \– diesen Hinweis heute nicht mehr anzeigen.', '2010-08-28 11:48:07');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2135', 'DE', 'OConly81-Statistik anzeigen', '2010-08-28 11:48:07');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2136', 'DE', 'OConly-Statistik', '2010-08-28 11:48:07');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2137', 'DE', 'Der Benutzer hat %1 von 81 theoretisch möglichen Gelände/Schwierigkeit-Kombinationen gefunden.', '2010-08-28 11:48:07');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2138', 'DE', 'Funde nach Region', '2010-08-28 11:48:07');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1', 'EN', 'Reorder IDs', '2010-09-02 00:15:30');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2', 'EN', 'The database could not be reconnected.', '2010-08-28 11:48:07');
|
||||
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('3', 'EN', 'Testing – please do not login', '2010-08-28 11:48:07');
|
||||
|
@@ -138,6 +138,7 @@ class OcSmarty extends Smarty
|
||||
function display($dummy1=null, $dummy2=null, $dummy3=null)
|
||||
{
|
||||
global $opt, $db, $cookie, $login, $menu, $sqldebugger, $translate;
|
||||
global $useragent_msie;
|
||||
$cookie->close();
|
||||
|
||||
// if the user is an admin, dont cache the content
|
||||
@@ -184,6 +185,7 @@ class OcSmarty extends Smarty
|
||||
$optn['geokrety'] = $opt['geokrety'];
|
||||
$optn['template']['usercountrieslist'] = labels::getLabels('usercountrieslist');
|
||||
$optn['help']['oconly'] = helppagelink('oconly','OConly');
|
||||
$optn['msie'] = $useragent_msie;
|
||||
|
||||
// url-sessions? (for session timout display)
|
||||
$optn['session']['url'] = false;
|
||||
|
@@ -72,6 +72,7 @@
|
||||
define('USR_OPT_MAP_PREVIEW', 10);
|
||||
define('USR_OPT_PICSTAT', 11);
|
||||
define('USR_OPT_TRANSLANG', 12);
|
||||
define('USR_OPT_OCONLY81', 13);
|
||||
|
||||
// user.data_license values
|
||||
define('OLD_DATA_LICSENSE',0); // before deadline
|
||||
|
@@ -340,6 +340,13 @@ div.changelog ul li ul {font-size: 83%; margin:0}
|
||||
.narrowtable th {margin: 0px; background-color: #deebcd; color: #404040; padding: 2px 7px 2px 7px; border-top: solid 1px #404040; border-bottom: solid 1px #404040; empty-cells: show; text-align: left; font-size: 120%; }
|
||||
.narrowtable-caption {margin: 0.5em 0px 1.0em 30px; padding: 0px; clear: both; text-align: left; font-size: 120%;}
|
||||
|
||||
.stattable { font-size:10px; line-height:1.4em; padding:0; background-color: white; }
|
||||
.stattable th { background-color: #deebcd; color: #404040; border:0; min-width: 1.8em; line-height:1.4em; }
|
||||
.stattable th.h1 { background-color: #fff; }
|
||||
span.percent { font-size: 11px; }
|
||||
|
||||
|
||||
|
||||
td.listicon {
|
||||
width:1%;
|
||||
margin-right:0 !important;
|
||||
@@ -367,9 +374,8 @@ td.search_listcolor2 { background:#f0f0f0; }
|
||||
.img-right-border-topmargin {float: right; margin: 3px 0px 0px 10px; border: solid 1px rgb(150,150,150);}
|
||||
|
||||
/* Other */
|
||||
div.default {
|
||||
font-size:110%;
|
||||
}
|
||||
div.default { font-size:110%; }
|
||||
td.default { font-size:12px; }
|
||||
|
||||
/* Links */
|
||||
a.nooutline:focus { outline: 0; }
|
||||
|
@@ -410,6 +410,7 @@
|
||||
$options['orderRatingFirst'] = true;
|
||||
|
||||
$options['country'] = isset($_REQUEST['country']) ? $_REQUEST['country'] : '';
|
||||
$options['adm2'] = isset($_REQUEST['adm2']) ? $_REQUEST['adm2'] : '';
|
||||
$options['cachetype'] = isset($_REQUEST['cachetype']) ? $_REQUEST['cachetype'] : '';
|
||||
|
||||
$options['cachesize'] = isset($_REQUEST['cachesize']) ? $_REQUEST['cachesize'] : '';
|
||||
@@ -1015,12 +1016,20 @@
|
||||
// ignore NC listings, which are mostly unmaintained or dead
|
||||
$sql_where[] = "`caches`.`wp_gc_maintained`=''";
|
||||
}
|
||||
|
||||
if (!isset($options['country'])) $options['country']='';
|
||||
if ($options['country'] != '')
|
||||
{
|
||||
$sql_where[] = '`caches`.`country`=\'' . sql_escape($options['country']) . '\'';
|
||||
}
|
||||
|
||||
if (!isset($options['adm2'])) $options['adm2']='';
|
||||
if ($options['adm2'] != '')
|
||||
{
|
||||
$sql_innerjoin[] = '`cache_location` ON `cache_location`.`cache_id`=`caches`.`cache_id`';
|
||||
$sql_where[] = '`cache_location`.`code2`=\'' . sql_escape($options['adm2']) . '\'';
|
||||
}
|
||||
|
||||
if ($options['cachetype'] != '')
|
||||
{
|
||||
$types = explode(';', $options['cachetype']);
|
||||
|
@@ -5,27 +5,28 @@
|
||||
***************************************************************************}
|
||||
{strip} {* OCSTYLE *}
|
||||
{*cachetype=1 status=1 logtype=0 owner=false small=false*}
|
||||
{if !isset($alignicon)}{assign var="alignicon" value="left"}{/if}
|
||||
|
||||
{if $cachetype==1}
|
||||
<img src="{$opt.page.absolute_urlpath}resource2/{$opt.template.style}/images/cacheicon/unknown.gif" alt="{t}Unknown Geocache{/t}" title="{t}Unknown Geocache{/t}" border="0" width="22" height="22" align="left" style="margin-right: 5px;" />
|
||||
<img src="{$opt.page.absolute_urlpath}resource2/{$opt.template.style}/images/cacheicon/unknown.gif" alt="{t}Unknown Geocache{/t}" title="{t}Unknown Geocache{/t}" border="0" width="22" height="22" align="{$alignicon}" style="margin-right: 5px;" />
|
||||
{elseif $cachetype==2}
|
||||
<img src="{$opt.page.absolute_urlpath}resource2/{$opt.template.style}/images/cacheicon/traditional.gif" alt="{t}Traditional Geocache{/t}" title="{t}Traditional Geocache{/t}" border="0" width="22" height="22" align="left" style="margin-right: 5px;" />
|
||||
<img src="{$opt.page.absolute_urlpath}resource2/{$opt.template.style}/images/cacheicon/traditional.gif" alt="{t}Traditional Geocache{/t}" title="{t}Traditional Geocache{/t}" border="0" width="22" height="22" align="{$alignicon}" style="margin-right: 5px;" />
|
||||
{elseif $cachetype==3}
|
||||
<img src="{$opt.page.absolute_urlpath}resource2/{$opt.template.style}/images/cacheicon/multi.gif" alt="{t}Multicache{/t}" title="{t}Multicache{/t}" border="0" width="22" height="22" align="left" style="margin-right: 5px;" />
|
||||
<img src="{$opt.page.absolute_urlpath}resource2/{$opt.template.style}/images/cacheicon/multi.gif" alt="{t}Multicache{/t}" title="{t}Multicache{/t}" border="0" width="22" height="22" align="{$alignicon}" style="margin-right: 5px;" />
|
||||
{elseif $cachetype==4}
|
||||
<img src="{$opt.page.absolute_urlpath}resource2/{$opt.template.style}/images/cacheicon/virtual.gif" alt="{t}Virtual Geocache{/t}" title="{t}Virtual Geocache{/t}" border="0" width="22" height="22" align="left" style="margin-right: 5px;" />
|
||||
<img src="{$opt.page.absolute_urlpath}resource2/{$opt.template.style}/images/cacheicon/virtual.gif" alt="{t}Virtual Geocache{/t}" title="{t}Virtual Geocache{/t}" border="0" width="22" height="22" align="{$alignicon}" style="margin-right: 5px;" />
|
||||
{elseif $cachetype==5}
|
||||
<img src="{$opt.page.absolute_urlpath}resource2/{$opt.template.style}/images/cacheicon/webcam.gif" alt="{t}Webcam Geocache{/t}" title="{t}Webcam Geocache{/t}" border="0" width="22" height="22" align="left" style="margin-right: 5px;" />
|
||||
<img src="{$opt.page.absolute_urlpath}resource2/{$opt.template.style}/images/cacheicon/webcam.gif" alt="{t}Webcam Geocache{/t}" title="{t}Webcam Geocache{/t}" border="0" width="22" height="22" align="{$alignicon}" style="margin-right: 5px;" />
|
||||
{elseif $cachetype==6}
|
||||
<img src="{$opt.page.absolute_urlpath}resource2/{$opt.template.style}/images/cacheicon/event.gif" alt="{t}Event Geocache{/t}" title="{t}Event Geocache{/t}" border="0" width="22" height="22" align="left" style="margin-right: 5px;" />
|
||||
<img src="{$opt.page.absolute_urlpath}resource2/{$opt.template.style}/images/cacheicon/event.gif" alt="{t}Event Geocache{/t}" title="{t}Event Geocache{/t}" border="0" width="22" height="22" align="{$alignicon}" style="margin-right: 5px;" />
|
||||
{elseif $cachetype==7}
|
||||
<img src="{$opt.page.absolute_urlpath}resource2/{$opt.template.style}/images/cacheicon/mystery.gif" alt="{t}Quizcache{/t}" title="{t}Quizcache{/t}" border="0" width="22" height="22" align="left" style="margin-right: 5px;" />
|
||||
<img src="{$opt.page.absolute_urlpath}resource2/{$opt.template.style}/images/cacheicon/mystery.gif" alt="{t}Quizcache{/t}" title="{t}Quizcache{/t}" border="0" width="22" height="22" align="{$alignicon}" style="margin-right: 5px;" />
|
||||
{elseif $cachetype==8}
|
||||
<img src="{$opt.page.absolute_urlpath}resource2/{$opt.template.style}/images/cacheicon/mathe.gif" alt="{t}Math/Physics Geocache{/t}" title="{t}Math/Physics Geocache{/t}" border="0" width="22" height="22" align="left" style="margin-right: 5px;" />
|
||||
<img src="{$opt.page.absolute_urlpath}resource2/{$opt.template.style}/images/cacheicon/mathe.gif" alt="{t}Math/Physics Geocache{/t}" title="{t}Math/Physics Geocache{/t}" border="0" width="22" height="22" align="{$alignicon}" style="margin-right: 5px;" />
|
||||
{elseif $cachetype==9}
|
||||
<img src="{$opt.page.absolute_urlpath}resource2/{$opt.template.style}/images/cacheicon/moving.gif" alt="{t}Moving Geocache{/t}" title="{t}Moving Geocache{/t}" border="0" width="22" height="22" align="left" style="margin-right: 5px;" />
|
||||
<img src="{$opt.page.absolute_urlpath}resource2/{$opt.template.style}/images/cacheicon/moving.gif" alt="{t}Moving Geocache{/t}" title="{t}Moving Geocache{/t}" border="0" width="22" height="22" align="{$alignicon}" style="margin-right: 5px;" />
|
||||
{elseif $cachetype==10}
|
||||
<img src="{$opt.page.absolute_urlpath}resource2/{$opt.template.style}/images/cacheicon/drivein.gif" alt="{t}Drive-In Geocache{/t}" title="{t}Drive-In Geocache{/t}" border="0" width="22" height="22" align="left" style="margin-right: 5px;" />
|
||||
<img src="{$opt.page.absolute_urlpath}resource2/{$opt.template.style}/images/cacheicon/drivein.gif" alt="{t}Drive-In Geocache{/t}" title="{t}Drive-In Geocache{/t}" border="0" width="22" height="22" align="{$alignicon}" style="margin-right: 5px;" />
|
||||
{else}
|
||||
|
||||
{/if}
|
||||
|
29
htdocs/templates2/ocstyle/res_cachetypestats.tpl
Normal file
29
htdocs/templates2/ocstyle/res_cachetypestats.tpl
Normal file
@@ -0,0 +1,29 @@
|
||||
{***************************************************************************
|
||||
* You can find the license in the docs directory
|
||||
*
|
||||
* Unicode Reminder メモ
|
||||
***************************************************************************}
|
||||
{* OCSTYLE *}
|
||||
{if $opt.msie}
|
||||
<table cellspacing=0 cellpadding=0><tr>
|
||||
{/if}
|
||||
{foreach from=$stat item=stats}
|
||||
{if $opt.msie}
|
||||
<td style="line-height:0.5em">
|
||||
{else}
|
||||
<div style="display:inline-block; line-height:1.8em; padding-right:1em; text-align:center">
|
||||
{/if}
|
||||
{$stats.anzahl}
|
||||
<a href="search.php?showresult=1&expert=0&output=HTML&sort=byname&f_inactive=0&{if $logs}&finderid={$userid}&searchbyfinder={else}&ownerid={$userid}&searchbyowner={/if}&cachetype={$stats.id}{if $oconly}&cache_attribs=6{/if}calledbysearch=0">{include file="res_cacheicon_22.tpl" cachetype=$stats.id alignicon=""}</a>
|
||||
{if $stat|@count > 1}
|
||||
<br /><span class="percent">{$stats.anzahl/$total*100+0.5|floor}% </span>
|
||||
{/if}
|
||||
{if $opt.msie}
|
||||
</td>
|
||||
{else}
|
||||
</div>
|
||||
{/if}
|
||||
{/foreach}
|
||||
{if $opt.msie}
|
||||
</tr></table>
|
||||
{/if}
|
116
htdocs/templates2/ocstyle/res_userstats.tpl
Normal file
116
htdocs/templates2/ocstyle/res_userstats.tpl
Normal file
@@ -0,0 +1,116 @@
|
||||
{***************************************************************************
|
||||
* You can find the license in the docs directory
|
||||
*
|
||||
* Unicode Reminder メモ
|
||||
***************************************************************************}
|
||||
{* OCSTYLE *}
|
||||
|
||||
<tr>
|
||||
<td valign="middle" class="header-small" style="padding-top:5px;padding-bottom:5px;white-space:nowrap" width="1%">
|
||||
<img src="resource2/{$opt.template.style}/images/cacheicon/22x22-traditional.gif" width="22" height="22" align="middle" border="0" style="padding-right:2px" /> <b>{t}Hidden caches{/t}:</b></td>
|
||||
<td class="header-small">{$hidden}
|
||||
{if $hidden>0}[<a href="search.php?showresult=1&expert=0&f_inactive=0&output=HTML&sort=byname&ownerid={$userid}&searchbyowner=&calledbysearch=0{if $oconly}&cache_attribs=6{/if}">{t}Show all{/t}</a>]{if $hidden_active<$hidden}, {t 1=$hidden_active}%1 of these are active{/t} {if $hidden_active>0}[<a href="search.php?showresult=1&expert=0&f_inactive=1&output=HTML&sort=byname&ownerid={$userid}&searchbyowner=&calledbysearch=0{if $oconly}&cache_attribs=6{/if}">{t}Show{/t}</a>]{/if}{/if}{/if}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
{if $show_statistics==true}
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<div style="padding-left:2px">
|
||||
{include file="res_cachetypestats.tpl" stat=$hidden_by_cachetype total=$hidden logs=false oconly=true}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td class="spacer" colspan="2"></td></tr>
|
||||
{/if}
|
||||
|
||||
<tr>
|
||||
<td valign="middle" class="header-small" style="padding-top:5px;padding-bottom:5px;white-space:nowrap" width="1%">
|
||||
<img src="resource2/ocstyle/images/log/16x16-found.png" style="padding-right:2px" />
|
||||
<b>{t}Caches found{/t}:</b>
|
||||
</td>
|
||||
<td class="header-small">
|
||||
{$found}
|
||||
{if $found>0}[<a href="search.php?showresult=1&expert=0&f_inactive=0&output=HTML&sort=byname&finderid={$userid}&searchbyfinder=&logtype=1,7&calledbysearch=0{if $oconly}&cache_attribs=6{/if}">{t}Show all{/t}</a>]{/if}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
{if $show_statistics==true}
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>
|
||||
<div style="padding-left:2px">
|
||||
{include file="res_cachetypestats.tpl" stat=$found_by_cachetype total=$found logs=true oconly=true}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr><td class="spacer" colspan="2"></td></tr>
|
||||
|
||||
<tr>
|
||||
<td valign="middle" class="header-small" style="padding-top:5px;padding-bottom:5px;white-space:nowrap">
|
||||
<img src="resource2/ocstyle/images/log/16x16-dnf.png" /> <b>{t}Not found{/t}:</b></td>
|
||||
<td class="header-small" >{$dnf}
|
||||
{if $dnf > 0}[<a href="search.php?showresult=1&expert=0&f_inactive=0&output=HTML&sort=byname&finderid={$userid}&searchbyfinder=&logtype=2&calledbysearch=0{if $oconly}&cache_attribs=6{/if}">{t}Show all{/t}</a>]{/if}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="middle" class="header-small" style="padding-bottom:5px;white-space:nowrap">
|
||||
<img src="resource2/ocstyle/images/log/16x16-note.png" /> <b>{t}Notes{/t}:</b></td>
|
||||
<td class="header-small" >{$notes}
|
||||
{if $notes>0}[<a href="search.php?showresult=1&expert=0&f_inactive=0&output=HTML&sort=byname&finderid={$userid}&searchbyfinder=&logtype=3&calledbysearch=0{if $oconly}&cache_attribs=6{/if}">{t}Show all{/t}</a>]{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{if $maintainence > 0}
|
||||
<tr>
|
||||
<td valign="middle" class="header-small" style="padding-bottom:5px;white-space:nowrap">
|
||||
<img src="resource2/ocstyle/images/viewcache/16x16-maintenance.png" /> <b>{t}Maintenance logs{/t}:</b></td>
|
||||
<td class="header-small" >{$maintainence}
|
||||
[<a href="search.php?showresult=1&expert=0&f_inactive=0&output=HTML&sort=byname&finderid={$userid}&searchbyfinder=&logtype=9,10,11,13,14&calledbysearch=0{if $oconly}&cache_attribs=6{/if}">{t}Show all{/t}</a>]
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
<tr>
|
||||
<td valign="middle" class="header-small" style="padding-bottom:5px;white-space:nowrap">
|
||||
<img src="resource2/{$opt.template.style}/images/viewcache/rating-star.gif" align="middle" border="0" style="padding-right:2px" /> <b>{t}Recommendations{/t}:</b></td>
|
||||
<td class="header-small" >{if $maxrecommended !== null}{t 1=$recommended 2=$maxrecommended}%1 of %2 possibles{/t}{else}{$recommended}{/if} {if $recommended>0}[<a href="usertops.php?userid={$userid}{if $oconly}&oconly=1{/if}">{t}Show all{/t}</a>]{/if}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
{if $show_picstat && $logpics !== null}
|
||||
<tr>
|
||||
<td class="header-small">
|
||||
<img src="resource2/{$opt.template.style}/images/action/16x16-addimage.png" align="middle" border="0" /> <b>{t}Log pictures{/t}:</b></td>
|
||||
<td class="header-small" >{$logpics} {if $logpics>0}[<a href="viewprofile.php?userid={$userid}&allpics=1">{t}Show all{/t}</a>]{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
|
||||
{if $show_statistics==true}
|
||||
<tr><td class="spacer" colspan="2"></td></tr>
|
||||
<tr><td class="spacer" colspan="2"></td></tr>
|
||||
<tr>
|
||||
<td valign="top">
|
||||
<img src="resource2/ocstyle/images/log/16x16-found.png" style="padding-right:2px" />
|
||||
<b>{t}Finds by region{/t}:</b>
|
||||
</td>
|
||||
<td>
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
{foreach from=$regionstat item=region name=regions}
|
||||
<tr>
|
||||
<td class="default" style="text-align:right; padding:0">
|
||||
{$region.count}
|
||||
</td>
|
||||
<td class="default" style="padding:0">
|
||||
{if !$region.state}<a href="search.php?showresult=1&expert=0&f_inactive=0&output=HTML&sort=byname&finderid={$userid}&searchbyfinder=&logtype=1,7&country={$region.countrycode}&calledbysearch=0{if $oconly}&cache_attribs=6{/if}">{$region.country}</a>{else}{$region.country}{/if}
|
||||
{if $region.state}> <a href="search.php?showresult=1&expert=0&f_inactive=0&output=HTML&sort=byname&finderid={$userid}&searchbyfinder=&logtype=1,7&adm2={$region.adm2code}&calledbysearch=0{if $oconly}&cache_attribs=6{/if}">{$region.state}</a>{/if}
|
||||
<img src="images/flags/{$region.countrycode|lower}.gif" width="16" height="11">
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
@@ -5,7 +5,7 @@
|
||||
***************************************************************************}
|
||||
{* OCSTYLE *}
|
||||
<div class="content2-pagetitle">
|
||||
<img src="resource2/{$opt.template.style}/images/misc/32x32-winner.png" style="align: left; margin-right: 10px;" width="32" height="32" alt="{t}Recommendations{/t}" />
|
||||
<img src="resource2/{$opt.template.style}/images/misc/{if $oconly}is_oconly_small.png{else}32x32-winner.png{/if}" style="align: left; margin-right: 10px;" {if !$oconly}width="32" height="32" alt="{t}Recommendations{/t}"{/if} />
|
||||
{t 1=$userid 2=$username|escape}Recommendations of <a href="viewprofile.php?userid=%1">%2</a>{/t}
|
||||
</div>
|
||||
|
||||
|
@@ -93,7 +93,7 @@
|
||||
<div> </div>
|
||||
{/if}
|
||||
|
||||
{* statistics *}
|
||||
{* all-caches statistics *}
|
||||
<div class="content2-container bg-blue02">
|
||||
<p class="content-title-noshade-size2">
|
||||
<img src="resource2/{$opt.template.style}/images/cacheicon/20x20-3.png" style="align: left; margin-right: 10px;" />
|
||||
@@ -104,92 +104,99 @@
|
||||
<table class="table">
|
||||
<tr><td class="spacer" colspan="2"></td></tr>
|
||||
|
||||
<tr>
|
||||
<td valign="middle" class="header-small" style="padding-top:5px;padding-bottom:5px">
|
||||
<img src="resource2/{$opt.template.style}/images/cacheicon/22x22-traditional.gif" width="22" height="22" align="middle" border="0" /> <b>{t}Hidden caches{/t}:</b></td>
|
||||
<td class="header-small">{$hidden}
|
||||
{if $hidden>0}[<a href="search.php?showresult=1&expert=0&f_inactive=0&output=HTML&sort=byname&ownerid={$userid}&searchbyowner=&calledbysearch=0">{t}Show all{/t}</a>]{if $active<$hidden}, {t 1=$active}%1 of these are active{/t} {if $active>0}[<a href="search.php?showresult=1&expert=0&f_inactive=1&output=HTML&sort=byname&ownerid={$userid}&searchbyowner=&calledbysearch=0">{t}Show{/t}</a>]{/if}{/if}{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{include file="res_userstats.tpl"
|
||||
oconly=false
|
||||
hidden=$hidden
|
||||
hidden_active=$active
|
||||
hidden_by_cachetype=$userstatshidden
|
||||
found=$founds
|
||||
found_by_cachetype=$userstatsfound
|
||||
dnf=$notfound
|
||||
notes=$note
|
||||
maintainence=$maintenance
|
||||
recommended=$recommended
|
||||
maxrecommended=$maxrecommended
|
||||
logpics=$logpics
|
||||
regionstat=$regionstat}
|
||||
|
||||
{if $show_statistics==true}
|
||||
{foreach from=$userstatshidden item=stats}
|
||||
<tr>
|
||||
<td>{include file="res_cacheicon_15.tpl" cachetype=$stats.id}{$stats.cachetype|escape}:</td>
|
||||
<td>{$stats.anzahl}
|
||||
<span style="color:#666666; font-size:10px;">
|
||||
(<a href="search.php?showresult=1&expert=0&output=HTML&sort=byname&ownerid={$userid}&searchbyowner=&f_inactive=0&cachetype={$stats.id}&calledbysearch=0">{t}show{/t}</a>)
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
<tr><td class="spacer" colspan="2"></td></tr>
|
||||
{/if}
|
||||
|
||||
<tr>
|
||||
<td valign="middle" class="header-small" style="padding-top:5px;padding-bottom:5px">
|
||||
<img src="resource2/ocstyle/images/log/16x16-found.png" />
|
||||
<b>{t}Caches found{/t}:</b>
|
||||
</td>
|
||||
<td class="header-small">
|
||||
{$founds}
|
||||
{if $founds>0}[<a href="search.php?showresult=1&expert=0&f_inactive=0&output=HTML&sort=byname&finderid={$userid}&searchbyfinder=&logtype=1,7&calledbysearch=0">{t}Show all{/t}</a>]{/if}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
{if $show_statistics==true}
|
||||
{foreach from=$userstatsfound item=stats}
|
||||
<tr>
|
||||
<td>{include file="res_cacheicon_15.tpl" cachetype=$stats.id}{$stats.cachetype|escape}:</td>
|
||||
<td>{$stats.anzahl}
|
||||
<span style="color:#666666; font-size:10px;">
|
||||
(<a href="search.php?showresult=1&expert=0&output=HTML&sort=byname&finderid={$userid}&searchbyfinder=&f_inactive=0&cachetype={$stats.id}&logtype=1,7&calledbysearch=0">{t}show{/t}</a>)
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
<tr><td class="spacer" colspan="2"></td></tr>
|
||||
|
||||
<tr>
|
||||
<td valign="middle" class="header-small" style="padding-top:5px;padding-bottom:5px">
|
||||
<img src="resource2/ocstyle/images/log/16x16-dnf.png" /> <b>{t}Not found{/t}:</b></td>
|
||||
<td class="header-small" >{$notfound}
|
||||
{if $notfound > 0}[<a href="search.php?showresult=1&expert=0&f_inactive=0&output=HTML&sort=byname&finderid={$userid}&searchbyfinder=&logtype=2&calledbysearch=0">{t}Show all{/t}</a>]{/if}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="middle" class="header-small" style="padding-bottom:5px">
|
||||
<img src="resource2/ocstyle/images/log/16x16-note.png" /> <b>{t}Notes{/t}:</b></td>
|
||||
<td class="header-small" >{$note}
|
||||
{if $note>0}[<a href="search.php?showresult=1&expert=0&f_inactive=0&output=HTML&sort=byname&finderid={$userid}&searchbyfinder=&logtype=3&calledbysearch=0">{t}Show all{/t}</a>]{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{if $maintenance > 0}
|
||||
<tr>
|
||||
<td valign="middle" class="header-small" style="padding-bottom:5px">
|
||||
<img src="resource2/ocstyle/images/viewcache/16x16-maintenance.png" /> <b>{t}Maintenance logs{/t}:</b></td>
|
||||
<td class="header-small" >{$maintenance}
|
||||
[<a href="search.php?showresult=1&expert=0&f_inactive=0&output=HTML&sort=byname&finderid={$userid}&searchbyfinder=&logtype=9,10,11,13,14&calledbysearch=0">{t}Show all{/t}</a>]
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
<tr>
|
||||
<td class="header-small">
|
||||
<img src="resource2/{$opt.template.style}/images/viewcache/rating-star.gif" align="middle" border="0" /> <b>{t}Recommendations{/t}:</b></td>
|
||||
<td class="header-small" >{t 1=$recommended 2=$maxrecommended}%1 of %2 possibles{/t} {if $recommended>0}[<a href="usertops.php?userid={$userid}">{t}Show all{/t}</a>]{/if}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
{if $show_picstat}
|
||||
<tr>
|
||||
<td class="header-small">
|
||||
<img src="resource2/{$opt.template.style}/images/action/16x16-addimage.png" align="middle" border="0" /> <b>{t}Log pictures{/t}:</b></td>
|
||||
<td class="header-small" >{$logpics} {if $logpics>0}[<a href="viewprofile.php?userid={$userid}&allpics=1">{t}Show all{/t}</a>]{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
|
||||
<tr><td class="spacer" colspan="2"></td></tr>
|
||||
<tr><td class="spacer"> </td></tr>
|
||||
</table>
|
||||
|
||||
{* OConly statistics *}
|
||||
<div class="content2-container bg-blue02">
|
||||
<p class="content-title-noshade-size2">
|
||||
<img src="resource2/{$opt.template.style}/images/misc/is_oconly_small.png" style="align: left; margin-right: 10px;" />
|
||||
{t}OConly statistics{/t}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<table class="table">
|
||||
<tr><td class="spacer" colspan="2"></td></tr>
|
||||
|
||||
{include file="res_userstats.tpl"
|
||||
oconly=true
|
||||
hidden=$oconly_hidden
|
||||
hidden_active=$oconly_hidden_active
|
||||
hidden_by_cachetype=$oconly_userstatshidden
|
||||
found=$oconly_found
|
||||
found_by_cachetype=$oconly_userstatsfound
|
||||
dnf=$oconly_dnf
|
||||
notes=$oconly_note
|
||||
maintainence=$oconly_maint
|
||||
recommended=$oconly_recommended
|
||||
maxrecommended=null
|
||||
logpics=$oconly_logpics
|
||||
regionstat=$oconly_regionstat}
|
||||
|
||||
<tr><td class="spacer"></td></tr>
|
||||
|
||||
{if $show_oconly81}
|
||||
<tr><td colspan="3">
|
||||
<table class="stattable">
|
||||
<tr>
|
||||
<th class="h1"></th>
|
||||
<th class="h1" colspan="11" style="text-align:center; line-height:1.8em">{t}Terrain{/t}</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td> <img src="resource2/ocstyle/images/log/16x16-found.png" /</td>
|
||||
{foreach from=$stat81 key=step item=dummy}
|
||||
<th style="text-align:center">{$step/2}</th>
|
||||
{/foreach}
|
||||
<th class="h1" style="text-align:center">Σ</th>
|
||||
</tr>
|
||||
{assign var=matrixfound value=0}
|
||||
{foreach from=$stat81 key=difficulty item=terrains name=difficulty}
|
||||
<tr>
|
||||
{if $smarty.foreach.difficulty.first}
|
||||
<th class="h1" rowspan="9">{t}Difficulty{/t} </th>
|
||||
{/if}
|
||||
<th> {$difficulty/2}</th>
|
||||
{assign var=dsum value=0}
|
||||
{foreach from=$terrains key=terrain item=count}
|
||||
<td style="text-align:center; background-color:{if $count}rgb({$count/$stat81_maxcount*-242+242.5|floor},{$count/$stat81_maxcount*-242+242.5|floor},242){else}#f2f2f2{/if}" {if $count}onclick='location.href="search.php?showresult=1&expert=0&f_inactive=0&output=HTML&sort=byname&finderid={$userid}&searchbyfinder=&logtype=1,7&calledbysearch=0&cache_attribs=6&terrainmin={$terrain}&terrainmax={$terrain}&difficultymin={$difficulty}&difficultymax={$difficulty}"'{/if}>
|
||||
{if $count}
|
||||
<span style="cursor:pointer; color:{if $count > $stat81_maxcount/3}#fff{else}#000{/if}">{$count}</span>
|
||||
{assign var=dsum value=$dsum+$count}
|
||||
{assign var=matrixfound value=$matrixfound+1}
|
||||
{else} {/if}
|
||||
</td>
|
||||
{/foreach}
|
||||
<td style="text-align:center">{if $dsum}{$dsum}{/if}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
<tr>
|
||||
<td rowspan="2"></td>
|
||||
<th class="h1" style="text-align:center">Σ</th>
|
||||
{foreach from=$stat81_tsum item=count}
|
||||
<td style="text-align:center">{if $count}{$count}{/if}</td>
|
||||
{/foreach}
|
||||
<td style="text-align:center"><b>{$oconly_found}</b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="11" style="padding-top:0.5em"><p>{t 1=$matrixfound}The user has found %1 of 81 theoretically possible terrain/difficulty combinations.{/t}</p></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td></tr>
|
||||
{/if}
|
||||
</table>
|
||||
|
@@ -10,6 +10,7 @@
|
||||
$tpl->menuitem = MNU_CACHES_USERTOPS;
|
||||
|
||||
$userid = isset($_REQUEST['userid']) ? $_REQUEST['userid']+0 : 0;
|
||||
$oconly = isset($_REQUEST['oconly']) && $_REQUEST['oconly'];
|
||||
|
||||
$sUsername = sql_value("SELECT `username` FROM `user` WHERE `user_id`='&1'", null, $userid);
|
||||
if ($sUsername == null)
|
||||
@@ -17,6 +18,7 @@
|
||||
|
||||
$tpl->assign('userid', $userid);
|
||||
$tpl->assign('username', $sUsername);
|
||||
$tpl->assign('oconly',$oconly);
|
||||
|
||||
$rs = sql("SELECT `cache_rating`.`cache_id` AS `cacheid`, `caches`.`name` AS `cachename`, `user`.`username` AS `ownername`, `caches`.`type` AS `type`, `caches`.`status` AS `status`, `ca`.`attrib_id` IS NOT NULL AS `oconly`
|
||||
FROM `cache_rating`
|
||||
@@ -25,8 +27,9 @@
|
||||
INNER JOIN `cache_status` ON `caches`.`status`=`cache_status`.`id`
|
||||
LEFT JOIN `caches_attributes` `ca` ON `ca`.`cache_id`=`caches`.`cache_id` AND `ca`.`attrib_id`=6
|
||||
WHERE `cache_status`.`allow_user_view`=1
|
||||
AND `cache_rating`.`user_id`='&1'
|
||||
ORDER BY `caches`.`name` ASC", $userid);
|
||||
AND `cache_rating`.`user_id`='&1'
|
||||
AND (NOT '&2' OR `ca`.`attrib_id` IS NOT NULL)
|
||||
ORDER BY `caches`.`name` ASC", $userid, $oconly ? 1 : 0);
|
||||
$tpl->assign_rs('ratings', $rs);
|
||||
sql_free_result($rs);
|
||||
|
||||
|
@@ -29,6 +29,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
// user data and basic statistics
|
||||
$rs = sql("SELECT `user`.`username`,
|
||||
`user`.`last_login`,
|
||||
`user`.`pmr_flag`,
|
||||
@@ -75,36 +76,196 @@
|
||||
$tpl->assign('description',
|
||||
sql_value("SELECT `description` FROM `user` WHERE `user_id`='&1'", "", $userid));
|
||||
|
||||
$rs = sql("SELECT COUNT(*) AS `anzahl`, `t`.`id`, IFNULL(`tt`.`text`, `t`.`name`) AS `cachetype`
|
||||
FROM `caches` AS `c`
|
||||
LEFT JOIN `cache_type` AS `t` ON `t`.`id`=`c`.`type`
|
||||
LEFT JOIN `sys_trans` AS `st` ON `st`.`id`=`t`.`trans_id` AND `t`.`name`=`st`.`text`
|
||||
LEFT JOIN `sys_trans_text` AS `tt` ON `st`.`id`=`tt`.`trans_id` AND `tt`.`lang`='&2'
|
||||
LEFT JOIN `cache_status` ON `cache_status`.`id`=`c`.`status`
|
||||
WHERE `c`.`user_id`='&1' AND `allow_user_view`='1'
|
||||
GROUP BY `t`.`id`
|
||||
ORDER BY `anzahl` DESC",
|
||||
$userid,
|
||||
$opt['template']['locale']);
|
||||
$tpl->assign_rs('userstatshidden', $rs);
|
||||
sql_free_result($rs);
|
||||
|
||||
$rs = sql("SELECT COUNT(*) AS `anzahl`, `t`.`id`, IFNULL(`tt`.`text`, `t`.`name`) AS `cachetype`
|
||||
FROM `cache_logs` AS `l`
|
||||
LEFT JOIN `caches` AS `c` ON `l`.`cache_id`=`c`.`cache_id`
|
||||
LEFT JOIN `cache_type` AS `t` ON `t`.`id`=`c`.`type`
|
||||
LEFT JOIN `sys_trans` AS `st` ON `st`.`id`=`t`.`trans_id` AND `t`.`name`=`st`.`text`
|
||||
LEFT JOIN `sys_trans_text` AS `tt` ON `st`.`id`=`tt`.`trans_id` AND `tt`.`lang`='&2'
|
||||
WHERE `l`.`user_id`='&1' AND (`l`.`type`=1 OR `l`.`type`=7)
|
||||
GROUP BY `t`.`id`
|
||||
ORDER BY `anzahl` DESC",
|
||||
$userid,
|
||||
$opt['template']['locale']);
|
||||
$tpl->assign_rs('userstatsfound', $rs);
|
||||
sql_free_result($rs);
|
||||
|
||||
$useropt = new useroptions($userid);
|
||||
$tpl->assign('show_statistics', ($useropt->getOptValue(USR_OPT_SHOWSTATS) == 1));
|
||||
$show_statistics = $useropt->getOptValue(USR_OPT_SHOWSTATS);
|
||||
$show_oconly81 = $useropt->getOptValue(USR_OPT_OCONLY81);
|
||||
|
||||
if ($show_statistics)
|
||||
{
|
||||
// detail statistics
|
||||
$rs = sql("SELECT COUNT(*) AS `anzahl`, `t`.`id`, IFNULL(`tt`.`text`, `t`.`name`) AS `cachetype`
|
||||
FROM `caches` AS `c`
|
||||
LEFT JOIN `cache_type` AS `t` ON `t`.`id`=`c`.`type`
|
||||
LEFT JOIN `sys_trans` AS `st` ON `st`.`id`=`t`.`trans_id` AND `t`.`name`=`st`.`text`
|
||||
LEFT JOIN `sys_trans_text` AS `tt` ON `st`.`id`=`tt`.`trans_id` AND `tt`.`lang`='&2'
|
||||
LEFT JOIN `cache_status` ON `cache_status`.`id`=`c`.`status`
|
||||
WHERE `c`.`user_id`='&1' AND `allow_user_view`='1'
|
||||
GROUP BY `t`.`id`
|
||||
ORDER BY `anzahl` DESC, `t`.`ordinal` ASC",
|
||||
$userid,
|
||||
$opt['template']['locale']);
|
||||
$tpl->assign_rs('userstatshidden', $rs);
|
||||
sql_free_result($rs);
|
||||
|
||||
$rs = sql("SELECT COUNT(*) AS `anzahl`, `t`.`id`, IFNULL(`tt`.`text`, `t`.`name`) AS `cachetype`
|
||||
FROM `cache_logs` AS `l`
|
||||
LEFT JOIN `caches` AS `c` ON `l`.`cache_id`=`c`.`cache_id`
|
||||
LEFT JOIN `cache_type` AS `t` ON `t`.`id`=`c`.`type`
|
||||
LEFT JOIN `sys_trans` AS `st` ON `st`.`id`=`t`.`trans_id` AND `t`.`name`=`st`.`text`
|
||||
LEFT JOIN `sys_trans_text` AS `tt` ON `st`.`id`=`tt`.`trans_id` AND `tt`.`lang`='&2'
|
||||
WHERE `l`.`user_id`='&1' AND (`l`.`type`=1 OR `l`.`type`=7)
|
||||
GROUP BY `t`.`id`
|
||||
ORDER BY `anzahl` DESC, `t`.`ordinal` ASC",
|
||||
$userid,
|
||||
$opt['template']['locale']);
|
||||
$tpl->assign_rs('userstatsfound', $rs);
|
||||
sql_free_result($rs);
|
||||
|
||||
$rs = sql("
|
||||
SELECT
|
||||
COUNT(*) AS `count`,
|
||||
IFNULL(`stt`.`text`, `caches`.`country`) AS `country`,
|
||||
IF(`caches`.`country`='&3' AND `cache_location`.`code1`='&3', `cache_location`.`adm2`, NULL) AS `state`,
|
||||
`caches`.`country` AS `countrycode`,
|
||||
`cache_location`.`code2` AS `adm2code`
|
||||
FROM
|
||||
`cache_logs`
|
||||
INNER JOIN `caches` ON `caches`.`cache_id`=`cache_logs`.`cache_id`
|
||||
INNER JOIN `cache_location` ON `cache_location`.`cache_id`=`cache_logs`.`cache_id`
|
||||
LEFT JOIN `countries` ON `countries`.`short`=`caches`.`country`
|
||||
LEFT JOIN `sys_trans_text` `stt` ON `stt`.`lang`='&2' AND `stt`.`trans_id`=`countries`.`trans_id`
|
||||
WHERE `cache_logs`.`user_id`='&1' AND `cache_logs`.`type` IN (1,7)
|
||||
GROUP BY `country`, `state`
|
||||
ORDER BY `count` DESC, `country`, `state`",
|
||||
$userid, $opt['template']['locale'], $login->getUserCountry());
|
||||
|
||||
$tpl->assign_rs('regionstat', $rs);
|
||||
sql_free_result($rs);
|
||||
}
|
||||
|
||||
// OConly statistics
|
||||
$oconly_hidden = sql_value("
|
||||
SELECT COUNT(*)
|
||||
FROM `caches`
|
||||
INNER JOIN `caches_attributes` ON `caches_attributes`.`cache_id`=`caches`.`cache_id` AND `caches_attributes`.`attrib_id`=6
|
||||
INNER JOIN `cache_status` ON `cache_status`.`id`=`caches`.`status` AND `allow_user_view`=1
|
||||
WHERE `user_id`='&1'",
|
||||
0, $userid);
|
||||
$oconly_hidden_active = sql_value("
|
||||
SELECT COUNT(*)
|
||||
FROM `caches`
|
||||
INNER JOIN `caches_attributes` ON `caches_attributes`.`cache_id`=`caches`.`cache_id` AND `caches_attributes`.`attrib_id`=6
|
||||
WHERE `user_id`='&1' AND `caches`.`status`=1",
|
||||
0, $userid);
|
||||
$oconly_recommended = sql_value("
|
||||
SELECT COUNT(*)
|
||||
FROM `cache_logs`
|
||||
INNER JOIN `caches_attributes` ON `caches_attributes`.`cache_id`=`cache_logs`.`cache_id` AND `caches_attributes`.`attrib_id`=6
|
||||
INNER JOIN `cache_rating` ON `cache_rating`.`user_id`=`cache_logs`.`user_id` AND `cache_rating`.`cache_id`=`cache_logs`.`cache_id` AND `cache_rating`.`rating_date`=`cache_logs`.`date`
|
||||
WHERE `cache_logs`.`user_id`='&1' AND `cache_logs`.`type` IN (1,7)",
|
||||
0, $userid);
|
||||
|
||||
$rs = sql("
|
||||
SELECT
|
||||
COUNT(*) AS `count`,
|
||||
IFNULL(`stt`.`text`, `caches`.`country`) AS `country`,
|
||||
IF(`caches`.`country`='&3' AND `cache_location`.`code1`='&3', `cache_location`.`adm2`, NULL) AS `state`,
|
||||
`caches`.`country` AS `countrycode`,
|
||||
`cache_location`.`code2` AS `adm2code`
|
||||
FROM
|
||||
`cache_logs`
|
||||
INNER JOIN `caches_attributes` ON `caches_attributes`.`cache_id`=`cache_logs`.`cache_id` AND `caches_attributes`.`attrib_id`=6
|
||||
INNER JOIN `caches` ON `caches`.`cache_id`=`cache_logs`.`cache_id`
|
||||
INNER JOIN `cache_location` ON `cache_location`.`cache_id`=`cache_logs`.`cache_id`
|
||||
LEFT JOIN `countries` ON `countries`.`short`=`caches`.`country`
|
||||
LEFT JOIN `sys_trans_text` `stt` ON `stt`.`lang`='&2' AND `stt`.`trans_id`=`countries`.`trans_id`
|
||||
WHERE `cache_logs`.`user_id`='&1' AND `cache_logs`.`type` IN (1,7)
|
||||
GROUP BY `country`, `state`
|
||||
ORDER BY `count` DESC, `country`, `state`",
|
||||
$userid, $opt['template']['locale'], $login->getUserCountry());
|
||||
|
||||
$tpl->assign_rs('oconly_regionstat', $rs);
|
||||
sql_free_result($rs);
|
||||
|
||||
$rs = sql("
|
||||
SELECT `cache_logs`.`type`, COUNT(*) AS `count`
|
||||
FROM `cache_logs`
|
||||
INNER JOIN `caches_attributes` ON `caches_attributes`.`cache_id`=`cache_logs`.`cache_id` AND `caches_attributes`.`attrib_id`=6
|
||||
WHERE `user_id`='&1'
|
||||
GROUP BY `cache_logs`.`type`",
|
||||
$userid);
|
||||
$oconly_found = 0;
|
||||
$oconly_dnf = 0;
|
||||
$oconly_note = 0;
|
||||
$oconly_maint = 0;
|
||||
while ($r = sql_fetch_assoc($rs))
|
||||
{
|
||||
switch ($r['type'])
|
||||
{
|
||||
case 1:
|
||||
case 7: $oconly_found += $r['count']; break;
|
||||
case 2: $oconly_dnf = $r['count']; break;
|
||||
case 3: $oconly_note = $r['count']; break;
|
||||
case 9:
|
||||
case 10:
|
||||
case 11:
|
||||
case 13: $oconly_maint += $r['count']; break;
|
||||
}
|
||||
}
|
||||
sql_free_result($rs);
|
||||
$tpl->assign('oconly_found', $oconly_found);
|
||||
$tpl->assign('oconly_dnf', $oconly_dnf);
|
||||
$tpl->assign('oconly_note', $oconly_note);
|
||||
$tpl->assign('oconly_maint', $oconly_maint);
|
||||
|
||||
// OConly detail statistics
|
||||
if ($show_statistics)
|
||||
{
|
||||
$rs = sql("SELECT COUNT(*) AS `anzahl`, `t`.`id`, IFNULL(`tt`.`text`, `t`.`name`) AS `cachetype`
|
||||
FROM `caches` AS `c`
|
||||
LEFT JOIN `cache_type` AS `t` ON `t`.`id`=`c`.`type`
|
||||
LEFT JOIN `sys_trans` AS `st` ON `st`.`id`=`t`.`trans_id` AND `t`.`name`=`st`.`text`
|
||||
LEFT JOIN `sys_trans_text` AS `tt` ON `st`.`id`=`tt`.`trans_id` AND `tt`.`lang`='&2'
|
||||
LEFT JOIN `cache_status` ON `cache_status`.`id`=`c`.`status`
|
||||
INNER JOIN `caches_attributes` ON `caches_attributes`.`cache_id`=`c`.`cache_id` AND `caches_attributes`.`attrib_id`=6
|
||||
WHERE `c`.`user_id`='&1' AND `allow_user_view`='1'
|
||||
GROUP BY `t`.`id`
|
||||
ORDER BY `anzahl` DESC, `t`.`ordinal` ASC",
|
||||
$userid,
|
||||
$opt['template']['locale']);
|
||||
$tpl->assign_rs('oconly_userstatshidden', $rs);
|
||||
sql_free_result($rs);
|
||||
|
||||
$rs = sql("SELECT COUNT(*) AS `anzahl`, `t`.`id`, IFNULL(`tt`.`text`, `t`.`name`) AS `cachetype`
|
||||
FROM `cache_logs` AS `l`
|
||||
LEFT JOIN `caches` AS `c` ON `l`.`cache_id`=`c`.`cache_id`
|
||||
LEFT JOIN `cache_type` AS `t` ON `t`.`id`=`c`.`type`
|
||||
LEFT JOIN `sys_trans` AS `st` ON `st`.`id`=`t`.`trans_id` AND `t`.`name`=`st`.`text`
|
||||
LEFT JOIN `sys_trans_text` AS `tt` ON `st`.`id`=`tt`.`trans_id` AND `tt`.`lang`='&2'
|
||||
INNER JOIN `caches_attributes` ON `caches_attributes`.`cache_id`=`c`.`cache_id` AND `caches_attributes`.`attrib_id`=6
|
||||
WHERE `l`.`user_id`='&1' AND (`l`.`type`=1 OR `l`.`type`=7)
|
||||
GROUP BY `t`.`id`
|
||||
ORDER BY `anzahl` DESC, `t`.`ordinal` ASC",
|
||||
$userid,
|
||||
$opt['template']['locale']);
|
||||
$tpl->assign_rs('oconly_userstatsfound', $rs);
|
||||
sql_free_result($rs);
|
||||
}
|
||||
|
||||
if ($show_oconly81)
|
||||
{
|
||||
$terr = $tsum = array(2=>0, 3=>0, 4=>0, 5=>0, 6=>0, 7=>0, 8=>0, 9=>0, 10=>0);
|
||||
$stat81 = array(2=>$terr, 3=>$terr, 4=>$terr, 5=>$terr, 6=>$terr, 7=>$terr, 8=>$terr, 9=>$terr, 10=>$terr);
|
||||
$rs = sql("
|
||||
SELECT `difficulty`, `terrain`, COUNT(*) AS `count`
|
||||
FROM `cache_logs`
|
||||
INNER JOIN `caches` ON `caches`.`cache_id`=`cache_logs`.`cache_id`
|
||||
INNER JOIN `caches_attributes` ON `caches_attributes`.`cache_id`=`cache_logs`.`cache_id` AND `caches_attributes`.`attrib_id`=6
|
||||
WHERE `cache_logs`.`user_id`='&1' AND `cache_logs`.`type` IN (1,7)
|
||||
GROUP BY `difficulty`*10 + `terrain`",
|
||||
$userid);
|
||||
$maxcount = 0;
|
||||
while ($r = sql_fetch_assoc($rs))
|
||||
{
|
||||
$stat81[$r['difficulty']][$r['terrain']] = $r['count'];
|
||||
$maxcount = max($maxcount, $r['count']);
|
||||
$tsum[$r['difficulty']] += $r['count'];
|
||||
}
|
||||
sql_free_result($rs);
|
||||
$tpl->assign('stat81',$stat81);
|
||||
$tpl->assign('stat81_maxcount',max(10,$maxcount));
|
||||
$tpl->assign('stat81_tsum', $tsum);
|
||||
}
|
||||
|
||||
$tpl->assign('username', $record['username']);
|
||||
$tpl->assign('userid', $userid);
|
||||
@@ -117,6 +278,12 @@
|
||||
$tpl->assign('active', $active);
|
||||
$tpl->assign('recommended', sql_value("SELECT COUNT(*) FROM `cache_rating` WHERE `user_id`='&1'", 0, $userid));
|
||||
$tpl->assign('maxrecommended', floor($record['found'] * $opt['logic']['rating']['percentageOfFounds'] / 100));
|
||||
$tpl->assign('show_statistics', $show_statistics);
|
||||
$tpl->assign('show_oconly81', $show_oconly81);
|
||||
|
||||
$tpl->assign('oconly_hidden', $oconly_hidden);
|
||||
$tpl->assign('oconly_hidden_active', $oconly_hidden_active);
|
||||
$tpl->assign('oconly_recommended', $oconly_recommended);
|
||||
|
||||
$user = new user($userid);
|
||||
|
||||
|
Reference in New Issue
Block a user