[MOD] Avatar Required During Registration »  Show posts from    to     

Icy Phoenix


Old Customizations - [MOD] Avatar Required During Registration



TopoMotoV3X [ Thu 10 Jan, 2013 20:09 ]
Post subject: [MOD] Avatar Required During Registration
The MOD makes mandatory the inclusion of the avatar being recorded, you can copy the files that you find inside the package with its path's, or change your existing files with the following guidelines:

Files involved:

* root/includes/usercp_register.php
* root/templates/default/profile_register_body.tpl
* root/language/lang_english/lang_admin.php
* root/language/lang_english/lang_main.php
* root/includes/settings/settings_users.php


OPEN root/includes/usercp_register.php

FIND

Code: [Hide] [Select]
elseif ($mode == 'register')
{
if (empty($username) || empty($new_password) || empty($password_confirm) || empty($email) || empty($email_confirm))
{
$error = true;
$error_msg .= ((isset($error_msg)) ? '<br />' : '') . $lang['Fields_empty'];
}
}


REPLACE WITCH

Code: [Hide] [Select]
elseif ($mode == 'register')
{
if (empty($username) || empty($new_password) || empty($password_confirm) || empty($email) || empty($email_confirm))
{
$error = true;
$error_msg .= ((isset($error_msg)) ? '<br />' : '') . $lang['Fields_empty'];
}
// Avatar required MOD
if ($config['avatar_required'] && (empty($user_avatar_upload)))
{
$error = true;
$error_msg .= ((isset($error_msg)) ? '<br />' : '') . $lang['Avatar_required'];
}
// END Avatar required MOD
}


FIND

Code: [Hide] [Select]
}

full_page_generation($template_to_parse, '', '', '');

?>


BEFORE ADD

Code: [Hide] [Select]
// Avatar required MOD
if ($config['avatar_required'] && ($mode == 'register'))
{
$template_to_parse = 'profile_register_body.tpl';

if ($user->data['user_allowavatar'] && ($config['allow_avatar_upload'] || $config['allow_avatar_local'] || $config['allow_avatar_remote']))
{
$template->assign_block_vars($cpl_avatar_control . 'switch_avatar_block', array());

if ($config['allow_avatar_upload'] && file_exists(@phpbb_realpath('./' . $config['avatar_path'])))
{
if ($form_enctype != '')
{
$template->assign_block_vars($cpl_avatar_control . 'switch_avatar_block.switch_avatar_local_upload', array());
}
$template->assign_block_vars($cpl_avatar_control . 'switch_avatar_block.switch_avatar_remote_upload', array());
}
}
}

// End Avatar required MOD


OPEN root/templates/default/profile_register_body.tpl

FIND

Code: [Hide] [Select]
<input type="radio" name="gender" value="2" {GENDER_FEMALE_CHECKED} />
<span class="gen">{L_GENDER_FEMALE}</span>
</td>


AFTER ADD

Code: [Hide] [Select]
<!-- Avatar required MOD -->
<!-- BEGIN switch_cpl_avatar -->
<!-- BEGIN switch_avatar_block -->
<tr>
<tr><th colspan="2" valign="middle">{L_AVATAR} {L_REQUIRED} *</th></tr>
<tr><td class="row2" colspan="2"><span class="gensmall">{L_AVATAR_EXPLAIN}</span><br /><br /></td>
</tr>

<!-- BEGIN switch_avatar_local_upload -->
<tr>
<td class="row1"><span class="gen">{L_UPLOAD_AVATAR_FILE}</span></td>
<td class="row2"><input type="hidden" name="MAX_FILE_SIZE" value="{AVATAR_SIZE}" /><input type="file" name="avatar" class="post" style="width: 200px;" /></td>
</tr>
<!-- END switch_avatar_local_upload -->

<!-- BEGIN switch_avatar_remote_upload -->
<tr>
<td class="row1"><span class="gen">{L_UPLOAD_AVATAR_URL}:</span><br /><span class="gensmall">{L_UPLOAD_AVATAR_URL_EXPLAIN}</span></td>
<td class="row2"><input type="text" name="avatarurl" size="40" class="post" style="width: 200px;" /></td>
</tr>
<!-- END switch_avatar_remote_upload -->
<!-- END switch_avatar_block -->
<!-- END switch_cpl_avatar -->
<!-- END Avatar required MOD -->
</tr>


OPEN root/language/lang_english/lang_admin.php

FIND

Code: [Hide] [Select]
'Default_avatar' => 'Set a default avatar',


AFTER ADD

Code: [Hide] [Select]
'Avatar_required' => 'Force the avatar during registration', // Avatar required MOD


OPEN root/language/lang_english/lang_main.php

FIND

Code: [Hide] [Select]
'Fields_empty' => 'You must fill in the required fields.',


AFTER ADD

Code: [Hide] [Select]
'Avatar_required' => 'You must add your avatar to complete the registration.', //Avatar required MOD


OPEN root/includes/settings/settings_users.php

FIND

Code: [Hide] [Select]
'birthday_required' => array(
'lang_key' => 'Birthday_required',
'type' => 'LIST_RADIO',
'default' => 0,
'values' => $this->list_yes_no,
),


AFTER ADD

Code: [Hide] [Select]
// Avatar required MOD
'avatar_required' => array(
'lang_key' => 'Avatar_required',
'type' => 'LIST_RADIO',
'default' => 0,
'values' => $this->list_yes_no,
),
// END Avatar required MOD


Result:


acp_en

design_en

error_en


Download

Best regards.


Joshua203 [ Thu 10 Jan, 2013 20:21 ]
Post subject: Re: [MOD] Avatar Required During Registration
WOW.. good idea!!!


mort [ Fri 11 Jan, 2013 10:48 ]
Post subject: Re: [MOD] Avatar Required During Registration
Heck TopoMotoV3X, I don't know what vitamins you are taking, but sure as He** you've been busy.

But it doesn't need to be a MOD that strict.

For example - No It's not IP/phpBB code - If the user doesn't have a an avatar - It will give them one. And I actually wrote this for something else.

Not only that - It determines the sex also, other than that - They just get a default avatar.

Spoiler: [ Show ]

Maybe someone can take the same approach with IP and turn it into a MOD?

Because when one starts forcing people into doing something specific, that they may not agree with, particularly with file types and file-size limits in place - You're going to get a lot of flak - Or worse - A lot of rubbish avatars.

And seriously no, I'm not hijacking your thread, I'm just giving you an alternative option.


TopoMotoV3X [ Fri 11 Jan, 2013 23:02 ]
Post subject: Re: [MOD] Avatar Required During Registration
I made this mod for a user in the support forum Italian, online, we find people of all kinds, unfortunately there is no way to prevent someone from doing something stupid, either before or after the registration site..


mort [ Sat 12 Jan, 2013 10:16 ]
Post subject: Re: [MOD] Avatar Required During Registration
TopoMotoV3X wrote: [View Post]
unfortunately there is no way to prevent someone from doing something stupid, either before or after the registration site..


That my friend is "The never-ending story"

But how does one make something that's idiot-proof?




Powered by Icy Phoenix