News:

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

Main Menu

Encore une tite question

Started by WoWsagele, February 13, 2005, 09:41:39 PM

Previous topic - Next topic

WoWsagele

Y a pas moyen pour les utilisateur de voir les avatar directement a coter de leur compte a la création de leur acompte.

Alexandre P.

Dans le fichier /Themes/NOM_DE_TON_THEME/Register.template.php, recherche:
// Require them to agree here?

Ajoute avant:

// Sélection des avatars
if (!empty($modSettings['avatar_allow_server_stored']))
echo '
<script language="JavaScript1.2" type="text/javascript"><!--
function ready()
{
if (avatar.src.indexOf("blank.gif") > -1 && cat.selectedIndex != 0)
changeSel(selavatar);
}
// --></script>';
echo'
<table border="0" width="100%" cellpadding="3" cellspacing="0" class="tborder">
<tr class="titlebg">
<td>S&eacute;lectionnez votre avatar</td>
</tr><tr class="windowbg">
<td width="100%">

<table border="0" width="100%" cellpadding="5" cellspacing="0">';
if (!empty($modSettings['avatar_allow_server_stored']) || !empty($modSettings['avatar_allow_external_url']) || !empty($modSettings['avatar_allow_upload']))
{
// If users are allowed to choose avatars stored on the server show selection boxes to choice them from.
if (!empty($modSettings['avatar_allow_server_stored']))
{
echo '
<tr>
<td width="40%" valign="top" style="padding: 0 2px;">
<table width="100%" cellpadding="5" cellspacing="0" border="0" style="height: 25ex;"><tr>
<td valign="top" width="20" class="windowbg"><input type="radio" name="avatar_choice" value="server_stored"', ($context['member']['avatar']['choice'] == 'server_stored' ? ' checked="checked"' : ''), ' class="check" /></td>
<td valign="top" style="padding-left: 1ex;">
<b', (isset($context['modify_error']['bad_avatar']) ? ' style="color: #FF0000;"' : ''), '>', $txt[229], ':</b>
<div style="margin: 2ex;"><img name="avatar" id="avatar" src="', $modSettings['avatar_url'], '/blank.gif" alt="Do Nothing" /></div>
</td>
</tr></table>
</td>
<td>
<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr>
<td style="width: 20ex;">
<select name="cat" id="cat" size="10" onchange="changeSel(\'\');" onfocus="selectRadioByName(document.creator.avatar_choice, \'server_stored\');">';
// This lists all the file catergories.
foreach ($context['avatars'] as $avatar)
echo '
<option value="', $avatar['filename'] . ($avatar['is_dir'] ? '/' : ''), '"', ($avatar['checked'] ? ' selected="selected"' : ''), '>', $avatar['name'], '</option>';
echo '
</select>
</td>
<td>
<select name="file" id="file" size="10" style="display: none;" onchange="showAvatar()" onfocus="selectRadioByName(document.creator.avatar_choice, \'server_stored\');" disabled="disabled"><option></option></select>
</td>
</tr></table>
</td>
</tr>';
}

// 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 '
<tr>
<td valign="top" style="padding: 0 2px;">
<table width="100%" cellpadding="5" cellspacing="0" border="0"><tr>
<td valign="top" width="20" class="windowbg"><input type="radio" name="avatar_choice" value="external"', ($context['member']['avatar']['choice'] == 'external' ? ' checked="checked"' : ''), ' class="check" /></td>
<td valign="top" style="padding-left: 1ex;"><b>', $txt[475], ':</b><div class="smalltext">', $txt[474], '</div></td>
</tr></table>
</td>
<td valign="top">
<input type="text" name="userpicpersonal" size="45" value="', $context['member']['avatar']['external'], '" onfocus="selectRadioByName(document.creator.avatar_choice, \'external\');" />
</td>
</tr>';
}

// If the user is able to upload avatars to the server show them an upload box.
if (!empty($modSettings['avatar_allow_upload']))
echo '
<tr>
<td valign="top" style="padding: 0 2px;">
<table width="100%" cellpadding="5" cellspacing="0" border="0"><tr>
<td valign="top" width="20" class="windowbg"><input type="radio" name="avatar_choice" value="upload"', ($context['member']['avatar']['choice'] == 'upload' ? 'checked="checked"' : ''), ' class="check" /></td>
<td valign="top" style="padding-left: 1ex;"><b>', $txt['avatar_will_upload'], ':</b></td>
</tr></table>
</td>
<td valign="top">
', ($context['member']['avatar']['ID_ATTACH'] > 0 ? '<img src="' . $scripturl . '?action=dlattach;id=' . $context['member']['avatar']['ID_ATTACH'] . ';type=avatar" /><input type="hidden" name="ID_ATTACH" value="' . $context['member']['avatar']['ID_ATTACH'] . '" /><br /><br />' : ''), '
<input type="file" size="48" name="attachment" value="" onfocus="selectRadioByName(document.creator.avatar_choice, \'upload\');" />
</td>
</tr>';
};
echo' </table>

</td>
</tr>
</table>';


En espérant que ça fonctionne bien...
Aucun support par M.P., courriel ou messagerie instantanée / No support by P.M., email or I.M.

Advertisement: