News:

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

Main Menu

Add size info to Avatar upload

Started by demlak, December 29, 2012, 06:12:41 AM

Previous topic - Next topic

demlak

Link to Mod

Adds max hight and max width pixel info to avatar upload in profile

License:
http://creativecommons.org/licenses/by-sa/3.0/

bolubeyi61

#1
Thank you.

add External avatars


./Themes/default/Profile.template.php
find:
   // If the user can link to an off server avatar, show them a box to input the address.
   if (!empty($context['member']['avatar']['allow_external']))
   {
      echo '
                        <div id="avatar_external">
                           <div class="smalltext">', $txt['avatar_by_url'], '<>
                           <input type="text" name="userpicpersonal" size="45" value="', $context['member']['avatar']['external'], '" onfocus="selectRadioByName(document.forms.creator.avatar_choice, \'external\');" onchange="if (typeof(previewExternalAvatar) != \'undefined\') previewExternalAvatar(this.value);" class="input_text" />
                        <>';
   }


replace:
   // If the user can link to an off server avatar, show them a box to input the address.
   if (!empty($context['member']['avatar']['allow_external']))
   {
      echo '
                        <div id="avatar_external">
                           <div class="smalltext">', $txt['avatar_by_url'], '<>
                           <input type="text" name="userpicpersonal" size="45" value="', $context['member']['avatar']['external'], '" onfocus="selectRadioByName(document.forms.creator.avatar_choice, \'external\');" onchange="if (typeof(previewExternalAvatar) != \'undefined\') previewExternalAvatar(this.value);" class="input_text" />
                           <br />max. ', $modSettings['avatar_max_width_external'] ,' x ', $modSettings['avatar_max_width_external'], ' pixel                           
                        <>';
   }

demlak

thx for idea..
i added the external avatar part..

btw.. there is a mistake in your code.. you did use avatar_max_width_external two times.. instead of avatar_max_width_external and avatar_max_hight_external..

but nevermind... you can undo your changes.. uninstal the old mod.. and install the new one.. and everything is ok =)

(also i saw, that a wrong version was uploaded here.. with hardcoded text... fixed also)

Eclipse16V

I worked with:
SMF 2 in German

Shop:
SID Giessen

Advertisement: