From 5806bba7f309d81ee9d8d1dac0acc518b455b97e Mon Sep 17 00:00:00 2001 From: aB0t Date: Sun, 13 Aug 2023 11:50:18 +0200 Subject: [PATCH] Stable release of v2.0.19 Adds metadata to each Bible page to resolve getBible/support#6. Adds option to force chapter hash checking. --- CHANGELOG.md | 7 +- README.md | 14 +-- admin/README.txt | 14 +-- admin/access.xml | 1 + admin/controllers/books.php | 54 +++++++++ admin/language/en-GB/en-GB.com_getbible.ini | 8 +- .../language/en-GB/en-GB.com_getbible.sys.ini | 2 + admin/sql/updates/mysql/2.0.18.sql | 1 + admin/views/books/view.html.php | 5 + getbible.xml | 6 +- .../src/Abstraction/Watcher.php | 20 +++- .../src/Watcher/Chapter.php | 35 ++++++ .../VDM.Joomla/src/Utilities/FileHelper.php | 2 +- script.php | 4 +- site/language/en-GB/en-GB.com_getbible.ini | 6 +- site/models/app.php | 2 +- site/views/app/tmpl/default_getbibleapp.php | 2 +- site/views/app/tmpl/default_getbibletext.php | 4 +- site/views/app/view.html.php | 104 +++++++++++++++++- site/views/tag/tmpl/default_getbiblenotag.php | 1 + site/views/tag/view.html.php | 18 ++- update_server.xml | 18 +++ 22 files changed, 297 insertions(+), 31 deletions(-) create mode 100644 admin/sql/updates/mysql/2.0.18.sql diff --git a/CHANGELOG.md b/CHANGELOG.md index 8dd3549..9d4dafd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -92,4 +92,9 @@ # v2.0.18 - Adds bottom module position on tag, search, ai and app pages. -- Fixed JavaScript Database Manager some more. \ No newline at end of file +- Fixed JavaScript Database Manager some more. + +# v2.0.19 + +- Adds metadata to each Bible page to resolve getBible/support#6 +- Adds option to force chapter hash checking. \ No newline at end of file diff --git a/README.md b/README.md index babdf71..462a0c1 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Get Bible (2.0.18) +# Get Bible (2.0.19) ![Get Bible image](https://git.vdm.dev/getBible/joomla-component/raw/branch/master/admin/assets/images/vdm-component.jpg "GetBible") @@ -18,21 +18,21 @@ In essence, The Bible for Joomla is designed to transform how the Word of God is + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Get Bible](https://getbible.net) + *First Build*: 3rd December, 2015 -+ *Last Build*: 10th August, 2023 -+ *Version*: 2.0.18 ++ *Last Build*: 13th August, 2023 ++ *Version*: 2.0.19 + *Copyright*: Copyright (C) 2015. All Rights Reserved + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html ## Build Time -**552 Hours** or **69 Eight Hour Days** (actual time the author saved - +**553 Hours** or **69 Eight Hour Days** (actual time the author saved - 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*: **197705** -+ *File count*: **1717** ++ *Line count*: **198087** ++ *File count*: **1718** + *Folder count*: **163** **364 Hours** or **46 Eight Hour Days** (the actual time the author spent) @@ -43,7 +43,7 @@ due to [Automated Component Builder](https://www.joomlacomponentbuilder.com)) > **mapping @55hours** = codingtime / 10; > **office @92hours** = codingtime / 6;) -**916 Hours** or **115 Eight Hour Days** +**917 Hours** or **115 Eight Hour Days** (a total of the realistic time frame for this project) > (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**, diff --git a/admin/README.txt b/admin/README.txt index babdf71..462a0c1 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -1,4 +1,4 @@ -# Get Bible (2.0.18) +# Get Bible (2.0.19) ![Get Bible image](https://git.vdm.dev/getBible/joomla-component/raw/branch/master/admin/assets/images/vdm-component.jpg "GetBible") @@ -18,21 +18,21 @@ In essence, The Bible for Joomla is designed to transform how the Word of God is + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Get Bible](https://getbible.net) + *First Build*: 3rd December, 2015 -+ *Last Build*: 10th August, 2023 -+ *Version*: 2.0.18 ++ *Last Build*: 13th August, 2023 ++ *Version*: 2.0.19 + *Copyright*: Copyright (C) 2015. All Rights Reserved + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html ## Build Time -**552 Hours** or **69 Eight Hour Days** (actual time the author saved - +**553 Hours** or **69 Eight Hour Days** (actual time the author saved - 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*: **197705** -+ *File count*: **1717** ++ *Line count*: **198087** ++ *File count*: **1718** + *Folder count*: **163** **364 Hours** or **46 Eight Hour Days** (the actual time the author spent) @@ -43,7 +43,7 @@ due to [Automated Component Builder](https://www.joomlacomponentbuilder.com)) > **mapping @55hours** = codingtime / 10; > **office @92hours** = codingtime / 6;) -**916 Hours** or **115 Eight Hour Days** +**917 Hours** or **115 Eight Hour Days** (a total of the realistic time frame for this project) > (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**, diff --git a/admin/access.xml b/admin/access.xml index 6837e1f..63c770c 100644 --- a/admin/access.xml +++ b/admin/access.xml @@ -13,6 +13,7 @@ + diff --git a/admin/controllers/books.php b/admin/controllers/books.php index 6b5e685..d6e10d9 100644 --- a/admin/controllers/books.php +++ b/admin/controllers/books.php @@ -104,5 +104,59 @@ class GetbibleControllerBooks extends AdminController $message = JText::_('COM_GETBIBLE_UPDATE_FAILED_PLEASE_TRY_AGAIN_LATTER'); $this->setRedirect(JRoute::_('index.php?option=com_getbible&view=books', false), $message, 'error'); return; + } + + public function forceHashCheck() + { + // Check for request forgeries + JSession::checkToken() or die(Text::_('JINVALID_TOKEN')); + + // check if export is allowed for this user. + $user = JFactory::getUser(); + if ($user->authorise('book.force_hash_check', 'com_getbible')) + { + // Get the input + $input = JFactory::getApplication()->input; + $pks = $input->post->get('cid', array(), 'array'); + // Sanitize the input + JArrayHelper::toInteger($pks); + // check if there is any selections + $number = UtilitiesArrayHelper::check($pks); + if (!$number) + { + // Redirect to the list screen with error. + $message = JText::_('COM_GETBIBLE_NO_BOOK_WAS_SELECTED_PLEASE_MAKE_A_SELECTION_AND_TRY_AGAIN'); + $this->setRedirect(JRoute::_('index.php?option=com_getbible&view=books', false), $message, 'error'); + return; + } + elseif (Factory::_('GetBible.Watcher.Chapter')->force($pks)) + { + // Redirect to the list screen with success. + $message = array(); + $message[] = '

' . JText::_('COM_GETBIBLE_FORCE_HASH_CHECK_ENABLED') . '

'; + // get the data to export + if ($number == 1) + { + $message[] = '

' . JText::_('COM_GETBIBLE_THE_CHAPTERS_OF_THE_BOOK_WILL_BE_FORCEFULLY_SYNCED_WITH_THE_GETBIBLE_API') . '

'; + } + else + { + $message[] = '

' . JText::_('COM_GETBIBLE_THE_CHAPTERS_OF_THE_SELECTED_BOOKS_WILL_BE_FORCEFULLY_SYNCED_WITH_THE_GETBIBLE_API') . '

'; + } + $this->setRedirect(JRoute::_('index.php?option=com_getbible&view=books', false), implode('', $message), 'Success'); + return; + } + } + else + { + // Redirect to the list screen with error. + $message = JText::_('COM_GETBIBLE_YOU_DO_NOT_HAVE_PERMISSION_TO_ENABLED_FORCEFUL_CHECK_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_HELP'); + $this->setRedirect(JRoute::_('index.php?option=com_getbible&view=books', false), $message, 'error'); + return; + } + // Redirect to the list screen with error. + $message = JText::_('COM_GETBIBLE_UPDATE_FAILED_PLEASE_TRY_AGAIN_LATTER'); + $this->setRedirect(JRoute::_('index.php?option=com_getbible&view=books', false), $message, 'error'); + return; } } diff --git a/admin/language/en-GB/en-GB.com_getbible.ini b/admin/language/en-GB/en-GB.com_getbible.ini index 723ed53..3621667 100644 --- a/admin/language/en-GB/en-GB.com_getbible.ini +++ b/admin/language/en-GB/en-GB.com_getbible.ini @@ -70,6 +70,8 @@ COM_GETBIBLE_BOOK_CREATED_DATE_DESC="The date this Book was created." COM_GETBIBLE_BOOK_CREATED_DATE_LABEL="Created Date" COM_GETBIBLE_BOOK_DETAILS="Details" COM_GETBIBLE_BOOK_ERROR_UNIQUE_ALIAS="Another Book has the same alias." +COM_GETBIBLE_BOOK_FORCE_HASH_CHECK_BUTTON_ACCESS="Book Force Hash Check Button Access" +COM_GETBIBLE_BOOK_FORCE_HASH_CHECK_BUTTON_ACCESS_DESC="Allows the users in this group to access the force hash check button." COM_GETBIBLE_BOOK_ID="Id" COM_GETBIBLE_BOOK_MODIFIED_BY_DESC="The last user that modified this Book." COM_GETBIBLE_BOOK_MODIFIED_BY_LABEL="Modified By" @@ -590,10 +592,11 @@ COM_GETBIBLE_FILTER_TRANSLATION_ASCENDING="Translation ascending" COM_GETBIBLE_FILTER_TRANSLATION_DESCENDING="Translation descending" COM_GETBIBLE_FILTER_VERSE_ASCENDING="Verse ascending" COM_GETBIBLE_FILTER_VERSE_DESCENDING="Verse descending" +COM_GETBIBLE_FORCE_HASH_CHECK="Force Hash Check" +COM_GETBIBLE_FORCE_HASH_CHECK_ENABLED="Force Hash Check Enabled!" COM_GETBIBLE_GET_TOKEN="Get Token" COM_GETBIBLE_GET_TOKEN_FROM_VDM_TO_GET_UPDATE_NOTICE_AND_ADD_IT_TO_YOUR_GLOBAL_OPTIONS="Get token from VDM to get update notice, and add it to your global options." COM_GETBIBLE_HELP_MANAGER="Help" -COM_GETBIBLE_HTWOCURL_NOT_FOUNDHTWOPPLEASE_SETUP_CURL_ON_YOUR_SYSTEM_OR_BGETBIBLEB_WILL_NOT_FUNCTION_CORRECTLYP="

Curl Not Found!

Please setup curl on your system, or getbible will not function correctly!

" COM_GETBIBLE_INACTIVE="Inactive" COM_GETBIBLE_INCORRECT_FAVOURITE_VERSE_SELECTED="Incorrect favourite verse selected." COM_GETBIBLE_INVALID_SESSION_KEY_VALUE="Invalid session key value." @@ -1606,6 +1609,8 @@ COM_GETBIBLE_TAG_VERSION_DESC="A count of the number of times this Tag has been COM_GETBIBLE_TAG_VERSION_LABEL="Version" COM_GETBIBLE_THE_BOOK_NAMES_OF_THE_SELECTED_TRANSLATIONS_WERE_SUCCESSFULLY_UPDATED_AND_THEY_ARE_NOW_IN_SYNC_WITH_THE_GETBIBLE_API="The book names of the selected translations were successfully updated, and they are now in sync with the getBible API." COM_GETBIBLE_THE_BOOK_NAMES_OF_THE_TRANSLATION_WERE_SUCCESSFULLY_UPDATED_AND_THEY_ARE_NOW_IN_SYNC_WITH_THE_GETBIBLE_API="The book names of the translation were successfully updated, and they are now in sync with the getBible API." +COM_GETBIBLE_THE_CHAPTERS_OF_THE_BOOK_WILL_BE_FORCEFULLY_SYNCED_WITH_THE_GETBIBLE_API="The chapters of the book will be forcefully synced with the getBible API." +COM_GETBIBLE_THE_CHAPTERS_OF_THE_SELECTED_BOOKS_WILL_BE_FORCEFULLY_SYNCED_WITH_THE_GETBIBLE_API="The chapters of the selected books will be forcefully synced with the getBible API." COM_GETBIBLE_THE_CHAPTER_NAMES_OF_THE_BOOK_WERE_SUCCESSFULLY_UPDATED_AND_THEY_ARE_NOW_IN_SYNC_WITH_THE_GETBIBLE_API="The chapter names of the book were successfully updated, and they are now in sync with the getBible API." COM_GETBIBLE_THE_CHAPTER_NAMES_OF_THE_SELECTED_BOOKS_WERE_SUCCESSFULLY_UPDATED_AND_THEY_ARE_NOW_IN_SYNC_WITH_THE_GETBIBLE_API="The chapter names of the selected books were successfully updated, and they are now in sync with the getBible API." COM_GETBIBLE_THE_NAME_COULD_NOT_BE_UPDATED="The name could not be updated." @@ -1912,6 +1917,7 @@ COM_GETBIBLE_WITHOUT_SELECTING_THE_CORRECT_FAVOURITE_VERSEBR_YOU_CANT_PERFORM_TH COM_GETBIBLE_YOU_ARE_CURRENTLY_VIEWING_THE_TRASHED_ITEMS="You are currently viewing the trashed items." COM_GETBIBLE_YOU_ARE_CURRENTLY_VIEWING_THE_TRASH_AREA_AND_YOU_DONT_HAVE_ANY_ITEMS_IN_TRASH_AT_THE_MOMENT="You are currently viewing the trash area, and you don't have any items in trash at the moment!" COM_GETBIBLE_YOU_CAN_DIRECTLY_DOWNLOAD_THE_LATEST_UPDATE_OR_USE_THE_JOOMLA_UPDATE_AREA="You can directly download the latest update, or use the Joomla update area." +COM_GETBIBLE_YOU_DO_NOT_HAVE_PERMISSION_TO_ENABLED_FORCEFUL_CHECK_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_HELP="You do not have permission to enabled forceful check, please contact your system administrator for more help." COM_GETBIBLE_YOU_DO_NOT_HAVE_PERMISSION_TO_UPDATE_THE_BOOK_NAMES_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_HELP="You do not have permission to update the book names, please contact your system administrator for more help." COM_GETBIBLE_YOU_DO_NOT_HAVE_PERMISSION_TO_UPDATE_THE_CHAPTER_NAMES_PLEASE_CONTACT_YOUR_SYSTEM_ADMINISTRATOR_FOR_MORE_HELP="You do not have permission to update the chapter names, please contact your system administrator for more help." COM_GETBIBLE_YOU_HAVE_BEEN_BLOCKED_YOU_WILL_NEED_TO_WAIT_ONE_DAY_BEFORE_TRYING_AGAIN_OR_CONTACT_SUPPORT="You have been blocked, you will need to wait one day before trying again, or contact support." diff --git a/admin/language/en-GB/en-GB.com_getbible.sys.ini b/admin/language/en-GB/en-GB.com_getbible.sys.ini index 54c29f0..d739617 100644 --- a/admin/language/en-GB/en-GB.com_getbible.sys.ini +++ b/admin/language/en-GB/en-GB.com_getbible.sys.ini @@ -29,6 +29,8 @@ COM_GETBIBLE_BOOKS_EDIT_STATE="Books Edit State" COM_GETBIBLE_BOOKS_EDIT_STATE_DESC="Allows the users in this group to update the state of the book" COM_GETBIBLE_BOOKS_SUBMENU="Books Submenu" COM_GETBIBLE_BOOKS_SUBMENU_DESC="Allows the users in this group to submenu of book" +COM_GETBIBLE_BOOK_FORCE_HASH_CHECK_BUTTON_ACCESS="Book Force Hash Check Button Access" +COM_GETBIBLE_BOOK_FORCE_HASH_CHECK_BUTTON_ACCESS_DESC="Allows the users in this group to access the force hash check button." COM_GETBIBLE_BOOK_UPDATE_CHAPTERS_NAMES_BUTTON_ACCESS="Book Update Chapters Names Button Access" COM_GETBIBLE_BOOK_UPDATE_CHAPTERS_NAMES_BUTTON_ACCESS_DESC="Allows the users in this group to access the update chapters names button." COM_GETBIBLE_CHAPTERS_ACCESS="Chapters Access" diff --git a/admin/sql/updates/mysql/2.0.18.sql b/admin/sql/updates/mysql/2.0.18.sql new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/admin/sql/updates/mysql/2.0.18.sql @@ -0,0 +1 @@ + diff --git a/admin/views/books/view.html.php b/admin/views/books/view.html.php index a67759b..c329b22 100644 --- a/admin/views/books/view.html.php +++ b/admin/views/books/view.html.php @@ -137,6 +137,11 @@ class GetbibleViewBooks extends HtmlView // add Update Chapters Names button. JToolBarHelper::custom('books.updateChaptersNames', 'generic custom-button-updatechaptersnames', '', 'COM_GETBIBLE_UPDATE_CHAPTERS_NAMES', 'true'); } + if ($this->user->authorise('book.force_hash_check', 'com_getbible')) + { + // add Force Hash Check button. + JToolBarHelper::custom('books.forceHashCheck', 'health custom-button-forcehashcheck', '', 'COM_GETBIBLE_FORCE_HASH_CHECK', 'true'); + } if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) { diff --git a/getbible.xml b/getbible.xml index 455d71e..f1e15e3 100644 --- a/getbible.xml +++ b/getbible.xml @@ -1,15 +1,15 @@ COM_GETBIBLE - 10th August, 2023 + 13th August, 2023 Llewellyn van der Merwe joomla@vdm.io 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.18 + 2.0.19 Get Bible (v.2.0.18) +

