From 4fa8a23bf750cd1e3d7013dbcce3c3bf95a39313 Mon Sep 17 00:00:00 2001 From: Aaron Maturen Date: Wed, 23 May 2012 19:10:08 -0400 Subject: [PATCH] fixed problem with multi-word keywords --- build.sh | 2 +- inline_keywords.yaml | 2 +- pages/add_keywords.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build.sh b/build.sh index 1ed0440..badde62 100755 --- a/build.sh +++ b/build.sh @@ -3,7 +3,7 @@ git log | grep -m 1 commit commit=`git log | grep -m 1 commit ` commitnick=${commit:7:10} -commitnick='0.4' +commitnick='0.5' echo "updating version information in inline_keywords.yaml with latest git commit $commitnick" sed -ibk "s/version: .*/version: $commitnick/" inline_keywords.yaml rm inline_keywords.yamlbk diff --git a/inline_keywords.yaml b/inline_keywords.yaml index b9865e6..02f017c 100644 --- a/inline_keywords.yaml +++ b/inline_keywords.yaml @@ -1,6 +1,6 @@ name: inline_keywords author: Aaron T. Maturen -version: 0.4 +version: 0.5 desc: Enable Adding Keywords on Search Result Page info_url: https://github.com/aaronmaturen/rs_inline_keywords config_url: /plugins/inline_keywords/pages/setup.php diff --git a/pages/add_keywords.php b/pages/add_keywords.php index 195799d..6be8c71 100644 --- a/pages/add_keywords.php +++ b/pages/add_keywords.php @@ -8,7 +8,7 @@ $fields = sql_query("select ref from resource_type_field where title = 'Keywords'"); $type = ($fields[0]['ref']); -$keywords = explode(' ',str_replace('+',' ',$_REQUEST['keywords'])); +$keywords = explode(',',str_replace('+',' ',$_REQUEST['keywords'])); $refs = explode(' ',str_replace('+',' ',$_REQUEST['refs'])); foreach($refs as $ref) { @@ -18,7 +18,7 @@ $inline_keyword_data = sql_query("SELECT * FROM resource_data WHERE resource_type_field = '$type' AND resource = '$ref'"); if($inline_keyword_data) { - $keywordstring = implode(' ',array_unique(array_merge($keywords, explode(' ',$inline_keyword_data[0]['value'])))); + $keywordstring = implode(', ',array_unique(array_merge($keywords, explode(', ',$inline_keyword_data[0]['value'])))); sql_query("UPDATE resource_data SET value = '$keywordstring' WHERE resource_type_field = '$type' AND resource = '$ref'"); } else