This resolved #3 implementation of new sermons.

This commit is contained in:
Llewellyn van der Merwe 2016-04-11 21:37:35 +01:00
parent 85297fa52a
commit ae990fbb03
12 changed files with 68 additions and 8 deletions

View File

@ -30,17 +30,17 @@ The best way to see all your options is to install this component on you Joomla
## Build Time :hourglass:
**134 Hours** or **17 Eight Hour Days** (actual time the author saved -
**135 Hours** or **17 Eight Hour Days** (actual time the author saved -
due to [Automated Component Builder] (https://www.vdm.io/joomla-component-builder))
> (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*: **48173**
+ *File count*: **351**
+ *Line count*: **48233**
+ *File count*: **352**
+ *Folder count*: **79**
**89 Hours** or **11 Eight Hour Days** (the actual time the author spent)
**88 Hours** or **11 Eight Hour Days** (the actual time the author spent)
> (with the following break down:
> **debugging @34hours** = codingtime / 4;

View File

@ -21,6 +21,7 @@ COM_SERMONDISTRIBUTOR_HITS_DESC="Hits (Desc)"
COM_SERMONDISTRIBUTOR_NAME="Name"
COM_SERMONDISTRIBUTOR_NAME_ASC="Name (Asc)"
COM_SERMONDISTRIBUTOR_NAME_DESC="Name (Desc)"
COM_SERMONDISTRIBUTOR_NEW="New"
COM_SERMONDISTRIBUTOR_NO_CATEGORIES_WERE_FOUND="No categories were found."
COM_SERMONDISTRIBUTOR_NO_CATEGORY_WAS_FOUND="No category was found."
COM_SERMONDISTRIBUTOR_NO_PREACHERS_WERE_FOUND="No preachers were found."

33
site/layouts/isnew.php Normal file
View File

@ -0,0 +1,33 @@
<?php
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 1.3.2
@build 11th April, 2016
@created 22nd October, 2015
@package Sermon Distributor
@subpackage isnew.php
@author Llewellyn van der Merwe <https://www.vdm.io/>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
A sermon distributor that links to Dropbox.
/-----------------------------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('JPATH_BASE') or die('Restricted access');
$display = '<span class="uk-button uk-button-danger uk-button-mini">'.JText::_('COM_SERMONDISTRIBUTOR_NEW').'</span>';
?>
<?php echo ($displayData->isNew) ? $display:''; ?>

View File

@ -30,7 +30,7 @@ defined('JPATH_BASE') or die('Restricted access');
?>
<a <?php if ($displayData->params->get($displayData->viewKey.'_sermons_download_count')): ?> data-uk-tooltip title="<?php echo JText::_('COM_SERMONDISTRIBUTOR_SERMON_DOWNLOAD_COUNT'); ?>: <?php echo 4; ?>" <?php endif; ?>href="<?php echo $displayData->link; ?>"><?php echo $displayData->name; ?></a>
<?php echo JLayoutHelper::render('isnew', $displayData); ?> <a <?php if ($displayData->params->get($displayData->viewKey.'_sermons_download_count')): ?> data-uk-tooltip title="<?php echo JText::_('COM_SERMONDISTRIBUTOR_SERMON_DOWNLOAD_COUNT'); ?>: <?php echo 4; ?>" <?php endif; ?>href="<?php echo $displayData->link; ?>"><?php echo $displayData->name; ?></a>
<?php if (('preacher' == $displayData->viewKey || 'category' == $displayData->viewKey) && $displayData->params->get($displayData->viewKey.'_sermons_series')): ?>
<a href="<?php echo $displayData->series_link; ?>" data-uk-tooltip title="<?php echo $displayData->series_name; ?>"><?php echo $displayData->series_name; ?></a>
<?php endif ;?>

View File

@ -62,6 +62,7 @@ switch ($style)
<?php echo JText::_('COM_SERMONDISTRIBUTOR_HITS'); ?>: <?php echo $displayData->hits; ?>
</div>
<?php endif ;?>
<?php echo JLayoutHelper::render('isnew', $displayData); ?>
<h3 class="uk-panel-title"><?php echo $displayData->name; ?></h3>
<?php if ($displayData->params->get($displayData->viewKey.'_sermons_icon')): ?>
<?php $displayData->icon = ($displayData->icon) ? $displayData->icon : $displayData->params->get('sermon_default_icon'); ?>

View File

@ -36,6 +36,7 @@ defined('JPATH_BASE') or die('Restricted access');
<?php else: ?>
<?php echo $displayData->name; ?>
<?php endif; ?>
<?php echo JLayoutHelper::render('isnew', $displayData); ?>
<?php echo JLayoutHelper::render('addtodropboxicon', $displayData); ?>
</td>
<?php if ($displayData->params->get($displayData->viewKey.'_sermons_desc')): ?>

View File

@ -121,7 +121,7 @@ class SermondistributorModelCategories extends JModelList
{
foreach ($items as $nr => &$item)
{
if (!$item->idCatidSermonB)
if (!SermondistributorHelper::checkArray($item->idCatidSermonB))
{
// remove empty category
unset($items[$nr]);

View File

@ -165,8 +165,16 @@ class SermondistributorModelCategory extends JModelList
// do a quick build of all the sermon links
if (isset($items) && $items)
{
$pastDate = strtotime('-1 week');
foreach ($items as $nr => &$item)
{
$item->isNew = false;
// check if sermon is new
$createdTime = strtotime($item->created);
if ($pastDate < $createdTime)
{
$item->isNew = true;
}
$item->statisticTotal = 0;
if (isset($item->auto_sermons) && SermondistributorHelper::checkString($item->auto_sermons))
{

View File

@ -165,8 +165,16 @@ class SermondistributorModelPreacher extends JModelList
// do a quick build of all the sermon links
if (isset($items) && $items)
{
$pastDate = strtotime('-1 week');
foreach ($items as $nr => &$item)
{
$item->isNew = false;
// check if sermon is new
$createdTime = strtotime($item->created);
if ($pastDate < $createdTime)
{
$item->isNew = true;
}
$item->statisticTotal = 0;
if (isset($item->auto_sermons) && SermondistributorHelper::checkString($item->auto_sermons))
{

View File

@ -124,7 +124,7 @@ class SermondistributorModelPreachers extends JModelList
{
foreach ($items as $nr => &$item)
{
if (!$item->idPreacherSermonB)
if (!SermondistributorHelper::checkArray($item->idPreacherSermonB))
{
// remove empty preacher
unset($items[$nr]);

View File

@ -165,8 +165,16 @@ class SermondistributorModelSeries extends JModelList
// do a quick build of all the sermon links
if (isset($items) && $items)
{
$pastDate = strtotime('-1 week');
foreach ($items as $nr => &$item)
{
$item->isNew = false;
// check if sermon is new
$createdTime = strtotime($item->created);
if ($pastDate < $createdTime)
{
$item->isNew = true;
}
$item->statisticTotal = 0;
if (isset($item->auto_sermons) && SermondistributorHelper::checkString($item->auto_sermons))
{

View File

@ -124,7 +124,7 @@ class SermondistributorModelSerieslist extends JModelList
{
foreach ($items as $nr => &$item)
{
if (!$item->idSeriesSermonB)
if (!SermondistributorHelper::checkArray($item->idSeriesSermonB))
{
// remove empty series
unset($items[$nr]);