By Thodoris on Tuesday, 02 October 2018
Posted in General Issues
Likes 0
Views 485
Votes 0
Hello I want to add some html code (links) but I want to hide them after for example 7 days.

I can do this by writing a PHP script but I don't know how to get the publish date and the id of the current post.

Thanks.
Hi Thodoris,

May I know are you referring to EasyDiscuss post or EasyBlog post? so that I know the code that to retrieve 'published date' and 'id' of that post.
·
Tuesday, 02 October 2018 10:55
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Fadhli,
Sorry I open the question in general thread .
I referring to EasyBlog thanks.

Regards
·
Tuesday, 02 October 2018 16:29
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Thodoris,

Basically you can get the data in the table #__easyblog_post in column 'publish_up' and 'id' where the publish up is the published date and id of the blog post respectively.

Basically you can use as shown:
[gist type="php"]
//to get current blog id
$id = EB::request()->get('id', 0, 'default');
$post = EB::post($id);
//get publish date
$date = $post->getDisplayDate('publish_up')->format(JText::_('DATE_FORMAT_LC1'));
[/gist]
·
Tuesday, 02 October 2018 17:44
·
0 Likes
·
0 Votes
·
0 Comments
·
Thank you Fadhli this is fine for me

Regards
·
Tuesday, 02 October 2018 23:01
·
0 Likes
·
0 Votes
·
0 Comments
·
You are most welcome Thodoris, glad that your issue is resolved now
·
Tuesday, 02 October 2018 23:49
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post