Get Bible (v.2.0.3)
+ Get Bible (v.2.0.4)
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/DailyScripture.php b/libraries/jcb_powers/VDM.Joomla.GetBible/src/DailyScripture.php
index 46cf947..95a1b05 100644
--- a/libraries/jcb_powers/VDM.Joomla.GetBible/src/DailyScripture.php
+++ b/libraries/jcb_powers/VDM.Joomla.GetBible/src/DailyScripture.php
@@ -107,6 +107,36 @@ final class DailyScripture
return (strcasecmp($this->active, $this->reference) == 0);
}
+ /**
+ * Set Current active verse
+ *
+ * @return int|null Book number
+ * @return int|null Chapter number
+ * @return string|null Verses
+ *
+ * @since 2.0.1
+ */
+ public function setActive(?int $book, ?int $chapter, ?string $verses): void
+ {
+ $active = '';
+ if ($book !== null)
+ {
+ $active = $book;
+ if ($chapter !== null)
+ {
+ $this->book = (int) $book;
+ $this->chapter = (int) $chapter;
+ $active .= ' ' . $chapter;
+ if ($verses !== null)
+ {
+ $active .= ':' . $verses;
+ $this->verses = $verses;
+ }
+ $this->active = $active;
+ }
+ }
+ }
+
/**
* An option to load another reference
*
diff --git a/script.php b/script.php
index 603aee2..3dc4dc4 100644
--- a/script.php
+++ b/script.php
@@ -1108,7 +1108,7 @@ class com_getbibleInstallerScript
$query = $db->getQuery(true);
// Field to update.
$fields = array(
- $db->quoteName('params') . ' = ' . $db->quote('{"autorName":"Llewellyn van der Merwe","autorEmail":"joomla@vdm.io","show_install_button":"0","show_getbible_logo":"1","show_getbible_link":"1","show_hash_validation":"1","show_api_link":"1","activate_search":"0","search_found_color":"#4747ff","table_selection_color":"#dfdfdf","search_words":"1","search_match":"1","search_case":"1","activate_notes":"0","activate_tags":"0","allow_untagging":"0","activate_sharing":"1","verse_layout_share":"1","verse_number_share":"1","local_link_share":"1","text_reference_share":"3","type_translation_share":"2","default_format_share":"1","verse_selected_color":"#4747ff","show_header":"1","verse_per_line":"1","show_top_menu":"1","top_menu_type":"1","show_bottom_menu":"0","bottom_menu_type":"1","previous_next_navigation":"1","set_custom_tabs":"0","custom_tabs":"div","set_default_tab_names":"0","custom_icons":"0","show_scripture_tab_text":"1","show_scripture_icon":"1","show_scripture_card":"1","scripture_card_style":"default","show_translations_tab_text":"1","show_translations_icon":"1","show_translations_card":"1","translations_card_style":"default","show_books_tab_text":"1","show_books_icon":"1","show_books_card":"1","books_card_style":"default","show_chapters_tab_text":"1","show_chapters_icon":"1","show_chapters_card":"1","chapters_card_style":"default","show_settings":"0","show_settings_tab_text":"1","show_settings_icon":"1","show_settings_card":"1","settings_card_style":"default","show_details":"1","show_details_tab_text":"1","show_details_icon":"1","show_details_card":"1","details_card_style":"default","debug":"0","enable_open_ai":"0","openai_model":"gpt-4","openai_token":"secret","enable_open_ai_org":"0","openai_org_token":"secret","openai_max_tokens":"300","openai_temperature":"1","openai_top_p":"1","openai_n":"1","openai_presence_penalty":"0","openai_frequency_penalty":"0","check_in":"-1 day","save_history":"1","history_limit":"10","add_jquery_framework":"1","uikit_load":"1","uikit_min":""}'),
+ $db->quoteName('params') . ' = ' . $db->quote('{"autorName":"Llewellyn van der Merwe","autorEmail":"joomla@vdm.io","default_translation":"kjv","show_install_button":"0","show_getbible_logo":"1","show_getbible_link":"1","show_hash_validation":"1","show_api_link":"1","activate_search":"0","search_found_color":"#4747ff","table_selection_color":"#dfdfdf","search_words":"1","search_match":"1","search_case":"1","activate_notes":"0","activate_tags":"0","allow_untagging":"0","activate_sharing":"1","verse_layout_share":"1","verse_number_share":"1","local_link_share":"1","text_reference_share":"3","type_translation_share":"2","default_format_share":"1","verse_selected_color":"#4747ff","show_header":"1","verse_per_line":"1","show_top_menu":"1","top_menu_type":"1","show_bottom_menu":"0","bottom_menu_type":"1","previous_next_navigation":"1","set_custom_tabs":"0","custom_tabs":"div","set_default_tab_names":"0","custom_icons":"0","show_scripture_tab_text":"1","show_scripture_icon":"1","show_scripture_card":"1","scripture_card_style":"default","show_translations_tab_text":"1","show_translations_icon":"1","show_translations_card":"1","translations_card_style":"default","show_books_tab_text":"1","show_books_icon":"1","show_books_card":"1","books_card_style":"default","show_chapters_tab_text":"1","show_chapters_icon":"1","show_chapters_card":"1","chapters_card_style":"default","show_settings":"0","show_settings_tab_text":"1","show_settings_icon":"1","show_settings_card":"1","settings_card_style":"default","show_details":"1","show_details_tab_text":"1","show_details_icon":"1","show_details_card":"1","details_card_style":"default","debug":"0","enable_open_ai":"0","openai_model":"gpt-4","openai_token":"secret","enable_open_ai_org":"0","openai_org_token":"secret","openai_max_tokens":"300","openai_temperature":"1","openai_top_p":"1","openai_n":"1","openai_presence_penalty":"0","openai_frequency_penalty":"0","check_in":"-1 day","save_history":"1","history_limit":"10","add_jquery_framework":"1","uikit_load":"1","uikit_min":""}'),
);
// Condition.
$conditions = array(
@@ -1539,7 +1539,7 @@ class com_getbibleInstallerScript
echo '
-
Upgrade to Version 2.0.3 Was Successful! Let us know if anything is not working as expected.
';
+ Upgrade to Version 2.0.4 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/app.php b/site/models/app.php
index 79626bc..389a70c 100644
--- a/site/models/app.php
+++ b/site/models/app.php
@@ -104,17 +104,21 @@ class GetbibleModelApp extends ItemModel
}
// we get all the Scripture Details
- $this->translation = $this->input->getString('translation') ?? $this->input->getString('t', 'kjv');
+ $this->translation = $this->input->getString('translation') ?? $this->input->getString('t', Helper::getParams('com_getbible')->get('default_translation', 'kjv'));
$this->book = $this->input->getInt('book') ?? $this->input->getInt('b');
$this->chapter = $this->input->getInt('chapter') ?? $this->input->getInt('c', 1);
$this->verses = $this->input->getString('verses') ?? $this->input->getString('verse') ?? $this->input->getString('v');
$pk = 0;
- // try the ref string
+ // set daily verse (STUFF)
if (empty($this->book) && ($ref = $this->input->getString('ref')) !== null)
{
Factory::_('DailyScripture')->load($ref);
}
+ else
+ {
+ Factory::_('DailyScripture')->setActive($this->book, $this->chapter, $this->verses);
+ }
// load Daily Scripture if no book value was found
if (empty($this->book))
diff --git a/site/models/openai.php b/site/models/openai.php
index 5f172be..dad676e 100644
--- a/site/models/openai.php
+++ b/site/models/openai.php
@@ -97,7 +97,7 @@ class GetbibleModelOpenai extends ItemModel
$pk = (!empty($pk)) ? $pk : (int) $this->getState('openai.id');
- $this->translation = $this->input->getString('t') ?? $this->input->getString('version') ?? $this->input->getString('translation', 'kjv');
+ $this->translation = $this->input->getString('t') ?? $this->input->getString('translation', Helper::getParams('com_getbible')->get('default_translation', 'kjv'));
$this->guid = $pk = $this->input->getString('guid');
$this->book = $this->input->getInt('book', 0);
$this->chapter = $this->input->getInt('chapter', 0);
diff --git a/site/models/search.php b/site/models/search.php
index 31db839..8075b39 100644
--- a/site/models/search.php
+++ b/site/models/search.php
@@ -370,7 +370,7 @@ class GetbibleModelSearch extends ListModel
// Get the global params
$globalParams = JComponentHelper::getParams('com_getbible', true);
- $this->translation = $this->input->getString('t') ?? $this->input->getString('version') ?? $this->input->getString('translation', 'kjv');
+ $this->translation = $this->input->getString('t') ?? $this->input->getString('translation', $globalParams->get('default_translation', 'kjv'));
$this->words = $this->input->getInt('words', $globalParams->get('search_words', 1));
$this->match = $this->input->getInt('match', $globalParams->get('search_match', 1));
$this->case = $this->input->getInt('case', $globalParams->get('search_case', 1));
diff --git a/site/models/tag.php b/site/models/tag.php
index a23a38a..54338f3 100644
--- a/site/models/tag.php
+++ b/site/models/tag.php
@@ -20,6 +20,7 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Model\ListModel;
use Joomla\Utilities\ArrayHelper;
+use VDM\Joomla\Utilities\Component\Helper;
use VDM\Joomla\Utilities\GuidHelper;
use VDM\Joomla\GetBible\Factory;
@@ -166,7 +167,7 @@ class GetbibleModelTag extends ListModel
$this->input ??= JFactory::getApplication()->input;
- $this->translation = $this->input->getString('t') ?? $this->input->getString('version') ?? $this->input->getString('translation', 'kjv') ;
+ $this->translation = $this->input->getString('t') ?? $this->input->getString('translation', Helper::getParams('com_getbible')->get('default_translation', 'kjv')) ;
$this->tag = $this->input->getString('guid') ?? '';
if (!GuidHelper::valid($this->tag))
diff --git a/site/router.php b/site/router.php
index 92c104d..3f1c443 100644
--- a/site/router.php
+++ b/site/router.php
@@ -35,15 +35,17 @@ class GetbibleRouter extends JComponentRouterBase
* @since 3.3
*/
+ protected ?string $defaultTranslation = null;
public function build(&$query)
{
$segments = [];
$view = $query['view'] ?? 'app';
+ $this->defaultTranslation ??= JComponentHelper::getParams('com_getbible')->get('default_translation', 'kjv');
if ($view === 'search')
{
$segments[0] = 'search';
- $segments[1] = $query['t'] ?? $query['version'] ?? $query['translation'] ?? 'kjv';
+ $segments[1] = $query['t'] ?? $query['version'] ?? $query['translation'] ?? $this->defaultTranslation;
$criteria = $query['criteria'] ?? null;
if ($criteria === null)
@@ -117,7 +119,7 @@ class GetbibleRouter extends JComponentRouterBase
{
$segments[0] = 'openai';
$segments[1] = $query['guid'] ?? '';
- $segments[2] = $query['t'] ?? $query['version'] ?? $query['translation'] ?? '';
+ $segments[2] = $query['t'] ?? $query['version'] ?? $query['translation'] ?? $this->defaultTranslation;
$segments[3] = $query['book'] ?? '';
$segments[4] = $query['chapter'] ?? '';
$segments[5] = $query['verse'] ?? '';
@@ -136,13 +138,13 @@ class GetbibleRouter extends JComponentRouterBase
elseif ($view === 'api')
{
$segments[0] = 'api';
- $segments[1] = $query['t'] ?? $query['version'] ?? $query['translation'] ?? 'kjv';
+ $segments[1] = $query['t'] ?? $query['version'] ?? $query['translation'] ?? $this->defaultTranslation;
$segments[2] = $query['get'] ?? '';
}
elseif ($view === 'tag')
{
$segments[0] = 'tag';
- $segments[1] = $query['t'] ?? $query['version'] ?? $query['translation'] ?? 'kjv';
+ $segments[1] = $query['t'] ?? $query['version'] ?? $query['translation'] ?? $this->defaultTranslation;
$segments[2] = $query['guid'] ?? '';
if (!empty($query['guid']) && ($tag_name = $this->getVar('tag', $query['guid'], 'guid', 'name')) !== null)
{
@@ -152,7 +154,7 @@ class GetbibleRouter extends JComponentRouterBase
}
else
{
- $segments[0] = $query['t'] ?? $query['version'] ?? $query['translation'] ?? 'kjv';
+ $segments[0] = $query['t'] ?? $query['version'] ?? $query['translation'] ?? $this->defaultTranslation;
$segments[1] = $query['ref'] ?? $query['b'] ?? $query['book'] ?? '';
$chapter = $query['chapter'] ?? $query['c'] ?? '';
@@ -205,6 +207,8 @@ class GetbibleRouter extends JComponentRouterBase
$vars = [];
$vars['view'] = 'app';
+ $this->defaultTranslation ??= JComponentHelper::getParams('com_getbible')->get('default_translation', 'kjv');
+
$key = 0;
$vars['t'] = $segments[$key] ?? '';
@@ -268,7 +272,7 @@ class GetbibleRouter extends JComponentRouterBase
// if the first tag is none of the above, we are probably on the app page
else
{
- $vars['t'] = 'kjv';
+ $vars['t'] = $this->defaultTranslation;
$this->setAppVars($vars, $key, $segments);
}
@@ -483,7 +487,7 @@ class GetbibleRouter extends JComponentRouterBase
*/
private function setTranslation(array &$vars, int &$key, array $segments): void
{
- $vars['t'] = $segments[$key] ?? 'kjv';
+ $vars['t'] = $segments[$key] ?? $this->defaultTranslation;
if ($this->validTranslation($vars['t']))
{
@@ -491,7 +495,7 @@ class GetbibleRouter extends JComponentRouterBase
}
else
{
- $vars['t'] = 'kjv';
+ $vars['t'] = $this->defaultTranslation;
}
}
diff --git a/site/views/app/tmpl/default_getbibleapp.php b/site/views/app/tmpl/default_getbibleapp.php
index 917c7c2..838f850 100644
--- a/site/views/app/tmpl/default_getbibleapp.php
+++ b/site/views/app/tmpl/default_getbibleapp.php
@@ -259,6 +259,7 @@ const getbibleActiveVerse = {
setActiveNoteTextarea(this._value);
params->get('activate_tags') == 1): ?> // update the tags
setActiveTags(this._value);
+ setSharedValues(this._value, this._value, true);
}
};
const setActiveVerse = async (number, update = true) => {
diff --git a/site/views/app/tmpl/default_getbibleappshare.php b/site/views/app/tmpl/default_getbibleappshare.php
index 1b9fe22..3a27d39 100644
--- a/site/views/app/tmpl/default_getbibleappshare.php
+++ b/site/views/app/tmpl/default_getbibleappshare.php
@@ -393,9 +393,9 @@ function setSharedValues(start, end, update = true) {
if (update) {
getbibleShareVerseSlider.noUiSlider.set([start, end]);
} else {
- let function_call = 'setSharedValues(' + start + ',' + end + ')';
- let functionCall = document.getElementById('getbible-main-sharing-button');
- functionCall.setAttribute('onclick', function_call);
+ //let function_call = 'setSharedValues(' + start + ',' + end + ')';
+ //let functionCall = document.getElementById('getbible-main-sharing-button');
+ //functionCall.setAttribute('onclick', function_call);
}
}
getbibleShareVerseSlider.noUiSlider.on('update', function(values, handle) {
diff --git a/update_server.xml b/update_server.xml
index 1627c21..be24cd6 100644
--- a/update_server.xml
+++ b/update_server.xml
@@ -53,4 +53,22 @@
https://getbible.net
+
+ Get Bible
+ The Bible for Joomla
+ pkg_getbible
+ component
+ site
+ 2.0.4
+ https://getbible.net
+
+ https://git.vdm.dev/api/v1/repos/getBible/joomla-pkg/archive/v2.0.4.zip
+
+
+ stable
+
+ Llewellyn van der Merwe
+ https://getbible.net
+
+
\ No newline at end of file