Skip to content

Commit

Permalink
added OConly mark to more cache lists; changed link title
Browse files Browse the repository at this point in the history
  • Loading branch information
following5 committed Jul 19, 2013
1 parent c7e6cf5 commit 92d3764
Show file tree
Hide file tree
Showing 16 changed files with 34 additions and 28 deletions.
2 changes: 1 addition & 1 deletion htdocs/lib2/OcSmarty.class.php
Expand Up @@ -182,7 +182,7 @@ function display($dummy1=null, $dummy2=null, $dummy3=null)
$optn['cms'] = $opt['cms'];
$optn['geokrety'] = $opt['geokrety'];
$optn['template']['usercountrieslist'] = labels::getLabels('usercountrieslist');
$optn['help']['oconly'] = helppagelink('oconly');
$optn['help']['oconly'] = helppagelink('oconly','OConly');

// url-sessions? (for session timout display)
$optn['session']['url'] = false;
Expand Down
4 changes: 2 additions & 2 deletions htdocs/lib2/common.inc.php
Expand Up @@ -344,7 +344,7 @@ function fix_magic_quotes_gpc()
// pay attention to use only ' quotes in $text (escape other ')
//
// see corresponding function in lib/common.inc.php
function helppagelink($ocpage)
function helppagelink($ocpage, $title='Instructions')
{
global $opt, $translate;

Expand All @@ -358,7 +358,7 @@ function helppagelink($ocpage)
if ($helppage == "" && isset($opt['locale'][$opt['template']['locale']]['help'][$ocpage]))
$helppage = $opt['locale'][$opt['template']['locale']]['help'][$ocpage];

$imgtitle = $translate->t('Instructions', '', basename(__FILE__), __LINE__);
$imgtitle = $translate->t($title, '', basename(__FILE__), __LINE__);
$imgtitle = "alt='" . $imgtitle . "' title='" . $imgtitle . "'";

if (substr($helppage,0,1) == "!")
Expand Down
12 changes: 7 additions & 5 deletions htdocs/myhome.php
Expand Up @@ -29,25 +29,27 @@

//get last logs
$tpl->assign_rs('logs', sql("SELECT `cache_logs`.`cache_id` `cacheid`, `cache_logs`.`type` `type`, `cache_logs`.`date` `date`, `caches`.`name` `name`,
`user`.`user_id` AS `userid`, `user`.`username`, `caches`.`wp_oc`
FROM `cache_logs`, `caches`, `user`
`user`.`user_id` AS `userid`, `user`.`username`, `caches`.`wp_oc`, `ca`.`attrib_id` IS NOT NULL AS `oconly`
FROM `cache_logs`
INNER JOIN `caches` ON `cache_logs`.`cache_id`=`caches`.`cache_id`
INNER JOIN `user` ON `caches`.`user_id`=`user`.`user_id`
LEFT JOIN `caches_attributes` `ca` ON `ca`.`cache_id`=`caches`.`cache_id` AND `ca`.`attrib_id`=6
WHERE `cache_logs`.`user_id`='&1'
AND `cache_logs`.`cache_id`=`caches`.`cache_id`
AND `caches`.`user_id`=`user`.`user_id`
ORDER BY `cache_logs`.`date` DESC, `cache_logs`.`date_created` DESC LIMIT 10", $login->userid));

//get last hidden caches
$tpl->assign_rs('caches', sql("SELECT `caches`.`cache_id`, `caches`.`name`, `caches`.`type`,
`caches`.`date_hidden`, `caches`.`status`, `caches`.`wp_oc`,
`found`,
/* COUNT(*) as `logcount`, */
`ca`.`attrib_id` IS NOT NULL AS `oconly`,
MAX(`cache_logs`.`date`) AS `lastlog`,
(SELECT `type` FROM `cache_logs` `cl2`
WHERE `cl2`.`cache_id`=`caches`.`cache_id`
ORDER BY `date` DESC,`id` DESC LIMIT 1) AS `lastlog_type`
FROM `caches`
LEFT JOIN `stat_caches` ON `stat_caches`.`cache_id`=`caches`.`cache_id`
LEFT JOIN `cache_logs` ON `cache_logs`.`cache_id`=`caches`.`cache_id`
LEFT JOIN `caches_attributes` `ca` ON `ca`.`cache_id`=`caches`.`cache_id` AND `ca`.`attrib_id`=6
WHERE `caches`.`user_id`='&1'
AND `caches`.`status` != 5
GROUP BY `caches`.`cache_id`
Expand Down
2 changes: 1 addition & 1 deletion htdocs/myignores.php
Expand Up @@ -15,7 +15,7 @@
if ($login->userid == 0)
$tpl->redirect('login.php?target=mytop5.php');

$rs = sql("SELECT `cache_ignore`.`cache_id` AS `cacheid`, `caches`.`wp_oc` AS `wp`, `caches`.`name` AS `name`, `caches`.`type` AS `type`, `caches`.`status` AS `status` FROM `cache_ignore` INNER JOIN `caches` ON `cache_ignore`.`cache_id`=`caches`.`cache_id` INNER JOIN `cache_status` ON `caches`.`status`=`cache_status`.`id` WHERE `cache_ignore`.`user_id`='&1' AND `cache_status`.`allow_user_view`=1 ORDER BY `caches`.`name`", $login->userid);
$rs = sql("SELECT `cache_ignore`.`cache_id` AS `cacheid`, `caches`.`wp_oc` AS `wp`, `caches`.`name` AS `name`, `caches`.`type` AS `type`, `caches`.`status` AS `status`, `ca`.`attrib_id` IS NOT NULL AS `oconly` FROM `cache_ignore` INNER JOIN `caches` ON `cache_ignore`.`cache_id`=`caches`.`cache_id` 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_ignore`.`user_id`='&1' AND `cache_status`.`allow_user_view`=1 ORDER BY `caches`.`name`", $login->userid);
$tpl->assign_rs('ignores', $rs);
sql_free_result($rs);

Expand Down
9 changes: 5 additions & 4 deletions htdocs/mytop5.php
Expand Up @@ -39,10 +39,11 @@
}
}

$rs = sql("SELECT `cache_rating`.`cache_id` AS `cacheid`, `cache_rating`.`rating_date`, `caches`.`wp_oc` AS `wp`, `caches`.`name` AS `cachename`, `caches`.`type` AS `type`, `caches`.`status` AS `status`
FROM `cache_rating`, `caches`
WHERE `cache_rating`.`cache_id`=`caches`.`cache_id`
AND `cache_rating`.`user_id`='&1'
$rs = sql("SELECT `cache_rating`.`cache_id` AS `cacheid`, `cache_rating`.`rating_date`, `caches`.`wp_oc` AS `wp`, `caches`.`name` AS `cachename`, `caches`.`type` AS `type`, `caches`.`status` AS `status`, `ca`.`attrib_id` IS NOT NULL AS `oconly`
FROM `cache_rating`
INNER JOIN `caches` ON `cache_rating`.`cache_id`=`caches`.`cache_id`
LEFT JOIN `caches_attributes` `ca` ON `ca`.`cache_id`=`caches`.`cache_id` AND `ca`.`attrib_id`=6
WHERE `cache_rating`.`user_id`='&1'
ORDER BY `caches`.`name` ASC", $login->userid);
$tpl->assign_rs('ratings', $rs);
sql_free_result($rs);
Expand Down
2 changes: 1 addition & 1 deletion htdocs/mywatches.php
Expand Up @@ -75,7 +75,7 @@
}
else
{
$rs = sql("SELECT `cache_watches`.`cache_id` AS `cacheid`, `caches`.`wp_oc` AS `wp`, `caches`.`name` AS `name`, `stat_caches`.`last_found` AS `lastfound`, `caches`.`type` AS `type`, `caches`.`status` AS `status` FROM `cache_watches` INNER JOIN `caches` ON `cache_watches`.`cache_id`=`caches`.`cache_id` INNER JOIN `cache_status` ON `caches`.`status`=`cache_status`.`id` LEFT JOIN `stat_caches` ON `caches`.`cache_id`=`stat_caches`.`cache_id` WHERE (`cache_status`.`allow_user_view`=1 OR `caches`.`user_id`='&1') AND `cache_watches`.`user_id`='&1' ORDER BY `caches`.`name`", $login->userid);
$rs = sql("SELECT `cache_watches`.`cache_id` AS `cacheid`, `caches`.`wp_oc` AS `wp`, `caches`.`name` AS `name`, `stat_caches`.`last_found` AS `lastfound`, `caches`.`type` AS `type`, `caches`.`status` AS `status`, `ca`.`attrib_id` IS NOT NULL AS `oconly` FROM `cache_watches` INNER JOIN `caches` ON `cache_watches`.`cache_id`=`caches`.`cache_id` INNER JOIN `cache_status` ON `caches`.`status`=`cache_status`.`id` LEFT JOIN `stat_caches` ON `caches`.`cache_id`=`stat_caches`.`cache_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 OR `caches`.`user_id`='&1') AND `cache_watches`.`user_id`='&1' ORDER BY `caches`.`name`", $login->userid);
$tpl->assign_rs('watches', $rs);
sql_free_result($rs);
}
Expand Down
Binary file added htdocs/resource2/ocstyle/images/misc/15x21-oc.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions htdocs/templates2/ocstyle/myhome.tpl
Expand Up @@ -74,7 +74,7 @@ function myHomeLoad()
<tr>
<td>{include file="res_logtype.tpl" type=$logItem.type}</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>
<td><a href="viewcache.php?wp={$logItem.wp_oc}">{$logItem.name|escape}</a> {include file="res_oconly.tpl" oconly=$logItem.oconly} {t}by{/t} <a href="viewprofile.php?userid={$logItem.userid}">{$logItem.username|escape}</a></td>
</tr>
{foreachelse}
<tr><td>{t}No entries found{/t}</td></tr>
Expand Down Expand Up @@ -144,7 +144,7 @@ function myHomeLoad()
{assign var="listcolor" value=""}
{/if}
<tr {if $cacheItem.status>2}name="row_archived"{/if}>
<td>{include file="res_cacheicon_22.tpl" cachetype=$cacheItem.type}</td>
<td>{include file="res_cacheicon_22.tpl" cachetype=$cacheItem.type} {include file="res_oconly.tpl" oconly=$cacheItem.oconly size="15x21"}</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>
Expand All @@ -160,7 +160,7 @@ function myHomeLoad()
</tr>
{foreach from=$notpublished item=notpublishedItem}
<tr>
<td>{include file="res_cacheicon_22.tpl" cachetype=$notpublishedItem.type}</td>
<td>{include file="res_cacheicon_22.tpl" cachetype=$notpublishedItem.type} {include file="res_oconly.tpl" oconly=$cacheItem.oconly size="15x21"}</td>
<td>{$notpublishedItem.date_activate|date_format:$opt.format.datelong}</td>
<td>{include file="res_cachestatus.tpl" status=$notpublishedItem.status}</td>
<td><a href="viewcache.php?wp={$notpublishedItem.wp_oc}">{$notpublishedItem.name|escape}</a></td>
Expand Down
8 changes: 4 additions & 4 deletions htdocs/templates2/ocstyle/myignores.tpl
Expand Up @@ -22,10 +22,10 @@
{foreach from=$ignores item=ignoreItem}
{cycle values="listcolor1,listcolor2" assign=listcolor}
<tr>
<td class="{$listcolor}">{include file="res_cacheicon_22.tpl" cachetype=$ignoreItem.type|escape}</th>
<td class="{$listcolor}">{include file="res_cachestatus.tpl" status=$ignoreItem.status}</th>
<td class="{$listcolor}"><span style="{include file="res_cachestatus_span.tpl" status=$ignoreItem.status}"><a href="viewcache.php?wp={$ignoreItem.wp}">{$ignoreItem.name|escape}</a></span></th>
<td class="{$listcolor}">[<a href="javascript:if(confirm('{t escape=js}Do you really want to delete this entry?{/t}'))location.href='ignore.php?cacheid={$ignoreItem.cacheid}&action=removeignore'">{t}remove{/t}</a>]</th>
<td class="{$listcolor}">{include file="res_cacheicon_22.tpl" cachetype=$ignoreItem.type|escape}</td>
<td class="{$listcolor}">{include file="res_cachestatus.tpl" status=$ignoreItem.status}</td>
<td class="{$listcolor}"><span style="{include file="res_cachestatus_span.tpl" status=$ignoreItem.status}"><a href="viewcache.php?wp={$ignoreItem.wp}">{$ignoreItem.name|escape}</a></span> {include file="res_oconly.tpl" oconly=$ignoreItem.oconly}</td>
<td class="{$listcolor}">[<a href="javascript:if(confirm('{t escape=js}Do you really want to delete this entry?{/t}'))location.href='ignore.php?cacheid={$ignoreItem.cacheid}&action=removeignore'">{t}remove{/t}</a>]</td>
</tr>
{foreachelse}
<tr><td colspan="4"><br />{t}You do not ignore any geocaches now.{/t}</td></tr>
Expand Down
2 changes: 1 addition & 1 deletion htdocs/templates2/ocstyle/mytop5.tpl
Expand Up @@ -33,7 +33,7 @@
<tr>
<td class="{$listcolor}">{include file="res_cacheicon_22.tpl" cachetype=$ratingItem.type|escape}</td>
<td class="{$listcolor}">{include file="res_cachestatus.tpl" status=$ratingItem.status}</td>
<td class="{$listcolor}"><span style="{include file="res_cachestatus_span.tpl" status=$ratingItem.status}"><a href="viewcache.php?wp={$ratingItem.wp}">{$ratingItem.cachename|escape}</a></span></td>
<td class="{$listcolor}"><span style="{include file="res_cachestatus_span.tpl" status=$ratingItem.status}"><a href="viewcache.php?wp={$ratingItem.wp}">{$ratingItem.cachename|escape}</a></span> {include file="res_oconly.tpl" oconly=$ratingItem.oconly}</td>
<td class="{$listcolor}" style="text-align:center">{$ratingItem.rating_date|date_format:$opt.format.date}</td>
<td class="{$listcolor}"><nobr>[<a href="javascript:if(confirm('{t escape=js}Do you really want to remove this recommendation?{/t}'))location.href='mytop5.php?action=delete&amp;cacheid={$ratingItem.cacheid}'">{t}Remove recommendation{/t}</a>]</nobr></td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion htdocs/templates2/ocstyle/mywatches.tpl
Expand Up @@ -131,7 +131,7 @@
<tr>
<td class="{$listcolor}">{include file="res_cacheicon_22.tpl" cachetype=$watchItem.type|escape}</td>
<td class="{$listcolor}">{include file="res_cachestatus.tpl" status=$watchItem.status}</td>
<td class="{$listcolor}"><span style="{include file="res_cachestatus_span.tpl" status=$watchItem.status}"><a href="viewcache.php?wp={$watchItem.wp}">{$watchItem.name|escape}</a></span></td>
<td class="{$listcolor}"><span style="{include file="res_cachestatus_span.tpl" status=$watchItem.status}"><a href="viewcache.php?wp={$watchItem.wp}">{$watchItem.name|escape}</a></span> {include file="res_oconly.tpl" oconly=$watchItem.oconly}</td>
<td class="{$listcolor}" style="text-align:center">
{if $watchItem.lastfound==null}
---
Expand Down
2 changes: 1 addition & 1 deletion htdocs/templates2/ocstyle/res_oconly.tpl
Expand Up @@ -4,5 +4,5 @@
* Unicode Reminder メモ
***************************************************************************}
{if $oconly}
{if $opt.help.oconly != ''}{$opt.help.oconly}{/if}<img src="resource2/ocstyle/images/misc/15x15-oc.png" width="15" height="15" >{if $opt.help.oconly != ''}</a>{/if}
{if $opt.help.oconly != ''}{$opt.help.oconly}{/if}{if $size=='15x21'}<img src="resource2/ocstyle/images/misc/15x21-oc.png" width="15" height="21" >{else}<img src="resource2/ocstyle/images/misc/15x15-oc.png" width="15" height="15" >{/if}{if $opt.help.oconly != ''}</a>{/if}
{/if}
2 changes: 1 addition & 1 deletion htdocs/templates2/ocstyle/tops.tpl
Expand Up @@ -98,7 +98,7 @@
{$topItem.founds}
</td>
<td>
<a href="viewcache.php?wp={$topItem.wpoc}">{$topItem.name|escape}</a> {t}by{/t} <a href="viewprofile.php?userid={$topItem.userid}">{$topItem.username|escape}</a>
<a href="viewcache.php?wp={$topItem.wpoc}">{$topItem.name|escape}</a> {include file="res_oconly.tpl" oconly=$topItem.oconly} {t}by{/t} <a href="viewprofile.php?userid={$topItem.userid}">{$topItem.username|escape}</a>
</td>
</tr>

Expand Down
2 changes: 1 addition & 1 deletion htdocs/templates2/ocstyle/usertops.tpl
Expand Up @@ -22,7 +22,7 @@
{cycle assign=listcolor values="listcolor1,listcolor2"}
<tr>
<td class="{$listcolor}">{include file="res_cacheicon_22.tpl" cachetype=$ratingItem.type|escape}</td>
<td class="{$listcolor}"><span style="{include file="res_cachestatus_span.tpl" status=$ratingItem.status}"><a href="viewcache.php?cacheid={$ratingItem.cacheid}">{$ratingItem.cachename|escape}</a></span>&nbsp;{t 1=$ratingItem.ownername|escape}by %1{/t}</td>
<td class="{$listcolor}"><span style="{include file="res_cachestatus_span.tpl" status=$ratingItem.status}"><a href="viewcache.php?cacheid={$ratingItem.cacheid}">{$ratingItem.cachename|escape}</a></span> {include file="res_oconly.tpl" oconly=$ratingItem.oconly} {t 1=$ratingItem.ownername|escape}by %1{/t}</td>
<td class="{$listcolor}">{include file="res_cachestatus.tpl" status=$ratingItem.status}</td>
</tr>
{foreachelse}
Expand Down
4 changes: 3 additions & 1 deletion htdocs/tops.php
Expand Up @@ -19,14 +19,16 @@
$rs = sql("SELECT IFNULL(`sys_trans_text`.`text`,`cache_location`.`adm1`) AS `adm1`,
`cache_location`.`adm3`,
`rating_tops`.`rating` AS `idx`, `stat_caches`.`toprating` AS `ratings`, `stat_caches`.`found` AS `founds`,
`caches`.`name`, `caches`.`wp_oc` AS `wpoc`, `user`.`username`, `user`.`user_id` AS `userid`
`caches`.`name`, `caches`.`wp_oc` AS `wpoc`, `user`.`username`, `user`.`user_id` AS `userid`,
`ca`.`attrib_id` IS NOT NULL AS `oconly`
FROM `rating_tops`
INNER JOIN `caches` ON `rating_tops`.`cache_id`=`caches`.`cache_id`
INNER JOIN `cache_location` ON `rating_tops`.`cache_id`=`cache_location`.`cache_id`
LEFT JOIN `countries` ON `countries`.`short`=`cache_location`.`code1`
LEFT JOIN `sys_trans_text` ON `sys_trans_text`.`trans_id`=`countries`.`trans_id` AND `sys_trans_text`.`lang`='&1'
INNER JOIN `stat_caches` ON `rating_tops`.`cache_id`=`stat_caches`.`cache_id`
INNER JOIN `user` ON `caches`.`user_id`=`user`.`user_id`
LEFT JOIN `caches_attributes` `ca` ON `ca`.`cache_id`=`caches`.`cache_id` AND `ca`.`attrib_id`=6
ORDER BY `cache_location`.`adm1` ASC,
`cache_location`.`adm3` ASC,
`rating_tops`.`rating` DESC,
Expand Down
3 changes: 2 additions & 1 deletion htdocs/usertops.php
Expand Up @@ -18,11 +18,12 @@
$tpl->assign('userid', $userid);
$tpl->assign('username', $sUsername);

$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`
$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`
INNER JOIN `caches` ON `cache_rating`.`cache_id` = `caches`.`cache_id`
INNER JOIN `user` ON `caches`.`user_id`=`user`.`user_id`
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);
Expand Down

0 comments on commit 92d3764

Please sign in to comment.