#########################################################################################
## 
## Hack Title:   Add new field to profile 
## Hack Version: 1.2.2 (ex phpbb 2.0.4)
## Author        Acid
##
## Description:  Just a simple way to add a new field to profile. "info" can be
##		 changed to "whatever" of course but be aware of the spelling (e.g.
##		 "INFO", "info", "user_info").
##		 If you want to add more than one field duplicate the following
##		 steps and change "info" to "whatever" (be aware of the spelling).	 
##		 The field "info" is just an example.
##
## Files to edit:	8
##			admin/admin_users.php
##	                language/lang_english/lang_main.php
##              	includes/usercp_viewprofile.php 
##	                includes/usercp_register.php
##      	        includes/usercp_avatar.php 
##              	templates/xxx/admin/user_edit_body.tpl
## 	                templates/xxx/profile_add_body.tpl 
##      	        templates/xxx/profile_view_body.tpl 
##
#########################################################################################
## 
## Installation/Author Notes: 
## First always backup the files/database that you're going to edit. 
## 
## This hacks adds a new column to the 'user' table. 
##
#########################################################################################
##
## Versions:
##
## 1.2.2       - optional part changed
## 1.2.1       - typo in "dropdown guide" fixed
## 1.2.0       - guide re_written
## 1.0.1/1.0.8 - ...
## 1.0         - Release
##
#########################################################################################
#
#-----[ SQL ]-------------------------------------------
#  
# You have to execute the following query via phpmyadmin (change prefix)..

ALTER TABLE phpbb_users ADD user_info VARCHAR(255) AFTER user_interests;

# If youre going to add/change several fields duplicate the above query and 
# change the field name "user_info".
#
#########################################################################################
# 
#-----[ OPEN ]------------------------------------------ 
#  
# language/lang_english/lang_main.php
# 
#-----[ FIND ]---------------------------------------------------
# 
$lang['Interests'] = 'Interests';

# 
#-----[ BELOW ADD ]---------------------------------------------------
# 
$lang['Info'] = 'Info';



# 
#-----[ OPEN ]------------------------------------------ 
#  
# includes/usercp_viewprofile.php
# 
#-----[ FIND ]---------------------------------------------------
# 
	'INTERESTS' => ( $profiledata['user_interests'] ) ? $profiledata['user_interests'] : '&nbsp;',

# 
#-----[ BELOW ADD ]---------------------------------------------------
# 
	'INFO' => ( $profiledata['user_info'] ) ? $profiledata['user_info'] : '&nbsp;',
	'L_INFO' => $lang['Info'],



# 
#-----[ OPEN ]------------------------------------------ 
#  
# includes/usercp_register.php
# 
#-----[ FIND ]---------------------------------------------------
# 
	$strip_var_list = array('username' => 'username', 'email' => 'email', 'icq' => 'icq', 'aim' => 'aim', 'msn' => 'msn', 'yim' => 'yim', 'website' => 'website', 'location' => 'location', 'occupation' => 'occupation', 'interests' => 'interests');

# 
#-----[ IN-LINE FIND ]---------------------------------------------------
# 
'interests'

# 
#-----[ IN-LINE ADD ]---------------------------------------------------
# 
, 'info' => 'info'

# 
#-----[ FIND (2x) ]---------------------------------------------------
# 
		$interests = stripslashes($interests);

# 
#-----[ always BELOW ADD ]---------------------------------------------------
# 
		$info = stripslashes($info);

# 
#-----[ FIND (just a quote) ]---------------------------------------------------
# 
			$sql = "UPDATE " . USERS_TABLE . "

# 
#-----[ IN-LINE FIND ]---------------------------------------------------
# 
$interests) . "'

# 
#-----[ IN-LINE ADD ]---------------------------------------------------
# 
, user_info = '" . str_replace("\'", "''", $info) . "'

# 
#-----[ FIND ]---------------------------------------------------
# 
			$sql = "INSERT INTO " . USERS_TABLE . "

# 
#-----[ IN-LINE FIND ]---------------------------------------------------
# 
user_interests

# 
#-----[ IN-LINE ADD ]---------------------------------------------------
# 
, user_info

# 
#-----[ IN-LINE FIND ]---------------------------------------------------
# 
$interests) . "'

# 
#-----[ IN-LINE ADD ]---------------------------------------------------
# 
, '" . str_replace("\'", "''", $info) . "'

# 
#-----[ FIND ]---------------------------------------------------
# 
	$interests = $userdata['user_interests'];

# 
#-----[ BELOW ADD ]---------------------------------------------------
# 
	$info = $userdata['user_info'];

