Icy Phoenix

     
 


Post new topic  Reply to topic 
Page 1 of 1
 
 
Reply with quote Download Post 
Post [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: [Download] [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: [Download] [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: [Download] [Hide] [Select]
}

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

?>


BEFORE ADD

Code: [Download] [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: [Download] [Hide] [Select]
              <input type="radio" name="gender" value="2" {GENDER_FEMALE_CHECKED} />
        <span class="gen">{L_GENDER_FEMALE}</span>
    </td>


AFTER ADD

Code: [Download] [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: [Download] [Hide] [Select]
'Default_avatar' => 'Set a default avatar',


AFTER ADD

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


OPEN root/language/lang_english/lang_main.php

FIND

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


AFTER ADD

Code: [Download] [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: [Download] [Hide] [Select]
    'birthday_required' => array(
        'lang_key' => 'Birthday_required',
        'type' => 'LIST_RADIO',
        'default' => 0,
        'values' => $this->list_yes_no,
    ),


AFTER ADD

Code: [Download] [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.
 




____________
IP Version: 1.3.0.53b
Server: Linux
 
TopoMotoV3XSend private messageVisit poster's website  
Back to topPage bottom
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.

Support us
 
Reply with quote Download Post 
Post Re: [MOD] Avatar Required During Registration 
 
WOW.. good idea!!!  
 




____________
www.DutchaGoGo.com (development/under construction ...Forever?¿?)
 
Joshua203Send private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post 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.  
 



 
mortSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post 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..  
 




____________
IP Version: 1.3.0.53b
Server: Linux
 
TopoMotoV3XSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post 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?  
 



 
mortSend private message  
Back to topPage bottom
Post new topic  Reply to topic  Page 1 of 1
 


Display posts from previous:    

HideWas this topic useful?

Link this topic
URL
BBCode
HTML




 
Permissions List
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events


  

 

  cron