By Ineke Huibregtse on Tuesday, 10 May 2016
Posted in Technical Issues
Replies 7
Likes 0
Views 274
Votes 0
Hello,
Yesterday I asked about using the publication date in the easyblog modules for latest blogs and archive.
I needed to replace this:

<?php echo $post->getCreationDate(true)->format($params->get('dateformat', JText::_('DATE_FORMAT_LC3'))); ?>


with:

<?php echo $post->getPublishDate()->format($params->get('dateformat', JText::_('DATE_FORMAT_LC3'))); ?>


This worked for the latest blog module with one problem: If I set the publication date to 8 May at 00:01 o'clock, the component says 8 May, but the latest blog module says 7 May, as if it's in a different time zone. When I set the time to 02:00 o'clock, also the module says 8 May. (01:30 still gives 7 May)

In de archive module I couldn't find the code as mentioned. How can I adjust the archive module in order to show the publication date?

Best,
Ineke
Hm okay it looks like the post library always uses the GMT (+0). To fix this, download the attached file and upload it into /administrator/components/com_easyblog/includes/post/

Then, in your module, use this code,

·
Tuesday, 10 May 2016 17:53
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark,
Thank you very much, that fixes the problem with the latest blog module.
Will I have to reload the post.php file after update, or will this be fixed in the next version?

The archive module is still showing the creation date. The code that I replaced in the template of the latest module is not present in the archive module. Is there a way to make the archive also show the publication date.

Thank you for your help!
Ineke
·
Tuesday, 10 May 2016 18:06
·
0 Likes
·
0 Votes
·
0 Comments
·
The changes on the post.php will be added in the next release. I will also log this as a feature request for the next release of EasyBlog.

As for the archive module, it's actually much more complicated than just changing that because the retrieval of the posts will also need to be based on the publishing date rather than creation date.
·
Tuesday, 10 May 2016 22:22
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark,
Alright thank you.

I'm not sure what you mean with your remark about the archive module.
Do you mean it's not possible to let the archive module show the publication date? Or do you mean it would be necessary to make more adjustments? Because it looks rather strange to have different dates showing...
For me it would be fine to have the posts retrived by publishing date.
Best,
Ineke
·
Tuesday, 10 May 2016 22:47
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Ineke,

Sorry, but there could be some misunderstanding here. The archive module in EasyBlog displays the year / month as you can see here, http://screencast.com/t/DBvk0cx5

Not really sure what / which formatting are you referring to.
·
Tuesday, 10 May 2016 23:11
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark,
I'm sorry I'm not being clear. The module displays the month, but when you click on the item the post date is shown, and that happens to be the creation date (see first screen shot, in this case 2 May). In the latest blog module now the publication date is shown (8 May).
You can also take a look at http://rusland-colleges.nl/blog

Best
Ineke
·
Tuesday, 10 May 2016 23:45
·
0 Likes
·
0 Votes
·
0 Comments
·
This is not from the module It's from the blog's layout. Edit the file /components/com_easyblog/themes/wireframe/blogs/archives/list.php and change the following,


<?php echo $this->html('string.date', $post->created, JText::_('DATE_FORMAT_LC1')); ?>


To,


<?php echo $this->html('string.date', $post->publish_up, JText::_('DATE_FORMAT_LC1')); ?>
·
Wednesday, 11 May 2016 00:05
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post