diff --git a/CHANGELOG.md b/CHANGELOG.md index 71aa2e3..f0f2ece 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# v2.0.32 + +- Fixed other search related issues. + # v2.0.31 - Fixed #10 so that exact search results now work correctly. diff --git a/README.md b/README.md index e2ca3d0..c6a4cc8 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Get Bible (2.0.31) +# Get Bible (2.0.32) ![Get Bible image](https://git.vdm.dev/getBible/joomla-component/raw/branch/master/admin/assets/images/vdm-component.jpg "GetBible") @@ -19,7 +19,7 @@ In essence, The Bible for Joomla is designed to transform how the Word of God is + *Name*: [Get Bible](https://getbible.net) + *First Build*: 3rd December, 2015 + *Last Build*: 4th December, 2023 -+ *Version*: 2.0.31 ++ *Version*: 2.0.32 + *Copyright*: Copyright (C) 2015. All Rights Reserved + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html @@ -31,8 +31,8 @@ due to [Automated Component Builder](https://www.joomlacomponentbuilder.com)) > (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**, > never making one mistake or taking any coffee break.) -+ *Line count*: **200940** -+ *File count*: **1743** ++ *Line count*: **200979** ++ *File count*: **1744** + *Folder count*: **167** **370 Hours** or **46 Eight Hour Days** (the actual time the author spent) diff --git a/admin/README.txt b/admin/README.txt index e2ca3d0..c6a4cc8 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -1,4 +1,4 @@ -# Get Bible (2.0.31) +# Get Bible (2.0.32) ![Get Bible image](https://git.vdm.dev/getBible/joomla-component/raw/branch/master/admin/assets/images/vdm-component.jpg "GetBible") @@ -19,7 +19,7 @@ In essence, The Bible for Joomla is designed to transform how the Word of God is + *Name*: [Get Bible](https://getbible.net) + *First Build*: 3rd December, 2015 + *Last Build*: 4th December, 2023 -+ *Version*: 2.0.31 ++ *Version*: 2.0.32 + *Copyright*: Copyright (C) 2015. All Rights Reserved + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html @@ -31,8 +31,8 @@ due to [Automated Component Builder](https://www.joomlacomponentbuilder.com)) > (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**, > never making one mistake or taking any coffee break.) -+ *Line count*: **200940** -+ *File count*: **1743** ++ *Line count*: **200979** ++ *File count*: **1744** + *Folder count*: **167** **370 Hours** or **46 Eight Hour Days** (the actual time the author spent) diff --git a/admin/sql/updates/mysql/2.0.31.sql b/admin/sql/updates/mysql/2.0.31.sql new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/admin/sql/updates/mysql/2.0.31.sql @@ -0,0 +1 @@ + diff --git a/getbible.xml b/getbible.xml index fb4b8db..7097c55 100644 --- a/getbible.xml +++ b/getbible.xml @@ -7,9 +7,9 @@ https://getbible.net Copyright (C) 2015. All Rights Reserved GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html - 2.0.31 + 2.0.32 Get Bible (v.2.0.31) +

Get Bible (v.2.0.32)

Welcome to the next level of scripture engagement - The Bible for Joomla! Our purpose is to bring the Word of God to every person, in their native language, entirely free. This isn't just a typical extension; it's a groundbreaking tool developed to span language divides and deliver a rich, customizable Bible study experience to users worldwide. diff --git a/script.php b/script.php index 48b7af3..f0bf91d 100644 --- a/script.php +++ b/script.php @@ -1539,7 +1539,7 @@ class com_getbibleInstallerScript echo ' -

Upgrade to Version 2.0.31 Was Successful! Let us know if anything is not working as expected.

'; +

Upgrade to Version 2.0.32 Was Successful! Let us know if anything is not working as expected.

'; // Set db if not set already. if (!isset($db)) diff --git a/site/models/search.php b/site/models/search.php index 02a17e2..947fc90 100644 --- a/site/models/search.php +++ b/site/models/search.php @@ -403,15 +403,18 @@ class GetbibleModelSearch extends ListModel $i = 0; foreach ($words as $word) { - if ($i == 0) + if ($this->hasLength($word)) { - $condition .= $db->quote('%' . $db->escape($word, true) . '%'); + if ($i == 0) + { + $condition .= $db->quote('%' . $db->escape($word, true) . '%'); + } + else + { + $condition .= ' OR ' . $case . ' a.text LIKE ' . $db->quote('%' . $db->escape($word, true) . '%'); + } + $i++; } - else - { - $condition .= ' OR ' . $case . ' a.text LIKE ' . $db->quote('%' . $db->escape($word, true) . '%'); - } - $i++; } $conditions[] = $condition . ')'; @@ -424,15 +427,18 @@ class GetbibleModelSearch extends ListModel $i = 0; foreach ($words as $word) { - if ($i == 0) + if ($this->hasLength($word)) { - $condition .= $db->quote('[[:<:]]' . $db->escape($word, true). '[[:>:]]'); + if ($i == 0) + { + $condition .= $db->quote('[[:<:]]' . $db->escape($word, true). '[[:>:]]'); + } + else + { + $condition .= ' OR ' . $case . ' a.text REGEXP '. $db->quote('[[:<:]]' . $db->escape($word, true) . '[[:>:]]'); + } + $i++; } - else - { - $condition .= ' OR ' . $case . ' a.text REGEXP '. $db->quote('[[:<:]]' . $db->escape($word, true) . '[[:>:]]'); - } - $i++; } $conditions[] = $condition . ')'; } @@ -444,8 +450,12 @@ class GetbibleModelSearch extends ListModel if ($this->match == 2) { $words = $this->splitSentence($this->search); $search = []; - foreach ($words as $word) { - $search[] = '%' . $db->escape($word, true) . '%'; + foreach ($words as $word) + { + if ($this->hasLength($word)) + { + $search[] = '%' . $db->escape($word, true) . '%'; + } } // Construct the LIKE clause with wildcards between each word for partial matches @@ -468,8 +478,11 @@ class GetbibleModelSearch extends ListModel $words = $this->splitSentence($this->search); foreach ($words as $word) { - $search = $db->quote('%' . $db->escape($word, true) . '%'); - $conditions[] = '( '.$case.' a.text LIKE ' . $search . ')'; + if ($this->hasLength($word)) + { + $search = $db->quote('%' . $db->escape($word, true) . '%'); + $conditions[] = '( '.$case.' a.text LIKE ' . $search . ')'; + } } } // 1 = exact match @@ -478,8 +491,11 @@ class GetbibleModelSearch extends ListModel $words = $this->splitSentence($this->search); foreach ($words as $word) { - $search = $case . ' a.text REGEXP '. $db->quote('[[:<:]]' . $db->escape($word, true) . '[[:>:]]'); - $conditions[] = '( ' . $search . ')'; + if ($this->hasLength($word)) + { + $search = $case . ' a.text REGEXP '. $db->quote('[[:<:]]' . $db->escape($word, true) . '[[:>:]]'); + $conditions[] = '( ' . $search . ')'; + } } } } diff --git a/update_server.xml b/update_server.xml index 5e11a65..034ebcc 100644 --- a/update_server.xml +++ b/update_server.xml @@ -521,4 +521,22 @@ https://getbible.net + + Get Bible + The Bible for Joomla + pkg_getbible + package + site + 2.0.32 + https://getbible.net + + https://git.vdm.dev/api/v1/repos/getBible/joomla-pkg/archive/v2.0.32.zip + + + stable + + Llewellyn van der Merwe + https://getbible.net + + \ No newline at end of file