Buy One OpenCart Theme, Download One for Free!
0
Your Cart is currently empty!
Product update
Coupon
add
Coupon code invalid! Please re-enter!
AJAX loader
You are here: HomeForum

We are here to serve :)

Our support team is currently online to solve your issues.

Our support team is currently offline

Our support heroes might not be around this hour. Please expect some delays.

Our support is available from

Monday - Friday 8am - 5:30pm GMT+7

Your time: 00:00:00
Our time: 00:00:00

Welcome, Guest

Change Post Date format 2
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: Change Post Date format 2

Change Post Date format 2 3 years, 3 months ago #28189

Hi everyone!

Please help me with date format in newsfeed. In the previous topic there's no answer.
The topic has been locked.

Re: Change Post Date format 2 3 years, 3 months ago #28201

  • thuyltt
  • OFFLINE
  • Administrator
  • Posts: 1096
  • Karma: 10
Dear sir,
Please go to file: modules/mod_sj_basic_news/tmpl/default.php and change code
<?php echo $item->created; ?>
<?php echo JHTML::_('date', $item->created , JText::_('d M Y'));?>
('d M Y'): You can change like you want, refer here:
www.w3schools.com/php/func_date_date.asp

Thanks
The topic has been locked.

Re: Change Post Date format 2 3 years, 3 months ago #28206

Sorry to bother you, but it has no such code

Here's what I have in modules/mod_sj_basic_news/tmpl/default.php

<?php
/**
* @package Sj Basic News
* @version 3.0
* @license www.gnu.org/licenses/gpl-2.0.html GNU/GPL
* @copyright (c) 2012 YouTech Company. All Rights Reserved.
* @author YouTech Company www.smartaddons.com
*
*/
defined('_JEXEC') or die;

if(!empty($list)){
$uniquied = 'sj_basic_news_'.time().rand();
JHtml::stylesheet('modules/mod_sj_basic_news/assets/css/sj-basic-news.css');
ImageHelper::setDefault($params);
?>
<?php if($params->get('pretext') != null) {?>
<div class="bs-pretext">
<?php echo $params->get('pretext'); ?>
</div>
<?php }?>
<div id="<?php echo $uniquied?>" class="sj-basic-news">
<div class="bs-items">
<?php $i = 0; foreach($list as $item){ $i++;
$show_line = ($params->get('showline') == 1)?' bs-show-line':'';
$last_class = ($i == count($list))?' last':'';
$img = SjBasicNewsHelper::getAImage($item, $params);
?>
<div class="bs-item cf <?php echo $show_line.' '.$last_class; ?>">
<?php if($img){?>
<div class="bs-image">
<a href="<?php echo $item->link ?>" title="<?php echo $item->title; ?>" <?php echo SjBasicNewsHelper::parseTarget($params->get('link_target')); ?>>
<?php
echo SjBasicNewsHelper::imageTag($img);
?>
</a>
</div>
<?php } ?>
<div class="bs-content">
<?php if($params->get('title_display') == 1) {?>
<div class="bs-title">
<a href="<?php echo $item->link ?>" title="<?php echo $item->title; ?>" <?php echo SjBasicNewsHelper::parseTarget($params->get('link_target')); ?>>
<?php echo SjBasicNewsHelper::truncate($item->title, $params->get('item_title_max_characs',25)); ?>
</a>
</div>
<?php }?>
<?php if($params->get('item_desc_display') == 1) {?>
<div class="bs-description">
<?php echo SjBasicNewsHelper::truncate($item->introtext, $params->get('item_desc_max_characs',200)); ?>
</div>
<?php } ?>
<?php if($params->get('cat_title_display') == 1 || $params->get('item_date_display') == 1 ){?>
<div class="bs-cat-date">
<?php if($params->get('cat_title_display') == 1 ){?>
<span class="bs-cat-title">
<?php echo JText::_('Category: ');?>
<a href="<?php echo $item->catlink; ?>" title="<?php echo $item->category_title; ?>" <?php echo SjBasicNewsHelper::parseTarget($params->get('link_target')); ?> >
<?php echo $item->category_title; ?>
</a>
</span>
<?php } ?>
<?php if($params->get('item_date_display') == 1 ){?>
<span class="bs-date"><?php echo $item->created; ?></span>
<?php }?>
</div>
<?php }?>
<?php if($params->get('item_readmore_display') == 1){?>
<div class="bs-readmore">
<a href="<?php echo $item->link ?>" title="<?php echo $item->title; ?>" <?php echo SjBasicNewsHelper::parseTarget($params->get('link_target')); ?>>
<?php echo $params->get('item_readmore_text'); ?>
</a>
</div>
<?php }?>
</div>
</div>
<?php } ?>
</div>
</div>
<?php if($params->get('posttext') != null) {?>
<div class="bs-posttext">
<?php echo $params->get('posttext'); ?>
</div>
<?php }?>


<?php
}else{
echo JText::_('Has no content to show!');
}?>
The topic has been locked.

Re: Change Post Date format 2 3 years, 3 months ago #28213

  • thuyltt
  • OFFLINE
  • Administrator
  • Posts: 1096
  • Karma: 10
Dear sir,
Sorry, i miss some word
Please go to file: modules/mod_sj_basic_news/tmpl/default.php and change code
<?php echo $item->created; ?>

Change to=>
<?php echo JHTML::_('date', $item->created , JText::_('d M Y'));?>

('d M Y'): You can change like you want, refer here:
www.w3schools.com/php/func_date_date.asp

Thanks
The topic has been locked.

Re: Change Post Date format 2 3 years, 3 months ago #28238

Thanks a lot! Worked like a charm)
The topic has been locked.
  • Page:
  • 1
Time to create page: 0.50 seconds

Notification

Please find your issue via Suggested Posts before submitting your question. We have solved the most of issues and maybe your issue was solved before.

Suggested Posts

(/)
Result not found!

Latest My Topics

No posts to display.

Love all our templates?

Join our membership clubs starting at $49 only for access to all of our templates

Join Now
Magento Themes Magento Extensions Free Magento Extensions Prestashop Themes Prestashop Modules Magento 2 Themes