3.10 #37

Merged
Llewellyn merged 3 commits from 3.10 into master 2024-02-11 19:13:56 +00:00
20 changed files with 150 additions and 85 deletions
Showing only changes of commit 304c0cd388 - Show all commits

View File

@ -1,3 +1,7 @@
# v3.0.3
- Removed the not_required field from the sermon model. #36
# v3.0.2
- 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)
+ *Name*: [Sermon Distributor](https://www.vdm.io/)
+ *First Build*: 22nd October, 2015
+ *Last Build*: 10th February, 2024
+ *Last Build*: 11th February, 2024
+ *Version*: 3.0.x
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *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**,
> never making one mistake or taking any coffee break.)
+ *Line count*: **86974**
+ *File count*: **594**
+ *Line count*: **87039**
+ *File count*: **595**
+ *Folder count*: **113**
**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)
+ *Name*: [Sermon Distributor](https://www.vdm.io/)
+ *First Build*: 22nd October, 2015
+ *Last Build*: 10th February, 2024
+ *Last Build*: 11th February, 2024
+ *Version*: 3.0.x
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *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**,
> never making one mistake or taking any coffee break.)
+ *Line count*: **86974**
+ *File count*: **594**
+ *Line count*: **87039**
+ *File count*: **595**
+ *Folder count*: **113**
**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">
<img src="components/com_sermondistributor/assets/images/vdm-component.jpg"/>
</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.
if (!isset($db))

View File

