Skip to content
Permalink
Browse files

option to hide archived own caches in profile

  • Loading branch information...
following5 committed Jun 17, 2013
1 parent a572d7b commit 9a43ed254049f1fa9a9ba4918e3e960d5889e27e
Showing with 70 additions and 14 deletions.
  1. +10 −6 htdocs/doc/sql/static-data/data.sql
  2. +1 −0 htdocs/myhome.php
  3. +59 −8 htdocs/templates2/ocstyle/myhome.tpl
@@ -1374,7 +1374,7 @@ INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('502', 'Finds: %
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('503', 'Your latest log entries:', '2010-08-28 11:48:04');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('504', 'No entries found', '2010-08-28 11:48:04');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('505', 'Geocaches hidden: %1', '2010-08-28 11:48:04');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('506', 'Your geocaches hidden:', '2010-08-28 11:48:04');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('506', 'Your geocaches hidden', '2010-08-28 11:48:04');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('507', 'No Geocaches hidden', '2010-08-28 11:48:04');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('508', 'Unpublished Geocaches', '2010-08-28 11:48:04');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('509', 'All Geocaches are published', '2010-08-28 11:48:04');
@@ -2502,6 +2502,8 @@ INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2080', 'only ac
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2081', 'Finds', '2013-05-28 16:51:40');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2082', 'Locked', '2013-04-25 23:00:00');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2083', 'NEW', '2013-04-25 23:00:00');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2084', 'show archived', '2013-04-25 23:00:00');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2085', 'hide archived', '2013-04-25 23:00:00');

-- Table sys_trans_ref
SET NAMES 'utf8';
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('503', 'DE', 'Deine letzten Logeinträge:', '2010-08-28 11:48:06');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('504', 'DE', 'Keine Einträge gefunden', '2010-08-28 11:48:06');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('505', 'DE', 'Versteckte Caches: %1', '2010-08-28 11:48:06');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('506', 'DE', 'Deine versteckten Caches:', '2010-08-28 11:48:06');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('506', 'DE', 'Deine versteckten Caches', '2010-08-28 11:48:06');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('507', 'DE', 'Du hast noch keine Geocaches versteckt.', '2010-08-28 11:48:06');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('508', 'DE', 'Deine noch nicht veröffentlichten Caches:', '2012-07-23 15:54:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('509', 'DE', 'Keine nicht veröffentlichten Caches', '2010-08-28 11:48:06');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2081', 'DE', 'Funde', '2013-04-25 23:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2082', 'DE', 'Gesperrt', '2013-04-25 23:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2083', 'DE', 'NEU', '2013-04-25 23:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2084', 'DE', 'archivierte einblenden', '2013-04-25 23:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2085', 'DE', 'archivierte ausblenden', '2013-04-25 23:00:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1', 'EN', 'Reorder IDs \r', '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');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('503', 'EN', 'Your latest log entries:', '2010-08-28 11:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('504', 'EN', 'No entries found', '2010-08-28 11:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('505', 'EN', 'Geocaches hidden: %1', '2010-08-28 11:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('506', 'EN', 'Your geocaches hidden:', '2010-08-28 11:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('506', 'EN', 'Your geocaches hidden', '2010-08-28 11:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('507', 'EN', 'No geocaches hidden ', '2010-08-28 11:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('508', 'EN', 'Your pending geocaches:', '2012-07-23 15:54:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('509', 'EN', 'All your geocaches are published.', '2010-08-28 11:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('503', 'ES', 'Sus últimas entradas de Logs:', '2010-12-09 00:17:57');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('504', 'ES', 'No hay encuentros', '2010-12-09 00:17:57');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('505', 'ES', 'Geocaches escondidos: %1', '2010-12-09 00:17:57');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('506', 'ES', 'Tus geocaches escondidos:', '2010-12-09 00:17:57');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('506', 'ES', 'Tus geocaches escondidos', '2010-12-09 00:17:57');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('507', 'ES', 'No hay geocaches escondidos', '2010-12-09 00:17:57');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('508', 'ES', 'Tus geocaches pendientes de publicar', '2010-12-09 00:17:57');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('509', 'ES', 'Todos tus caches estan publicados', '2010-12-09 00:17:57');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('503', 'IT', 'I tuoi ultimi log:', '2010-08-31 20:06:23');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('504', 'IT', 'Nessuna trovata', '2010-10-27 18:49:19');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('505', 'IT', 'Geocaches nascoste: %1', '2010-08-31 20:06:23');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('506', 'IT', 'Le tue geocaches nascoste:', '2010-09-01 23:48:28');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('506', 'IT', 'Le tue geocaches nascoste', '2010-09-01 23:48:28');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('507', 'IT', 'Nessuna geocache nascosta', '2010-10-27 18:49:19');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('508', 'IT', 'Le tue geocache in attesa di pubblicazione', '2010-10-27 18:49:19');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('509', 'IT', 'Tutte le tue geocache sono pubblicate.', '2010-08-31 20:06:23');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('503', 'NL', 'Je laatste logjes:', '2011-02-04 19:50:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('504', 'NL', 'Geen items gevonden', '2011-02-04 19:50:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('505', 'NL', 'Geplaatste caches: %1', '2011-02-04 19:50:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('506', 'NL', 'Jouw geplaatste caches:', '2011-02-04 19:50:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('506', 'NL', 'Jouw geplaatste caches', '2011-02-04 19:50:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('507', 'NL', 'Geen geplaatste caches gevonden', '2011-02-04 19:50:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('508', 'NL', 'Jouw nog niet gepubliceerde caches:', '2012-07-23 15:54:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('509', 'NL', 'Geen ongepubliceerde caches.', '2011-02-04 19:50:07');
@@ -57,6 +57,7 @@
$tpl->assign('dotfill','');
else
$tpl->assign('dotfill','...........................................................................................................');
$tpl->add_body_load('myHomeLoad()');
//get not published caches
$tpl->assign_rs('notpublished', sql("SELECT `caches`.`cache_id`, `caches`.`name`, `caches`.`date_hidden`, `caches`.`date_activate`, `caches`.`status`, `caches`.`wp_oc`, `caches`.`type`
@@ -5,17 +5,62 @@
***************************************************************************}
{* OCSTYLE *}

<script type="text/javascript">
{literal}<!--
function toggle_archived()
{
var archived = document.getElementsByName("row_archived");
var show;
if (archived[0].style.display == "none")
{
show="";
document.getElementById("show_archived").style.display = "none";
document.getElementById("hide_archived").style.display = "";
}
else
{
show="none";
document.getElementById("hide_archived").style.display = "none";
document.getElementById("show_archived").style.display = "";
}
for (var i=0; i<archived.length; i++)
archived[i].style.display = show;
var dCookieExp = new Date(2049, 12, 31);
document.cookie = "ocprofilearchived=" + show + ";expires=" + dCookieExp.toUTCString();
}
function myHomeLoad()
{
var archived = document.getElementsByName("row_archived");
if (archived.length > 0) // is 0 for MSIE due to getElementsByName() bug
{
var sCookieContent = document.cookie.split(";");
for (var nIndex = 0; nIndex < sCookieContent.length; nIndex++)
{
var sCookieValue = sCookieContent[nIndex].split("=");
if (sCookieValue[0].replace(/^\s+/,'') == "ocprofilearchived" && sCookieValue[1] == "none")
toggle_archived();
}
document.getElementById("toggle_archived_option").style.display = "";
}
}
-->{/literal}
</script>
{* Welcome *}
<div class="content2-pagetitle">
<img src="resource2/{$opt.template.style}/images/misc/32x32-home.png" border="0" width="32px" height="32px" style="align: left; margin-right: 10px;" />
<img src="resource2/{$opt.template.style}/images/misc/32x32-home.png" border="0" width="32px" height="32px" style="margin-right: 10px;" />
{t 1=$login.username}Hello %1{/t}
</div>
{if !$allpics}
{* Geocaches found *}
<div class="content2-container bg-blue02" style="margin-top:20px;">
<p class="content-title-noshade-size3">
<img src="resource2/{$opt.template.style}/images/description/22x22-logs.png" width="22" height="22" style="align: left; margin-right: 10px;" />&nbsp;
<img src="resource2/{$opt.template.style}/images/description/22x22-logs.png" width="22" height="22" style="margin-right: 10px;" />&nbsp;
{t 1=$found}Finds: %1{/t} &nbsp;
<span class="content-title-link">[<a href="search.php?showresult=1&amp;expert=0&amp;output=HTML&amp;sort=bymylastlog&amp;finderid={$login.userid}&amp;searchbyfinder=&amp;f_inactive=0&amp;logtype=1,7&amp;calledbysearch=0">{t}Geocaches found{/t}</a>]&nbsp; [<a href="search.php?showresult=1&amp;expert=0&amp;output=HTML&amp;sort=bymylastlog&amp;finderid={$login.userid}&amp;searchbyfinder=&amp;f_inactive=0&amp;logtype=1,2,3,4,5,6,7,8,9,10,11,12,13,14&amp;calledbysearch=0">{t}Geocaches logged{/t}</a>]</span>
</p>
@@ -28,7 +73,7 @@
{foreach from=$logs item=logItem}
<tr>
<td>{include file="res_logtype.tpl" type=$logItem.type}</td>
<td style="white-space:nowrap">{$logItem.date|date_format:$opt.format.datelong}</td>
<td style="white-space:nowrap; text-align:center">{$logItem.date|date_format:$opt.format.datelong}</td>
<td><a href="viewcache.php?wp={$logItem.wp_oc}">{$logItem.name|escape}</a> {t}by{/t} <a href="viewprofile.php?userid={$logItem.userid}">{$logItem.username|escape}</a></td>
</tr>
{foreachelse}
@@ -40,7 +85,7 @@
{* Log pictures *}
<div class="content2-container bg-blue02" style="margin-top:20px;">
<p class="content-title-noshade-size3">
<img src="resource2/{$opt.template.style}/images/misc/32x32-pictures.gif" width="24" height="24" style="align: left; margin-right: 10px;" />&nbsp;
<img src="resource2/{$opt.template.style}/images/misc/32x32-pictures.gif" width="24" height="24" style="margin-right: 10px;" />&nbsp;
{t 1=$total_pictures}Log pictures: %1{/t} &nbsp;
{if !$allpics}<span class="content-title-link">[<a href="myhome.php?allpics=1">{t}Show all{/t}</a>]</span>{/if}
</p>
@@ -70,7 +115,7 @@
{* Geocaches hidden *}
<div class="content2-container bg-blue02" style="margin-top:5px;">
<p class="content-title-noshade-size3">
<img src="resource2/{$opt.template.style}/images/misc/22x22-traditional.gif" width="22" height="22" style="align: left; margin-right: 10px;" />&nbsp;
<img src="resource2/{$opt.template.style}/images/misc/22x22-traditional.gif" width="22" height="22" style="margin-right: 10px;" />&nbsp;
{t 1=$hidden}Geocaches hidden: %1{/t} &nbsp;
{* Ocprop: (find|us|own)erid=([0-9]+) *}
<span class="content-title-link">[<a href="search.php?showresult=1&amp;expert=0&amp;output=HTML&amp;sort=byname&amp;ownerid={$login.userid}&amp;searchbyowner=&amp;f_inactive=0&calledbysearch=0">{t}Show details{/t}</a>]&nbsp; [<a href="search.php?showresult=1&amp;expert=0&amp;output=HTML&amp;sort=byname&amp;ownerid={$login.userid}&amp;searchbyowner=&amp;f_inactive=1&calledbysearch=0">... {t}only active caches{/t}</a>]</span>
@@ -82,7 +127,13 @@
{if $caches|@count == 0}
<td colspan="4"><p style="margin-bottom:24px">{t}No Geocaches hidden{/t}</p></td>
{else}
<td colspan="4"><b><span style="line-height:2em">{t}Your geocaches hidden:{/t}</b></span></td>
{assign var="archived" value=0}
{foreach from=$caches item=cacheItem}
{if $cacheItem.status > 2}
{assign var="archived" value=$archived+1}
{/if}
{/foreach}
<td colspan="4"><b><span style="line-height:2em">{t}Your geocaches hidden{/t}</b><span id="toggle_archived_option" style="display:none">{if $archived>0} (<a href="javascript:toggle_archived()" style="outline:none"><span id="hide_archived">{t}hide archived{/t}</span><span id="show_archived" style="display:none">{t}show archived{/t}</span></a>){/if}</span>:</span></td>
<td colspan="2" style="text-align:right"><span style="line-height:2em"><b>{t}Finds{/t} / {t}Last log{/t}</b></span></td>
{/if}
</tr>
@@ -92,9 +143,9 @@
{else}
{assign var="listcolor" value=""}
{/if}
<tr>
<tr {if $cacheItem.status>2}name="row_archived"{/if}>
<td>{include file="res_cacheicon_22.tpl" cachetype=$cacheItem.type}</td>
<td class="{$listcolor}"><nobr>{$cacheItem.date_hidden|date_format:$opt.format.datelong}&nbsp;</nobr></td>
<td class="{$listcolor}" style="text-align:center"><nobr>{$cacheItem.date_hidden|date_format:$opt.format.datelong}&nbsp;</nobr></td>
<td class="{$listcolor}">{include file="res_cachestatus.tpl" status=$cacheItem.status}</td>
<td class="{$listcolor}" style="{if strlen($cacheItem.name) < 45}white-space:nowrap;{/if}min-width:300px;max-width:{if $dotfill==''}400{else}300{/if}px;overflow:hidden;"><a href="viewcache.php?wp={$cacheItem.wp_oc}">{$cacheItem.name|escape}</a>{if strlen($cacheItem.name) < 45} &nbsp;&nbsp; <span style="color:#b0b0b0">{$dotfill}</span>{/if}</td>
<td class="{$listcolor}" style="text-align:right;" align="right"><nobr>&nbsp;&nbsp;{if $cacheItem.found>0}{$cacheItem.found}{/if} &nbsp;&nbsp; <a href="viewcache.php?cacheid={$cacheItem.cache_id}#logentries">{$cacheItem.lastlog|date_format:$opt.format.date}</a>&nbsp; {include file="res_logtype.tpl" type=$cacheItem.lastlog_type}</nobr></td>

0 comments on commit 9a43ed2

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