News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

How can you display members avatars in "view all members"

Started by bruce marusich, March 21, 2006, 04:14:35 PM

Previous topic - Next topic

bruce marusich

I've looked around on the forums, but havn't found what I was looking for. I have the latest ver of SMF, and I was wondering how to enable members avatars to show when anyone is viewing "view all members?
Thanks,
Bruce Marusich

bruce marusich


codenaught

The following will add each member that has an avatar in a row to the right of their username row.

Open Themes/default/Memberlist.template.php

Find:
Quote<td class="windowbg" align="left">', $member['link'], '</td>

Add After:
Quote<td class="windowbg" align="left"><img src="',$member['avatar']['url'],'" /></td>

Open Sources/Memberlist.php

Find:
Quote'realName' => array(
         'label' => $txt[35]
      ),

Add After:
Quote'avatar' => array(
            'label' => Avatar
        ),
Dev Consultant
Former SMF Doc Coordinator

bruce marusich

Thank for the info, it works well! One thing tho, while all avatars (of members who have them) show up in messages, individual profile peeks, etc only some are showing up in the members list that this mod displays. Any ideas?
Thanks again,
Bruce

Superdaantje

I also add this to my template. But I gave also all members a default avatar when the did not have one. Is it possible to show the default avatar here? So yes what is the best way to do?
Greetz
Superdaantje.nl

.
Joomlabridge.org SMF Bridge Support, Downloads and Joomla Video Tutorials

sawz

Quote from: akabugeyes on March 24, 2006, 08:24:39 PM
The following will add each member that has an avatar in a row to the right of their username row.
Open Themes/default/Memberlist.template.php
Find:
Quote<td class="windowbg" align="left">', $member['link'], '</td>
Add After:
Quote<td class="windowbg" align="left"><img src="',$member['avatar']['url'],'" /></td>
Open Sources/Memberlist.php
Find:
Quote'realName' => array(
         'label' => $txt[35]
      ),

Add After:
Quote'avatar' => array(
            'label' => Avatar
        ),

this seems to only work with avatars that are linked externally, what can be added so that server stored avatars are also included in the member list?
keep smiling, they'll always wonder what your up too.....

jen

for users with server stored avatars, use $member['avatar']['image']

sawz

Quote from: jen on November 11, 2006, 03:43:39 AM
for users with server stored avatars, use $member['avatar']['image']
it must be version sensitive cause it will not work that way on v 1.1 RC3
keep smiling, they'll always wonder what your up too.....

codenaught

Quote from: sawz on November 11, 2006, 08:17:29 AM
Quote from: jen on November 11, 2006, 03:43:39 AM
for users with server stored avatars, use $member['avatar']['image']
it must be version sensitive cause it will not work that way on v 1.1 RC3

The following worked for me fine in RC3:

<td class="windowbg" align="left">',$member['avatar']['image'], '</td>
Dev Consultant
Former SMF Doc Coordinator

sawz

Quote from: akabugeyes on November 11, 2006, 11:11:55 AM
Quote from: sawz on November 11, 2006, 08:17:29 AM
Quote from: jen on November 11, 2006, 03:43:39 AM
for users with server stored avatars, use $member['avatar']['image']
it must be version sensitive cause it will not work that way on v 1.1 RC3

The following worked for me fine in RC3:

<td class="windowbg" align="left">',$member['avatar']['image'], '</td>
yes it does work and i thank you, but, why is the original code you posted different.
keep smiling, they'll always wonder what your up too.....

codenaught

Quote from: sawz on November 11, 2006, 11:30:01 AM
Quote from: akabugeyes on November 11, 2006, 11:11:55 AM
Quote from: sawz on November 11, 2006, 08:17:29 AM
Quote from: jen on November 11, 2006, 03:43:39 AM
for users with server stored avatars, use $member['avatar']['image']
it must be version sensitive cause it will not work that way on v 1.1 RC3

The following worked for me fine in RC3:

<td class="windowbg" align="left">',$member['avatar']['image'], '</td>
yes it does work and i thank you, but, why is the original code you posted different.
I guess it was a mistake. I must have overlooked the available options and not picked the best option to use. Anyways it was back in March so I wouldn't worry about it too much now.
Dev Consultant
Former SMF Doc Coordinator

Oldiesmann

One other thing - in Memberlist.php, you'll want to make sure that the label is 'Avatar' (with the quotes). Otherwise your error log will be filled with "Use of undefined constant Avatar, assumed 'Avatar'" messages :)

sawz

Quote from: Oldiesmann on November 11, 2006, 03:33:09 PM
One other thing - in Memberlist.php, you'll want to make sure that the label is 'Avatar' (with the quotes). Otherwise your error log will be filled with "Use of undefined constant Avatar, assumed 'Avatar'" messages :)
thanks for the additional note, error log was loaded right up :)
keep smiling, they'll always wonder what your up too.....

Cavan

Quote from: akabugeyes on November 11, 2006, 11:11:55 AM

The following worked for me fine in RC3:

<td class="windowbg" align="left">',$member['avatar']['image'], '</td>
Thanks for this---I added width="100px" and align="center" rather than align="left". My memberlist works fine now (using 1.1.3).

Cheers.

Fiery

So everyone has everything working as they like so I can mark this as solved?

Advertisement: