Keyword

Displaying User Avatar in a feed module

  • Chris Hood
  • Chris Hood's Avatar Topic Author
  • Offline
  • New Member
More
8 years 2 months ago - 8 years 2 months ago #156187 by Chris Hood
Displaying User Avatar in a feed module was created by Chris Hood
Hi everyone,

I'm a little stuck, and haven't found a solution to this yet - I'm trying to display the authors Avatar in a K2 item home page feed, using a module (BT Content Slider). Basically, the k2 items are job postings, and I want the image shown to be the logo of the company posting the job - IE, their user avatar.

I'm using custom templated php for the module, in my template, and editing the php code to suit.

I've tried using a varation on the solution in www.joomlaworks.net/forum/k2-en/38466-how-to-show-author-image-in-k2-category-listing-page, but can't get it functioning for this application.

I can get the author's ID to display using a simple:
<?php echo $row->created_by ?>

And I just need to select the image from the 'image' column in #__k2_users, where 'id' = the value of 'created_by' in #__k2_items. Then insert it into an src using something like :
<php echo "<img src="media/k2/users/$image>" ?>

Would anyone be able to assist me?

Thank you!
Last edit: 8 years 2 months ago by Chris Hood.

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum