################################################################################### 
## 
## Hack Titel:   Neues Feld in Profil einfgen
## Hack Version: 1.2.1 (ab phpBB 2.0.4)
## Autor:        Acid
## Support:	 http://www.phpbbhacks.com/forums oder http://www.phpbb.de/
##
## Beschreibung: Ein einfacher Weg um ein neues Feld ins Profil einzufgen,
##		 natrlich kann man "music" mit "wasauchimmer" ersetzen, sollte
##		 dabei auf die verschiedene Schreibweise achten (z.B. "MUSIC",
##		 "music", "user_music").
##		 Wenn man mehrere Felder einfgen will, muss man die folgenden
##		 Schritte duplizieren und dabei jeweils "music" ndern (auf
##		 Schreibweise achten).
##		 
##
## Dateien zu ndern:     8
##	                  admin/admin_users.php
##      	          language/lang_german/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 
##
################################################################################### 
##
## Installationsnotiz: 
## Vor jeglichen nderungen an Dateien oder Datenbank, solltest Du diese vorher
## sichern.
## 
## Mit diesem Hack wird ein neues Feld in die 'users' Tabelle eingefgt. 
##
##################################################################################### 
##
## Versionen:
##
## 1.2.1       - Schreibfehler in "Dropdown Anleitung" behoben
## 1.2.0       - Anleitung berarbeitet
## 1.0.1/1.0.8 - ...
## 1.0         - Verffentlichung
##
##################################################################################### 
#
#-----[ SQL ]-------------------------------------------
#  
# Du solltest den Prefix angleichen.

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

## alternativ kannst Du auch die table_update.php benutzen, um die Datenbank
## anzugleichen (einfach hochladen und ausfhren).
##
################################################################################### 
# 
#-----[ FFNEN ]------------------------------------------ 
#  
# language/lang_german/lang_main.php
# 
#-----[ FINDE ]---------------------------------------------------
# 
$lang['Interests'] = 'Interessen';

# 
#-----[ DARUNTER EINFGEN ]---------------------------------------------------
# 
$lang['Music'] = 'Musik';



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

# 
#-----[ DARUNTER EINFGEN ]---------------------------------------------------
# 
	'MUSIC' => ( $profiledata['user_music'] ) ? $profiledata['user_music'] : '&nbsp;',
	'L_MUSIC' => $lang['Music'],



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

# 
#-----[ FINDE in dieser Zeile ]---------------------------------------------------
# 
'interests'

# 
#-----[ DANACH EINFGEN ]---------------------------------------------------
# 
, 'music' => 'music'

# 
#-----[ FINDE ]---------------------------------------------------
# 
	validate_optional_fields($icq, $aim, $msn, $yim, $website, $location, $occupation, $interests, $signature);

# 
#-----[ FINDE in dieser Zeile ]---------------------------------------------------
# 
$interests

# 
#-----[ DANACH EINFGEN ]---------------------------------------------------
# 
, $music

# 
#-----[ FINDE (1. Vorkommen) ]---------------------------------------------------
# 
		$interests = stripslashes($interests);

# 
#-----[ DARUNTER EINFGEN ]---------------------------------------------------
# 
		$music = stripslashes($music);

# 
#-----[ FINDE ]---------------------------------------------------
# 
			$sql = "UPDATE " . USERS_TABLE . "
				SET " . $username_sql . $passwd_sql . "user_email = '" . str_replace("\'", "''", $email) ."', user_icq = '" . str_replace("\'", "''", $icq) . "', user_website = '" . str_replace("\'", "''", $website) . "', user_occ = '" . str_replace("\'", "''", $occupation) . "', user_from = '" . str_replace("\'", "''", $location) . "', user_interests = '" . str_replace("\'", "''", $interests) . "', user_sig = '" . str_replace("\'", "''", $signature) . "', user_sig_bbcode_uid = '$signature_bbcode_uid', user_viewemail = $viewemail, user_aim = '" . str_replace("\'", "''", str_replace(' ', '+', $aim)) . "', user_yim = '" . str_replace("\'", "''", $yim) . "', user_msnm = '" . str_replace("\'", "''", $msn) . "', user_attachsig = $attachsig, user_allowsmile = $allowsmilies, user_allowhtml = $allowhtml, user_allowbbcode = $allowbbcode, user_allow_viewonline = $allowviewonline, user_notify = $notifyreply, user_notify_pm = $notifypm, user_popup_pm = $popuppm, user_timezone = $user_timezone, user_dateformat = '" . str_replace("\'", "''", $user_dateformat) . "', user_lang = '" . str_replace("\'", "''", $user_lang) . "', user_style = $user_style, user_active = $user_active, user_actkey = '" . str_replace("\'", "''", $user_actkey) . "'" . $avatar_sql . "

# 
#-----[ FINDE in dieser Zeile ]---------------------------------------------------
# 
$interests) . "'

# 
#-----[ DANACH EINFGEN ]---------------------------------------------------
# 
, user_music = '" . str_replace("\'", "''", $music) . "'

