News:

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

Main Menu

Avatar on Member List

Started by Gary, April 25, 2007, 03:29:12 PM

Previous topic - Next topic

Gary

Link to Mod

This mod will add each users's avatar to the member list.

If an avatar is not selected, then nothing appears.

I've only tested it with 1.1.2 but it should work with any version since 1.1 RC2

-ALM
Gary M. Gadsdon
Do NOT PM me unless I say so
War of the Simpsons
Bongo Comics Fan Forum
Youtube Let's Plays

^ YT is changing monetisation policy, help reach 1000 sub threshold.

RoarinRow


SMF 2.0
TP 1.0 RC1.1
Wordpress 3.1.3

nitsua


thecatlady

Looks great, but I get a test failed message on my memberlist, so one of my other mods must be interfering.

shadow82x

This mod works great! Thanks for taking my idea into consideration ALM
Colin B
Former Spammer, Customize, & Support Team Member

Gary

Quote from: thecatlady on April 25, 2007, 09:05:28 PM
Looks great, but I get a test failed message on my memberlist, so one of my other mods must be interfering.

I got that myself (on my real forum), if it's just the colspans, just open up Memberlist.template.php and increase each one by one.

-ALM
Gary M. Gadsdon
Do NOT PM me unless I say so
War of the Simpsons
Bongo Comics Fan Forum
Youtube Let's Plays

^ YT is changing monetisation policy, help reach 1000 sub threshold.

qtime


samozin

thanx man  but let me  ask u .......who cares for  looking at the avatars ? u  know i dont let the

users
to access the members area   i think u  need to  think  of another mod makes us  say wooo  hes really good something  usefull
iam sorry for saying this and being mean 

Gary

I'm not trying to make you say "whooo" this mod was requested and I made it, it's as simple as that. If you dot want to install it. Fine. I'm not forcing you to.

-ALM
Gary M. Gadsdon
Do NOT PM me unless I say so
War of the Simpsons
Bongo Comics Fan Forum
Youtube Let's Plays

^ YT is changing monetisation policy, help reach 1000 sub threshold.

pongsak

#9
I've one question.
How to choose default avatar for the non-avatar user in memberlist page.
I try to wrote the code like this in memberlist.php but it didn't work, no log errors.
Just show nothing as the attached picture. Can U tell me why?

