#########################################################################################
## 
## Hack Title:    New field is editable/visible only for certain users
## Author:        Acid
##
## Description:   If you want to set a (new) field editable/visible only for
##		  certain users..
##		  If you want to set several (new) fields that way duplicate
##		  the steps for the tpl files and change "info"
##		  (be aware of the spelling).
##		  The field "info" is just an example.
##
## Files to edit: 2 (4)
##		  includes/usercp_register.php (usercp_viewprofile.php)
##                templates/xxx/profile_add_body.tpl (profile_view_body.tpl)
##
#########################################################################################
## 
## Installation/Author Notes: 
## First always backup the files that you're going to edit. 
## 
#########################################################################################
# 
#-----[ OPEN ]------------------------------------------
#  
# includes/usercp_register.php und/oder usercp_viewprofile.php
# 
#-----[ FIND ]---------------------------------------------------
# 
$template->pparse('body');

# 
#-----[ ADD BEFORE ]---------------------------------------------------
# 
# thats just an example, define whatever you want (example: only for admins)
# $userdata['user_level'] == MOD (only for mods)
# $userdata['user_posts'] >= '10' (only for users with more than 10 posts)

if( $userdata['user_level'] == ADMIN )
{
        $template->assign_block_vars('switch_certain_users', array() );
}



# 
#-----[ OPEN ]------------------------------------------
#  
# templates/xxx/profile_add_body.tpl
# 
#-----[ FIND ]---------------------------------------------------
# 
	<tr> 
	  <td class="row1"><span class="gen">{L_INFO}:</span></td>
	  <td class="row2"> <input type="text" class="post"style="width: 200px"  name="info" size="35" maxlength="150" value="{INFO}" /> </td>
	</tr>

# 
#-----[ REPLACE WITH ]---------------------------------------------------
# 
<!-- BEGIN switch_certain_users -->
	<tr> 
	  <td class="row1"><span class="gen">{L_INFO}:</span></td>
	  <td class="row2"> <input type="text" class="post"style="width: 200px"  name="info" size="35" maxlength="150" value="{INFO}" /> </td>
	</tr>
<!-- END switch_certain_users -->



# 
#-----[ OPEN ]------------------------------------------
#  
# templates/xxx/profile_view_body.tpl
# 
#-----[ FIND ]---------------------------------------------------
# 
		<tr> 
		  <td valign="top" align="right"><span class="gen">{L_INFO}:</span></td>
		  <td> <b><span class="gen">{INFO}</span></b></td>
		</tr>

# 
#-----[ REPLACE WITH ]---------------------------------------------------
# 
<!-- BEGIN switch_certain_users -->
		<tr> 
		  <td valign="top" align="right"><span class="gen">{L_INFO}:</span></td>
		  <td> <b><span class="gen">{INFO}</span></b></td>
		</tr>
<!-- END switch_certain_users -->

#########################################################################################
#########################################################################################
#########################################################################################