Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion admin/views/articles/tmpl/default_batch_body.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
$published = $this->state->get('filter.published');
$published = (int) $this->state->get('filter.published');
?>

<div class="container-fluid">
Expand Down
8 changes: 6 additions & 2 deletions site/views/article/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
$assocParam = (JLanguageAssociations::isEnabled() && $params->get('show_associations'));
JHtml::_('behavior.caption');

$currentDate = JFactory::getDate()->format('Y-m-d H:i:s');
$isNotPublishedYet = $this->item->publish_up > $currentDate;
$isExpired = $this->item->publish_down < $currentDate && $this->item->publish_down !== JFactory::getDbo()->getNullDate();

?>
<div class="item-page<?php echo $this->pageclass_sfx; ?>" itemscope itemtype="https://schema.org/Article">
<meta itemprop="inLanguage" content="<?php echo ($this->item->language === '*') ? JFactory::getConfig()->get('language') : $this->item->language; ?>" />
Expand Down Expand Up @@ -75,10 +79,10 @@
<?php if ($this->item->state == 0) : ?>
<span class="label label-warning"><?php echo JText::_('JUNPUBLISHED'); ?></span>
<?php endif; ?>
<?php if (strtotime($this->item->publish_up) > strtotime(JFactory::getDate())) : ?>
<?php if ($isNotPublishedYet) : ?>
<span class="label label-warning"><?php echo JText::_('JNOTPUBLISHEDYET'); ?></span>
<?php endif; ?>
<?php if ((strtotime($this->item->publish_down) < strtotime(JFactory::getDate())) && $this->item->publish_down != JFactory::getDbo()->getNullDate()) : ?>
<?php if ($isExpired) : ?>
<span class="label label-warning"><?php echo JText::_('JEXPIRED'); ?></span>
<?php endif; ?>
</div>
Expand Down
10 changes: 6 additions & 4 deletions site/views/category/tmpl/blog_item.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
// Check if associations are implemented. If they are, define the parameter.
$assocParam = (JLanguageAssociations::isEnabled() && $params->get('show_associations'));

$currentDate = JFactory::getDate()->format('Y-m-d H:i:s');
$isUnpublished = ($this->item->state == 0 || $this->item->publish_up > $currentDate)
|| ($this->item->publish_down < $currentDate && $this->item->publish_down !== JFactory::getDbo()->getNullDate());

?>
<link itemprop="mainEntityOfPage" href="<?php echo JRoute::_(BlogHelperRoute::getArticleRoute($this->item->slug, $this->item->catid)); ?>">
<meta itemprop="headline" content="<?php echo $this->escape($this->item->title); ?>">
Expand All @@ -39,8 +43,7 @@
<time datetime="<?php echo JHtml::_('date', $this->item->publish_up, 'c'); ?>" itemprop="datePublished"></time>
<?php endif; ?>

<?php if ($this->item->state == 0 || strtotime($this->item->publish_up) > strtotime(JFactory::getDate())
|| ((strtotime($this->item->publish_down) < strtotime(JFactory::getDate())) && $this->item->publish_down != JFactory::getDbo()->getNullDate())) : ?>
<?php if ($isUnpublished) : ?>
<div class="system-unpublished">
<?php endif; ?>

Expand Down Expand Up @@ -99,8 +102,7 @@

<?php endif; ?>

<?php if ($this->item->state == 0 || strtotime($this->item->publish_up) > strtotime(JFactory::getDate())
|| ((strtotime($this->item->publish_down) < strtotime(JFactory::getDate())) && $this->item->publish_down != JFactory::getDbo()->getNullDate())) : ?>
<?php if ($isUnpublished) : ?>
</div>
<?php endif; ?>

Expand Down
7 changes: 5 additions & 2 deletions site/views/category/tmpl/default_articles.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@
');

$tableClass = $this->params->get('show_headings') != 1 ? ' table-noheader' : '';

$nullDate = JFactory::getDbo()->getNullDate();
$currentDate = JFactory::getDate()->format('Y-m-d H:i:s');
?>
<form action="<?php echo htmlspecialchars(JUri::getInstance()->toString()); ?>" method="post" name="adminForm" id="adminForm" class="form-inline">
<?php if ($this->params->get('filter_field') !== 'hide' || $this->params->get('show_pagination_limit')) : ?>
Expand Down Expand Up @@ -213,12 +216,12 @@
<?php echo JText::_('JUNPUBLISHED'); ?>
</span>
<?php endif; ?>
<?php if (strtotime($article->publish_up) > strtotime(JFactory::getDate())) : ?>
<?php if ($article->publish_up > $currentDate) : ?>
<span class="list-published label label-warning">
<?php echo JText::_('JNOTPUBLISHEDYET'); ?>
</span>
<?php endif; ?>
<?php if ((strtotime($article->publish_down) < strtotime(JFactory::getDate())) && $article->publish_down != JFactory::getDbo()->getNullDate()) : ?>
<?php if ($article->publish_down < $currentDate && $article->publish_down !== $nullDate) : ?>
<span class="list-published label label-warning">
<?php echo JText::_('JEXPIRED'); ?>
</span>
Expand Down
15 changes: 9 additions & 6 deletions site/views/featured/tmpl/default_item.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,14 @@

// Check if associations are implemented. If they are, define the parameter.
$assocParam = (JLanguageAssociations::isEnabled() && $params->get('show_associations'));

$currentDate = JFactory::getDate()->format('Y-m-d H:i:s');
$isExpired = $this->item->publish_down < $currentDate && $this->item->publish_down !== JFactory::getDbo()->getNullDate();
$isNotPublishedYet = $this->item->publish_up > $currentDate;
$isUnpublished = $this->item->state == 0 || $isNotPublishedYet || $isExpired;
?>

<?php if ($this->item->state == 0 || strtotime($this->item->publish_up) > strtotime(JFactory::getDate())
|| ((strtotime($this->item->publish_down) < strtotime(JFactory::getDate())) && $this->item->publish_down != JFactory::getDbo()->getNullDate())) : ?>
<?php if ($isUnpublished) : ?>
<div class="system-unpublished">
<?php endif; ?>

Expand All @@ -38,10 +42,10 @@
<?php if ($this->item->state == 0) : ?>
<span class="label label-warning"><?php echo JText::_('JUNPUBLISHED'); ?></span>
<?php endif; ?>
<?php if (strtotime($this->item->publish_up) > strtotime(JFactory::getDate())) : ?>
<?php if ($isNotPublishedYet) : ?>
<span class="label label-warning"><?php echo JText::_('JNOTPUBLISHEDYET'); ?></span>
<?php endif; ?>
<?php if ((strtotime($this->item->publish_down) < strtotime(JFactory::getDate())) && $this->item->publish_down != JFactory::getDbo()->getNullDate()) : ?>
<?php if ($isExpired) : ?>
<span class="label label-warning"><?php echo JText::_('JEXPIRED'); ?></span>
<?php endif; ?>

Expand Down Expand Up @@ -96,8 +100,7 @@

<?php endif; ?>

<?php if ($this->item->state == 0 || strtotime($this->item->publish_up) > strtotime(JFactory::getDate())
|| ((strtotime($this->item->publish_down) < strtotime(JFactory::getDate())) && $this->item->publish_down != $this->db->getNullDate() )) : ?>
<?php if ($isUnpublished) : ?>
</div>
<?php endif; ?>

Expand Down