// Assuming there are members loop through each one displaying their data.
if (!empty($context['members']))
{
foreach ($context['members'] as $member)
echo '
<tr style="text-align: center;"', empty($member['sort_letter']) ? '' : ' id="letter' . $member['sort_letter'] . '"', '>
<td class="windowbg2">
', $context['can_send_pm'] ? '<a href="' . $member['online']['href'] . '" title="' . $member['online']['text'] . '">' : '', $settings['use_image_buttons'] ? '<img src="' . $member['online']['image_href'] . '" alt="' . $member['online']['text'] . '" align="middle" />' : $member['online']['label'], $context['can_send_pm'] ? '</a>' : '', '
</td>
<td class="windowbg" align="left">', $member['link'], '</td>

';
// modified code start here
if ($member['avatar']['image']!=='')
{
echo '
<td class="windowbg" align="center">' . $member['avatar']['image'] . '</td>';
  }
else
{
echo '
<td class="windowbg" align="center"><img src="'.$boardurl.'/avatars/upload/default.jpg"></td>';
}
echo '

<td class="windowbg2" align="left" >', $member['hide_email'] ? '' : '<a href="' . $scripturl . '?action=useremail;u=' . $member['id'] . '"><img src="' . $settings['images_url'] . '/user1_email.gif" alt="' . $member['email'] . '" /></a>', '</td>
smf 1.1.2 with dilbermc themes.
> 50 mods installed.

Gary

I'll have to take a look this afternoon.

-ALM
Gary M. Gadsdon
Do NOT PM me unless I say so
War of the Simpsons
Bongo Comics Fan Forum
Youtube Let's Plays

^ YT is changing monetisation policy, help reach 1000 sub threshold.

DOOM666

#11
it didn't happen in tell in tell i put in customprofile field form winruzles.
I'm still pretty new at this so any help will be appreciated


Type Action Description
1. Execute Modification ./Sources/Memberlist.php Test successful
2. Execute Modification ./Themes/default/Memberlist.template.php Test failed
3. Execute Modification ./Themes/default/languages/Modifications.english.php Test successful


i solved this all i did did was change some numbers and it worked Whooooo

Gary

Try Daniel15's modification parser, it'll tell you what to find and where.

http://modparser.dev.dansoftaustralia.net/

You'll need to show all edits

-ALM
Gary M. Gadsdon
Do NOT PM me unless I say so
War of the Simpsons
Bongo Comics Fan Forum
Youtube Let's Plays

^ YT is changing monetisation policy, help reach 1000 sub threshold.

pongsak

#13
The original modified code here

[code]// Assuming there are members loop through each one displaying their data.
    if (!empty($context['members']))
    {
        foreach ($context['members'] as $member)
            echo '
        <tr style="text-align: center;"', empty($member['sort_letter']) ? '' : ' id="letter' . $member['sort_letter'] . '"', '>
            <td class="windowbg2">
                ', $context['can_send_pm'] ? '<a href="' . $member['online']['href'] . '" title="' . $member['online']['text'] . '">' : '', $settings['use_image_buttons'] ? '<img src="' . $member['online']['image_href'] . '" alt="' . $member['online']['text'] . '" align="middle" />' : $member['online']['label'], $context['can_send_pm'] ? '</a>' : '', '
            </td>
            <td class="windowbg" align="left">', $member['link'], '</td>

             ', empty($modSettings['enable_memberlist_avatars']) ? '' : ' <td class="windowbg" align="center">' . $member['avatar']['image'] . '</td>' ,'
               
            <td class="windowbg2" align="left" >', $member['hide_email'] ? '' : '<a href="' . $scripturl . '?action=useremail;u=' . $member['id'] . '"><img src="' . $settings['images_url'] . '/user1_email.gif" alt="' . $member['email'] . '" /></a>', '</td>
            <td class="windowbg">', $member['website']['url'] != '' ? '<a href="' . $member['website']['url'] . '" target="_blank"><img src="' . $settings['images_url'] . '/www.gif" alt="' . $member['website']['title'] . '" title="' . $member['website']['title'] . '" /></a>' : '', '</td>
            <td class="windowbg2">', $member['icq']['link'], '</td>
            <td class="windowbg2">', $member['aim']['link'], '</td>
            <td class="windowbg2">', $member['yim']['link'], '</td>
            <td class="windowbg2">', $member['msn']['link'], '</td>
            <td class="windowbg" align="left">', empty($member['group']) ? $member['post_group'] : $member['group'], '</td>
            <td class="windowbg" align="left">', $member['registered_date'], '</td>
            <td class="windowbg2" width="15">', $member['posts'], '</td>
            <td class="windowbg" width="100" align="left">
                ', $member['posts'] > 0 ? '<img src="' . $settings['images_url'] . '/bar.gif" width="' . $member['post_percent'] . '" height="15" alt="" />' : '', '
            </td>
        </tr>';
    }
    // No members?


Then i adapt at the line about 11-12  like this

// Assuming there are members loop through each one displaying their data.
    if (!empty($context['members']))
    {
        foreach ($context['members'] as $member)
            echo '
        <tr style="text-align: center;"', empty($member['sort_letter']) ? '' : ' id="letter' . $member['sort_letter'] . '"', '>
            <td class="windowbg2">
                ', $context['can_send_pm'] ? '<a href="' . $member['online']['href'] . '" title="' . $member['online']['text'] . '">' : '', $settings['use_image_buttons'] ? '<img src="' . $member['online']['image_href'] . '" alt="' . $member['online']['text'] . '" align="middle" />' : $member['online']['label'], $context['can_send_pm'] ? '</a>' : '', '
            </td>
            <td class="windowbg" align="left">', $member['link'], '</td>
             


// modified code start here
            ';
             if ($member['avatar']['image']!=='')
             {
                 echo '
                    <td class="windowbg" align="center">' . $member['avatar']['image'] . '</td>';
              }
            else
            {
                echo '
                    <td class="windowbg" align="center"><img src="'.$boardurl.'/avatars/upload/default.jpg"></td>';
            }
            echo '
//modified end here
               


            <td class="windowbg2" align="left" >', $member['hide_email'] ? '' : '<a href="' . $scripturl . '?action=useremail;u=' . $member['id'] . '"><img src="' . $settings['images_url'] . '/user1_email.gif" alt="' . $member['email'] . '" /></a>', '</td>
            <td class="windowbg">', $member['website']['url'] != '' ? '<a href="' . $member['website']['url'] . '" target="_blank"><img src="' . $settings['images_url'] . '/www.gif" alt="' . $member['website']['title'] . '" title="' . $member['website']['title'] . '" /></a>' : '', '</td>
            <td class="windowbg2">', $member['icq']['link'], '</td>
            <td class="windowbg2">', $member['aim']['link'], '</td>
            <td class="windowbg2">', $member['yim']['link'], '</td>
            <td class="windowbg2">', $member['msn']['link'], '</td>
            <td class="windowbg" align="left">', empty($member['group']) ? $member['post_group'] : $member['group'], '</td>
            <td class="windowbg" align="left">', $member['registered_date'], '</td>
            <td class="windowbg2" width="15">', $member['posts'], '</td>
            <td class="windowbg" width="100" align="left">
                ', $member['posts'] > 0 ? '<img src="' . $settings['images_url'] . '/bar.gif" width="' . $member['post_percent'] . '" height="15" alt="" />' : '', '
            </td>
        </tr>';
    }
    // No members?


And the outcome look like the picture

ps: i don't know how to bold text in the code tag, use bbc bold it look good in post page
but when i submiitted it show ... every sentense.
[/code]
smf 1.1.2 with dilbermc themes.
> 50 mods installed.

shaiss

Quote from: DOOM666 on May 02, 2007, 12:15:31 PM
it didn't happen in tell in tell i put in customprofile field form winruzles.
I'm still pretty new at this so any help will be appreciated


Type Action Description
1. Execute Modification ./Sources/Memberlist.php Test successful
2. Execute Modification ./Themes/default/Memberlist.template.php Test failed
3. Execute Modification ./Themes/default/languages/Modifications.english.php Test successful


i solved this all i did did was change some numbers and it worked Whooooo

So what #s did you change?
-Shai
If you ride on two wheels you need to ocmoto.com!

Gary

Most likely just increasing the number of colspans in the table.

-ALM
Gary M. Gadsdon
Do NOT PM me unless I say so
War of the Simpsons
Bongo Comics Fan Forum
Youtube Let's Plays

^ YT is changing monetisation policy, help reach 1000 sub threshold.

shaiss

Quote from: ALM on May 10, 2007, 02:46:45 PM
Most likely just increasing the number of colspans in the table.

-ALM
your code changes:
<td colspan="12" class="windowbg">', $txt[170], '</td>
to:
<td colspan="13" class="windowbg">', $txt[170], '</td>

So my understanding is that your increasing that colspan value by 1 to make room for the avatar.

In my case (ocomoto.com) the colspan is already = 13
<td colspan="13" class="windowbg">', $txt[170], '</td>

So, should I install anyway, then go in and increase the # to 14.  Or is there another way to do it?
-Shai
If you ride on two wheels you need to ocmoto.com!

Gary

That is exactly what you do, all you need to do is increase the colspan by one, in your case, just change it to 14, if you already have 14, change to 15, and so on.

-ALM
Gary M. Gadsdon
Do NOT PM me unless I say so
War of the Simpsons
Bongo Comics Fan Forum
Youtube Let's Plays

^ YT is changing monetisation policy, help reach 1000 sub threshold.

shaiss

but do you do this before or after installing the mod?
-Shai
If you ride on two wheels you need to ocmoto.com!

Gary

After is my preference. But either way, it'd fail for those parts. :P

-ALM
Gary M. Gadsdon
Do NOT PM me unless I say so
War of the Simpsons
Bongo Comics Fan Forum
Youtube Let's Plays

^ YT is changing monetisation policy, help reach 1000 sub threshold.

Advertisement: