Stable release of v3.0.3

Removed the not_required field from the sermon model. #36.
This commit is contained in:
Robot 2024-02-11 19:24:51 +02:00
parent 3bca4fe609
commit 304c0cd388
Signed by untrusted user: Robot
GPG Key ID: 14DECD44E7E1BB95
20 changed files with 150 additions and 85 deletions

View File

@ -1,3 +1,7 @@
# v3.0.3
- Removed the not_required field from the sermon model. #36
# v3.0.2 # v3.0.2
- Add the HTML class to the site default layout. - Add the HTML class to the site default layout.

View File

@ -24,7 +24,7 @@ The best way to see all your options is to install this component on you Joomla
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
+ *Name*: [Sermon Distributor](https://www.vdm.io/) + *Name*: [Sermon Distributor](https://www.vdm.io/)
+ *First Build*: 22nd October, 2015 + *First Build*: 22nd October, 2015
+ *Last Build*: 10th February, 2024 + *Last Build*: 11th February, 2024
+ *Version*: 3.0.x + *Version*: 3.0.x
+ *Copyright*: Copyright (C) 2015. All Rights Reserved + *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
@ -37,8 +37,8 @@ due to [Automated Component Builder](https://www.joomlacomponentbuilder.com))
> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**, > (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.) > never making one mistake or taking any coffee break.)
+ *Line count*: **86974** + *Line count*: **87039**
+ *File count*: **594** + *File count*: **595**
+ *Folder count*: **113** + *Folder count*: **113**
**160 Hours** or **20 Eight Hour Days** (the actual time the author spent) **160 Hours** or **20 Eight Hour Days** (the actual time the author spent)

View File

@ -24,7 +24,7 @@ The best way to see all your options is to install this component on you Joomla
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
+ *Name*: [Sermon Distributor](https://www.vdm.io/) + *Name*: [Sermon Distributor](https://www.vdm.io/)
+ *First Build*: 22nd October, 2015 + *First Build*: 22nd October, 2015
+ *Last Build*: 10th February, 2024 + *Last Build*: 11th February, 2024
+ *Version*: 3.0.x + *Version*: 3.0.x
+ *Copyright*: Copyright (C) 2015. All Rights Reserved + *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
@ -37,8 +37,8 @@ due to [Automated Component Builder](https://www.joomlacomponentbuilder.com))
> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**, > (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.) > never making one mistake or taking any coffee break.)
+ *Line count*: **86974** + *Line count*: **87039**
+ *File count*: **594** + *File count*: **595**
+ *Folder count*: **113** + *Folder count*: **113**
**160 Hours** or **20 Eight Hour Days** (the actual time the author spent) **160 Hours** or **20 Eight Hour Days** (the actual time the author spent)

View File

@ -0,0 +1 @@

View File

@ -1847,7 +1847,7 @@ class Com_SermondistributorInstallerScript
echo '<div style="background-color: #fff;" class="alert alert-info"><a target="_blank" href="https://www.vdm.io/" title="Sermon Distributor"> echo '<div style="background-color: #fff;" class="alert alert-info"><a target="_blank" href="https://www.vdm.io/" title="Sermon Distributor">
<img src="components/com_sermondistributor/assets/images/vdm-component.jpg"/> <img src="components/com_sermondistributor/assets/images/vdm-component.jpg"/>
</a> </a>
<h3>Upgrade to Version 3.0.2 Was Successful! Let us know if anything is not working as expected.</h3></div>'; <h3>Upgrade to Version 3.0.3 Was Successful! Let us know if anything is not working as expected.</h3></div>';
// Set db if not set already. // Set db if not set already.
if (!isset($db)) if (!isset($db))

View File

@ -1,15 +1,15 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="3.10" method="upgrade"> <extension type="component" version="3.10" method="upgrade">
<name>COM_SERMONDISTRIBUTOR</name> <name>COM_SERMONDISTRIBUTOR</name>
<creationDate>10th February, 2024</creationDate> <creationDate>11th February, 2024</creationDate>
<author>Llewellyn van der Merwe</author> <author>Llewellyn van der Merwe</author>
<authorEmail>joomla@vdm.io</authorEmail> <authorEmail>joomla@vdm.io</authorEmail>
<authorUrl>https://www.vdm.io/</authorUrl> <authorUrl>https://www.vdm.io/</authorUrl>
<copyright>Copyright (C) 2015. All Rights Reserved</copyright> <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> <license>GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html</license>
<version>3.0.2</version> <version>3.0.3</version>
<description><![CDATA[ <description><![CDATA[
<h1>Sermon Distributor (v.3.0.2)</h1> <h1>Sermon Distributor (v.3.0.3)</h1>
<div style="clear: both;"></div> <div style="clear: both;"></div>
<p>Distributor is a highly advanced sermon distributor that runs on the [Joomla 3.x](http://www.joomla.org) framework. You can link a shared folder from Dropbox to the component and use Dropbox as your file host, not to mention the advanced auto builder that gives you the ability to simply load sermons to your website by only adding them to Dropbox.</p> <p>Distributor is a highly advanced sermon distributor that runs on the [Joomla 3.x](http://www.joomla.org) framework. You can link a shared folder from Dropbox to the component and use Dropbox as your file host, not to mention the advanced auto builder that gives you the ability to simply load sermons to your website by only adding them to Dropbox.</p>
<p>Created by <a href="https://www.vdm.io/" target="_blank">Llewellyn van der Merwe</a><br /><small>Development started 22nd October, 2015</small></p> <p>Created by <a href="https://www.vdm.io/" target="_blank">Llewellyn van der Merwe</a><br /><small>Development started 22nd October, 2015</small></p>

View File

@ -139,4 +139,22 @@
<maintainerurl>https://www.vdm.io/</maintainerurl> <maintainerurl>https://www.vdm.io/</maintainerurl>
<targetplatform name="joomla" version="3.*"/> <targetplatform name="joomla" version="3.*"/>
</update> </update>
<update>
<name>Sermon Distributor</name>
<description>A sermon distributor that links to Dropbox.</description>
<element>pkg_sermondistributor</element>
<type>package</type>
<client>site</client>
<version>3.0.3</version>
<infourl title="Sermon Distributor!">https://www.vdm.io/</infourl>
<downloads>
<downloadurl type="full" format="zip">https://git.vdm.dev/api/v1/repos/christian/pkg-sermondistributor/archive/v3.0.3.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Llewellyn van der Merwe</maintainer>
<maintainerurl>https://www.vdm.io/</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
</updates> </updates>

View File

@ -171,7 +171,7 @@ class SermondistributorModelAjax extends ListModel
// make sure the lock is removed // make sure the lock is removed
unset($sermon->lock); unset($sermon->lock);
// convert the placeholders to json object // convert the placeholders to json object
$registry = new JRegistry; $registry = new Registry;
$registry->loadArray($sermon->auto_sermons); $registry->loadArray($sermon->auto_sermons);
$sermon->auto_sermons = (string) $registry; $sermon->auto_sermons = (string) $registry;
// always the same // always the same
@ -397,23 +397,23 @@ class SermondistributorModelAjax extends ListModel
{ {
// Only process once per/sermon // Only process once per/sermon
$bad_characters = array("\"", "<", ">"); $bad_characters = array("\"", "<", ">");
$this->sermons->$key->metadesc = JString::str_ireplace($bad_characters, "", $description); // just to be save $this->sermons->$key->metadesc = \JString::str_ireplace($bad_characters, "", $description); // just to be save
} }
// Array of characters to remove. // Array of characters to remove.
$bad_characters = array("\n", "\r", "\"", "<", ">"); $bad_characters = array("\n", "\r", "\"", "<", ">");
// set the meta key words // set the meta key words
$this->sermons->$key->metakey[] = trim(JString::str_ireplace($bad_characters, '', $name)); // just to be save $this->sermons->$key->metakey[] = trim(\JString::str_ireplace($bad_characters, '', $name)); // just to be save
if ($series) if ($series)
{ {
$this->sermons->$key->metakey[] = trim(JString::str_ireplace($bad_characters, '', $seriesName)); // just to be save $this->sermons->$key->metakey[] = trim(\JString::str_ireplace($bad_characters, '', $seriesName)); // just to be save
} }
if ($preacher) if ($preacher)
{ {
$this->sermons->$key->metakey[] = trim(JString::str_ireplace($bad_characters, '', $preacherName)); // just to be save $this->sermons->$key->metakey[] = trim(\JString::str_ireplace($bad_characters, '', $preacherName)); // just to be save
} }
if ($category) if ($category)
{ {
$this->sermons->$key->metakey[] = trim(JString::str_ireplace($bad_characters, '', $categoryName)); // just to be save $this->sermons->$key->metakey[] = trim(\JString::str_ireplace($bad_characters, '', $categoryName)); // just to be save
} }
$author = ($preacher) ? trim($preacherName): ''; $author = ($preacher) ? trim($preacherName): '';
$this->sermons->$key->metadata = '{"robots":"","author":"'.$author.'","rights":"See our site terms."}'; $this->sermons->$key->metadata = '{"robots":"","author":"'.$author.'","rights":"See our site terms."}';
@ -426,11 +426,11 @@ class SermondistributorModelAjax extends ListModel
// sanitize the name to an alias // sanitize the name to an alias
if (Factory::getConfig()->get('unicodeslugs') == 1) if (Factory::getConfig()->get('unicodeslugs') == 1)
{ {
$alias = JFilterOutput::stringURLUnicodeSlug($name); $alias = \JFilterOutput::stringURLUnicodeSlug($name);
} }
else else
{ {
$alias = JFilterOutput::stringURLSafe($name); $alias = \JFilterOutput::stringURLSafe($name);
} }
if ($type) if ($type)
{ {
@ -537,8 +537,8 @@ class SermondistributorModelAjax extends ListModel
protected function createCategory($name,$alias) protected function createCategory($name,$alias)
{ {
// load the category table // load the category table
JTable::addIncludePath(JPATH_LIBRARIES . '/joomla/database/table'); \JTable::addIncludePath(JPATH_LIBRARIES . '/joomla/database/table');
$category = JTable::getInstance('Category'); $category = \JTable::getInstance('Category');
$category->extension = 'com_sermondistributor.sermons'; $category->extension = 'com_sermondistributor.sermons';
$category->title = $name; $category->title = $name;
$category->alias = $alias; $category->alias = $alias;
@ -568,7 +568,7 @@ class SermondistributorModelAjax extends ListModel
// insure the filed is always uniqe // insure the filed is always uniqe
while (isset($this->uniqeValueArray[$type][$field][$value])) while (isset($this->uniqeValueArray[$type][$field][$value]))
{ {
$value = JString::increment($value, 'dash'); $value = \JString::increment($value, 'dash');
} }
$this->uniqeValueArray[$type][$field][$value] = $value; $this->uniqeValueArray[$type][$field][$value] = $value;
return $value; return $value;

View File

@ -137,8 +137,8 @@ class SermondistributorModelSermon extends ItemModel
// Get from #__sermondistributor_sermon as a // Get from #__sermondistributor_sermon as a
$query->select($db->quoteName( $query->select($db->quoteName(
array('a.id','a.asset_id','a.name','a.alias','a.preacher','a.short_description','a.icon','a.scripture','a.series','a.catid','a.description','a.link_type','a.source','a.build','a.manual_files','a.local_files','a.url','a.not_required','a.auto_sermons','a.published','a.created_by','a.modified_by','a.created','a.modified','a.version','a.hits','a.ordering','a.metadesc','a.metakey','a.metadata'), array('a.id','a.asset_id','a.name','a.alias','a.preacher','a.short_description','a.icon','a.scripture','a.series','a.catid','a.description','a.link_type','a.source','a.build','a.manual_files','a.local_files','a.url','a.auto_sermons','a.published','a.created_by','a.modified_by','a.created','a.modified','a.version','a.hits','a.ordering','a.metadesc','a.metakey','a.metadata'),
array('id','asset_id','name','alias','preacher','short_description','icon','scripture','series','catid','description','link_type','source','build','manual_files','local_files','url','not_required','auto_sermons','published','created_by','modified_by','created','modified','version','hits','ordering','metadesc','metakey','metadata'))); array('id','asset_id','name','alias','preacher','short_description','icon','scripture','series','catid','description','link_type','source','build','manual_files','local_files','url','auto_sermons','published','created_by','modified_by','created','modified','version','hits','ordering','metadesc','metakey','metadata')));
$query->from($db->quoteName('#__sermondistributor_sermon', 'a')); $query->from($db->quoteName('#__sermondistributor_sermon', 'a'));
// Get from #__sermondistributor_series as b // Get from #__sermondistributor_series as b

View File

@ -60,7 +60,7 @@ class SermondistributorViewCategories extends HtmlView
{ {
foreach ($this->items as $nr => &$item) foreach ($this->items as $nr => &$item)
{ {
$item->link = JRoute::_(SermondistributorHelperRoute::getCategoryRoute($item->slug)); $item->link = \JRoute::_(SermondistributorHelperRoute::getCategoryRoute($item->slug));
} }
} }
// set the FooTable style // set the FooTable style

View File

@ -54,20 +54,31 @@ use Joomla\CMS\HTML\HTMLHelper as Html;
<?php echo $this->loadTemplate('sermons-list'); ?> <?php echo $this->loadTemplate('sermons-list'); ?>
<?php endif; ?> <?php endif; ?>
<script> <script>
function sermonCounter(key,filename)
{ function sermonCounter(key, filename) {
var getUrl = "index.php?option=com_sermondistributor&task=ajax.countDownload&format=json"; const getUrl = "index.php?option=com_sermondistributor&task=ajax.countDownload&format=json&raw=true";
if (key.length > 0 && filename.length > 0) let requestUrl = '';
{
var request = 'token=<?php echo JSession::getFormToken(); ?>&key='+key+'&filename='+filename; if (key.length > 0 && filename.length > 0) {
request = getUrl + '&<?php echo \JSession::getFormToken(); ?>=1&key=' + encodeURIComponent(key) + '&filename=' + encodeURIComponent(filename);
} else {
return;
} }
return jQuery.ajax({
type: 'POST', // Using Fetch API for the AJAX call
url: getUrl, return fetch(requestUrl, {
dataType: 'jsonp', method: 'GET',
data: request, headers: {
jsonp: 'callback' 'Content-Type': 'application/x-www-form-urlencoded',
}); }
})
.then(response => {
if (!response.ok) {
throw new Error('Network response was not ok');
}
return response.json();
})
.catch(error => console.error('There was a problem with your fetch operation:', error));
} }
</script> </script>
<?php else: ?> <?php else: ?>

View File

@ -109,7 +109,7 @@ class SermondistributorViewCategory extends HtmlView
parent::display($tpl); parent::display($tpl);
} }
/** /**
* Increment the hit counter for the category. * Increment the hit counter for the category.
* *
* @param integer $pk Primary key of the category to increment. * @param integer $pk Primary key of the category to increment.

View File

@ -54,20 +54,31 @@ use Joomla\CMS\HTML\HTMLHelper as Html;
<?php echo $this->loadTemplate('sermons-list'); ?> <?php echo $this->loadTemplate('sermons-list'); ?>
<?php endif; ?> <?php endif; ?>
<script> <script>
function sermonCounter(key,filename)
{ function sermonCounter(key, filename) {
var getUrl = "index.php?option=com_sermondistributor&task=ajax.countDownload&format=json"; const getUrl = "index.php?option=com_sermondistributor&task=ajax.countDownload&format=json&raw=true";
if (key.length > 0 && filename.length > 0) let requestUrl = '';
{
var request = 'token=<?php echo JSession::getFormToken(); ?>&key='+key+'&filename='+filename; if (key.length > 0 && filename.length > 0) {
request = getUrl + '&<?php echo \JSession::getFormToken(); ?>=1&key=' + encodeURIComponent(key) + '&filename=' + encodeURIComponent(filename);
} else {
return;
} }
return jQuery.ajax({
type: 'POST', // Using Fetch API for the AJAX call
url: getUrl, return fetch(requestUrl, {
dataType: 'jsonp', method: 'GET',
data: request, headers: {
jsonp: 'callback' 'Content-Type': 'application/x-www-form-urlencoded',
}); }
})
.then(response => {
if (!response.ok) {
throw new Error('Network response was not ok');
}
return response.json();
})
.catch(error => console.error('There was a problem with your fetch operation:', error));
} }
</script> </script>
<?php else: ?> <?php else: ?>

View File

@ -135,7 +135,6 @@ class SermondistributorViewPreacher extends HtmlView
return false; return false;
} }
/** /**
* Prepares the document * Prepares the document
*/ */

View File

@ -60,7 +60,7 @@ class SermondistributorViewPreachers extends HtmlView
{ {
foreach ($this->items as $nr => &$item) foreach ($this->items as $nr => &$item)
{ {
$item->link = JRoute::_(SermondistributorHelperRoute::getPreacherRoute($item->slug)); $item->link = \JRoute::_(SermondistributorHelperRoute::getPreacherRoute($item->slug));
} }
} }
// set the FooTable style // set the FooTable style

View File

@ -29,6 +29,7 @@ use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text; use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route; use Joomla\CMS\Router\Route;
use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\HTML\HTMLHelper as Html;
use Joomla\CMS\Session\Session;
?> ?>
<form action="<?php echo Route::_('index.php?option=com_sermondistributor'); ?>" method="post" name="adminForm" id="adminForm"> <form action="<?php echo Route::_('index.php?option=com_sermondistributor'); ?>" method="post" name="adminForm" id="adminForm">
<?php if ($this->series): ?> <?php if ($this->series): ?>
@ -54,20 +55,31 @@ use Joomla\CMS\HTML\HTMLHelper as Html;
<?php echo $this->loadTemplate('sermons-list'); ?> <?php echo $this->loadTemplate('sermons-list'); ?>
<?php endif; ?> <?php endif; ?>
<script> <script>
function sermonCounter(key,filename)
{ function sermonCounter(key, filename) {
var getUrl = "index.php?option=com_sermondistributor&task=ajax.countDownload&format=json"; const getUrl = "index.php?option=com_sermondistributor&task=ajax.countDownload&format=json&raw=true";
if (key.length > 0 && filename.length > 0) let requestUrl = '';
{
var request = 'token=<?php echo JSession::getFormToken(); ?>&key='+key+'&filename='+filename; if (key.length > 0 && filename.length > 0) {
request = getUrl + '&<?php echo \JSession::getFormToken(); ?>=1&key=' + encodeURIComponent(key) + '&filename=' + encodeURIComponent(filename);
} else {
return;
} }
return jQuery.ajax({
type: 'POST', // Using Fetch API for the AJAX call
url: getUrl, return fetch(requestUrl, {
dataType: 'jsonp', method: 'GET',
data: request, headers: {
jsonp: 'callback' 'Content-Type': 'application/x-www-form-urlencoded',
}); }
})
.then(response => {
if (!response.ok) {
throw new Error('Network response was not ok');
}
return response.json();
})
.catch(error => console.error('There was a problem with your fetch operation:', error));
} }
</script> </script>
<?php else: ?> <?php else: ?>

View File

@ -135,7 +135,6 @@ class SermondistributorViewSeries extends HtmlView
return false; return false;
} }
/** /**
* Prepares the document * Prepares the document
*/ */

View File

@ -60,7 +60,7 @@ class SermondistributorViewSerieslist extends HtmlView
{ {
foreach ($this->items as $nr => &$item) foreach ($this->items as $nr => &$item)
{ {
$item->link = JRoute::_(SermondistributorHelperRoute::getSeriesRoute($item->slug)); $item->link = \JRoute::_(SermondistributorHelperRoute::getSeriesRoute($item->slug));
} }
} }
// set the FooTable style // set the FooTable style

View File

@ -44,20 +44,31 @@ use VDM\Joomla\Utilities\StringHelper;
<div><?php echo $this->item->scripture; ?></div> <div><?php echo $this->item->scripture; ?></div>
<?php endif; ?> <?php endif; ?>
<script> <script>
function sermonCounter(key,filename)
{ function sermonCounter(key, filename) {
var getUrl = "index.php?option=com_sermondistributor&task=ajax.countDownload&format=json"; const getUrl = "index.php?option=com_sermondistributor&task=ajax.countDownload&format=json&raw=true";
if (key.length > 0 && filename.length > 0) let requestUrl = '';
{
var request = 'token=<?php echo JSession::getFormToken(); ?>&key='+key+'&filename='+filename; if (key.length > 0 && filename.length > 0) {
request = getUrl + '&<?php echo \JSession::getFormToken(); ?>=1&key=' + encodeURIComponent(key) + '&filename=' + encodeURIComponent(filename);
} else {
return;
} }
return jQuery.ajax({
type: 'POST', // Using Fetch API for the AJAX call
url: getUrl, return fetch(requestUrl, {
dataType: 'jsonp', method: 'GET',
data: request, headers: {
jsonp: 'callback' 'Content-Type': 'application/x-www-form-urlencoded',
}); }
})
.then(response => {
if (!response.ok) {
throw new Error('Network response was not ok');
}
return response.json();
})
.catch(error => console.error('There was a problem with your fetch operation:', error));
} }
<?php if (1 == $this->item->playerKey) : ?> <?php if (1 == $this->item->playerKey) : ?>
soundManager.setup({ soundManager.setup({

View File

@ -109,7 +109,6 @@ class SermondistributorViewSermon extends HtmlView
return false; return false;
} }
/** /**
* Prepares the document * Prepares the document
*/ */