Stable release of v2.0.21

Adds Tags meta data to tag pages. Adds option to share a tag. Improve the URL creation, and return URL feature for search and tag pages.
This commit is contained in:
Robot 2023-08-21 17:36:30 +02:00
parent c42df2d720
commit 91264e8511
Signed by: Robot
GPG Key ID: 14DECD44E7E1BB95
32 changed files with 1363 additions and 197 deletions

View File

@ -103,3 +103,9 @@
- First step to resolve getBible/support#8 so that the selection works on mobile browsers.
- Fixed the scrolling for mobiles.
# v2.0.21
- Adds Tags meta data to tag pages
- Adds option to share a tag
- Improve the URL creation, and return URL feature for search and tag pages

View File

@ -1,4 +1,4 @@
# Get Bible (2.0.20)
# Get Bible (2.0.21)
![Get Bible image](https://git.vdm.dev/getBible/joomla-component/raw/branch/master/admin/assets/images/vdm-component.jpg "GetBible")
@ -18,32 +18,32 @@ 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*: 14th August, 2023
+ *Version*: 2.0.20
+ *Last Build*: 21st August, 2023
+ *Version*: 2.0.21
+ *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
**553 Hours** or **69 Eight Hour Days** (actual time the author saved -
**556 Hours** or **70 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*: **198159**
+ *File count*: **1719**
+ *Line count*: **199323**
+ *File count*: **1721**
+ *Folder count*: **163**
**365 Hours** or **46 Eight Hour Days** (the actual time the author spent)
**367 Hours** or **45 Eight Hour Days** (the actual time the author spent)
> (with the following break down:
> **debugging @138hours** = codingtime / 4;
> **debugging @139hours** = codingtime / 4;
> **planning @79hours** = codingtime / 7;
> **mapping @55hours** = codingtime / 10;
> **office @92hours** = codingtime / 6;)
> **mapping @56hours** = codingtime / 10;
> **office @93hours** = codingtime / 6;)
**918 Hours** or **115 Eight Hour Days**
**923 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**,

View File

@ -1,4 +1,4 @@
# Get Bible (2.0.20)
# Get Bible (2.0.21)
![Get Bible image](https://git.vdm.dev/getBible/joomla-component/raw/branch/master/admin/assets/images/vdm-component.jpg "GetBible")
@ -18,32 +18,32 @@ 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*: 14th August, 2023
+ *Version*: 2.0.20
+ *Last Build*: 21st August, 2023
+ *Version*: 2.0.21
+ *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
**553 Hours** or **69 Eight Hour Days** (actual time the author saved -
**556 Hours** or **70 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*: **198159**
+ *File count*: **1719**
+ *Line count*: **199323**
+ *File count*: **1721**
+ *Folder count*: **163**
**365 Hours** or **46 Eight Hour Days** (the actual time the author spent)
**367 Hours** or **45 Eight Hour Days** (the actual time the author spent)
> (with the following break down:
> **debugging @138hours** = codingtime / 4;
> **debugging @139hours** = codingtime / 4;
> **planning @79hours** = codingtime / 7;
> **mapping @55hours** = codingtime / 10;
> **office @92hours** = codingtime / 6;)
> **mapping @56hours** = codingtime / 10;
> **office @93hours** = codingtime / 6;)
**918 Hours** or **115 Eight Hour Days**
**923 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**,

View File

@ -174,6 +174,59 @@
readonly="true"
class="readonly"
/>
<field type="spacer" name="spacerContributor1" hr="true" />
<field name="contributor1"
type="spacer"
class="text"
label="COM_GETBIBLE_CONFIG_CONTRIBUTOR_ONE"
/>
<field name="titleContributor1"
type="text"
label="COM_GETBIBLE_CONFIG_CONTRIBUTOR_TITLE_LABEL"
description="COM_GETBIBLE_CONFIG_CONTRIBUTOR_TITLE_DESC"
size="60"
default="Modules"
/>
<field name="nameContributor1"
type="text"
label="COM_GETBIBLE_CONFIG_CONTRIBUTOR_NAME_LABEL"
description="COM_GETBIBLE_CONFIG_CONTRIBUTOR_NAME_DESC"
size="60"
default="CrossWire"
/>
<field name="emailContributor1"
type="email"
label="COM_GETBIBLE_CONFIG_CONTRIBUTOR_EMAIL_LABEL"
description="COM_GETBIBLE_CONFIG_CONTRIBUTOR_EMAIL_DESC"
size="60"
default="sword-support@crosswire.org"
/>
<field name="linkContributor1"
type="url"
label="COM_GETBIBLE_CONFIG_CONTRIBUTOR_LINK_LABEL"
description="COM_GETBIBLE_CONFIG_CONTRIBUTOR_LINK_DESC"
size="60"
default="https://wiki.crosswire.org/"
/>
<field name="useContributor1"
type="list"
default="2"
label="COM_GETBIBLE_CONFIG_CONTRIBUTOR_USE_LABEL"
description="COM_GETBIBLE_CONFIG_CONTRIBUTOR_USE_DESC">
<option value="0">COM_GETBIBLE_CONFIG_CONTRIBUTOR_USE_NONE</option>
<option value="1">COM_GETBIBLE_CONFIG_CONTRIBUTOR_USE_EMAIL</option>
<option value="2">COM_GETBIBLE_CONFIG_CONTRIBUTOR_USE_WWW</option>
</field>
<field name="showContributor1"
type="list"
default="3"
label="COM_GETBIBLE_CONFIG_CONTRIBUTOR_SHOW_LABEL"
description="COM_GETBIBLE_CONFIG_CONTRIBUTOR_SHOW_DESC">
<option value="0">COM_GETBIBLE_CONFIG_CONTRIBUTOR_SHOW_NONE</option>
<option value="1">COM_GETBIBLE_CONFIG_CONTRIBUTOR_SHOW_BACK</option>
<option value="2">COM_GETBIBLE_CONFIG_CONTRIBUTOR_SHOW_FRONT</option>
<option value="3">COM_GETBIBLE_CONFIG_CONTRIBUTOR_SHOW_ALL</option>
</field>
</fieldset>
<fieldset
name="uikit_config"

View File

@ -252,6 +252,26 @@ COM_GETBIBLE_CONFIG_CHECK_TIMER_OPTION_TWO="Every twelve hours"
COM_GETBIBLE_CONFIG_CLASS_HINT="Blank for none"
COM_GETBIBLE_CONFIG_CLASS_LABEL="Class"
COM_GETBIBLE_CONFIG_CLASS_MESSAGE="Error! Please add some Class here."
COM_GETBIBLE_CONFIG_CONTRIBUTOR_EMAIL_DESC="The email of this contributor."
COM_GETBIBLE_CONFIG_CONTRIBUTOR_EMAIL_LABEL="Contributor Email"
COM_GETBIBLE_CONFIG_CONTRIBUTOR_LINK_DESC="The link to this contributor's website."
COM_GETBIBLE_CONFIG_CONTRIBUTOR_LINK_LABEL="Contributor Website"
COM_GETBIBLE_CONFIG_CONTRIBUTOR_NAME_DESC="The name of this contributor."
COM_GETBIBLE_CONFIG_CONTRIBUTOR_NAME_LABEL="Contributor Name"
COM_GETBIBLE_CONFIG_CONTRIBUTOR_ONE="Contributor One"
COM_GETBIBLE_CONFIG_CONTRIBUTOR_SHOW_ALL="Both Front & Back-end"
COM_GETBIBLE_CONFIG_CONTRIBUTOR_SHOW_BACK="Back-end"
COM_GETBIBLE_CONFIG_CONTRIBUTOR_SHOW_DESC="Select where you want this contributor's details to show in the component."
COM_GETBIBLE_CONFIG_CONTRIBUTOR_SHOW_FRONT="Front-end"
COM_GETBIBLE_CONFIG_CONTRIBUTOR_SHOW_LABEL="Show"
COM_GETBIBLE_CONFIG_CONTRIBUTOR_SHOW_NONE="Hide"
COM_GETBIBLE_CONFIG_CONTRIBUTOR_TITLE_DESC="The job title that best describes the contributor's relationship to this component."
COM_GETBIBLE_CONFIG_CONTRIBUTOR_TITLE_LABEL="Contributor Job Title"
COM_GETBIBLE_CONFIG_CONTRIBUTOR_USE_DESC="How should we link to this contributor."
COM_GETBIBLE_CONFIG_CONTRIBUTOR_USE_EMAIL="Email"
COM_GETBIBLE_CONFIG_CONTRIBUTOR_USE_LABEL="Use"
COM_GETBIBLE_CONFIG_CONTRIBUTOR_USE_NONE="None"
COM_GETBIBLE_CONFIG_CONTRIBUTOR_USE_WWW="Website"
COM_GETBIBLE_CONFIG_CUSTOM_ICONS_DESCRIPTION="Use this option to set custom icons found at https://getuikit.com/docs/icon"
COM_GETBIBLE_CONFIG_CUSTOM_ICONS_LABEL="Set Custom Icons"
COM_GETBIBLE_CONFIG_CUSTOM_TABS_LABEL="Custom Tabs"

View File

@ -0,0 +1 @@

View File

@ -1,15 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="4" method="upgrade">
<name>COM_GETBIBLE</name>
<creationDate>14th August, 2023</creationDate>
<creationDate>21st August, 2023</creationDate>
<author>Llewellyn van der Merwe</author>
<authorEmail>joomla@vdm.io</authorEmail>
<authorUrl>https://getbible.net</authorUrl>
<copyright>Copyright (C) 2015. All Rights Reserved</copyright>
<license>GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html</license>
<version>2.0.20</version>
<version>2.0.21</version>
<description><![CDATA[
<h1>Get Bible (v.2.0.20)</h1>
<h1>Get Bible (v.2.0.21)</h1>
<div style="clear: both;"></div>
<p>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.

View File

@ -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","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","bottom_search_position":"div","show_bottom_search_position_card":"1","bottom_search_position_card_style":"default","activate_notes":"0","activate_tags":"0","allow_untagging":"0","bottom_tag_position":"div","show_bottom_tag_position_card":"1","bottom_tag_position_card_style":"default","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_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_translations_tab_text":"1","show_translations_icon":"1","show_translations_card":"1","translations_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","bottom_app_position":"div","show_bottom_app_position_card":"1","bottom_app_position_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","bottom_ai_position":"div","show_bottom_ai_position_card":"1","bottom_ai_position_card_style":"default","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","bottom_search_position":"div","show_bottom_search_position_card":"1","bottom_search_position_card_style":"default","activate_notes":"0","activate_tags":"0","allow_untagging":"0","bottom_tag_position":"div","show_bottom_tag_position_card":"1","bottom_tag_position_card_style":"default","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_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_translations_tab_text":"1","show_translations_icon":"1","show_translations_card":"1","translations_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","bottom_app_position":"div","show_bottom_app_position_card":"1","bottom_app_position_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","bottom_ai_position":"div","show_bottom_ai_position_card":"1","bottom_ai_position_card_style":"default","check_in":"-1 day","save_history":"1","history_limit":"10","titleContributor1":"Modules","nameContributor1":"CrossWire","emailContributor1":"sword-support@crosswire.org","linkContributor1":"https://wiki.crosswire.org/","useContributor1":"2","showContributor1":"3","add_jquery_framework":"1","uikit_load":"1","uikit_min":""}'),
);
// Condition.
$conditions = array(
@ -1539,7 +1539,7 @@ class com_getbibleInstallerScript
echo '<a target="_blank" href="https://getbible.net" title="Get Bible">
<img src="components/com_getbible/assets/images/vdm-component.jpg"/>
</a>
<h3>Upgrade to Version 2.0.20 Was Successful! Let us know if anything is not working as expected.</h3>';
<h3>Upgrade to Version 2.0.21 Was Successful! Let us know if anything is not working as expected.</h3>';
// Set db if not set already.
if (!isset($db))

View File

@ -39,21 +39,6 @@ const handleSearch = async () => {
}
};
/**
* JS Function to get the current search URL
*/
const getSearchURL = (search, words = 1, match = 1, type_case = 1, target = 1000, translation = 'kjv') => {
// build search url
return urlAjax +
'getSearchUrl&translation=' + urlencode(translation) +
'&words=' + words +
'&match=' + match +
'&case=' + type_case +
'&target=' + target +
'&book=' + 0 +
'&search=' + urlencode(search);
};
/**
* JS Function to update the URL of the browser with the search query
*/
@ -88,18 +73,6 @@ const handleApp = async (book, chapter, verse, translation) => {
}
};
/**
* JS Function to get the current search URL
*/
const getAppURL = (book, chapter, verse, translation = 'kjv') => {
// build search url
return urlAjax +
'getAppUrl&translation=' + urlencode(translation) +
'&book=' + book +
'&chapter=' + chapter +
'&verse=' + verse;
};
function urlencode (str) {
// discuss at: https://locutus.io/php/urlencode/
// original by: Philip Peterson

View File

@ -46,6 +46,7 @@ class GetbibleController extends BaseController
'translation' => 'STRING',
'b' => 'INT',
'book' => 'INT',
'target_book' => 'INT',
'c' => 'INT',
'chapter' => 'INT',
'verse' => 'STRING',

View File

@ -803,11 +803,13 @@ class GetbibleControllerAjax extends BaseController
$matchValue = $jinput->get('match', NULL, 'INT');
$caseValue = $jinput->get('case', NULL, 'INT');
$targetValue = $jinput->get('target', NULL, 'INT');
$bookValue = $jinput->get('book', NULL, 'INT');
$searchValue = $jinput->get('search', NULL, 'STRING');
$target_bookValue = $jinput->get('target_book', 0, 'INT');
$bookValue = $jinput->get('book', 0, 'INT');
$chapterValue = $jinput->get('chapter', 0, 'INT');
if($translationValue && $wordsValue && $matchValue && $caseValue && $targetValue)
{
$result = $this->getModel('ajax')->getSearchUrl($translationValue, $wordsValue, $matchValue, $caseValue, $targetValue, $bookValue, $searchValue);
$result = $this->getModel('ajax')->getSearchUrl($translationValue, $wordsValue, $matchValue, $caseValue, $targetValue, $searchValue, $target_bookValue, $bookValue, $chapterValue);
}
else
{

View File

@ -148,9 +148,12 @@ COM_GETBIBLE_REVOKE_EXCLUSIVE_ACCESS_TO_EDIT_YOUR_NOTES_AND_TAGS="Revoke exclusi
COM_GETBIBLE_SAVE="Save"
COM_GETBIBLE_SCRIPTURE="Scripture"
COM_GETBIBLE_SEARCH="Search"
COM_GETBIBLE_SEARCHING_S_IN_S_S="Searching: %s in %s - %s"
COM_GETBIBLE_SEARCHING_S_IN_S_TARGETING_S_WITH_S_S_IN_S="Searching: %s, in %s, targeting %s with %s, %s, in %s"
COM_GETBIBLE_SEARCH_DESC="Search"
COM_GETBIBLE_SEARCH_OPTIONS="Search Options"
COM_GETBIBLE_SEARCH_RESULTS="Search Results"
COM_GETBIBLE_SEARCH_S_S_S_S_S_S_BIBLE_S_S_SCRIPTURE_SEARCH_GETBIBLE="search, %s, %s, %s, %s, %s, %s Bible, %s, %s, scripture search, getBible"
COM_GETBIBLE_SELECT="Select"
COM_GETBIBLE_SENSITIVE="Sensitive"
COM_GETBIBLE_SESSIONS="Sessions"
@ -162,6 +165,7 @@ COM_GETBIBLE_SESSION_NOT_ACTIVE="Session not active."
COM_GETBIBLE_SETTINGS="Settings"
COM_GETBIBLE_SHARE="Share"
COM_GETBIBLE_SHARE_LINK="Share Link"
COM_GETBIBLE_SHARE_TAG="Share Tag"
COM_GETBIBLE_SHARE_TEXT="Share Text"
COM_GETBIBLE_SHARE_YOUR_SESSION="Share Your Session"
COM_GETBIBLE_SHARING_THE_WORD_OF_GOD_WITH_THE_WORLD="Sharing the Word of God with the world."
@ -184,6 +188,9 @@ COM_GETBIBLE_TAG_DESCRIPTION="Tag Description"
COM_GETBIBLE_TAG_FOUND_BUT_COULD_NOT_BE_REACTIVATED="Tag found, but could not be reactivated."
COM_GETBIBLE_TAG_NAME="Tag Name"
COM_GETBIBLE_TAG_SUCCESSFULLY_DELETED="Tag successfully deleted."
COM_GETBIBLE_TAG_S_IN_S_S="Tag: %s in %s - %s"
COM_GETBIBLE_TAG_S_S="Tag: %s. %s"
COM_GETBIBLE_TAG_S_S_BIBLE_S_S_SCRIPTURE_TAG_GETBIBLE="tag, %s, %s Bible, %s, %s, scripture tag, getBible"
COM_GETBIBLE_TARGETED_BOOKS="Targeted Books"
COM_GETBIBLE_TEMPERATURE="Temperature"
COM_GETBIBLE_THERE_HAS_BEEN_AN_ERROR="There has been an error"

View File

@ -21,20 +21,18 @@ defined('JPATH_BASE') or die('Restricted access');
?>
<p>We, at <a href="https://getbible.net/">getBible</a>, have a robust system to ensure our API stays up-to-date with the <a href="http://www.crosswire.org/">Crosswire</a> project's <a href="http://www.crosswire.org/sword/modules/ModDisp.jsp?modType=Bibles">modules</a>. Let me walk you through how it all works, making sure it all makes sense without any technical jargon.</p>
<p>At <a href="https://getbible.net/">getBible</a>, we've established a robust system to keep our API synchronized with the <a href="https://wiki.crosswire.org/">Crosswire</a> project's <a href="http://www.crosswire.org/sword/modules/ModDisp.jsp?modType=Bibles">modules</a>. Let me explain how this integration works in simple terms.</p>
<p>Our Bible text comes directly from the <a href="http://www.crosswire.org/">Crosswire</a> <a href="http://www.crosswire.org/sword/modules/ModDisp.jsp?modType=Bibles">modules</a>. To track any changes, we create what are known as "hash values" for every chapter, book, and translation. Think of these hash values as unique identifiers that change when the content they're associated with changes. This system firmly links <a href="https://getbible.net/">getBible</a> with the <a href="http://www.crosswire.org/">Crosswire</a> <a href="http://www.crosswire.org/sword/modules/ModDisp.jsp?modType=Bibles">modules</a>.</p>
<p>We source our Bible text directly from the <a href="https://wiki.crosswire.org/">Crosswire</a> <a href="http://www.crosswire.org/sword/modules/ModDisp.jsp?modType=Bibles">modules</a>. To monitor any updates, we generate "hash values" for each chapter, book, and translation. These hash values serve as unique identifiers that change only when the underlying content changes, thereby ensuring a tight integration between <a href="https://getbible.net/">getBible</a> and the <a href="https://wiki.crosswire.org/">Crosswire</a> modules.</p>
<p>Every month, a process kicks off that takes about three hours. During this time, we pull the Bible text again from the <a href="http://www.crosswire.org/">Crosswire</a> <a href="http://www.crosswire.org/sword/modules/ModDisp.jsp?modType=Bibles">modules</a> and place it into a special repository. We then check if there are any changes by comparing the new hash values and the actual text with the old ones. If we detect any changes, we automatically update our official <a href="https://getbible.net/">getBible</a> repository, which holds the JSON <a href="https://github.com/getbible/v2#api-usage">API</a> files. This process has been running flawlessly for nearly three years and happens without any human intervention.</p>
<p>Every month, an automated process runs for approximately three hours. During this window, we fetch the latest Bible text from the <a href="https://wiki.crosswire.org/">Crosswire</a> modules. Subsequently, we compare the new hash values and the text with the previous ones. Any detected changes trigger updates to both our <a href="https://git.vdm.dev/getBible/v2">official getBible hash repository</a> and the <a href="https://api.getbible.net">Bible API</a> for all affected <a href="https://api.getbible.net/v2/translations.json">translations</a>. This system has been operating seamlessly for several years.</p>
<p>Once our official repository is updated, a new event is triggered to push these fresh files to our actual <a href="https://github.com/getbible/v2#api-usage">API</a> endpoints, which is <code>https://api.getbible.net/v2/translations.json</code>. This URL lists all the available translations in our API.</p>
<p>Once the updates are complete, any application utilizing our <a href="https://api.getbible.net">Bible API</a> should monitor the <a href="https://getbible.net/docs#mapping-helpers">hash values</a> at the chapter, book, or translation level. Spotting a change in these values indicates that they should update their respective systems.</p>
<p>At this point, all the hash values are updated too. So, any application using our <a href="https://github.com/getbible/v2#api-usage">API</a> should monitor for changes in these hash values, either on the chapter, book, or translation level. If a change in hash is detected, they should update their systems accordingly.</p>
<p>Hash values can change due to various reasons, including textual corrections like adding omitted verses, rectifying spelling errors, or addressing any discrepancies flagged by the publishers maintaining the <a href="http://www.crosswire.org/sword/modules/ModDisp.jsp?modType=Bibles">modules</a> at <a href="https://wiki.crosswire.org/">Crosswire</a>.</p>
<p>Changes in hash values may occur due to fixes in the text, such as adding missing verses or correcting spelling mistakes, or any other types of errors detected by the Publishers maintaining the <a href="http://www.crosswire.org/sword/modules/ModDisp.jsp?modType=Bibles">modules</a> at <a href="http://www.crosswire.org/">Crosswire</a>.</p>
<p>The <a href="https://wiki.crosswire.org/">Crosswire</a> initiative, also known as the SWORD Project, is the "source of truth" for <a href="https://wiki.crosswire.org/Frontends:getBible">getBible</a>. Any modifications in the <a href="https://wiki.crosswire.org/">Crosswire</a> <a href="http://www.crosswire.org/sword/modules/ModDisp.jsp?modType=Bibles">modules</a> get reflected in our API within days, ensuring our users access the most precise and current Bible text. We pledge to uphold this standard as long as <a href="https://getbible.net/">getBible</a> exists and our build scripts remain operational.</p>
<p>The <a href="http://www.crosswire.org/">Crosswire</a> project, also known as the SWORD Project, is therefore the "source of truth" for <a href="https://getbible.net/">getBible</a>. Any change in the <a href="http://www.crosswire.org/">Crosswire</a> <a href="http://www.crosswire.org/sword/modules/ModDisp.jsp?modType=Bibles">modules</a> reflects in our API within a few days, ensuring our API always provides the most accurate and up-to-date Bible text. This will continue for as long as <a href="https://getbible.net/">getBible</a> exists and we're able to run our build scripts.</p>
<p>We're united in our mission to preserve the integrity and authenticity of the Bible text. If you have questions or require additional information, please use our <a href="https://git.vdm.dev/getBible/support">support system</a>. We're here to assist and will respond promptly.</p>
<p>Remember, we're all in this together to maintain the integrity and accuracy of the Bible text. So, if you have any questions or need further clarification, please feel free to open issues in the relevant repositories, and we'll respond as soon as we can.</p>
<p>Thank you very much for your attention and for being a part of our mission at <a href="https://getbible.net/">getBible</a>.</p>
<p>Thank you for your understanding and for being an integral part of the <a href="https://getbible.net/">getBible</a> community.</p>

View File

@ -416,13 +416,15 @@ class GetbibleModelAjax extends ListModel
/**
* Get Search URL
*
* @param string $translation The translation abbreviation
* @param int $words The words search behaviour
* @param int $match The match search behaviour
* @param int $case The case search behaviour
* @param string $translation The translation abbreviation
* @param int $words The words search behaviour
* @param int $match The match search behaviour
* @param int $case The case search behaviour
* @param int $target The target search behaviour
* @param int $book The book search behaviour
* @param string $search The search string
* @param string|null $search The search string
* @param int $targetBook The target book search behaviour
* @param int $book The book from which the search is started
* @param int $chapter The chapter from which the search is started
*
* @return array|null
* @since 3.2.0
@ -433,12 +435,21 @@ class GetbibleModelAjax extends ListModel
int $match,
int $case,
int $target,
?string $search,
int $targetBook = 0,
int $book = 0,
string $search = ''): ?array
int $chapter = 0): ?array
{
if ($this->app_params->get('activate_search') == 1)
{
return ['url' => trim(trim(JUri::base(), '/') . JRoute::_('index.php?option=com_getbible&view=search&Itemid=' . $this->app_params->get('app_menu', 0) . '&t=' . $translation . '&words=' . $words . '&match=' . $match . '&case=' . $case . '&target=' . $target . '&search=' . $search))];
// set the return URL
$return = '';
if ($book > 0 && $chapter > 0)
{
$return = '&return=' . urlencode(base64_encode((string) JRoute::_('index.php?option=com_getbible&view=app&t=' . $translation . '&Itemid=' . $this->app_params->get('app_menu', 0) . '&book=' . $book . '&chapter=' . $chapter)));
}
return ['url' => trim(trim(JUri::base(), '/') . JRoute::_('index.php?option=com_getbible&view=search&Itemid=' . $this->app_params->get('app_menu', 0) . $return . '&t=' . $translation . '&words=' . $words . '&match=' . $match . '&case=' . $case . '&target=' . $target . '&search=' . $search ?? ''))];
}
return ['error' => 'The search feature has not been activated. Please contact the system administrator of this website to resolve this.'];
@ -471,7 +482,11 @@ class GetbibleModelAjax extends ListModel
{
if ($abbreviation === 'all' || $abbreviation === $translation)
{
return ['url' => trim(trim(JUri::base(), '/') . JRoute::_('index.php?option=com_getbible&view=openai&t=' . $translation . '&Itemid=' . $this->app_params->get('app_menu', 0) . '&guid=' . $guid . '&book=' . $book . '&chapter=' . $chapter . '&verse=' . $verse . '&words=' . $words))];
// set the return URL
$return = urlencode(base64_encode((string) JRoute::_('index.php?option=com_getbible&view=app&t=' . $translation . '&Itemid=' . $this->app_params->get('app_menu', 0) . '&book=' . $book . '&chapter=' . $chapter)));
// we return the AI url
return ['url' => trim(trim(JUri::base(), '/') . JRoute::_('index.php?option=com_getbible&view=openai&t=' . $translation . '&Itemid=' . $this->app_params->get('app_menu', 0) . '&return=' . $return . '&guid=' . $guid . '&book=' . $book . '&chapter=' . $chapter . '&verse=' . $verse . '&words=' . $words))];
}
return ['error' => 'There was an error please try again.'];

View File

@ -375,7 +375,7 @@ class GetbibleModelSearch extends ListModel
$this->match = $this->input->getInt('match', $globalParams->get('search_match', 1));
$this->case = $this->input->getInt('case', $globalParams->get('search_case', 1));
$this->target = $this->input->getInt('target', 1000);
$this->book = $this->input->getString('book');
$this->book = $this->input->getString('target_book');
$search = $this->input->getString('search') ?? $this->input->getString('s');
$this->search = trim($search);
}

View File

@ -183,6 +183,7 @@ class GetbibleRouter extends JComponentRouterBase
unset($query['translation']);
unset($query['b']);
unset($query['book']);
unset($query['target_book']);
unset($query['c']);
unset($query['chapter']);
unset($query['verse']);
@ -584,9 +585,9 @@ class GetbibleRouter extends JComponentRouterBase
*/
if ($vars['target'] == 4000)
{
$vars['book'] = $this->criteriaBook($criteria, 3);
$vars['target_book'] = $this->criteriaBook($criteria, 3);
if ($vars['book'] === null)
if ($vars['target_book'] === null)
{
$vars['target'] = 1000;
}

View File

@ -25,7 +25,7 @@ const getbible_active_translation = '<?php echo $this->chapter->abbreviation; ?>
const getbible_verses = <?php echo json_encode($this->chapter->verses); ?>;
const getbible_book_nr = <?php echo $this->chapter->book_nr; ?>;
const getbible_chapter_nr = <?php echo $this->chapter->chapter; ?>;
const getbible_page_url = '<?php echo $this->url_base; ?>/';
const getbible_page_url = '<?php echo $this->getBaseUrl(); ?>/';
var triggerGetBibleReload = false;
</script>
<div class="uk-section-default uk-section">

View File

@ -25,16 +25,12 @@ defined('_JEXEC') or die('Restricted access');
</div>
<?php endif; ?>
<?php if ($this->params->get('activate_sharing') == 1 || $this->params->get('activate_search') == 1 || empty($this->item->daily)): ?>
<?php if (strtolower($this->translation->direction) === 'ltr'): ?>
<div class="uk-float-right">
<?php else: ?>
<div class="uk-float-left">
<?php endif; ?>
<div class="uk-float-right">
<?php if (empty($this->item->daily)): ?>
<a class="uk-icon-button" href="<?php echo $this->url_daily; ?>" uk-tooltip="<?php echo JText::_('COM_GETBIBLE_DAILY_VERSE'); ?>" uk-icon="icon: home"></a>
<a class="uk-icon-button" href="<?php echo $this->getDailyVerseUrl(); ?>" uk-tooltip="<?php echo JText::_('COM_GETBIBLE_DAILY_VERSE'); ?>" uk-icon="icon: home"></a>
<?php endif; ?>
<?php if ($this->params->get('activate_search') == 1): ?>
<a class="uk-icon-button" href="<?php echo $this->url_search; ?>" id="getbible-main-search-button" uk-tooltip="<?php echo JText::_('COM_GETBIBLE_SEARCH'); ?>" uk-icon="icon: search"></a>
<a class="uk-icon-button" href="<?php echo $this->getSearchUrl(); ?>" id="getbible-main-search-button" uk-tooltip="<?php echo JText::_('COM_GETBIBLE_SEARCH'); ?>" uk-icon="icon: search"></a>
<?php endif; ?>
<?php if ($this->params->get('activate_sharing') == 1): ?>
<a class="uk-icon-button" href="#" id="getbible-main-sharing-button" uk-toggle="target: #getbible-app-sharing" onclick="setSharedValues(<?php echo $this->verses->first; ?>, <?php echo $this->verses->last; ?>)" uk-tooltip="<?php echo JText::_('COM_GETBIBLE_SHARE'); ?>" uk-icon="icon: forward"></a>

View File

@ -53,50 +53,31 @@ class GetbibleViewApp extends HtmlView
$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);
$this->params->set('openai_token', null);
$this->params->set('gitea_token', null);
// get the input values
$this->input = $this->app->input;
// 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;
// set the linker
$this->linker = $this->getLinker();
$this->linker_new = $this->getNewLinker();
// merge the system and linker
$this->mergeNotes();
$this->mergeTags();
$this->mergeTaggedVerses();
// should we not have tags at this point we should not load the tag feature
if (empty($this->tags))
{
$this->params->set('activate_tags', null);
}
// build the tab menu
$this->setTabsMenu();
if ($this->params->get('activate_search') == 1)
{
// set the search URL
$this->setSearchUrl();
}
// 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;
@ -109,7 +90,6 @@ class GetbibleViewApp extends HtmlView
}
// set the last verse in the chapter
$this->last_verse = end($this->chapter->verses)->verse;
$this->active = new \stdClass();
$this->active->verse = false;
// check if we have activity active
@ -119,10 +99,8 @@ class GetbibleViewApp extends HtmlView
$this->active->target = ($this->params->get('activate_sharing') == 1) ? 'sharing' : (($this->params->get('activate_tags') == 1) ? 'tags' : 'notes');
$this->active->tooltip = JText::_('COM_GETBIBLE_OPEN');
}
// start the modal state
$this->modalState = new \stdClass();
// set metadata
$this->setMetaData();
}
@ -130,13 +108,11 @@ class GetbibleViewApp extends HtmlView
{
$this->tab_name_placeholders = null;
}
// we get the verse count if we are going to show the install button
if ($this->params->get('show_install_button') == 1)
{
$this->totalVerse = Factory::_('GetBible.Watcher')->totalVerses($this->translation->abbreviation ?? 'kjv');
}
// sort translations
$this->setTranslations();
@ -155,6 +131,81 @@ class GetbibleViewApp extends HtmlView
parent::display($tpl);
}
/**
* Get the base url
*
* @return string
* @since 2.0.1
*/
public function getBaseUrl(): string
{
if (empty($this->url_base))
{
$this->setBaseUrl();
}
return $this->url_base ?? '';
}
/**
* Set the daily verse url
*
* @return string
* @since 2.0.1
*/
public function getDailyVerseUrl(): string
{
if (empty($this->url_daily))
{
$this->setDailyVerseUrl();
}
return $this->url_daily ?? '';
}
/**
* Get the search url
*
* @return string
* @since 2.0.1
*/
public function getSearchUrl(): string
{
if (empty($this->url_search))
{
$this->setSearchUrl();
}
return $this->url_search ?? '';
}
/**
* Get the AJAX url
*
* @return string
* @since 2.0.1
*/
public function getAjaxUrl(): string
{
if (empty($this->url_ajax))
{
$this->setAjaxUrl();
}
return $this->url_ajax ?? '';
}
/**
* Get the return url
*
* @return string
* @since 2.0.1
*/
public function getReturnUrl(): string
{
if (empty($this->url_return))
{
$this->setReturnUrl();
}
return '&return=' . $this->url_return;
}
/**
* Set the page metadata
*
@ -194,7 +245,7 @@ class GetbibleViewApp extends HtmlView
$this->item->created_by = JText::_('COM_GETBIBLE_THE_WORD_OF_GOD');
// set canonical URL
$this->document->addHeadLink($this->url_base, 'canonical');
$this->document->addHeadLink($this->getBaseUrl(), 'canonical');
// OG:Title
$this->document->setMetadata('og:title', $title, 'property');
@ -206,7 +257,7 @@ class GetbibleViewApp extends HtmlView
// $this->document->setMetadata('og:image', 'YOUR_IMAGE_URL_HERE', 'property');
// OG:URL
$this->document->setMetadata('og:url', $this->url_base, 'property');
$this->document->setMetadata('og:url', $this->getBaseUrl(), 'property');
// OG:Type
$this->document->setMetadata('og:type', 'website', 'property');
@ -397,7 +448,7 @@ class GetbibleViewApp extends HtmlView
foreach ($this->tags as $tag)
{
// set the tag url
$tag->url = JRoute::_('index.php?option=com_getbible&view=tag&Itemid=' . $this->params->get('app_menu', 0) . '&guid=' . $tag->guid . '&t=' . $this->translation->abbreviation);
$tag->url = JRoute::_('index.php?option=com_getbible&view=tag&Itemid=' . $this->params->get('app_menu', 0) . $this->getReturnUrl() . '&guid=' . $tag->guid . '&t=' . $this->translation->abbreviation);
// Use the 'verse' attribute as the key
$mergeTags[$tag->id] = $tag;
}
@ -415,7 +466,7 @@ class GetbibleViewApp extends HtmlView
continue;
}
// set the tag url
$tag->url = JRoute::_('index.php?option=com_getbible&view=tag&Itemid=' . $this->params->get('app_menu', 0) . '&guid=' . $tag->guid . '&t=' . $this->translation->abbreviation);
$tag->url = JRoute::_('index.php?option=com_getbible&view=tag&Itemid=' . $this->params->get('app_menu', 0) . $this->getReturnUrl(). '&guid=' . $tag->guid . '&t=' . $this->translation->abbreviation);
// If the verse already exists in $mergeTags, this will replace it
// If it doesn't exist, this will add it
$mergeTags[$tag->id] = $tag;
@ -451,7 +502,7 @@ class GetbibleViewApp extends HtmlView
// we build the key
$key = $tag->tag . '-' . $tag->verse;
// set the tag url
$tag->url = JRoute::_('index.php?option=com_getbible&view=tag&Itemid=' . $this->params->get('app_menu', 0) . '&guid=' . $tag->tag . '&t=' . $this->translation->abbreviation);
$tag->url = JRoute::_('index.php?option=com_getbible&view=tag&Itemid=' . $this->params->get('app_menu', 0) . $this->getReturnUrl() . '&guid=' . $tag->tag . '&t=' . $this->translation->abbreviation);
// Use the 'verse' attribute as the key
$mergeTags[$key] = $tag;
}
@ -471,7 +522,7 @@ class GetbibleViewApp extends HtmlView
continue;
}
// set the tag url
$tag->url = JRoute::_('index.php?option=com_getbible&view=tag&Itemid=' . $this->params->get('app_menu', 0) . '&guid=' . $tag->tag . '&t=' . $this->translation->abbreviation);
$tag->url = JRoute::_('index.php?option=com_getbible&view=tag&Itemid=' . $this->params->get('app_menu', 0) . $this->getReturnUrl() . '&guid=' . $tag->tag . '&t=' . $this->translation->abbreviation);
// If the verse already exists in $mergeTags, this will replace it
// If it doesn't exist, this will add it
$mergeTags[$key] = $tag;
@ -570,6 +621,17 @@ class GetbibleViewApp extends HtmlView
$this->url_daily = JRoute::_('index.php?option=com_getbible&view=app&Itemid=' . $this->params->get('app_menu', 0) . '&t=' . $this->translation->abbreviation);
}
/**
* Set the AJAX url
*
* @return void
* @since 2.0.1
*/
protected function setAjaxUrl()
{
$this->url_ajax = JUri::base() . 'index.php?option=com_getbible&format=json&raw=true&' . JSession::getFormToken() . '=1&task=ajax.';
}
/**
* Set the search url
*
@ -578,12 +640,29 @@ class GetbibleViewApp extends HtmlView
*/
protected function setSearchUrl()
{
if ($this->params->get('activate_search') != 1)
{
return;
}
$words = $this->params->get('search_word', 1);
$match = $this->params->get('search_match', 1);
$case = $this->params->get('search_case', 1);
// set the current search URL
$this->url_search = JRoute::_('index.php?option=com_getbible&view=search&t=' . $this->translation->abbreviation . '&words=' . $words . '&match=' . $match . '&case=' . $case . '&target=1000');
$this->url_search = JRoute::_('index.php?option=com_getbible&view=search&t=' . $this->translation->abbreviation . $this->getReturnUrl() . '&words=' . $words . '&match=' . $match . '&case=' . $case . '&target=1000');
}
/**
* Set the return url
*
* @return void
* @since 2.0.1
*/
protected function setReturnUrl()
{
// set the current return URL
$this->url_return = urlencode(base64_encode($this->getBaseUrl()));
}
/**
@ -839,9 +918,12 @@ class GetbibleViewApp extends HtmlView
$search_words = $this->params->get('search_words', 1);
$search_match = $this->params->get('search_match', 1);
$search_case = $this->params->get('search_case', 1);
$translation = $this->translation->abbreviation;
$book_nr = $this->chapter->book_nr ?? 0;
$chapter_nr = $this->chapter->chapter ?? 0;
// set the ajax url
$url_ajax = JUri::base() . 'index.php?option=com_getbible&format=json&raw=true&' . JSession::getFormToken() . '=1&task=ajax.';
$url_ajax = $this->getAjaxUrl();
// set some lang
JText::script('COM_GETBIBLE_VIEW_ALL_VERSES_TAGGED');
@ -877,9 +959,10 @@ class GetbibleViewApp extends HtmlView
// build search url
return UrlAjax +
'getSearchUrl&translation=' + translation +
'&words=$search_words' + '&match=$search_match' +
'&case=$search_case' + '&target=1000' +
'&book=' + 0 + '&search=' + search;
'&book=$book_nr&chapter=$chapter_nr' +
'&words=$search_words&match=$search_match' +
'&case=$search_case&target=1000' +
'&target_book=0&search=' + search;
};
const getOpenaiURL = (guid, words, verse, chapter, book, translation) => {
// build open ai url

View File

@ -23,6 +23,7 @@ defined('_JEXEC') or die('Restricted access');
<div class="uk-container">
<div class="tm-grid-expand uk-child-width-1-1 uk-grid-margin uk-grid uk-grid-stack" uk-grid>
<div class="uk-first-column">
<h2 class="uk-heading-small uk-heading-line uk-text-center"><?php echo JText::_('COM_GETBIBLE_OPEN_AI_RESPONSE'); ?></h2>
<div class="uk-margin">
<?php if ($this->params->get('show_top_menu') == 1): ?>
<?php echo $this->loadTemplate('getbibleaitopmenu'); ?>

View File

@ -38,6 +38,9 @@ class GetbibleViewOpenai extends HtmlView
// Initialise variables.
$this->item = $this->get('Item');
$this->translation = $this->get('Translation');
// remove from page (in case debug mode is on)
$this->params->set('openai_token', null);
$this->params->set('gitea_token', null);
// Set the toolbar
$this->addToolBar();

View File

@ -25,7 +25,7 @@ defined('_JEXEC') or die('Restricted access');
<?php echo $this->loadTemplate('getbiblesearchtable'); ?>
<?php else: ?>
<div class="uk-alert-primary" uk-alert>
<?php if (strlen($this->search) > 0): ?>
<?php if (strlen($this->getSearch()) > 0): ?>
<p><?php echo JText::_("COM_GETBIBLE_YOUR_SEARCH_DIDNT_YIELD_ANY_RESULTS_PLEASE_TYPE_A_DIFFERENT_KEYWORD_OR_PHRASE_INTO_THE_SEARCH_BOX_AND_PRESS_ENTER_TO_TRY_AGAIN"); ?></p>
<?php else: ?>
<p><?php echo JText::_('COM_GETBIBLE_TYPE_YOUR_SEARCH_PHRASE_INTO_THE_SEARCH_BOX_AND_PRESS_ENTER_TO_SEARCH_THE_BSCRIPTURESB_DAILY'); ?></p>

View File

@ -22,16 +22,16 @@ defined('_JEXEC') or die('Restricted access');
<nav class="uk-navbar-container uk-margin direction-<?php echo strtolower($this->translation->direction); ?>" uk-navbar>
<div class="uk-navbar-left">
<ul class="uk-navbar-nav">
<li><a href="<?php echo $this->url_bible; ?>"><?php echo JText::_('COM_GETBIBLE_BIBLE'); ?></a></li>
<li><a href="<?php echo $this->getBibleUrl(); ?>"><?php echo JText::_('COM_GETBIBLE_BIBLE'); ?></a></li>
</ul>
<div class="uk-navbar-item">
<form class="uk-search uk-search-navbar">
<span uk-search-icon></span>
<input id="getbible-search-field" class="uk-search-input" type="search" placeholder="<?php echo JText::_('COM_GETBIBLE_SEARCH'); ?>" aria-label="<?php echo JText::_('COM_GETBIBLE_SEARCH'); ?>" value="<?php echo $this->search; ?>">
<input id="getbible-search-field" class="uk-search-input" type="search" placeholder="<?php echo JText::_('COM_GETBIBLE_SEARCH'); ?>" aria-label="<?php echo JText::_('COM_GETBIBLE_SEARCH'); ?>" value="<?php echo $this->getSearch(); ?>">
</form>
</div>
<ul class="uk-navbar-nav">
<li><a href="#" onclick="handleSearch();"><?php echo JText::_('COM_GETBIBLE_SEARCH'); ?></a></li>
<li><a href="#" onclick="event.preventDefault(); handleSearch();"><?php echo JText::_('COM_GETBIBLE_SEARCH'); ?></a></li>
</ul>
</div>
</nav>

View File

@ -24,8 +24,6 @@ defined('_JEXEC') or die('Restricted access');
<?php echo $this->loadTemplate('getbiblesearchoptions'); ?>
</div>
<script type="text/javascript">
const urlSearch = <?php echo json_encode($this->url_search); ?>;
const urlAjax = '<?php echo $this->url_base; ?>index.php?option=com_getbible&format=json&raw=true&<?php echo JSession::getFormToken(); ?>=1&task=ajax.';
const urlCurrent = window.location.href;
// set the options and form triggers
const searchField = document.getElementById('getbible-search-field');

View File

@ -19,7 +19,7 @@
defined('_JEXEC') or die('Restricted access');
?>
<button class="uk-button uk-width-1-1 uk-button-small" uk-toggle="target: #search-options" type="button"><?php echo JText::_('COM_GETBIBLE_SEARCH_OPTIONS'); ?> (<?php echo implode(', ', $this->options_text); ?>)</button>
<button class="uk-button uk-width-1-1 uk-button-small" uk-toggle="target: #search-options" type="button"><?php echo JText::_('COM_GETBIBLE_SEARCH_OPTIONS'); ?> (<?php echo implode(', ', $this->getOptionsText()); ?>)</button>
<div id="search-options" class="uk-grid-small uk-width-1-1 uk-margin-small uk-margin-remove-bottom uk-child-width-1-1@s uk-child-width-1-3@m uk-child-width-1-5@l uk-text-center" hidden uk-grid>
<div>
<div class="uk-card uk-card-default uk-card-body uk-padding-remove">

View File

@ -41,15 +41,21 @@ class GetbibleViewSearch extends HtmlView
$this->translations = $this->get('Translations');
$this->books = $this->get('Books');
$this->translation = $this->get('Translation');
// remove from page (in case debug mode is on)
$this->params->set('openai_token', null);
$this->params->set('gitea_token', null);
// set the input object
$this->input = $this->app->input;
if ($this->params->get('activate_search') == 1)
{
$this->input = $this->app->input;
// set the search Params
$this->setSearchParams();
// set the page direction globally
$this->document->setDirection($this->translation->direction);
// set the global language declaration
// $this->document->setLanguage($this->translation->joomla); (soon ;)
// set the enough verses witch
$this->enoughVerses = Factory::_('GetBible.Watcher')->enoughVerses($this->translation->abbreviation ?? 'kjv');
// set metadata
$this->setMetaData();
}
// Set the toolbar
@ -68,34 +74,409 @@ class GetbibleViewSearch extends HtmlView
}
/**
* Set the search params
* Set the page metadata
*
* @return void
* @since 2.0.1
*/
public function setSearchParams()
protected function setMetaData()
{
$this->words = $this->input->getInt('words', $this->params->get('search_word', 1));
$this->match = $this->input->getInt('match', $this->params->get('search_match', 1));
$this->case = $this->input->getInt('case', $this->params->get('search_case', 1));
$this->target = $this->input->getInt('target', 1000);
$this->target = ($this->target == 4000) ? $this->input->getInt('book') : $this->target;
$this->search = $this->input->getString('search') ?? $this->input->getString('s') ?? '';
// set the page title
$title = JText::sprintf('COM_GETBIBLE_SEARCHING_S_IN_S_S',
$this->getSearch(),
$this->translation->translation,
$this->params->get('page_title', '')
);
$this->document->setTitle($title);
$url = $this->getCanonicalUrl();
// set the Generator
$this->document->setGenerator('getBible! - Open Source Bible App.');
// set the metadata values
$description = JText::sprintf('COM_GETBIBLE_SEARCHING_S_IN_S_TARGETING_S_WITH_S_S_IN_S',
$this->getSearch(),
$this->translation->translation,
strtolower($this->getWordsText()),
strtolower($this->getMatchText()),
strtolower($this->getCaseText()),
$this->getTargetText()
);
$this->document->setDescription($description);
$this->document->setMetadata('keywords', JText::sprintf('COM_GETBIBLE_SEARCH_S_S_S_S_S_S_BIBLE_S_S_SCRIPTURE_SEARCH_GETBIBLE',
$this->getSearch(),
strtolower($this->getWordsText()),
strtolower($this->getMatchText()),
strtolower($this->getCaseText()),
$this->getTargetText(),
$this->translation->translation,
$this->translation->abbreviation,
$this->translation->language
));
$this->document->setMetaData('author', JText::_('COM_GETBIBLE_THE_WORD_OF_GOD'));
// set canonical URL
$this->document->addHeadLink($url, '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', $url, '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');
}
/**
* Get the canonical url
*
* @return string
* @since 2.0.1
*/
public function getCanonicalUrl(): string
{
if (empty($this->url_canonical))
{
$this->setCanonicalUrl();
}
return $this->url_canonical ?? $this->getBaseUrl();
}
/**
* Get the Bible url
*
* @return string
* @since 2.0.1
*/
public function getBibleUrl(): string
{
if (empty($this->url_bible))
{
$this->setBibleUrl();
}
return $this->url_bible;
}
/**
* Get the base url
*
* @return string
* @since 2.0.1
*/
public function getBaseUrl(): string
{
if (empty($this->url_base))
{
$this->setBaseUrl();
}
return $this->url_base ?? '';
}
/**
* Get the search url
*
* @return string
* @since 2.0.1
*/
public function getSearchUrl(): string
{
if (empty($this->url_search))
{
$this->setSearchUrl();
}
return $this->url_search ?? '';
}
/**
* Get the AJAX url
*
* @return string
* @since 2.0.1
*/
public function getAjaxUrl(): string
{
if (empty($this->url_ajax))
{
$this->setAjaxUrl();
}
return $this->url_ajax ?? '';
}
/**
* Get the return url value
*
* @return string|null
* @since 2.0.1
*/
public function getReturnUrl(): ?string
{
if (empty($this->url_return))
{
$this->setReturnUrl();
}
return $this->url_return ?? null;
}
/**
* Get the return url value
*
* @return string
* @since 2.0.1
*/
public function getReturnUrlValue(): string
{
if (empty($this->url_return_value))
{
$this->setReturnUrl();
}
if (!empty($this->url_return_value))
{
return '&return=' . $this->url_return_value;
}
return '';
}
/**
* Get the return url book value
*
* @return int
* @since 2.0.1
*/
public function getReturnUrlBook(): int
{
if (empty($this->url_return_query))
{
$this->setReturnUrl();
}
return (int) $this->url_return_query['book'] ?? 0;
}
/**
* Get the return url chapter value
*
* @return int
* @since 2.0.1
*/
public function getReturnUrlChapter(): int
{
if (empty($this->url_return_query))
{
$this->setReturnUrl();
}
return (int) $this->url_return_query['chapter'] ?? 0;
}
/**
* Get the Options Search Behaviour (text)
*
* @return array
* @since 2.0.1
*/
public function getOptionsText(): array
{
if (empty($this->options_text))
{
$this->setOptionsText();
}
return $this->options_text;
}
/**
* Get the Words Search Behaviour
*
* @return int
* @since 2.0.1
*/
public function getWords(): int
{
if (empty($this->words))
{
$this->setWords();
}
return $this->words ?? 1;
}
/**
* Get the Words Search Behaviour
*
* @return string
* @since 2.0.1
*/
public function getWordsText(): string
{
if (empty($this->words_text))
{
$this->setWordsText();
}
return $this->words_text;
}
/**
* Get the Match Search Behaviour
*
* @return int
* @since 2.0.1
*/
public function getMatch(): int
{
if (empty($this->match))
{
$this->setMatch();
}
return $this->match ?? 1;
}
/**
* Get the Match Search Behaviour (text)
*
* @return string
* @since 2.0.1
*/
public function getMatchText(): string
{
if (empty($this->match_text))
{
$this->setMatchText();
}
return $this->match_text;
}
/**
* Get the Case Search Behaviour
*
* @return int
* @since 2.0.1
*/
public function getCase(): int
{
if (empty($this->case))
{
$this->setCase();
}
return $this->case ?? 1;
}
/**
* Get the Case Search Behaviour (text)
*
* @return string
* @since 2.0.1
*/
public function getCaseText(): string
{
if (empty($this->case_text))
{
$this->setCaseText();
}
return $this->case_text;
}
/**
* Get the Target Search Behaviour
*
* @return int
* @since 2.0.1
*/
public function getTarget(): int
{
if (empty($this->target))
{
$this->setTarget();
}
return $this->target ?? 1000;
}
/**
* Get the Target Search Behaviour (text)
*
* @return string
* @since 2.0.1
*/
public function getTargetText(): string
{
if (empty($this->target_text))
{
$this->setTargetText();
}
return $this->target_text;
}
/**
* Get the Search String
*
* @return string
* @since 2.0.1
*/
public function getSearch(): string
{
if (empty($this->search))
{
$this->setSearch();
}
return $this->search;
}
/**
* Set the Search String
*
* @return void
* @since 2.0.1
*/
protected function setSearch()
{
$this->search = $this->input->getString('search') ?? $this->input->getString('s') ?? '';
}
/**
* Set the Case Search Behaviour
*
* @return void
* @since 2.0.1
*/
protected function setTarget()
{
$target = $this->input->getInt('target', 1000);
$this->target = ($target == 4000) ? $this->input->getInt('target_book', $target) : $target;
}
/**
* Set the Target Search Behaviour (text)
*
* @return void
* @since 2.0.1
*/
public function setTargetText()
{
// set the value names
$words = [
1 => JText::_('COM_GETBIBLE_ALL_WORDS'),
2 => JText::_('COM_GETBIBLE_ANY_WORDS'),
3 => JText::_('COM_GETBIBLE_EXACT_WORDS')
];
$match = [
1 => JText::_('COM_GETBIBLE_EXACT_MATCH'),
2 => JText::_('COM_GETBIBLE_PARTIAL_MATCH')
];
$case = [
1 => JText::_('COM_GETBIBLE_CASE_INSENSITIVE'),
2 => JText::_('COM_GETBIBLE_CASE_SENSITIVE')
];
$target = [
1000 => JText::_('COM_GETBIBLE_ALL_BOOKS'),
2000 => JText::_('COM_GETBIBLE_OLD_TESTAMENT'),
@ -103,23 +484,194 @@ class GetbibleViewSearch extends HtmlView
4000 => JText::_('COM_GETBIBLE_A_BOOK')
];
$this->target_text = $target[$this->getTarget()] ?? JText::_('COM_GETBIBLE_A_BOOK');
}
/**
* Set the Case Search Behaviour
*
* @return void
* @since 2.0.1
*/
protected function setCase()
{
$this->case = $this->input->getInt('case', $this->params->get('search_case', 1));
}
/**
* Set the Case Search Behaviour (text)
*
* @return void
* @since 2.0.1
*/
protected function setCaseText()
{
// set the value names
$case = [
1 => JText::_('COM_GETBIBLE_CASE_INSENSITIVE'),
2 => JText::_('COM_GETBIBLE_CASE_SENSITIVE')
];
$this->case_text = $case[$this->getCase()] ?? JText::_('COM_GETBIBLE_CASE_INSENSITIVE');
}
/**
* Set the Match Search Behaviour
*
* @return void
* @since 2.0.1
*/
protected function setMatch()
{
$this->match = $this->input->getInt('match', $this->params->get('search_match', 1));
}
/**
* Set the Match Search Behaviour (text)
*
* @return void
* @since 2.0.1
*/
protected function setMatchText()
{
// set the value names
$match = [
1 => JText::_('COM_GETBIBLE_EXACT_MATCH'),
2 => JText::_('COM_GETBIBLE_PARTIAL_MATCH')
];
$this->match_text = $match[$this->getMatch()] ?? JText::_('COM_GETBIBLE_EXACT_MATCH');
}
/**
* Set the Words Search Behaviour
*
* @return void
* @since 2.0.1
*/
protected function setWords()
{
$this->words = $this->input->getInt('words', $this->params->get('search_word', 1));
}
/**
* Set the Words Search Behaviour (text)
*
* @return void
* @since 2.0.1
*/
protected function setWordsText()
{
// set the value names
$words = [
1 => JText::_('COM_GETBIBLE_ALL_WORDS'),
2 => JText::_('COM_GETBIBLE_ANY_WORDS'),
3 => JText::_('COM_GETBIBLE_EXACT_WORDS')
];
$this->words_text = $words[$this->getWords()] ?? JText::_('COM_GETBIBLE_ALL_WORDS');
}
/**
* Set the Options Search Behaviour (text)
*
* @return void
* @since 2.0.1
*/
protected function setOptionsText()
{
$this->options_text = [];
$this->options_text[] = $words[$this->words] ?? JText::_('COM_GETBIBLE_ALL_WORDS');
$this->options_text[] = $match[$this->match] ?? JText::_('COM_GETBIBLE_EXACT_MATCH');
$this->options_text[] = $case[$this->case] ?? JText::_('COM_GETBIBLE_CASE_INSENSITIVE');
$this->options_text[] = $target[$this->target] ?? JText::_('COM_GETBIBLE_A_BOOK');
$this->options_text[] = $this->getWordsText();
$this->options_text[] = $this->getMatchText();
$this->options_text[] = $this->getCaseText();
$this->options_text[] = $this->getTargetText();
}
// set the current search URL
$this->url_search = JRoute::_('index.php?option=com_getbible&view=search&t=' . $this->translation->abbreviation . '&words=' . $this->words . '&match=' . $this->match . '&case=' . $this->case . '&target=' . $this->target . '&search=' . $this->search);
/**
* Set the return URL if it's provided and internal.
*
* @return void
* @since 2.0.1
*/
protected function setReturnUrl(): void
{
$encodedUrl = $this->input->get('return', null, 'base64');
if ($encodedUrl === null)
{
return;
}
$decodedUrl = base64_decode($encodedUrl);
$uri = JUri::getInstance($decodedUrl);
$router = JRouter::getInstance('site');
$this->url_return_value = $encodedUrl;
$this->url_return = $decodedUrl;
$this->url_return_query = $router->parse($uri);
}
/**
* Set the base url
*
* @return void
* @since 2.0.1
*/
protected function setBaseUrl()
{
$this->url_base = JUri::base();
$this->url_bible = JRoute::_('index.php?option=com_getbible&view=app&Itemid=' . $this->params->get('app_menu', 0) . '&t=' . $this->translation->abbreviation);
}
// referer the referer page
//$referer = $this->input->server->get('HTTP_REFERER', null, 'STRING');
//if (strpos($referer, $this->url_bible) !== null && strpos($referer, $this->url_base) !== null)
//{
// $this->url_bible = $referer; // needs more work!
//}
/**
* Set the AJAX url
*
* @return void
* @since 2.0.1
*/
protected function setAjaxUrl()
{
$this->url_ajax = $this->getBaseUrl() . 'index.php?option=com_getbible&format=json&raw=true&' . JSession::getFormToken() . '=1&task=ajax.';
}
/**
* Set the search url
*
* @return void
* @since 2.0.1
*/
protected function setSearchUrl()
{
// set the current search URL
$this->url_search = JRoute::_('index.php?option=com_getbible&view=search&t=' .
$this->translation->abbreviation . $this->getReturnUrlValue() .
'&words=' . $this->getWords() . '&match=' . $this->getMatch() .
'&case=' . $this->getCase() . '&target=' . $this->getTarget() . '&search=' . $this->getSearch());
}
/**
* Set the canonical url
*
* @return void
* @since 2.0.1
*/
protected function setCanonicalUrl()
{
// set the current search URL
$this->url_canonical = trim($this->getBaseUrl(), '/') . JRoute::_('index.php?option=com_getbible&view=search&t=' .
$this->translation->abbreviation . '&words=' . $this->getWords() .
'&match=' . $this->getMatch() . '&case=' . $this->getCase() .
'&target=' . $this->getTarget() . '&search=' . $this->getSearch());
}
/**
* Set the Bible url
*
* @return void
* @since 2.0.1
*/
protected function setBibleUrl()
{
$this->url_bible = $this->getReturnUrl() ?? JRoute::_('index.php?option=com_getbible&view=app&Itemid=' . $this->params->get('app_menu', 0) . '&t=' . $this->translation->abbreviation);
}
/**
@ -164,6 +716,11 @@ class GetbibleViewSearch extends HtmlView
}
$search_found_color = $this->params->get('search_found_color', '#4747ff');
$table_selection_color = $this->params->get('table_selection_color', '#dfdfdf');
$url_search = $this->getSearchUrl();
$url_ajax = $this->getAjaxUrl();
$book = $this->getReturnUrlBook();
$chapter = $this->getReturnUrlChapter();
// add the document default css file
JHtml::_('stylesheet', 'components/com_getbible/assets/css/search.css', ['version' => 'auto']);
// Set the Custom CSS script to view
@ -192,6 +749,31 @@ class GetbibleViewSearch extends HtmlView
unicode-bidi: bidi-override;
}
");
// Set the Custom JS script to view
$this->document->addScriptDeclaration("
const urlSearch = '$url_search';
const urlAjax = '$url_ajax';
const getAppURL = (book, chapter, verse, translation = 'kjv') => {
// build search url
return urlAjax +
'getAppUrl&translation=' + urlencode(translation) +
'&book=' + book +
'&chapter=' + chapter +
'&verse=' + verse;
};
const getSearchURL = (search, words = 1, match = 1, type_case = 1, target = 1000, translation = 'kjv') => {
// build search url
return urlAjax +
'getSearchUrl&translation=' + urlencode(translation) +
'&words=' + words +
'&match=' + match +
'&case=' + type_case +
'&target=' + target +
'&search=' + urlencode(search) +
'&target_book=0' +
'&book=$book&chapter=$chapter';
};
");
}
/**

View File

@ -29,7 +29,7 @@ defined('_JEXEC') or die('Restricted access');
<div uk-alert>
<h3><?php echo JText::_('COM_GETBIBLE_NO_TAGGED_VERSES_FOUND'); ?>!</h3>
<p><?php echo JText::_("COM_GETBIBLE_THIS_TAG_CURRENTLY_DOESNT_HAVE_ANY_VERSES_LINKED_TO_IT_PLEASE_SELECT_ANOTHER_TAG_OR_ATTACH_SOME_VERSES_TO_THIS_ONE"); ?></p>
<a href="<?php echo $this->url_bible; ?>" class="uk-button uk-button-default uk-width-1-1 uk-margin-small-bottom"><?php echo JText::_('COM_GETBIBLE_BACK_TO_BIBLE'); ?></a>
<a href="<?php echo $this->getBibleUrl(); ?>" class="uk-button uk-button-default uk-width-1-1 uk-margin-small-bottom"><?php echo JText::_('COM_GETBIBLE_BACK_TO_BIBLE'); ?></a>
</div>
<?php echo $this->loadTemplate('getbibleselecttags'); ?>
</div>

View File

@ -35,8 +35,16 @@ $tags_card = ($this->params->get('show_tags_card') == 1) ? 'uk-card uk-card-' .
<ul id="get-bible-tag-body" class="uk-switcher" style="touch-action: pan-y pinch-zoom;" data-uk-observe>
<li class="el-item uk-margin-remove-first-child">
<div class="<?php echo $tagged_card; ?> direction-<?php echo strtolower($this->translation->direction); ?>" dir="<?php echo $this->translation->direction; ?>">
<h1><?php echo $this->tag->name; ?></h1>
<p class="uk-text-meta"><?php echo $this->tag->description; ?></p>
<div class="uk-margin">
<div class="uk-float-right">
<a class="uk-icon-button" href="<?php echo $this->getBibleUrl(); ?>" uk-tooltip="<?php echo JText::_('COM_GETBIBLE_BACK_TO_BIBLE'); ?>" uk-icon="icon: home"></a>
<?php if ($this->params->get('activate_sharing') == 1): ?>
<a class="uk-icon-button" href="#" id="getbible-tag-sharing-button" uk-toggle="target: #getbible-tag-sharing" uk-tooltip="<?php echo JText::_('COM_GETBIBLE_SHARE_TAG'); ?>" uk-icon="icon: forward"></a>
<?php endif; ?>
</div>
<div><span class="uk-text-large"><?php echo $this->tag->name; ?></span></div>
<div><span class="uk-text-meta"><?php echo $this->tag->description; ?></span></div>
</div>
<?php echo $this->loadTemplate('getbibletagparagraphssorter'); ?>
<?php echo $this->loadTemplate('getbibletagparagraphs'); ?>
</div>
@ -50,6 +58,9 @@ $tags_card = ($this->params->get('show_tags_card') == 1) ? 'uk-card uk-card-' .
<?php echo $this->loadTemplate('getbibletagcustomtabs'); ?>
<?php endif; ?>
</ul>
<?php if ($this->params->get('activate_sharing') == 1): ?>
<?php echo $this->loadTemplate('getbibletagshare'); ?>
<?php endif; ?>
<?php
$this->getBibleModules = [
'position' => 'bottom_tag_position',

View File

@ -28,6 +28,30 @@ defined('_JEXEC') or die('Restricted access');
<div class="uk-accordion-content">
<pre>
<?php var_dump($this->items); ?>
</pre>
</div>
</li>
<li>
<a class="uk-accordion-title" href="#"><?php echo JText::_('COM_GETBIBLE_PARAMS'); ?></a>
<div class="uk-accordion-content">
<pre>
<?php var_dump($this->params); ?>
</pre>
</div>
</li>
<li>
<a class="uk-accordion-title" href="#"><?php echo JText::_('COM_GETBIBLE_TAG'); ?></a>
<div class="uk-accordion-content">
<pre>
<?php var_dump($this->tag); ?>
</pre>
</div>
</li>
<li>
<a class="uk-accordion-title" href="#"><?php echo JText::_('COM_GETBIBLE_TRANSLATION'); ?></a>
<div class="uk-accordion-content">
<pre>
<?php var_dump($this->translation); ?>
</pre>
</div>
</li>

View File

@ -0,0 +1,75 @@
<?php
/*----------------------------------------------------------------------------------| io.vdm.dev |----/
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@package getBible.net
@created 3rd December, 2015
@author Llewellyn van der Merwe <https://getbible.net>
@git Get Bible <https://git.vdm.dev/getBible>
@github Get Bible <https://github.com/getBible>
@support Get Bible <https://git.vdm.dev/getBible/support>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
/------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
?>
<div id="getbible-tag-sharing" class="uk-modal-container" uk-modal>
<div class="uk-modal-dialog uk-modal-body">
<button class="uk-modal-close-default" type="button" uk-close></button>
<div class="uk-margin uk-margin-remove-top">
<h3 class="uk-modal-title uk-margin-remove"><?php echo $this->tag->name; ?> <span uk-icon="icon: forward; ratio: 1.5"></span></h3>
<span class="uk-text-small uk-text-muted uk-margin-remove"><?php echo JText::_('COM_GETBIBLE_SHARING_THE_WORD_OF_GOD_WITH_THE_WORLD'); ?></span>
</div>
<div>
<div id="getbible-link-share-url" class="uk-box-shadow-small uk-padding uk-margin uk-text-small uk-text-nowrap"><?php echo $this->getCanonicalUrl(); ?></div>
<button id="copy-share-getbible-link" class="uk-button uk-width-1-1 uk-button-default"><?php echo JText::_('COM_GETBIBLE_COPY'); ?></button>
</div>
</div>
</div>
</div>
<script type="text/javascript">
document.getElementById('copy-share-getbible-link').onclick = function() {
var textToCopy = document.getElementById('getbible-link-share-url').textContent;
try {
navigator.clipboard.writeText(textToCopy).then(function() {
// close the modal
UIkit.modal('#getbible-tag-sharing').hide();
// Show message
UIkit.notification({
message: '<?php echo JText::_('COM_GETBIBLE_THE_LINK_WAS_COPIED_TO_YOUR_CLIPBOARD'); ?>',
status: 'success',
timeout: 5000
});
}, function(err) {
console.error('Could not copy text: ', err);
});
} catch (err) {
// Fallback for browsers that do not support clipboard API
const textarea = document.createElement("textarea");
textarea.textContent = textToCopy;
document.body.appendChild(textarea);
textarea.select();
try {
document.execCommand("copy");
// close the modal
UIkit.modal('#getbible-tag-sharing').hide();
// Show message
UIkit.notification({
message: '<?php echo JText::_('COM_GETBIBLE_THE_LINK_WAS_COPIED_TO_YOUR_CLIPBOARD'); ?>',
status: 'success',
timeout: 5000
});
} catch (err) {
console.error('Failed to copy: ', err);
} finally {
document.body.removeChild(textarea);
}
}
}
</script>

View File

@ -43,6 +43,11 @@ class GetbibleViewTag extends HtmlView
$this->linkertags = $this->get('LinkerTags');
$this->tag = $this->get('Tag');
$this->linkertagged = $this->get('LinkerTagged');
// remove from page (in case debug mode is on)
$this->params->set('openai_token', null);
$this->params->set('gitea_token', null);
// set the input object
$this->input = $this->app->input;
// should we not have tags at this point we should not load the tag feature
if (empty($this->tags))
{
@ -52,30 +57,29 @@ class GetbibleViewTag extends HtmlView
{
$this->mergeTags();
}
// check if we have some tagged verses
if (!empty($this->items) || !empty($this->linkertagged))
{
// set the page direction globally
$this->document->setDirection($this->translation->direction);
// set the global language declaration
// $this->document->setLanguage($this->translation->joomla); (soon ;)
// set the linker
$this->linker = $this->getLinker();
// merge the system and linker
$this->mergeTaggedVerses();
// see if we have any tagged verses left
if (!empty($this->items))
{
// sort the tagged verses in to paragraphs
$this->items = Factory::_('GetBible.Tagged.Paragraphs')->get($this->items, $this->translation->abbreviation ?? 'kjv');
// set sorting books option
$this->setBooks();
}
// set metadata
$this->setMetaData();
}
// set the Bible url
$this->setBaseUrl();
// Set the toolbar
$this->addToolBar();
@ -91,6 +95,307 @@ class GetbibleViewTag 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_TAG_S_IN_S_S',
$this->tag->name,
$this->translation->translation,
$this->params->get('page_title', '')
);
$this->document->setTitle($title);
$url = $this->getCanonicalUrl();
// set the Generator
$this->document->setGenerator('getBible! - Open Source Bible App.');
// set the metadata values
$description = JText::sprintf('COM_GETBIBLE_TAG_S_S',
$this->tag->name,
$this->tag->description,
);
$this->document->setDescription($description);
$this->document->setMetadata('keywords', JText::sprintf('COM_GETBIBLE_TAG_S_S_BIBLE_S_S_SCRIPTURE_TAG_GETBIBLE',
$this->tag->name,
$this->translation->translation,
$this->translation->abbreviation,
$this->translation->language
));
$this->document->setMetaData('author', JText::_('COM_GETBIBLE_THE_WORD_OF_GOD'));
// set canonical URL
$this->document->addHeadLink($url, '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', $url, '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');
}
/**
* Get the canonical url
*
* @return string
* @since 2.0.1
*/
public function getCanonicalUrl(): string
{
if (empty($this->url_canonical))
{
$this->setCanonicalUrl();
}
return $this->url_canonical ?? $this->getTagUrl();
}
/**
* Get the Bible url
*
* @return string
* @since 2.0.1
*/
public function getBibleUrl(): string
{
if (empty($this->url_bible))
{
$this->setBibleUrl();
}
return $this->url_bible;
}
/**
* Get the base url
*
* @return string
* @since 2.0.1
*/
public function getBaseUrl(): string
{
if (empty($this->url_base))
{
$this->setBaseUrl();
}
return $this->url_base ?? '';
}
/**
* Get the tag url
*
* @return string
* @since 2.0.1
*/
public function getTagUrl(): string
{
if (empty($this->url_tag))
{
$this->setTagUrl();
}
return $this->url_tag ?? $this->getBaseUrl();
}
/**
* Get the AJAX url
*
* @return string
* @since 2.0.1
*/
public function getAjaxUrl(): string
{
if (empty($this->url_ajax))
{
$this->setAjaxUrl();
}
return $this->url_ajax ?? '';
}
/**
* Get the return url value
*
* @return string|null
* @since 2.0.1
*/
public function getReturnUrl(): ?string
{
if (empty($this->url_return))
{
$this->setReturnUrl();
}
return $this->url_return ?? null;
}
/**
* Get the return url value
*
* @return string
* @since 2.0.1
*/
public function getReturnUrlValue(): string
{
if (empty($this->url_return_value))
{
$this->setReturnUrl();
}
if (!empty($this->url_return_value))
{
return '&return=' . $this->url_return_value;
}
return '';
}
/**
* Get the return url book value
*
* @return int
* @since 2.0.1
*/
public function getReturnUrlBook(): int
{
if (empty($this->url_return_query))
{
$this->setReturnUrl();
}
return (int) $this->url_return_query['book'] ?? 0;
}
/**
* Get the return url chapter value
*
* @return int
* @since 2.0.1
*/
public function getReturnUrlChapter(): int
{
if (empty($this->url_return_query))
{
$this->setReturnUrl();
}
return (int) $this->url_return_query['chapter'] ?? 0;
}
/**
* Set the return URL if it's provided and internal.
*
* @return void
* @since 2.0.1
*/
protected function setReturnUrl(): void
{
$encodedUrl = $this->input->get('return', null, 'base64');
if ($encodedUrl === null)
{
return;
}
$decodedUrl = base64_decode($encodedUrl);
$uri = JUri::getInstance($decodedUrl);
$router = JRouter::getInstance('site');
$this->url_return_value = $encodedUrl;
$this->url_return = $decodedUrl;
$this->url_return_query = $router->parse($uri);
}
/**
* Set the base url
*
* @return void
* @since 2.0.1
*/
protected function setBaseUrl()
{
$this->url_base = JUri::base();
}
/**
* Set the AJAX url
*
* @return void
* @since 2.0.1
*/
protected function setAjaxUrl()
{
$this->url_ajax = $this->getBaseUrl() . 'index.php?option=com_getbible&format=json&raw=true&' . JSession::getFormToken() . '=1&task=ajax.';
}
/**
* Set the tag url
*
* @return void
* @since 2.0.1
*/
protected function setTagUrl()
{
// set the current tag URL
$this->url_tag = JRoute::_('index.php?option=com_getbible&view=tag&Itemid=' .
$this->params->get('app_menu', 0) . $this->getReturnUrlValue() .
'&guid=' . $this->tag->guid . '&t=' . $this->translation->abbreviation);
}
/**
* Set the canonical url
*
* @return void
* @since 2.0.1
*/
protected function setCanonicalUrl()
{
// set the current tag URL
$this->url_canonical = trim($this->getBaseUrl(), '/') .
JRoute::_('index.php?option=com_getbible&view=tag&Itemid=' .
$this->params->get('app_menu', 0) .
'&guid=' . $this->tag->guid .
'&t=' . $this->translation->abbreviation);
}
/**
* Set the Bible url
*
* @return void
* @since 2.0.1
*/
protected function setBibleUrl()
{
$this->url_bible = $this->getReturnUrl() ?? JRoute::_('index.php?option=com_getbible&view=app&Itemid=' . $this->params->get('app_menu', 0) . '&t=' . $this->translation->abbreviation);
}
/**
* Merge system and linker tags
*
@ -107,7 +412,7 @@ class GetbibleViewTag extends HtmlView
foreach ($this->tags as $tag)
{
// set the tag url
$tag->url = JRoute::_('index.php?option=com_getbible&view=tag&Itemid=' . $this->params->get('app_menu', 0) . '&guid=' . $tag->guid . '&t=' . $this->translation->abbreviation);
$tag->url = JRoute::_('index.php?option=com_getbible&view=tag&Itemid=' . $this->params->get('app_menu', 0) . $this->getReturnUrlValue() . '&guid=' . $tag->guid . '&t=' . $this->translation->abbreviation);
// Use the 'verse' attribute as the key
$mergeTags[$tag->id] = $tag;
}
@ -125,7 +430,7 @@ class GetbibleViewTag extends HtmlView
continue;
}
// set the tag url
$tag->url = JRoute::_('index.php?option=com_getbible&view=tag&Itemid=' . $this->params->get('app_menu', 0) . '&guid=' . $tag->guid . '&t=' . $this->translation->abbreviation);
$tag->url = JRoute::_('index.php?option=com_getbible&view=tag&Itemid=' . $this->params->get('app_menu', 0) . $this->getReturnUrlValue() . '&guid=' . $tag->guid . '&t=' . $this->translation->abbreviation);
// If the verse already exists in $mergeTags, this will replace it
// If it doesn't exist, this will add it
$mergeTags[$tag->id] = $tag;
@ -207,17 +512,6 @@ 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
*
@ -245,6 +539,10 @@ class GetbibleViewTag extends HtmlView
// Initialize the header checker.
$HeaderCheck = new getbibleHeaderCheck;
// always load these files.
JHtml::_('stylesheet', "media/com_getbible/nouislider/css/nouislider.min.css", ['version' => 'auto']);
JHtml::_('script', "media/com_getbible/nouislider/js/nouislider.min.js", ['version' => 'auto']);
// Load uikit options.
$uikit = $this->params->get('uikit_load');
// Set script size.

View File

@ -341,4 +341,22 @@
<maintainerurl>https://getbible.net</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
<update>
<name>Get Bible</name>
<description>The Bible for Joomla</description>
<element>pkg_getbible</element>
<type>package</type>
<client>site</client>
<version>2.0.21</version>
<infourl title="Get Bible!">https://getbible.net</infourl>
<downloads>
<downloadurl type="full" format="zip">https://git.vdm.dev/api/v1/repos/getBible/joomla-pkg/archive/v2.0.21.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Llewellyn van der Merwe</maintainer>
<maintainerurl>https://getbible.net</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
</updates>