Skip to content

Commit

Permalink
fixed problem with multi-word keywords
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronmaturen committed May 23, 2012
1 parent f5ae465 commit 4fa8a23
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion inline_keywords.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions pages/add_keywords.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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
Expand Down

0 comments on commit 4fa8a23

Please sign in to comment.