50 Posts
rtlehr
6 years ago
Topic

Hey all,

I'm trying to use users avatars in articles and article comments (from a list) I found the tutorial below, but the query does not seem to return anything. 

https://www.seblod.com/resources/tutorials/embedding-an-author-s-avatar-in-the-item-list-or-content-view

Some of the queries I've tried are

SELECT b.avatar AS text, a.id AS value
FROM #__users AS a
LEFT JOIN

#__cck_store_item_users AS b ON b.id = a.id

SELECT avatar AS text, id AS value FROM #__cck_store_item_users WHERE id = #$user -> id# (<- not sure about the syntax to dynamically set up the users ID)

SELECT avatar AS text, id AS value FROM #__cck_store_item_users WHERE id = 43 (<- hardcoading an ID I know exists)

the HTML Typography looks like (I know this will not show the image, I'm just trying to print the URL path at this point):

<strong>Avatar value: $cck->getText('orchard_comment_user_avatar'); </strong>

orchard_comment_user_avatar - Name of the field that gets the avatar URL path

When I try anything I get nothing.

Can someone point me in the right direction (or tell me :-) ) what I'm doing wrong?

Let me know if you need any other information

Thank You,

Ross

Get a Book for SEBLOD
50 Posts
rtlehr
6 years ago
0
Level 1

UPDATE

Figured it out... this is working

SELECT avatar AS text, id AS value FROM #__cck_store_item_users WHERE id = 43

There was a value in the "Select Label" field which was pushing the URL I need into the second position, so not rendering.

Get a Book for SEBLOD