# 
#-----[ FIND (just a quote) ]---------------------------------------------------
# 
display_avatar_gallery($mode, $avatar_category

# 
#-----[ IN-LINE FIND ]---------------------------------------------------
# 
$interests

# 
#-----[ IN-LINE ADD ]---------------------------------------------------
# 
, $info

# 
#-----[ FIND (just a quote) ]--------------------------
# 
	$template->assign_vars(array(
		.
		.
		.
		.
		'INTERESTS' => $interests,

# 
#-----[ BELOW ADD ]---------------------------------------------------
# 
		'INFO' => $info,
		'L_INFO' => $lang['Info'],



# 
#-----[ OPEN ]------------------------------------------ 
#  
# includes/usercp_avatar.php
# 
#-----[ FIND (just a quote) ]---------------------------------------------------
# 
function display_avatar_gallery($mode, &$category

# 
#-----[ IN-LINE FIND ]---------------------------------------------------
# 
&$interests

# 
#-----[ IN-LINE ADD ]---------------------------------------------------
# 
, &$info

# 
#-----[ FIND (just a quote) ]---------------------------------------------------
# 
$params = array('coppa', 'user_id'

# 
#-----[ IN-LINE FIND ]---------------------------------------------------
# 
'interests'

# 
#-----[ IN-LINE ADD ]---------------------------------------------------
# 
, 'info'



# 
#-----[ OPEN ]------------------------------------------ 
#  
# admin/admin_users.php 
# 
#-----[ FIND ]---------------------------------------------------
# 
		$interests = ( !empty($HTTP_POST_VARS['interests']) ) ? trim(strip_tags( $HTTP_POST_VARS['interests'] ) ) : '';

# 
#-----[ BELOW ADD ]---------------------------------------------------
# 
		$info = ( !empty($HTTP_POST_VARS['info']) ) ? trim(strip_tags( $HTTP_POST_VARS['info'] ) ) : ''; 

# 
#-----[ FIND (2x) ]--------------------------------------------
# 
			$interests = htmlspecialchars(stripslashes($interests));

# 
#-----[ always BELOW ADD ]---------------------------------------------------
# 
			$info = htmlspecialchars(stripslashes($info));

# 
#-----[ FIND (just a quote) ]---------------------------------------------------
# 
			$sql = "UPDATE " . USERS_TABLE . "

# 
#-----[ IN-LINE FIND ]---------------------------------------------------
# 
$interests) . "'

# 
#-----[ IN-LINE ADD ]---------------------------------------------------
# 
, user_info = '" . str_replace("\'", "''", $info) . "'

# 
#-----[ FIND ]---------------------------------------------------
# 
		$interests = htmlspecialchars($this_userdata['user_interests']);

# 
#-----[ BELOW ADD ]---------------------------------------------------
# 
		$info = htmlspecialchars($this_userdata['user_info']);

# 
#-----[ FIND ]---------------------------------------------------
# 
			$s_hidden_fields .= '<input type="hidden" name="interests" value="' . str_replace("\"", "&quot;", $interests) . '" />';

# 
#-----[ BELOW ADD ]---------------------------------------------------
# 
			$s_hidden_fields .= '<input type="hidden" name="info" value="' . str_replace("\"", "&quot;", $info) . '" />'; 

# 
#-----[ FIND ]---------------------------------------------------
# 
			'INTERESTS' => $interests,

# 
#-----[ BELOW ADD ]---------------------------------------------------
# 
			'INFO' => $info, 
			'L_INFO' => $lang['Info'],



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

# 
#-----[ BELOW ADD ]---------------------------------------------------
# 
	<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>



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

# 
#-----[ BELOW ADD ]---------------------------------------------------
# 
		<tr> 
		  <td valign="top" align="right"><span class="gen">{L_INFO}:</span></td>
		  <td> <b><span class="gen">{INFO}</span></b></td>
		</tr>



# 
#-----[ OPEN ]------------------------------------------ 
#  
# templates/xxx/admin/user_edit_body.tpl
# 
#-----[ FIND ]---------------------------------------------------
# 
	<tr> 
	  <td class="row1"><span class="gen">{L_INTERESTS}</span></td>
	  <td class="row2"> 
		<input type="text" name="interests" size="35" maxlength="150" value="{INTERESTS}" />
	  </td>
	</tr>

# 
#-----[ BELOW ADD ]---------------------------------------------------
# 
        <tr> 
          <td class="row1"><span class="gen">{L_INFO}</span></td> 
          <td class="row2"> <input class="post" type="text" name="info" size="35" maxlength="50" value="{INFO}" /> /td> 
         </tr>

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