# 
#-----[ FINDE ]---------------------------------------------------
# 
			$sql = "INSERT INTO " . USERS_TABLE . "	(user_id, username, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_sig_bbcode_uid, user_avatar, user_avatar_type, user_viewemail, user_aim, user_yim, user_msnm, user_attachsig, user_allowsmile, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_popup_pm, user_timezone, user_dateformat, user_lang, user_style, user_level, user_allow_pm, user_active, user_actkey)
				VALUES ($user_id, '" . str_replace("\'", "''", $username) . "', " . time() . ", '" . str_replace("\'", "''", $password) . "', '" . str_replace("\'", "''", $email) . "', '" . str_replace("\'", "''", $icq) . "', '" . str_replace("\'", "''", $website) . "', '" . str_replace("\'", "''", $occupation) . "', '" . str_replace("\'", "''", $location) . "', '" . str_replace("\'", "''", $interests) . "', '" . str_replace("\'", "''", $signature) . "', '$signature_bbcode_uid', $avatar_sql, $viewemail, '" . str_replace("\'", "''", str_replace(' ', '+', $aim)) . "', '" . str_replace("\'", "''", $yim) . "', '" . str_replace("\'", "''", $msn) . "', $attachsig, $allowsmilies, $allowhtml, $allowbbcode, $allowviewonline, $notifyreply, $notifypm, $popuppm, $user_timezone, '" . str_replace("\'", "''", $user_dateformat) . "', '" . str_replace("\'", "''", $user_lang) . "', $user_style, 0, 1, ";

# 
#-----[ FINDE in dieser Zeile ]---------------------------------------------------
# 
user_interests

# 
#-----[ DANACH EINFGEN ]---------------------------------------------------
# 
, user_music

# 
#-----[ FINDE in dieser Zeile ]---------------------------------------------------
# 
$interests) . "'

# 
#-----[ DANACH EINFGEN ]---------------------------------------------------
# 
, '" . str_replace("\'", "''", $music) . "'

# 
#-----[ FINDE (2. Vorkommen) ]---------------------------------------------------
# 
	$interests = stripslashes($interests);

# 
#-----[ DARUNTER EINFGEN ]---------------------------------------------------
# 
	$music = stripslashes($music);

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

# 
#-----[ DARUNTER EINFGEN ]---------------------------------------------------
# 
	$music = $userdata['user_music'];

# 
#-----[ FINDE ]---------------------------------------------------
# 
display_avatar_gallery($mode, $avatar_category, $user_id, $email, $current_email, $coppa, $username, $email, &$new_password, &$cur_password, $password_confirm, $icq, $aim, $msn, $yim, $website, $location, $occupation, $interests, $signature, $viewemail, $notifypm, $popuppm, $notifyreply, $attachsig, $allowhtml, $allowbbcode, $allowsmilies, $allowviewonline, $user_style, $user_lang, $user_timezone, $user_dateformat, $userdata['session_id']);

# 
#-----[ FINDE in dieser Zeile ]---------------------------------------------------
# 
$user_dateformat

# 
#-----[ DANACH EINFGEN ]---------------------------------------------------
# 
, $music

# 
#-----[ FINDE (nur ein Auszug) ]--------------------------
# 
	$template->assign_vars(array(
		.
		.
		.
		.
		'INTERESTS' => $interests,

# 
#-----[ DARUNTER EINFGEN ]---------------------------------------------------
# 
		'MUSIC' => $music,
		'L_MUSIC' => $lang['Music'],



# 
#-----[ FFNEN ]------------------------------------------ 
#  
# includes/usercp_avatar.php
# 
#-----[ FINDE ]---------------------------------------------------
# 
function display_avatar_gallery($mode, &$category, &$user_id, &$email, &$current_email, &$coppa, &$username, &$email, &$new_password, &$cur_password, &$password_confirm, &$icq, &$aim, &$msn, &$yim, &$website, &$location, &$occupation, &$interests, &$signature, &$viewemail, &$notifypm, &$popuppm, &$notifyreply, &$attachsig, &$allowhtml, &$allowbbcode, &$allowsmilies, &$hideonline, &$style, &$language, &$timezone, &$dateformat, &$session_id)

# 
#-----[ FINDE in dieser Zeile ]---------------------------------------------------
# 
&$dateformat

# 
#-----[ DANACH EINFGEN ]---------------------------------------------------
# 
, &$music

# 
#-----[ FINDE ]---------------------------------------------------
# 
$params = array('coppa', 'user_id', 'username', 'email', 'current_email', 'icq', 'aim', 'msn', 'yim', 'website', 'location', 'occupation', 'interests', 'signature', 'viewemail', 'notifypm', 'popuppm', 'notifyreply', 'attachsig', 'allowhtml', 'allowbbcode', 'allowsmilies', 'hideonline', 'style', 'language', 'timezone', 'dateformat'); 

# 
#-----[ FINDE in dieser Zeile ]---------------------------------------------------
# 
'dateformat'

# 
#-----[ DANACH EINFGEN ]---------------------------------------------------
# 
, 'music'



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

# 
#-----[ DARUNTER EINFGEN ]---------------------------------------------------
# 
		$music = ( !empty($HTTP_POST_VARS['music']) ) ? trim(strip_tags( $HTTP_POST_VARS['music'] ) ) : ''; 

# 
#-----[ FINDE ]---------------------------------------------------
# 
validate_optional_fields($icq, $aim, $msn, $yim, $website, $location, $occupation, $interests, $signature); 

# 
#-----[ FINDE in dieser Zeile ]---------------------------------------------------
# 
$interests

# 
#-----[ DANACH EINFGEN ]---------------------------------------------------
# 
, $music

# 
#-----[ FINDE (1. Vorkommen) ]-------------------------------------------
# 
			$interests = htmlspecialchars(stripslashes($interests));

# 
#-----[ DANACH EINFUEGEN ]---------------------------------------------------
# 
			$music = htmlspecialchars(stripslashes($music));

# 
#-----[ FINDE ]---------------------------------------------------
# 
			$sql = "UPDATE " . USERS_TABLE . "
				SET " . $username_sql . $passwd_sql . "user_email = '" . str_replace("\'", "''", $email) . "', user_icq = '" . str_replace("\'", "''", $icq) . "', user_website = '" . str_replace("\'", "''", $website) . "', user_occ = '" . str_replace("\'", "''", $occupation) . "', user_from = '" . str_replace("\'", "''", $location) . "', user_interests = '" . str_replace("\'", "''", $interests) . "', user_sig = '" . str_replace("\'", "''", $signature) . "', user_viewemail = $viewemail, user_aim = '" . str_replace("\'", "''", $aim) . "', user_yim = '" . str_replace("\'", "''", $yim) . "', user_msnm = '" . str_replace("\'", "''", $msn) . "', user_attachsig = $attachsig, user_sig_bbcode_uid = '$signature_bbcode_uid', user_allowsmile = $allowsmilies, user_allowhtml = $allowhtml, user_allowavatar = $user_allowavatar, user_allowbbcode = $allowbbcode, user_allow_viewonline = $allowviewonline, user_notify = $notifyreply, user_allow_pm = $user_allowpm, user_notify_pm = $notifypm, user_popup_pm = $popuppm, user_lang = '" . str_replace("\'", "''", $user_lang) . "', user_style = $user_style, user_timezone = $user_timezone, user_dateformat = '" . str_replace("\'", "''", $user_dateformat) . "', user_active = $user_status, user_rank = $user_rank" . $avatar_sql . "

# 
#-----[ FINDE in dieser Zeile ]---------------------------------------------------
# 
$interests) . "'

# 
#-----[ DANACH EINFUEGEN ]---------------------------------------------------
# 
, user_music = '" . str_replace("\'", "''", $music) . "'

# 
#-----[ FINDE (2. Vorkommen) ]---------------------------------------------
# 
			$interests = htmlspecialchars(stripslashes($interests));

# 
#-----[ DARUNTER EINFGEN ]---------------------------------------------------
# 
			$music = htmlspecialchars(stripslashes($music));

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

# 
#-----[ DARUNTER EINFGEN ]---------------------------------------------------
# 
		$music = htmlspecialchars($this_userdata['user_music']);

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

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

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

# 
#-----[ DARUNTER EINFGEN ]---------------------------------------------------
# 
			'MUSIC' => $music, 
			'L_MUSIC' => $lang['Music'],



# 
#-----[ FFNEN ]------------------------------------------ 
#  
# templates/xxx/profile_add_body.tpl
# 
#-----[ FINDE ]---------------------------------------------------
# 
	<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>

# 
#-----[ DARUNTER EINFGEN ]---------------------------------------------------
# 
	<tr> 
	  <td class="row1"><span class="gen">{L_MUSIC}:</span></td>
	  <td class="row2"> <input type="text" class="post"style="width: 200px"  name="music" size="35" maxlength="150" value="{MUSIC}" /> </td>
	</tr>



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

# 
#-----[ DARUNTER EINFGEN ]---------------------------------------------------
# 
		<tr> 
		  <td valign="top" align="right"><span class="gen">{L_MUSIC}:</span></td>
		  <td> <b><span class="gen">{MUSIC}</span></b></td>
		</tr>



# 
#-----[ FFNEN ]------------------------------------------ 
#  
# templates/xxx/admin/user_edit_body.tpl
# 
#-----[ FINDE ]---------------------------------------------------
# 
	<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>

# 
#-----[ DARUNTER EINFGEN ]---------------------------------------------------
# 
        <tr> 
          <td class="row1"><span class="gen">{L_MUSIC}</span></td> 
          <td class="row2"> <input class="post" type="text" name="music" size="35" maxlength="50" value="{MUSIC}" /> /td> 
         </tr>

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