By PeterChain on Friday, 26 September 2014
Likes 0
Views 1.1K
Votes 0
I discovered the Latest Blog module and I want to give it a very custom use:

To only show my own blogs (when I am logged in) no matter if they are published or not.

How can I do this? I guess some fature should be added to the module, right?
Hello Pere,

If you would like to hack the module, edit the file /modules/mod_latestblogs/helper.php and at line 77 locate the codes below,


$posts = $model->getBlogsBy('blogger', $id, $sort , $count , EBLOG_FILTER_PUBLISHED, null, false);


Replace it with,


$id = JFactory::getUser()->id;
$posts = $model->getBlogsBy('blogger', $id, $sort , $count , EBLOG_FILTER_PUBLISHED, null, false);


Also, kindly please do understand that our support does not cover customizations.
·
Wednesday, 01 October 2014 03:05
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Pere,

I am really sorry but unfortunately right now the module does not do that currently
·
Saturday, 27 September 2014 01:55
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi,

maybe you could suggest a code hack to include user_id filtering in the items that are selected to show in the module?

I'm not a coder but I guess it would be a small php file intervention. And of course would be good that you put this feature in the list of upgrades...

Thank you!
·
Monday, 29 September 2014 17:13
·
0 Likes
·
0 Votes
·
0 Comments
·
Also, kindly please do understand that our support does not cover customizations.


Thank you Mark, sorry if I abused 'the system', this was not in my intention.

You're a great support team!
·
Wednesday, 01 October 2014 03:36
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Pere,

You're welcome. And thanks for using our product.
·
Wednesday, 01 October 2014 10:45
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi,

I wouldn't like to abuse the support system as this thread became accidentally a "customization" thread, but in the case you want to help maybe we could close it and offer this useful knowledge to the EasyBlog community after answering a little bit to make the suggested hack effective 100%.

I applied the code suggested by Mark with this Module Types:

Latest posts
Latest posts by blogger
Latest posts by current active blogger

Sadly I get no different result (the module shows blogs from everybody NOT only the logged user as desired)

In fact I put some check code inside the

case 'blogger'::
$id = JFactory::getUser()->id;
$posts = $model->getBlogsBy('blogger', $id, $sort , $count , EBLOG_FILTER_PUBLISHED, null, false);
break;


and also deleted it and I experienced no difference so I assume that this code is simply not executing so I maybe missing some configuration setting that is diverting the execution out of this code stream.
·
Wednesday, 15 October 2014 18:20
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Peter,

Please replace the attached file in: ../modules/mod_latestblogs/helper.php. This is for Latest Post module type. As for the other module type, I believe you want to show post based on user who logged in, right? If so, you can't apply the hack for the Latest posts by blogger and Latest posts by current active blogger . Please give it a try.
·
Wednesday, 15 October 2014 19:14
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi NIK,

thanks a lot, you did much more than I would expect. With this substitution file it worked instantly with no other intervention!

Thousand Thanks!
·
Wednesday, 15 October 2014 20:06
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks for updating Peter, glad that your issues are resolved now
·
Thursday, 16 October 2014 00:21
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post