From d8803d0d6bd7b21fae7c70e42f6f38eba98694da Mon Sep 17 00:00:00 2001 From: flopp Date: Thu, 16 May 2013 19:56:37 +0200 Subject: [PATCH] styled minimap for new caches; made minimap url configurable; fixed line-breaking in new caches list --- htdocs/config2/settings-dist.inc.php | 11 +++++++++-- htdocs/index.php | 12 +++++++++++- htdocs/resource2/ocstyle/css/style_screen.css | 8 ++++++++ htdocs/templates2/ocstyle/res_newcaches.tpl | 17 ++++++++--------- 4 files changed, 36 insertions(+), 12 deletions(-) diff --git a/htdocs/config2/settings-dist.inc.php b/htdocs/config2/settings-dist.inc.php index 72e007c8..b7c61495 100644 --- a/htdocs/config2/settings-dist.inc.php +++ b/htdocs/config2/settings-dist.inc.php @@ -305,7 +305,14 @@ */ $opt['logic']['cachemaps']['url'] = 'http://maps.google.com/maps/api/staticmap?center={latitude},{longitude}&zoom={userzoom}&size=200x200&maptype=hybrid&markers=color:blue|label:|{latitude},{longitude}&sensor=false&key={gmkey}'; $opt['logic']['cachemaps']['iframe'] = false; - + + /* Minimap for the new-caches list on the front page. + * If the url string is empty, no minimap is displayed on the front page. + * + * Coordinates of new caches are appended to the url. + */ + $opt['logic']['minimapurl'] = 'http://maps.googleapis.com/maps/api/staticmap?sensor=false&size=220x220&maptype=roadmap&markers=color:blue|size:small'; + /* target vars * all _REQUEST-vars that identifiy the current page for target redirection after login */ @@ -554,4 +561,4 @@ // explanation of nature protection areas $opt['cms']['npa'] = 'http://wiki.opencaching.de/index.php/Schutzgebiete'; -?> \ No newline at end of file +?> diff --git a/htdocs/index.php b/htdocs/index.php index 636dbac7..8a478acb 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -100,7 +100,17 @@ // get newest caches $tpl->assign_rs('newcaches', $getNew->rsForSmarty('cache')); - + // enable minimap for new caches if url is set + if ($opt['logic']['minimapurl'] != '') + { + $tpl->assign('minimap_url', $opt['logic']['minimapurl']); + $tpl->assign('minimap_enabled', true); + } + else + { + $tpl->assign('minimap_enabled', false); + } + // last 30 days' top ratings $tpl->assign_rs('topratings', $getNew->rsForSmarty('rating')); diff --git a/htdocs/resource2/ocstyle/css/style_screen.css b/htdocs/resource2/ocstyle/css/style_screen.css index 2ef130b7..ba2b5a7d 100644 --- a/htdocs/resource2/ocstyle/css/style_screen.css +++ b/htdocs/resource2/ocstyle/css/style_screen.css @@ -784,6 +784,14 @@ p.main-totalstats { -webkit-box-shadow: 1px 2px 2px #555; } +.img-minimap { + border: 1px solid #a9a9a9; + padding: 2px; + box-shadow: 1px 2px 2px #555; + -moz-box-shadow: 1px 2px 2px #555; + -webkit-box-shadow: 1px 2px 2px #555; +} + form#register label { text-align: right; width: 14em; diff --git a/htdocs/templates2/ocstyle/res_newcaches.tpl b/htdocs/templates2/ocstyle/res_newcaches.tpl index 7aa21681..20d7fdc5 100755 --- a/htdocs/templates2/ocstyle/res_newcaches.tpl +++ b/htdocs/templates2/ocstyle/res_newcaches.tpl @@ -3,12 +3,15 @@ * * Unicode Reminder メモ ***************************************************************************} -
-
+{if $minimap_enabled} +
+ +{/if}
    {foreach name=newcaches from=$newcaches item=cacheitem}
  • {include file="res_cacheicon_22.tpl" cachetype=$cacheitem.type} +
    {$cacheitem.date_created|date_format:$opt.format.date}  {$cacheitem.name|escape} {t}by{/t} @@ -20,14 +23,10 @@ {$cacheitem.adm4|escape}

    +
  • {/foreach}
+{if $minimap_enabled}
-
- -
-{t}Large map{/t} -
-
-
+{/if}