Get Bible (v.2.0.19)

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/libraries/jcb_powers/VDM.Joomla.GetBible/src/Abstraction/Watcher.php b/libraries/jcb_powers/VDM.Joomla.GetBible/src/Abstraction/Watcher.php index 2496e2f..d37c895 100644 --- a/libraries/jcb_powers/VDM.Joomla.GetBible/src/Abstraction/Watcher.php +++ b/libraries/jcb_powers/VDM.Joomla.GetBible/src/Abstraction/Watcher.php @@ -73,6 +73,22 @@ abstract class Watcher */ protected ?object $target; + /** + * The today's date + * + * @var string + * @since 2.0.1 + */ + protected string $today; + + /** + * The two months in the past date + * + * @var string + * @since 2.0.1 + */ + protected string $past; + /** * The target table * @@ -99,8 +115,10 @@ abstract class Watcher $this->insert = $insert; $this->update = $update; - // just in-case we set a date + // just in-case we set some dates $this->today = (new Date())->toSql(); + $this->past = (new Date())->modify('-2 months')->toSql(); + } /** diff --git a/libraries/jcb_powers/VDM.Joomla.GetBible/src/Watcher/Chapter.php b/libraries/jcb_powers/VDM.Joomla.GetBible/src/Watcher/Chapter.php index 7e8e3e2..c38f519 100644 --- a/libraries/jcb_powers/VDM.Joomla.GetBible/src/Watcher/Chapter.php +++ b/libraries/jcb_powers/VDM.Joomla.GetBible/src/Watcher/Chapter.php @@ -137,6 +137,41 @@ final class Chapter extends Watcher return true; } + /** + * Force book chapter sync + * + * @param array $books The books ids. + * + * @return bool True on success + * @since 2.0.1 + */ + public function force(array $books): bool + { + foreach ($books as $book) + { + if (($_book = $this->load->item(['id' => $book], 'book')) === null) + { + return false; + } + + if (($chapters = $this->load->items( + ['abbreviation' => $_book->abbreviation, 'book_nr' => $_book->nr], + 'chapter' + )) !== null) + { + foreach ($chapters as $chapter) + { + $this->update->row([ + 'id' => $chapter->id, + 'created' => $this->past + ], 'id', 'chapter'); + } + } + } + + return true; + } + /** * Load the chapter numbers * diff --git a/libraries/jcb_powers/VDM.Joomla/src/Utilities/FileHelper.php b/libraries/jcb_powers/VDM.Joomla/src/Utilities/FileHelper.php index 7bbc782..0dd04d8 100644 --- a/libraries/jcb_powers/VDM.Joomla/src/Utilities/FileHelper.php +++ b/libraries/jcb_powers/VDM.Joomla/src/Utilities/FileHelper.php @@ -132,7 +132,7 @@ abstract class FileHelper elseif (!self::$curlError) { // set the notice - Factory::getApplication()->enqueueMessage(Text::_('COM_GETBIBLE_HTWOCURL_NOT_FOUNDHTWOPPLEASE_SETUP_CURL_ON_YOUR_SYSTEM_OR_BGETBIBLEB_WILL_NOT_FUNCTION_CORRECTLYP'), 'Error'); + Factory::getApplication()->enqueueMessage('

Curl Not Found!

Please setup curl on your system, or the Joomla Component will not function correctly!

', 'Error'); // load this notice only once self::$curlError = true; } diff --git a/script.php b/script.php index 4caabe9..52a745a 100644 --- a/script.php +++ b/script.php @@ -1125,7 +1125,7 @@ class com_getbibleInstallerScript { $rule_length = $db->loadResult(); // Check the size of the rules column - if ($rule_length <= 44320) + if ($rule_length <= 44480) { // Fix the assets table rules column size $fix_rules_size = "ALTER TABLE `#__assets` CHANGE `rules` `rules` TEXT NOT NULL COMMENT 'JSON encoded access control. Enlarged to TEXT by JCB';"; @@ -1539,7 +1539,7 @@ class com_getbibleInstallerScript echo ' -

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

'; +

Upgrade to Version 2.0.19 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/language/en-GB/en-GB.com_getbible.ini b/site/language/en-GB/en-GB.com_getbible.ini index 23f448f..3e305fa 100644 --- a/site/language/en-GB/en-GB.com_getbible.ini +++ b/site/language/en-GB/en-GB.com_getbible.ini @@ -23,6 +23,7 @@ COM_GETBIBLE_APP_DESC="App" COM_GETBIBLE_AUTO_GENERATED="auto generated" COM_GETBIBLE_AVAILABLE_TAGS="Available Tags" COM_GETBIBLE_A_BOOK="A Book" +COM_GETBIBLE_BACK_TO_BIBLE="Back to Bible" COM_GETBIBLE_BASIC_HASH_USAGE_EXPLAINED="Basic Hash Usage Explained" COM_GETBIBLE_BIBLE="Bible" COM_GETBIBLE_BOOKS="Books" @@ -75,7 +76,6 @@ COM_GETBIBLE_HELLO_S="Hello %s" COM_GETBIBLE_HIDE="Hide" COM_GETBIBLE_HOWEVER_TO_MODIFY_YOUR_SPAN_CLASSGETBIBLEACTIVITYNOTESANDTAGSNOTES_AND_TAGSSPAN_YOU_NEED_BOTH_THE_PERSISTENT_SESSION_KEY_AND_YOUR_FAVOURITE_VERSE="However, to modify your notes and tags, you need both the persistent session key and your favourite verse." COM_GETBIBLE_HOW_THIS_ALL_WORKS="How This All Works" -COM_GETBIBLE_HTWOCURL_NOT_FOUNDHTWOPPLEASE_SETUP_CURL_ON_YOUR_SYSTEM_OR_BGETBIBLEB_WILL_NOT_FUNCTION_CORRECTLYP="

Curl Not Found!

Please setup curl on your system, or getbible will not function correctly!

" COM_GETBIBLE_IF_YOU_SWITCH_FROM_YOUR_ACTIVE_SESSION_TO_A_SHARED_ONE_YOUR_ORIGINAL_SESSION_WILL_BE_PRESERVED_HERE_FOR_EASY_ACCESS="If you switch from your active session to a shared one, your original session will be preserved here for easy access." COM_GETBIBLE_INCORRECT_FAVOURITE_VERSE_SELECTED="Incorrect favourite verse selected." COM_GETBIBLE_INSENSITIVE="Insensitive" @@ -137,6 +137,7 @@ COM_GETBIBLE_PROMPT_SETTINGS="Prompt Settings" COM_GETBIBLE_PROMPT_TOKENS="Prompt Tokens" COM_GETBIBLE_PROMPT_USED="Prompt Used" COM_GETBIBLE_QUERY="Query" +COM_GETBIBLE_READ_S_CHAPTER_S_IN_THE_S="Read %s chapter %s in the %s" COM_GETBIBLE_REDIRECTING_TO="Redirecting to" COM_GETBIBLE_REFERENCE="Reference" COM_GETBIBLE_REMOVE="Remove" @@ -169,6 +170,8 @@ COM_GETBIBLE_SHOW="Show" COM_GETBIBLE_SOURCE="Source" COM_GETBIBLE_STYLE="Style" COM_GETBIBLE_STYLE_GO_HERE="Style go here" +COM_GETBIBLE_S_CHAPTER_S_S_S="%s: Chapter %s (%s) - %s" +COM_GETBIBLE_S_CHAPTER_S_S_S_S_S_BIBLE_S_SCRIPTURE_GETBIBLE="%s, chapter %s, %s, %s, %s, %s Bible, %s, scripture, getBible" COM_GETBIBLE_TAB_NAME_PLACEHOLDERS="Tab Name Placeholders" COM_GETBIBLE_TAG="Tag" COM_GETBIBLE_TAGGED_VERSES="Tagged Verses" @@ -206,6 +209,7 @@ COM_GETBIBLE_THE_TAG_WAS_SUCCESSFULLY_REMOVED_FROM_THE_VERSE="The tag was succes COM_GETBIBLE_THE_TAG_WAS_SUCCESSFULLY_UPDATED="The tag was successfully updated." COM_GETBIBLE_THE_VERSE_WAS_SUCCESSFULLY_TAGGED="The verse was successfully tagged." COM_GETBIBLE_THE_WORDS_OF_ETERNAL_LIFE="The words of eternal life!" +COM_GETBIBLE_THE_WORD_OF_GOD="The Word of God" COM_GETBIBLE_THIS_AREA_DISPLAYS_YOUR_RECENTLY_ACCESSED_SESSIONS="This area displays your recently accessed sessions." COM_GETBIBLE_THIS_INSTALLATION_PROCESS_IS_A_ONETIME_OPERATION_FOR_EACH_TRANSLATION_HOWEVER_YOU_ARE_WELCOME_TO_RUN_THE_PROCESS_A_SECOND_TIME_OR_AS_OFTEN_AS_YOUD_LIKE_TO_VALIDATE_AND_ENSURE_THAT_ALL_CONTENT_WAS_PROPERLY_LOADED_AND_IS_UPTODATE="This installation process is a one-time operation for each translation. However, you are welcome to run the process a second time or as often as you'd like to validate and ensure that all content was properly loaded and is up-to-date." COM_GETBIBLE_THIS_IS_A_GLOBAL_TAG_SET_BY_US_AT_BSB_FOR_YOUR_CONVENIENCE_WE_HOLD_THE_PRIVILEGE_TO_MODIFY_THESE_TAGS_IF_YOU_BELIEVE_ITS_SET_IN_ERROR_KINDLY_INFORM_US="This is a global tag, set by us at %s for your convenience. We hold the privilege to modify these tags. If you believe it's set in error, kindly inform us." diff --git a/site/models/app.php b/site/models/app.php index 6499fb7..8ab0b64 100644 --- a/site/models/app.php +++ b/site/models/app.php @@ -198,7 +198,7 @@ class GetbibleModelApp extends ItemModel Factory::_('GetBible.Watcher')->sync($this->translation, $this->book, $chapter_previous); } - $data = [ + $data = (object) [ 'translation' => $this->translation, 'book' => $this->book, 'chapter' => $this->chapter, diff --git a/site/views/app/tmpl/default_getbibleapp.php b/site/views/app/tmpl/default_getbibleapp.php index ef3775a..0d96c2a 100644 --- a/site/views/app/tmpl/default_getbibleapp.php +++ b/site/views/app/tmpl/default_getbibleapp.php @@ -25,7 +25,7 @@ const getbible_active_translation = 'chapter->abbreviation; ?> const getbible_verses = chapter->verses); ?>; const getbible_book_nr = chapter->book_nr; ?>; const getbible_chapter_nr = chapter->chapter; ?>; -const getbible_page_url = 'chapter->abbreviation . '&ref=' . $this->chapter->book_name . '&c=' . $this->chapter->chapter); ?>/'; +const getbible_page_url = 'url_base; ?>/'; var triggerGetBibleReload = false;
diff --git a/site/views/app/tmpl/default_getbibletext.php b/site/views/app/tmpl/default_getbibletext.php index 571e948..6d48559 100644 --- a/site/views/app/tmpl/default_getbibletext.php +++ b/site/views/app/tmpl/default_getbibletext.php @@ -24,13 +24,13 @@ defined('_JEXEC') or die('Restricted access'); previous); ?>
-params->get('activate_sharing') == 1 || $this->params->get('activate_search') == 1 || empty($this->item['daily'])): ?> +params->get('activate_sharing') == 1 || $this->params->get('activate_search') == 1 || empty($this->item->daily)): ?> translation->direction) === 'ltr'): ?>
- item['daily'])): ?> + item->daily)): ?> params->get('activate_search') == 1): ?> diff --git a/site/views/app/view.html.php b/site/views/app/view.html.php index 564d99c..96ee82f 100644 --- a/site/views/app/view.html.php +++ b/site/views/app/view.html.php @@ -52,8 +52,18 @@ class GetbibleViewApp extends HtmlView $this->prompts = $this->get('Prompts'); $this->linkertaggedverses = $this->get('LinkerTaggedVerses'); $this->linkertags = $this->get('LinkerTags'); + // remove from page (in case debug mode is on) + $this->params->get('openai_token', null); + + // only run these if we have an item if ($this->item) { + // set the page direction globally + $this->document->setDirection($this->translation->direction); + + // set the global language declaration + // $this->document->setLanguage($this->translation->joomla); (soon ;) + // get the input values $this->input = $this->app->input; @@ -82,11 +92,14 @@ class GetbibleViewApp extends HtmlView } // set the base URL + $this->setBaseUrl(); + + // set the daily verse url $this->setDailyVerseUrl(); // set the selected verses $this->verses = new \stdClass(); - $this->verses->selected = $this->item['verses'] ? $this->getSelectedVerses($this->item['verses']) : null; + $this->verses->selected = $this->item->verses ? $this->getSelectedVerses($this->item->verses) : null; $this->verses->first = 1; $this->verses->last = 2; if (!empty($this->verses->selected)) @@ -109,6 +122,9 @@ class GetbibleViewApp extends HtmlView // start the modal state $this->modalState = new \stdClass(); + + // set metadata + $this->setMetaData(); } else { @@ -139,6 +155,81 @@ class GetbibleViewApp extends HtmlView parent::display($tpl); } + /** + * Set the page metadata + * + * @return void + * @since 2.0.1 + */ + protected function setMetaData() + { + // set the page title + $title = JText::sprintf('COM_GETBIBLE_S_CHAPTER_S_S_S', + $this->chapter->book_name, + $this->chapter->chapter, + $this->translation->abbreviation, + $this->params->get('page_title', '') + ); + $this->document->setTitle($title); + + // set the Generator + $this->document->setGenerator('getBible! - Open Source Bible App.'); + + // set the metadata values + $description = JText::sprintf('COM_GETBIBLE_READ_S_CHAPTER_S_IN_THE_S', + $this->chapter->book_name, + $this->chapter->chapter, + $this->translation->translation + ); + $this->item->metadesc = $description; + $this->item->metakey = JText::sprintf('COM_GETBIBLE_S_CHAPTER_S_S_S_S_S_BIBLE_S_SCRIPTURE_GETBIBLE', + $this->chapter->book_name, + $this->chapter->chapter, + $this->chapter->name, + $this->translation->translation, + $this->translation->abbreviation, + $this->translation->language, + $this->translation->distribution_lcsh + ); + $this->item->created_by = JText::_('COM_GETBIBLE_THE_WORD_OF_GOD'); + + // set canonical URL + $this->document->addHeadLink($this->url_base, 'canonical'); + + // OG:Title + $this->document->setMetadata('og:title', $title, 'property'); + + // OG:Description + $this->document->setMetadata('og:description', $description, 'property'); + + // OG:Image + // $this->document->setMetadata('og:image', 'YOUR_IMAGE_URL_HERE', 'property'); + + // OG:URL + $this->document->setMetadata('og:url', $this->url_base, 'property'); + + // OG:Type + $this->document->setMetadata('og:type', 'website', 'property'); + + // Twitter Card Type + $this->document->setMetadata('twitter:card', 'summary'); + + // Twitter Title + $this->document->setMetadata('twitter:title', $title); + + // Twitter Description + $this->document->setMetadata('twitter:description', $description); + + // Twitter Image + // $this->document->setMetadata('twitter:image', 'YOUR_IMAGE_URL_HERE'); + + // Twitter Site (Your website's Twitter handle) + // $this->document->setMetadata('twitter:site', '@YourTwitterHandle'); + + // Twitter Creator (Author's Twitter handle or your website's Twitter handle) + // $this->document->setMetadata('twitter:creator', '@AuthorTwitterHandle'); + } + /** * Set the tabs menu * @@ -457,6 +548,17 @@ class GetbibleViewApp extends HtmlView } } + /** + * Set the base url + * + * @return void + * @since 2.0.1 + */ + protected function setBaseUrl() + { + $this->url_base = trim(JUri::base(), '/') . JRoute::_('index.php?option=com_getbible&view=app&t=' . $this->chapter->abbreviation . '&ref=' . $this->chapter->book_name . '&c=' . $this->chapter->chapter); + } + /** * Set the daily verse url * diff --git a/site/views/tag/tmpl/default_getbiblenotag.php b/site/views/tag/tmpl/default_getbiblenotag.php index c0a2a9d..6eb60e7 100644 --- a/site/views/tag/tmpl/default_getbiblenotag.php +++ b/site/views/tag/tmpl/default_getbiblenotag.php @@ -29,6 +29,7 @@ defined('_JEXEC') or die('Restricted access');

!

+
loadTemplate('getbibleselecttags'); ?>
diff --git a/site/views/tag/view.html.php b/site/views/tag/view.html.php index 1061cbd..27c242d 100644 --- a/site/views/tag/view.html.php +++ b/site/views/tag/view.html.php @@ -71,7 +71,10 @@ class GetbibleViewTag extends HtmlView // set sorting books option $this->setBooks(); } - } + } + + // set the Bible url + $this->setBaseUrl(); // Set the toolbar $this->addToolBar(); @@ -204,6 +207,17 @@ class GetbibleViewTag extends HtmlView } } + /** + * Set the base url + * + * @return void + * @since 2.0.1 + */ + protected function setBaseUrl() + { + $this->url_base = trim(JUri::base(), '/') . JRoute::_('index.php?option=com_getbible&view=app&t=' . $this->chapter->abbreviation . '&ref=' . $this->chapter->book_name . '&c=' . $this->chapter->chapter); + } + /** * Get the Linker Details * @@ -212,7 +226,7 @@ class GetbibleViewTag extends HtmlView */ protected function getLinker(): array { - return ['guid' => Factory::_('GetBible.Linker')->active()]; + return Factory::_('GetBible.Linker')->activeDetails(); } /** diff --git a/update_server.xml b/update_server.xml index 27de6a2..0d207de 100644 --- a/update_server.xml +++ b/update_server.xml @@ -305,4 +305,22 @@ https://getbible.net + + Get Bible + The Bible for Joomla + pkg_getbible + package + site + 2.0.19 + https://getbible.net + + https://git.vdm.dev/api/v1/repos/getBible/joomla-pkg/archive/v2.0.19.zip + + + stable + + Llewellyn van der Merwe + https://getbible.net + + \ No newline at end of file