Default Avatars

Started by BlazingShadow, June 10, 2010, 04:11:23 PM

Previous topic - Next topic

BlazingShadow

I was just wondering if there is an option to set a default avatar. aka. and avatar that is automatically set to a members profile if they do not chose another avatar?

kat

Hi, Blazing! Welcome to the asylum!


Have a look at these and see if any of those suit you.


http://custom.simplemachines.org/mods/index.php?action=search;basic_search=default+avatar

BlazingShadow

lol! The first one straight away!
Thanks!

kat


irwin

it's perfect... but why there is written Compatible with 2.0 rc3 and is not true ????
:P

How can i install on my smf 2.0 rc3.. please do u have a solution.
it's a really good mod .


irwin

sorry but you link is broken :-(

kat


irwin

sound good :-P
thank you

but there is a ittle problem:
Sorry, but this modification does not appear to be compatible with the selected version.

and is impossible to upload. :-(

kat

You'll have to use emulation.


Packages > Browse Packages > Advanced options.


Please backup, before installing ANY mods.




irwin

it was already selected the emulation mode... but:
COPY BEFORE ALL SOURCES FOLDER and make a backup of your database, then:
i have:
1-  package-info   -> changed  the string    <install for="2.0 - 2.x.x">  with <install for="2.0 - 2.0 RC3"> (twice)
2- zipped another tome all
3- ... and the play is gone..

kat

Quote from: irwin on June 22, 2010, 01:39:58 PM
2- zipped another tome all
3- ... and the play is gone..


I'm not with you, with those two. 


Sorry. :(

irwin

sorry but tome was a mistake... means time. - and the 3rd point means: upload inside your smf...

anyway, it's sound good but little bit strange - infact inside the block last_login the vatar is not there :-(
there is only inside the prifile. my page if u want check is www.irwin.it it italian is  'Gli ultimi iscritti' on the right, where i have this code:
    foreach ($members as $member)
      echo '
                           <tr>
                              <td class="sp_top_poster sp_center">', !empty($member['avatar']['href']) ? '
                                 <img src="' . $member['avatar']['href'] . '" alt="' . $member['name'] . '" width="40" />' : '', '
                              </td>
                              <td>
                                 ', $member['link'], '<br />
                                 ', $member['date'], '
                              </td>
                           </tr>';

   echo '
                        </table>';


kat

As your avatar is showing, maybe it's a permissions thing, that you have to setup, in Admin?

irwin

nothing in admin against his mod sorry.. :-)

i have this custom php block to shw the avatar.

   global $smcFunc, $context, $scripturl, $modSettings, $txt, $color_profile;

   $limit = 5;

   $request = $smcFunc['db_query']('','
      SELECT
         m.id_member, m.real_name, m.date_registered, m.avatar,
         a.id_attach, a.attachment_type, a.filename
      FROM {db_prefix}members AS m
         LEFT JOIN {db_prefix}attachments AS a ON (a.id_member = m.id_member)
      ORDER BY id_member DESC
      LIMIT {int:limit}',
      array(
         'limit' => $limit,
      )
   );
   $members = array();
   $colorids = array();
   while ($row = $smcFunc['db_fetch_assoc']($request))
   {
      if (!empty($row['id_member']))
         $colorids[$row['id_member']] = $row['id_member'];

      if ($modSettings['avatar_action_too_large'] == 'option_html_resize' || $modSettings['avatar_action_too_large'] == 'option_js_resize')
      {
         $avatar_width = !empty($modSettings['avatar_max_width_external']) ? ' width="' . $modSettings['avatar_max_width_external'] . '"' : '';
         $avatar_height = !empty($modSettings['avatar_max_height_external']) ? ' height="' . $modSettings['avatar_max_height_external'] . '"' : '';
      }
      else
      {
         $avatar_width = '';
         $avatar_height = '';
      }

      $members[] = array(
         'id' => $row['id_member'],
         'name' => $row['real_name'],
         'href' => $scripturl . '?action=profile;u=' . $row['id_member'],
         'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['real_name'] . '</a>',
         'date' => timeformat($row['date_registered'], '%d %B'),
         'avatar' => array(
            'name' => $row['avatar'],
            'image' => $row['avatar'] == '' ? ($row['id_attach'] > 0 ? '<img src="' . (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) . '" alt="" class="avatar" border="0" />' : '') : (stristr($row['avatar'], 'http://') ? '<img src="' . $row['avatar'] . '"' . $avatar_width . $avatar_height . ' alt="" class="avatar" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($row['avatar']) . '" alt="" class="avatar" border="0" />'),
            'href' => $row['avatar'] == '' ? ($row['id_attach'] > 0 ? (empty($row['attachment_type']) ? $scripturl . '?action=dlattach;attach=' . $row['id_attach'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $row['filename']) : '') : (stristr($row['avatar'], 'http://') ? $row['avatar'] : $modSettings['avatar_url'] . '/' . $row['avatar']),
            'url' => $row['avatar'] == '' ? '' : (stristr($row['avatar'], 'http://') ? $row['avatar'] : $modSettings['avatar_url'] . '/' . $row['avatar'])
         ),
      );
   }
   $smcFunc['db_free_result']($request);

   if (empty($members))
   {
      echo '
                        ', $txt['error_sp_no_members_found'];
      return;
   }

   if (!empty($colorids) && sp_loadColors($colorids) !== false)
   {
      foreach ($members as $k => $p)
      {
         if (!empty($color_profile[$p['id']]['link']))
            $members[$k]['link'] = $color_profile[$p['id']]['link'];
      }
   }

   echo '
                        <table class="sp_fullwidth">';

   foreach ($members as $member)
      echo '
                           <tr>
                              <td class="sp_top_poster sp_center">', !empty($member['avatar']['href']) ? '
                                 <img src="' . $member['avatar']['href'] . '" alt="' . $member['name'] . '" width="40" />' : '', '
                              </td>
                              <td>
                                 ', $member['link'], '<br />
                                 ', $member['date'], '
                              </td>
                           </tr>';

   echo '
                        </table>';

kat

Tell you what, Irwin...


Try a post in that mod's support topic. http://www.simplemachines.org/community/index.php?topic=201847.0


Dragoon's a good guy and he'll certainly help you, if he can.

irwin

yepp!! it's ok thank you K@. :-)


Advertisement: