By CNS Web on Wednesday, 15 January 2014
Likes 0
Views 1.1K
Votes 0
I don't know if this is an Issue or Feature Request. This is for both the Easy Blog component and Latest Posts module.

I can't figure out how to display the 'Published Date' on a story. Current the only 2 options are 'Creation Date' and 'Modified Date'. My users very often write stories in advance and set them to be published on a certain date. For example on Jan 10th an author wrote a news release for Jan 13th. The story displayed on Jan 13th but with the Jan 10th date.

Please advise on how to display or if this is not possible can this feature be added. It seems very necessary for anyone using EasyBlog to release News Stories.

Thanks.
Hello,

Hm, yeah you are right. What you can do is to edit the file /components/com_easyblog/themes/default/config.xml and locate the codes below:


<param type="list" name="creation_source" label="COM_EASYBLOG_THEME_POSTED_DATE_SOURCE" description="COM_EASYBLOG_THEME_POSTED_DATE_SOURCE_DESC" default="created">
<option value="created">COM_EASYBLOG_CREATED</option>
<option value="modified">COM_EASYBLOG_LAST_MODIFIED</option>
</param>


Change it to,


<param type="list" name="creation_source" label="COM_EASYBLOG_THEME_POSTED_DATE_SOURCE" description="COM_EASYBLOG_THEME_POSTED_DATE_SOURCE_DESC" default="created">
<option value="created">COM_EASYBLOG_CREATED</option>
<option value="modified">COM_EASYBLOG_LAST_MODIFIED</option>
<option value="publish_up">Publish date</option>
</param>


This should do the trick
·
Wednesday, 15 January 2014 02:06
·
0 Likes
·
0 Votes
·
0 Comments
·
Mark, thanks for your quick reply. I have tried your solution and am not seeing any changes to the Theme Options of the Latest Posts module options. I have attached screenshots of both.

I am using the Lithium template if it matters.
·
Wednesday, 15 January 2014 03:52
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello,

So sorry for the delay in getting back to you. In that case please edit the file

JOOMLA/components/com_easyblog/themes/lithium/config.xml

with the same changes instead Hope this helps.

Thanks!
·
Wednesday, 15 January 2014 10:36
·
0 Likes
·
0 Votes
·
0 Comments
·
Ok this is almost working at the moment. I tried using this same code for the mod_latestblogs module and it doesn't seem to be working. I tried modifying the file
/modules/mod_latestblogs/mod_latestblogs.xml

I have left an example for you on my site using an article with the title 'Tune In and Be Blinded with Science'. For this article I have set the published date to be Jan 10th, 2014 and the creation date to be Jan 3rd, 2014.

On my frontpage layout view, http://cns.utexas.edu/news, it displays in the correct order but shows the creation date instead of the published date. So the ordering is working but not the display.

On my home page, http://cns.utexas.edu, the module is ordered by creation date still. The 'Blinded with Science' article should be the 3rd on in the list, but is the fourth.

I really appreciate your help, thanks.
·
Thursday, 16 January 2014 00:09
·
0 Likes
·
0 Votes
·
0 Comments
·
Edit the file /modules/mod_latestblogs/tmpl/source.php and locate the code below:


<?php echo $post->date;?>


Replace it with,


<?php echo $post->publish_up;?>
·
Thursday, 16 January 2014 00:22
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark, thank you for your reply. This is great, but there are 2 issues getting mixed up here.

1) The mod_latestblogs is still ordering articles by creation date. I want the module to order them by Published Date.
2) The frontpage blog layout is showing the Creation Date instead of the Published Date. The order is correct though.

Thanks
·
Thursday, 16 January 2014 00:58
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello,

Edit the file /modules/mod_latestblogs/helper.php and at line 131 locate the codes below,


$posts = $model->getBlogsBy( $type , $cid , 'latest' , $count , EBLOG_FILTER_PUBLISHED, null, false , array() , false , false , true , array() , $cid );


Replace it with,


$posts = $model->getBlogsBy( $type , $cid , 'published' , $count , EBLOG_FILTER_PUBLISHED, null, false , array() , false , false , true , array() , $cid );
·
Thursday, 16 January 2014 02:24
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark, I've changed the line and the module is still sorting by Creation Date. Any other places to change?
·
Thursday, 16 January 2014 02:38
·
0 Likes
·
0 Votes
·
0 Comments
·
Hm, what is the module configured to behave like currently? By latest post or is it by bloggers?
·
Thursday, 16 January 2014 03:26
·
0 Likes
·
0 Votes
·
0 Comments
·
Latest post. Here is the Post Parameter config, as you can see the new Publish date value is selected.
·
Thursday, 16 January 2014 03:33
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello,

Hm, I am not too sure why it is not working for you but that code modification that I have provided should work fine.
·
Thursday, 16 January 2014 11:47
·
0 Likes
·
0 Votes
·
0 Comments
·
Well it did seem odd, you had me edit a module file but I am trying to fix this on the frontpage display menu item. Check the site details in this post for the url.
·
Thursday, 16 January 2014 11:58
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello,

Your front page item doesn't seem like a module and it does seem like it's pulling the front page of EasyBlog. You can change this from the back end settings of EasyBlog under Settings > Layout > General > Ordering. See my screen shot here, http://screencast.com/t/fHXUg0cO
·
Thursday, 16 January 2014 12:26
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark,

Yes you are correct. As I said that page is the EasyBlog front page. I have that setting selected, the problem is that the date that displays is the Creation Date when it should show the Published Date. The ordering is correct though, only the displayed date is wrong.

So the ordering is correct, how can I make the Published Date show instead of the Creation Date? I am using the lithium template.

Thank you.
·
Thursday, 16 January 2014 13:20
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello,

Sorry for the late reply. Please go to backend -> EasyBlog -> Themes -> Lithium. Here set the "Posted Date Source" to Last Modified. Hope this helps.

Thanks!
·
Thursday, 16 January 2014 15:29
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Adelene,

So I am not trying to be difficult, but 'Last Modified' is not the same as Published Date. This means that every time they modify the article to it will change the displayed date. Last Modified is a great feature but not what I am looking for here. Published date is being stored so there has to be a way to show published date on the EasyBlog front page.

Thanks.
·
Thursday, 16 January 2014 23:59
·
0 Likes
·
0 Votes
·
0 Comments
·
If you are using Lithium, you need to do the same as per the config.xml as my post earlier but this time, edit /components/com_easyblog/themes/lithium/config.xml
·
Friday, 17 January 2014 00:20
·
0 Likes
·
0 Votes
·
0 Comments
·
In the following file, /components/com_easyblog/themes/lithium/config.xml

I change the code in 2 different places to the following.
<field type="list" name="creation_source" label="COM_EASYBLOG_THEME_POSTED_DATE_SOURCE" description="COM_EASYBLOG_THEME_POSTED_DATE_SOURCE_DESC" default="created">
<option value="created">COM_EASYBLOG_CREATED</option>
<option value="modified">COM_EASYBLOG_LAST_MODIFIED</option>
<option value="publish_up">Publish date</option>
</field>


Then from the lithium backend I select the new option that is now available. I've attached a screenshot of the parameters.

The date showing has not changed, is there something else I am missing? The article Published date is Jan 10th, but it still show the creation date of Jan 3rd.
·
Friday, 17 January 2014 00:37
·
0 Likes
·
0 Votes
·
0 Comments
·
Looks like lithium has hardcoded the creation date. Edit the following files,

/components/com_easyblog/themes/lithium/blog.item.php
/components/com_easyblog/themes/lithium/blog.read.php

Then, replace any ->date with ->publish_up.
·
Friday, 17 January 2014 02:17
·
0 Likes
·
0 Votes
·
0 Comments
·
Mark, this is the info I was looking for. However there is no 'date' variable. I needed to change $row->created to $row->publish_up. Once I changed that in both files the published date was displayed. Thanks!

So that answered my #2 question from my earlier post. I still need my first question answered.
1) The mod_latestblogs is still ordering articles by creation date. I want the module to order them by Published Date.


What do I need to change so that the module will order stories based on published date?
·
Friday, 17 January 2014 06:00
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello,

If you apply the codes above that I provided in the module's helper.php file it should order items by published date already.
·
Friday, 17 January 2014 12:17
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark,

This is a different problem then above. I am not trying to display a date, I now want to order by published date in the module. Here is the code that I believe does the ordering on the helper.php file.


$sort = $params->get( 'sortby' , 'latest' ) == 'latest' ? 'latest' : 'modified';

switch( $type )
{
case 'blogger':
$posts = $model->getBlogsBy('blogger', $id, $sort , $count , EBLOG_FILTER_PUBLISHED, null, false);
break;
case 'category':
$posts = $model->getBlogsBy('category', $id, $sort , $count , EBLOG_FILTER_PUBLISHED, null, false);
break;
case 'tag':
$posts = $model->getTaggedBlogs( $id, $count );
break;
case 'team':
$posts = $model->getBlogsBy( 'teamblog' , $id , $sort , $count , EBLOG_FILTER_PUBLISHED , null , false );
break;
case 'latest':

It seems like I should be adding publish_up somewhere to the '$sort =' but I am not sure what to add. That line reads from the mod_latestblogs.xml file which I have changed per your instructions to.

<param name="sortby" type="list" default="0" label="MOD_LATESTBLOGS_SORTING_BY" description="MOD_LATESTBLOGS_SORTING_BY_DESC">
<option value="latest">MOD_LATESTBLOGS_CREATED_DATE</option>
<option value="modified">MOD_LATESTBLOGS_MODIFIED_DATE</option>
<option value="publish_up">Publish date</option>
</param>


I think we are really close, once the module can sort by Published Date then I'll stop bugging you.
·
Saturday, 18 January 2014 00:24
·
0 Likes
·
0 Votes
·
0 Comments
·
Please read the reply above http://stackideas.com/forums/display-published-date#reply-118734 . This hack is meant to change the ordering of the blog posts in the module.
·
Saturday, 18 January 2014 01:17
·
0 Likes
·
0 Votes
·
0 Comments
·
Ah, sorry I forgot about that reply. Yes that seems like it should work but it is having no effect. I changed line 131 exactly as you said.

I've attached screenshots of my module configuration.
·
Saturday, 18 January 2014 01:34
·
0 Likes
·
0 Votes
·
0 Comments
·
Please provide us with the back end and FTP access.
·
Saturday, 18 January 2014 02:13
·
0 Likes
·
0 Votes
·
0 Comments
·
Info provided
·
Saturday, 18 January 2014 02:38
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello,

I would need the FTP access to the site.
·
Saturday, 18 January 2014 14:09
·
0 Likes
·
0 Votes
·
0 Comments
·
See 'optional info' below
·
Wednesday, 22 January 2014 01:58
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello,

It looks like you have configured the module to pick up featured posts only, hence the hack earlier wasn't working as the hack earlier was provided if you want to display recent blog posts. Anyway I have modified the file /components/com_easyblog/models/blogs.php and at line 245 replaced the codes below:


$query .= ' ORDER BY a.`created` DESC';


With,


$query .= ' ORDER BY a.`publish_up` DESC';
·
Wednesday, 22 January 2014 02:17
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark,

This has fixed the display issue, thank you very much.

Is it possible that this fix would have broken the Menu Item-> Write Post? I had a menu item where users could write a new post, since the fix that menu item is now broken and just goes to a blank white screen.

See additional info below
·
Wednesday, 22 January 2014 04:28
·
0 Likes
·
0 Votes
·
0 Comments
·
Would you prefer I open a new ticket for the white screen issue? Also I've cloned my dev site so I can work on this issue without breaking anything like. Please see Info below for dev sites login.
·
Wednesday, 22 January 2014 04:44
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello,

Hm, I tried to set the error reporting to development and now the site is not accessible. This is one of the reasons why we need the FTP. Can you please provide us with the FTP access?
·
Wednesday, 22 January 2014 11:19
·
0 Likes
·
0 Votes
·
0 Comments
·
I cannot provide ftp at this time, plus you would need VPN access to get to the server which also cannot be provided.

Where can I change this on the backend? Was it the global config debug?
·
Wednesday, 22 January 2014 12:02
·
0 Likes
·
0 Votes
·
0 Comments
·
Ok everything is fixed. Can you please do work on the development site, not the live site. I have provided the dev url below.

Thank you for your time.
·
Wednesday, 22 January 2014 12:06
·
0 Likes
·
0 Votes
·
0 Comments
·
Actually, things are not quite back to working. In my config file I switched the line back to

public $error_reporting = 'default';

Anything else I should change, I still cannot access the administrator panel and some module are not working.
·
Wednesday, 22 January 2014 12:09
·
0 Likes
·
0 Votes
·
0 Comments
·
Ok, another update from my end. After clearing server cache things are back to normal. Sorry for the multiple message, was in panic mode trying to bring the site back.

I think everything is back, please use the dev site I provided earlier for future work.
·
Wednesday, 22 January 2014 12:17
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello,

Hm, I have tested this on your dev site and it seems to work fine as you can see here, http://screencast.com/t/68nyqZOE9G
·
Wednesday, 22 January 2014 15:52
·
0 Likes
·
0 Votes
·
0 Comments
·
Yes, things seem to be working fine. Not sure exactly what happened there.

Thank you for all your help Mark.
·
Friday, 24 January 2014 00:02
·
0 Likes
·
0 Votes
·
0 Comments
·
You are most welcome
·
Friday, 24 January 2014 01:05
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post