Skip to content

Commit

Permalink
added OConly statistics to user profile
Browse files Browse the repository at this point in the history
  • Loading branch information
following5 committed Aug 3, 2013
1 parent 06c52b5 commit 21f9939
Show file tree
Hide file tree
Showing 12 changed files with 475 additions and 125 deletions.
9 changes: 9 additions & 0 deletions htdocs/doc/sql/static-data/data.sql
Expand Up @@ -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 ('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 ('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 ('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 -- Table replication_overwritetypes
SET NAMES 'utf8'; SET NAMES 'utf8';
Expand Down Expand Up @@ -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 ('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 ('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 ('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 -- Table sys_trans_ref
SET NAMES 'utf8'; SET NAMES 'utf8';
Expand Down Expand Up @@ -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 ('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 ('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 \&ndash; diesen Hinweis heute nicht mehr anzeigen.', '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 \&ndash; 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 ('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 ('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'); 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');
Expand Down
2 changes: 2 additions & 0 deletions htdocs/lib2/OcSmarty.class.php
Expand Up @@ -138,6 +138,7 @@ function compile($resource_name, $compile_id = null)
function display($dummy1=null, $dummy2=null, $dummy3=null) function display($dummy1=null, $dummy2=null, $dummy3=null)
{ {
global $opt, $db, $cookie, $login, $menu, $sqldebugger, $translate; global $opt, $db, $cookie, $login, $menu, $sqldebugger, $translate;
global $useragent_msie;
$cookie->close(); $cookie->close();


// if the user is an admin, dont cache the content // if the user is an admin, dont cache the content
Expand Down Expand Up @@ -184,6 +185,7 @@ function display($dummy1=null, $dummy2=null, $dummy3=null)
$optn['geokrety'] = $opt['geokrety']; $optn['geokrety'] = $opt['geokrety'];
$optn['template']['usercountrieslist'] = labels::getLabels('usercountrieslist'); $optn['template']['usercountrieslist'] = labels::getLabels('usercountrieslist');
$optn['help']['oconly'] = helppagelink('oconly','OConly'); $optn['help']['oconly'] = helppagelink('oconly','OConly');
$optn['msie'] = $useragent_msie;


// url-sessions? (for session timout display) // url-sessions? (for session timout display)
$optn['session']['url'] = false; $optn['session']['url'] = false;
Expand Down
1 change: 1 addition & 0 deletions htdocs/lib2/logic/const.inc.php
Expand Up @@ -72,6 +72,7 @@
define('USR_OPT_MAP_PREVIEW', 10); define('USR_OPT_MAP_PREVIEW', 10);
define('USR_OPT_PICSTAT', 11); define('USR_OPT_PICSTAT', 11);
define('USR_OPT_TRANSLANG', 12); define('USR_OPT_TRANSLANG', 12);
define('USR_OPT_OCONLY81', 13);


// user.data_license values // user.data_license values
define('OLD_DATA_LICSENSE',0); // before deadline define('OLD_DATA_LICSENSE',0); // before deadline
Expand Down
12 changes: 9 additions & 3 deletions htdocs/resource2/ocstyle/css/style_screen.css
Expand Up @@ -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 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%;} .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 { td.listicon {
width:1%; width:1%;
margin-right:0 !important; margin-right:0 !important;
Expand Down Expand Up @@ -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);} .img-right-border-topmargin {float: right; margin: 3px 0px 0px 10px; border: solid 1px rgb(150,150,150);}


/* Other */ /* Other */
div.default { div.default { font-size:110%; }
font-size:110%; td.default { font-size:12px; }
}


/* Links */ /* Links */
a.nooutline:focus { outline: 0; } a.nooutline:focus { outline: 0; }
Expand Down
9 changes: 9 additions & 0 deletions htdocs/search.php
Expand Up @@ -410,6 +410,7 @@
$options['orderRatingFirst'] = true; $options['orderRatingFirst'] = true;


$options['country'] = isset($_REQUEST['country']) ? $_REQUEST['country'] : ''; $options['country'] = isset($_REQUEST['country']) ? $_REQUEST['country'] : '';
$options['adm2'] = isset($_REQUEST['adm2']) ? $_REQUEST['adm2'] : '';
$options['cachetype'] = isset($_REQUEST['cachetype']) ? $_REQUEST['cachetype'] : ''; $options['cachetype'] = isset($_REQUEST['cachetype']) ? $_REQUEST['cachetype'] : '';


$options['cachesize'] = isset($_REQUEST['cachesize']) ? $_REQUEST['cachesize'] : ''; $options['cachesize'] = isset($_REQUEST['cachesize']) ? $_REQUEST['cachesize'] : '';
Expand Down Expand Up @@ -1015,12 +1016,20 @@
// ignore NC listings, which are mostly unmaintained or dead // ignore NC listings, which are mostly unmaintained or dead
$sql_where[] = "`caches`.`wp_gc_maintained`=''"; $sql_where[] = "`caches`.`wp_gc_maintained`=''";
} }

if (!isset($options['country'])) $options['country']=''; if (!isset($options['country'])) $options['country']='';
if ($options['country'] != '') if ($options['country'] != '')
{ {
$sql_where[] = '`caches`.`country`=\'' . sql_escape($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'] != '') if ($options['cachetype'] != '')
{ {
$types = explode(';', $options['cachetype']); $types = explode(';', $options['cachetype']);
Expand Down
21 changes: 11 additions & 10 deletions htdocs/templates2/ocstyle/res_cacheicon_22.tpl
Expand Up @@ -5,27 +5,28 @@
***************************************************************************} ***************************************************************************}
{strip} {* OCSTYLE *} {strip} {* OCSTYLE *}
{*cachetype=1 status=1 logtype=0 owner=false small=false*} {*cachetype=1 status=1 logtype=0 owner=false small=false*}
{if !isset($alignicon)}{assign var="alignicon" value="left"}{/if}


{if $cachetype==1} {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} {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} {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} {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} {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} {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} {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} {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} {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} {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} {else}
&nbsp; &nbsp;
{/if} {/if}
Expand Down
29 changes: 29 additions & 0 deletions htdocs/templates2/ocstyle/res_cachetypestats.tpl
@@ -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}%&nbsp;</span>
{/if}
{if $opt.msie}
</td>
{else}
</div>
{/if}
{/foreach}
{if $opt.msie}
</tr></table>
{/if}

0 comments on commit 21f9939

Please sign in to comment.