Skip to content

Commit

Permalink
Added found-by-user indication in cacheratings.php + golden color for…
Browse files Browse the repository at this point in the history
… ftf markers on myneighborhood.php map

git-svn-id: https://opencaching-pl.googlecode.com/svn/trunk@5434 19cba9c3-8ce2-6c67-1c13-32ea8d8b491d
  • Loading branch information
feliks.przybyszewski@gmail.com authored and wrygiel committed Jul 27, 2015
1 parent 8858b0d commit 606d119
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
18 changes: 15 additions & 3 deletions cacheratings.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@
require_once('./lib/cache_icon.inc.php');
require_once($rootpath . 'lib/caches.inc.php');
require_once($stylepath . '/lib/icons.inc.php');
require_once __DIR__.'/lib/myn.inc.php';
require_once __DIR__.'/lib/db.php';

global $usr;
//Preprocessing
if ($error == false)
{
Expand Down Expand Up @@ -52,6 +55,7 @@
`user`.`username` `username`,
`caches`.`cache_id` `cache_id`,
`caches`.`name` `name`,
`caches`.`type` AS `cache_type`,
`cache_type`.`icon_large` `icon_large`,
count(`cache_rating`.`cache_id`) as `anzahl`
FROM `caches`, `user`, `cache_type`, `cache_rating`
Expand All @@ -62,8 +66,8 @@
GROUP BY `user`.`user_id`, `user`.`username`, `caches`.`cache_id`, `caches`.`name`, `cache_type`.`icon_large`
ORDER BY `anzahl` DESC, `caches`.`name` ASC
LIMIT ' . ($startat+0) . ', ' . ($perpage+0));

$cacheline = '<tr><td>&nbsp;</td><td><span class="content-title-noshade txt-blue08" >{rating_absolute}</span></td><td><img src="{cacheicon}" class="icon16" alt="Cache" title="Cache" /></td><td><strong><a class="links" href="viewcache.php?cacheid={cacheid}">{cachename}</a></strong></td><td><strong><a class="links" href="viewprofile.php?userid={userid}">{username}</a></strong></td></tr>';
$tr_myn_click_to_view_cache=tr('myn_click_to_view_cache');
$cacheline = '<tr><td>&nbsp;</td><td><span class="content-title-noshade txt-blue08" >{rating_absolute}</span></td><td><a class="links" href="viewcache.php?cacheid={cacheid}"><img src="{cacheicon}" class="icon16" alt="'.$tr_myn_click_to_view_cache.'" title="'.$tr_myn_click_to_view_cache.'" /></a></td><td><strong><a class="links" href="viewcache.php?cacheid={cacheid}">{cachename}</a></strong></td><td><strong><a class="links" href="viewprofile.php?userid={userid}">{username}</a></strong></td></tr>';

if (mysql_num_rows($rs) == 0)
{
Expand All @@ -77,14 +81,22 @@
for ($i = 0; $i < mysql_num_rows($rs); $i++)
{
$record = sql_fetch_array($rs);
$cacheicon = 'tpl/stdstyle/images/'.getSmallCacheIcon($record['icon_large']);
//$cacheicon = 'tpl/stdstyle/images/'.getSmallCacheIcon($record['icon_large']);

$thisline = $cacheline;
$thisline = mb_ereg_replace('{cacheid}', urlencode($record['cache_id']), $thisline);
$thisline = mb_ereg_replace('{cachename}', htmlspecialchars($record['name'], ENT_COMPAT, 'UTF-8'), $thisline);
$thisline = mb_ereg_replace('{userid}', urlencode($record['user_id']), $thisline);
$thisline = mb_ereg_replace('{username}', htmlspecialchars($record['username'], ENT_COMPAT, 'UTF-8'), $thisline);
$thisline = mb_ereg_replace('{rating_absolute}', $record['anzahl'], $thisline);

$cacheicon = $cache_icon_folder;
if ( $record['cache_type']!="6") { //if not event - check is_cache found
$cacheicon .=is_cache_found($record ['cache_id'], $usr['userid']) ? $foundCacheTypesIcons[ $record['cache_type']] : $CacheTypesIcons[$record ['cache_type']] ;
} else { //if an event - check is_event_attended - only hipothetical as normally events are not displayed here
$cacheicon .=is_event_attended ($record['cache_id'], $usr['userid']) ? $foundCacheTypesIcons["6"] : $CacheTypesIcons["6"] ;
};

$thisline = mb_ereg_replace('{cacheicon}', $cacheicon, $thisline);

$file_content .= $thisline . "\n";
Expand Down
4 changes: 2 additions & 2 deletions myneighborhood.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ function create_map_url($markerpos, $index,$latitude,$longitude) {
}
$markers_str = "&amp;markers=color:blue|size:small|";
$markers_ev_str = "&amp;markers=color:orange|size:small|";
$markers_ftf_str = "&amp;markers=color:0x66FF33|size:small|";
$markers_ftf_str = "&amp;markers=color:0xFFD700|size:small|";
$sel_marker_str = "";
foreach ($markers as $i => $marker) {
$lat = sprintf("%.3f", $marker['lat']);
Expand All @@ -216,7 +216,7 @@ function create_map_url($markerpos, $index,$latitude,$longitude) {
if ($i != $index)
$markers_ftf_str .= "$lat,$lon|";
else
$sel_marker_str = "&amp;markers=color:0x66FF33|label:$type|$lat,$lon|";
$sel_marker_str = "&amp;markers=color:0xFFD700|label:$type|$lat,$lon|";
else if (strcmp ($kind, 'new') == 0)
if ($i != $index)
$markers_str .= "$lat,$lon|";
Expand Down

0 comments on commit 606d119

Please sign in to comment.