Skip to content
Permalink
Browse files

disabled Google Maps link for stored queries, which are not accessibl…

…e from GM; fixes #5
  • Loading branch information...
following5 committed May 31, 2013
1 parent 6954229 commit 7b05652268b738929f6d12f3f856d823fbf31a6e
Showing with 19 additions and 4 deletions.
  1. +4 −0 htdocs/lang/de/ocstyle/search.inc.php
  2. +2 −2 htdocs/lang/de/ocstyle/search.result.caches.tpl.php
  3. +13 −2 htdocs/search.php
@@ -92,6 +92,10 @@
$cache_attrib_img_line1 = '<img id="attrimg1_{id}" src="{icon}" onmousedown="switchAttribute({id})" onmouseover="Tip(\'{html_desc}\', TITLE, \'{name}\', TITLEBGCOLOR, \'{color}\', TITLEFONTCOLOR, \'#000000\', BGCOLOR, \'#FFFFFF\', BORDERCOLOR, \'{color}\', CLICKCLOSE, true, DELAY, 0, FADEIN, false, FADEOUT, false, FONTCOLOR, \'#000080\', WIDTH, 500)" onmouseout="UnTip()" />&nbsp;';
$cache_attrib_img_line2 = '<img id="attrimg2_{id}" src="{icon}" onmousedown="switchAttribute({id})" onmouseover="Tip(\'{html_desc}\', TITLE, \'{name}\', TITLEBGCOLOR, \'{color}\', TITLEFONTCOLOR, \'#000000\', BGCOLOR, \'#FFFFFF\', BORDERCOLOR, \'{color}\', CLICKCLOSE, true, DELAY, 0, FADEIN, false, FADEOUT, false, FONTCOLOR, \'#000080\', WIDTH, 500)" onmouseout="UnTip()" />&nbsp;';
$search_in_gm = '<a href="http://maps.google.de/maps?f=q&hl=de&q=' . urlencode("http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']."&output=kml") . '" title="' . $translate->t('Show in Google Maps','','',0) . '">' . $translate->t('(in GM)','','',0) . '</a>';
$search_in_gm_zip = '<a href="http://maps.google.de/maps?f=q&hl=de&q=' . urlencode("http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']."&output=kml&zip=1&count=max") . '" title="' . $translate->t('Show in Google Maps','','',0) . '">' . $translate->t('(in GM)','','',0) . '</a>';
function dateDiff($interval, $dateTimeBegin, $dateTimeEnd)
{
//Parse about any English textual datetime
@@ -105,7 +105,7 @@
<a href="search.php?queryid={queryid}&output=gpx&startat={startat}" title="{t}GPS Exchange Format .gpx{/t}">GPX</a>
<a href="search.php?queryid={queryid}&output=loc&startat={startat}" title="{t}Waypointfile .loc{/t}">LOC</a>
<a href="search.php?queryid={queryid}&output=kml&startat={startat}" title="{t}Google Earth .kml{/t}">KML</a>
<a href="http://maps.google.de/maps?f=q&hl=de&q=<?php echo urlencode("http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']."&output=kml"); ?>" title="{t}Show in Google Maps{/t}">{t}(in GM){/t}</a>
{search_in_gm}
<a href="search.php?queryid={queryid}&output=ov2&startat={startat}" title="{t}TomTom POI .ov2{/t}">OV2</a>
<a href="search.php?queryid={queryid}&output=ovl&startat={startat}" title="{t}TOP50-Overlay .ovl{/t}">OVL</a>
<a href="search.php?queryid={queryid}&output=txt&startat={startat}" title="{t}Textfile .txt{/t}">TXT*</a>
@@ -120,7 +120,7 @@
<a href="search.php?queryid={queryid}&output=gpx&startat={startat}&count=max&zip=1" title="{t}GPS Exchange Format .gpx{/t}">GPX</a>
<a href="search.php?queryid={queryid}&output=loc&startat={startat}&count=max&zip=1" title="{t}Waypointfile .loc{/t}">LOC</a>
<a href="search.php?queryid={queryid}&output=kml&startat={startat}&count=max&zip=1" title="{t}Google Earth .kml{/t}">KML</a>
<a href="http://maps.google.de/maps?f=q&hl=de&q=<?php echo urlencode("http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']."&output=kml&zip=1&count=max"); ?>" title="{t}Show in Google Maps{/t}">{t}(in GM){/t}</a>
{search_in_gm_zip}
<a href="search.php?queryid={queryid}&output=ov2&startat={startat}&count=max&zip=1" title="{t}TomTom POI .ov2{/t}">OV2</a>
<a href="search.php?queryid={queryid}&output=ovl&startat={startat}&count=max&zip=1" title="{t}TOP50-Overlay .ovl{/t}">OVL</a>
<a href="search.php?queryid={queryid}&output=txt&startat={startat}&count=max&zip=1" title="{t}Textfile .txt{/t}">TXT</a>
@@ -53,10 +53,19 @@
$multiplier['sm'] = 0.62137;
$multiplier['nm'] = 0.53996;
// default template variables
tpl_set_var('search_in_gm', $search_in_gm);
tpl_set_var('search_in_gm_zip', $search_in_gm_zip);
if (isset($_REQUEST['queryid']) || isset($_REQUEST['showresult']))
{ // Ocprop: showresult, queryid
$bCookieQueryid = false;
$queryid = isset($_REQUEST['queryid']) ? $_REQUEST['queryid'] : 0;
if ($queryid)
{
tpl_set_var('search_in_gm', '');
tpl_set_var('search_in_gm_zip', '');
}
}
else
{
@@ -107,14 +116,16 @@
if (mysql_num_rows($query_rs) == 0)
{
// can happen if logged out after query was created (fix for #3915)
// can happen if logged out after query was created (fix for RT #3915)
$queryid = 0;
goto newquery; // goto needs PHP 5.3
/*
$tplname = 'error';
tpl_set_var('tplname', 'search.php');
tpl_set_var('error_msg', $error_query_not_found);
tpl_BuildTemplate();
exit;
*/
}
else
{
@@ -1811,4 +1822,4 @@ function outputLocidSelectionForm($locSql, $urlparams)
tpl_BuildTemplate();
exit;
}
?>
?>

0 comments on commit 7b05652

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