From 6e569199623b3d62e6726c4a0442323accded9f7 Mon Sep 17 00:00:00 2001 From: Brian Quinion Date: Fri, 25 Mar 2011 11:53:17 +0000 Subject: [PATCH] option to get list of search keywords --- lib/template/details-html.php | 18 ++++++++++++++++++ website/details.php | 12 ++++++++++++ 2 files changed, 30 insertions(+) diff --git a/lib/template/details-html.php b/lib/template/details-html.php index 8bef4791..a02d3abf 100644 --- a/lib/template/details-html.php +++ b/lib/template/details-html.php @@ -148,6 +148,24 @@ foreach($aPolyPoints as $aPolyPoint) } echo ''; + if ($aPlaceSearchNameKeywords) + { + echo '

Name Keywords

'; + foreach($aPlaceSearchNameKeywords as $aRow) + { + echo '
'.$aRow['word_token'].'
'; + } + } + + if ($aPlaceSearchAddressKeywords) + { + echo '

Address Keywords

'; + foreach($aPlaceSearchAddressKeywords as $aRow) + { + echo '
'.($aRow['word_token'][0]==' '?'*':'').$aRow['word_token'].'('.$aRow['word_id'].')'.'
'; + } + } + if (sizeof($aParentOfLines)) { echo '

Parent Of (named features only):

'; diff --git a/website/details.php b/website/details.php index a4a2ae5e..110fdc07 100755 --- a/website/details.php +++ b/website/details.php @@ -119,6 +119,18 @@ $sSQL .= " order by rank_address asc,rank_search asc,get_name_by_language(name,$sLanguagePrefArraySQL),housenumber"; $aParentOfLines = $oDB->getAll($sSQL); + $aPlaceSearchNameKeywords = false; + $aPlaceSearchAddressKeywords = false; + if (isset($_GET['keywords']) && $_GET['keywords']) + { + $sSQL = "select * from search_name where place_id = $iPlaceID"; + $aPlaceSearchName = $oDB->getRow($sSQL); + $sSQL = "select * from word where word_id in (".substr($aPlaceSearchName['name_vector'],1,-1).")"; + $aPlaceSearchNameKeywords = $oDB->getAll($sSQL); + $sSQL = "select * from word where word_id in (".substr($aPlaceSearchName['nameaddress_vector'],1,-1).")"; + $aPlaceSearchAddressKeywords = $oDB->getAll($sSQL); + } + logEnd($oDB, $hLog, 1); include(CONST_BasePath.'/lib/template/details-'.$sOutputFormat.'.php'); -- 2.39.5