@ -1,15 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="3.10" method="upgrade">
<name>COM_SERMONDISTRIBUTOR</name>
<creationDate>10th February, 2024</creationDate>
<creationDate>11th February, 2024</creationDate>
<author>Llewellyn van der Merwe</author>
<authorEmail>joomla@vdm.io</authorEmail>
<authorUrl>https://www.vdm.io/</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>3.0.2</version>
<version>3.0.3</version>
<description><![CDATA[
<h1>Sermon Distributor (v.3.0.2)</h1>
<h1>Sermon Distributor (v.3.0.3)</h1>
<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>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>
<targetplatform name="joomla" version="3.*"/>
</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>

View File

@ -171,7 +171,7 @@ class SermondistributorModelAjax extends ListModel
// make sure the lock is removed
unset($sermon->lock);
// convert the placeholders to json object
$registry = new JRegistry;
$registry = new Registry;
$registry->loadArray($sermon->auto_sermons);
$sermon->auto_sermons = (string) $registry;
// always the same
@ -397,23 +397,23 @@ class SermondistributorModelAjax extends ListModel
{
// Only process once per/sermon
$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.
$bad_characters = array("\n", "\r", "\"", "<", ">");
// 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)
{
$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)
{
$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)
{
$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): '';
$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
if (Factory::getConfig()->get('unicodeslugs') == 1)
{
$alias = JFilterOutput::stringURLUnicodeSlug($name);
$alias = \JFilterOutput::stringURLUnicodeSlug($name);
}
else
{
$alias = JFilterOutput::stringURLSafe($name);
$alias = \JFilterOutput::stringURLSafe($name);
}
if ($type)
{
@ -537,8 +537,8 @@ class SermondistributorModelAjax extends ListModel
protected function createCategory($name,$alias)
{
// load the category table
JTable::addIncludePath(JPATH_LIBRARIES . '/joomla/database/table');
$category = JTable::getInstance('Category');
\JTable::addIncludePath(JPATH_LIBRARIES . '/joomla/database/table');
$category = \JTable::getInstance('Category');
$category->extension = 'com_sermondistributor.sermons';
$category->title = $name;
$category->alias = $alias;
@ -568,7 +568,7 @@ class SermondistributorModelAjax extends ListModel
// insure the filed is always uniqe
while (isset($this->uniqeValueArray[$type][$field][$value]))
{
$value = JString::increment($value, 'dash');
$value = \JString::increment($value, 'dash');
}
$this->uniqeValueArray[$type][$field][$value] = $value;
return $value;

View File

@ -137,8 +137,8 @@ class SermondistributorModelSermon extends ItemModel
// Get from #__sermondistributor_sermon as a
$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('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('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','auto_sermons','published','created_by','modified_by','created','modified','version','hits','ordering','metadesc','metakey','metadata')));
$query->from($db->quoteName('#__sermondistributor_sermon', 'a'));
// Get from #__sermondistributor_series as b

View File

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

View File

@ -54,20 +54,31 @@ use Joomla\CMS\HTML\HTMLHelper as Html;
<?php echo $this->loadTemplate('sermons-list'); ?>
<?php endif; ?>
<script>
function sermonCounter(key,filename)
{
var getUrl = "index.php?option=com_sermondistributor&task=ajax.countDownload&format=json";
if (key.length > 0 && filename.length > 0)
{
var request = 'token=<?php echo JSession::getFormToken(); ?>&key='+key+'&filename='+filename;
function sermonCounter(key, filename) {
const getUrl = "index.php?option=com_sermondistributor&task=ajax.countDownload&format=json&raw=true";
let requestUrl = '';
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',
url: getUrl,
dataType: 'jsonp',
data: request,
jsonp: 'callback'
});
// Using Fetch API for the AJAX call
return fetch(requestUrl, {
method: 'GET',
headers: {
'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>
<?php else: ?>

View File

@ -109,7 +109,7 @@ class SermondistributorViewCategory extends HtmlView
parent::display($tpl);
}
/**
/**
* Increment the hit counter for the category.
*
* @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 endif; ?>
<script>
function sermonCounter(key,filename)
{
var getUrl = "index.php?option=com_sermondistributor&task=ajax.countDownload&format=json";
if (key.length > 0 && filename.length > 0)
{
var request = 'token=<?php echo JSession::getFormToken(); ?>&key='+key+'&filename='+filename;
function sermonCounter(key, filename) {
const getUrl = "index.php?option=com_sermondistributor&task=ajax.countDownload&format=json&raw=true";
let requestUrl = '';
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',
url: getUrl,
dataType: 'jsonp',
data: request,
jsonp: 'callback'
});
// Using Fetch API for the AJAX call
return fetch(requestUrl, {
method: 'GET',
headers: {
'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>
<?php else: ?>

View File

@ -133,8 +133,7 @@ class SermondistributorViewPreacher extends HtmlView
return $db->execute();
}
return false;
}
}
/**
* Prepares the document

View File

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

View File

@ -29,6 +29,7 @@ use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
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">
<?php if ($this->series): ?>
@ -54,20 +55,31 @@ use Joomla\CMS\HTML\HTMLHelper as Html;
<?php echo $this->loadTemplate('sermons-list'); ?>
<?php endif; ?>
<script>
function sermonCounter(key,filename)
{
var getUrl = "index.php?option=com_sermondistributor&task=ajax.countDownload&format=json";
if (key.length > 0 && filename.length > 0)
{
var request = 'token=<?php echo JSession::getFormToken(); ?>&key='+key+'&filename='+filename;
function sermonCounter(key, filename) {
const getUrl = "index.php?option=com_sermondistributor&task=ajax.countDownload&format=json&raw=true";
let requestUrl = '';
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',
url: getUrl,
dataType: 'jsonp',
data: request,
jsonp: 'callback'
});
// Using Fetch API for the AJAX call
return fetch(requestUrl, {
method: 'GET',
headers: {
'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>
<?php else: ?>

View File

@ -133,8 +133,7 @@ class SermondistributorViewSeries extends HtmlView
return $db->execute();
}
return false;
}
}
/**
* Prepares the document

View File

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

View File

@ -44,20 +44,31 @@ use VDM\Joomla\Utilities\StringHelper;
<div><?php echo $this->item->scripture; ?></div>
<?php endif; ?>
<script>
function sermonCounter(key,filename)
{
var getUrl = "index.php?option=com_sermondistributor&task=ajax.countDownload&format=json";
if (key.length > 0 && filename.length > 0)
{
var request = 'token=<?php echo JSession::getFormToken(); ?>&key='+key+'&filename='+filename;
function sermonCounter(key, filename) {
const getUrl = "index.php?option=com_sermondistributor&task=ajax.countDownload&format=json&raw=true";
let requestUrl = '';
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',
url: getUrl,
dataType: 'jsonp',
data: request,
jsonp: 'callback'
});
// Using Fetch API for the AJAX call
return fetch(requestUrl, {
method: 'GET',
headers: {
'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) : ?>
soundManager.setup({

View File

@ -107,8 +107,7 @@ class SermondistributorViewSermon extends HtmlView
return $db->execute();
}
return false;
}
}
/**
* Prepares the document