diff --git a/CHANGELOG.md b/CHANGELOG.md index 1febcd5..403d3aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -57,4 +57,8 @@ # v2.0.11 -- Adds better translation selection by Language \ No newline at end of file +- Adds better translation selection by Language + +# v2.0.12 + +- Fixes Links to Translations (to use their own book names) \ No newline at end of file diff --git a/README.md b/README.md index 47b753d..27cc392 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Get Bible (2.0.11) +# Get Bible (2.0.12) ![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*: 3rd August, 2023 -+ *Version*: 2.0.11 ++ *Version*: 2.0.12 + *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*: **196018** -+ *File count*: **1701** ++ *Line count*: **196041** ++ *File count*: **1702** + *Folder count*: **162** **361 Hours** or **46 Eight Hour Days** (the actual time the author spent) diff --git a/admin/README.txt b/admin/README.txt index 47b753d..27cc392 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -1,4 +1,4 @@ -# Get Bible (2.0.11) +# Get Bible (2.0.12) ![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*: 3rd August, 2023 -+ *Version*: 2.0.11 ++ *Version*: 2.0.12 + *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*: **196018** -+ *File count*: **1701** ++ *Line count*: **196041** ++ *File count*: **1702** + *Folder count*: **162** **361 Hours** or **46 Eight Hour Days** (the actual time the author spent) diff --git a/admin/sql/updates/mysql/2.0.11.sql b/admin/sql/updates/mysql/2.0.11.sql new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/admin/sql/updates/mysql/2.0.11.sql @@ -0,0 +1 @@ + diff --git a/getbible.xml b/getbible.xml index 52ccdf8..fb46156 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.11 + 2.0.12 Get Bible (v.2.0.11) +

Get Bible (v.2.0.12)

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 3600c96..cd7da8c 100644 --- a/script.php +++ b/script.php @@ -1539,7 +1539,7 @@ class com_getbibleInstallerScript echo ' -

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

'; +

Upgrade to Version 2.0.12 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/controller.php b/site/controller.php index b71f2e6..d808d1a 100644 --- a/site/controller.php +++ b/site/controller.php @@ -56,6 +56,8 @@ class GetbibleController extends BaseController 'case' => 'STRING', 'target' => 'STRING', 'guid' => 'STRING', + 'tag' => 'STRING', + 'linker' => 'STRING', 'return' => 'BASE64', 'layout' => 'STRING', 'format' => 'STRING', diff --git a/site/models/app.php b/site/models/app.php index fd96595..3fc3907 100644 --- a/site/models/app.php +++ b/site/models/app.php @@ -124,8 +124,8 @@ class GetbibleModelApp extends ItemModel if (empty($this->book)) { $this->book = Factory::_('DailyScripture')->book(); - $this->chapter = Factory::_('DailyScripture')->chapter(); - $this->verses = Factory::_('DailyScripture')->verses(); + $this->chapter = $this->chapter ?? Factory::_('DailyScripture')->chapter(); + $this->verses = $this->verses?? Factory::_('DailyScripture')->verses(); } // if we still have nothing... were done here! diff --git a/site/router.php b/site/router.php index 2729766..c93f029 100644 --- a/site/router.php +++ b/site/router.php @@ -158,7 +158,7 @@ class GetbibleRouter extends JComponentRouterBase $book = $query['ref'] ?? $query['b'] ?? $query['book'] ?? ''; if (is_numeric($book) && $book > 0) { - $book = $this->getBookName((int) $book); + $book = $this->getBookName((int) $book, $segments[0]); } $segments[1] = $book; @@ -299,7 +299,7 @@ class GetbibleRouter extends JComponentRouterBase $value = $segments[$key] ?? null; $book_number = 0; - $book_name = $this->getBook($value, $book_number); + $book_name = $this->getBook($value, $book_number, $vars['t']); if ($book_name !== null && $book_number > 0) { @@ -363,19 +363,20 @@ class GetbibleRouter extends JComponentRouterBase /** * Retrieve book based on the value provided * - * @param mixed $value - * @param int &$bookNumber + * @param mixed $value + * @param int &$bookNumber + * @param string|null $translation The book translation. * * @return string|null * @since 3.3 */ - private function getBook($value, int &$bookNumber): ?string + private function getBook($value, int &$bookNumber, ?string $translation = null): ?string { if (is_numeric($value)) { $bookNumber = $value; - return $this->getBookName((int) $value); + return $this->getBookName((int) $value, $translation); } elseif (!empty($value) && ($bookNumber = $this->getBookNumber($value)) !== null) { @@ -687,13 +688,33 @@ class GetbibleRouter extends JComponentRouterBase /** * Get a Book name * - * @param int $value The book number. + * @param int $value The book number. + * @param string|null $translation The book translation. * * @return string|null The book name * @since 3.3 */ - private function getBookName(int $value): ?string + private function getBookName(int $value, ?string $translation = null): ?string { + if (!empty($translation) && is_numeric($value) && $value > 0) + { + // Get a db connection. + $db = JFactory::getDbo(); + + // Create a new query object. + $query = $db->getQuery(true); + $query->select($db->quoteName('name')); + $query->from($db->quoteName('#__getbible_book')); + $query->where($db->quoteName('nr') . ' = '. (int) $value); + $query->where($db->quoteName('abbreviation') . ' = ' . $db->quote((string) $translation)); + $db->setQuery($query); + $db->execute(); + if ($db->getNumRows()) + { + return $db->loadResult(); + } + } + if (($name = $this->getVar('book', $value, 'nr', 'name')) !== null) { return $name; diff --git a/site/views/app/tmpl/default_getbibletranslations.php b/site/views/app/tmpl/default_getbibletranslations.php index 4b1e023..1525466 100644 --- a/site/views/app/tmpl/default_getbibletranslations.php +++ b/site/views/app/tmpl/default_getbibletranslations.php @@ -20,7 +20,7 @@ defined('_JEXEC') or die('Restricted access'); ?> defaultTranslation)): ?> - + defaultTranslation->translation; ?> (defaultTranslation->abbreviation; ?>) @@ -35,11 +35,11 @@ defined('_JEXEC') or die('Restricted access');
abbreviation !== $this->chapter->abbreviation): ?> - + translation; ?> (abbreviation; ?>) - + translation; ?> (abbreviation; ?>) diff --git a/update_server.xml b/update_server.xml index d1a0cf8..51c3f83 100644 --- a/update_server.xml +++ b/update_server.xml @@ -179,4 +179,22 @@ https://getbible.net + + Get Bible + The Bible for Joomla + pkg_getbible + package + site + 2.0.12 + https://getbible.net + + https://git.vdm.dev/api/v1/repos/getBible/joomla-pkg/archive/v2.0.12.zip + + + stable + + Llewellyn van der Merwe + https://getbible.net + + \ No newline at end of file