Blog module user post overview with user avatar

eric redegeld Posted in Component Development 1 month ago

Hi, have active the blog module https://www.opensource-socialnetwork.org/component/view/1653/blog

Got an question, as for now the blog are shareable https://nlsociaal.nl/blog/all_blogs_by_date
But its kind a clean ;-) is it possible to add thumbnail user avatar in front of the Title

Regards
Eric

Replies
Dutch Eric redegeld Replied 1 month ago

Thank you, this looks better
https://nlsociaal.nl/blog/all_blogs_by_date

German Michael Zülsdorff Replied 1 month ago

Well, personally I wouldn't vote for that, but why not?
If we have a look into all_blogs_item.php we see that the author of the blog is already accessable via $author->fullname
Thus, displaying his avatar would mean to add

<img src="<?php echo $author->iconURL()->smaller?>"> 

like

<a href="<?php echo $params['item']->profileURL();?>"><img src="<?php echo $author->iconURL()->smaller?>"> <?php echo $params['item']->title;?>  <i style="font-weight:normal; font-size:smaller"><?php echo ossn_print('com:blog:blog:edit:timestamp' , array(date(ossn_print('com:blog:blog:edit:timestamp:format'), $params['item']->time_created))); ?>  <?php echo ossn_print('com:blog:list:by:author:', array($author->fullname)); ?></i></a>