hmm, ich weiss net, wahrscheinlich nicht, denn im Mod musste ich die viewtopic.php nicht ändern.
Code: Alles auswählen
###################################################################################
##
## Hack Titel: Neues Feld in Profil einfügen (BBcode, Smilees, HTML Nutzung möglich)
## Hack Version: 1.0.1 (ab phpBB 2.0.4)
## Author Acid
## Support: http://www.phpbbhacks.com/forums oder http://www.phpbb.de/
##
## Beschreibung: Ein einfacher Weg um ein neues Feld ins Profil einzufügen,
## natürlich kann man "infos" mit "wasauchimmer" ersetzen, sollte
## dabei auf die verschiedene Schreibweise achten (z.B. "INFOS",
## "infos", "user_infos").
## Wenn man mehrere Felder einfügen will, muss man die folgenden
## Schritte duplizieren und dabei jeweils "infos" ändern (auf
## Schreibweise achten).
## Es werden HTML, BBcode und Smilees unterstützt.
##
## 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 werden zwei neue Felder in die 'users' Tabelle eingefügt.
##
###################################################################################
##
## Versionen:
##
## v1.0.1
## - HTML-Status in profile_add_body.tpl/user_edit_body.tpl hinzugefügt
## - BBcode wird nun im Adminbereich korrekt dargestellt
## v1.0.0
## - Veröffentlichung
##
##########################################################################################
#
#-----[ SQL ]-------------------------------------------
#
# Du solltest den Prefix angleichen.
ALTER TABLE phpbb_users ADD user_infos TEXT;
ALTER TABLE phpbb_users ADD user_infos_bbcode_uid VARCHAR (255);
## alternativ kannst Du auch die table_update.php benutzen, um die Datenbank
## anzugleichen (einfach hochladen und ausführen).
#
#-----[ ÖFFNEN ]------------------------------------------
#
# language/lang_german/lang_main.php
#
#-----[ FINDE (nur ein Auszug) ]---------------------------------------------------
#
$lang['Signature_explain'] = '
#
#-----[ DARUNTER EINFÜGEN ]---------------------------------------------------
#
$lang['Infos'] = 'Infos';
$lang['Infos_explain'] = 'Der eingetragene Text wird in deinem Profil angezeigt.';
#
#-----[ ÖFFNEN ]------------------------------------------
#
# includes/usercp_viewprofile.php
#
#-----[ FINDE ]---------------------------------------------------
#
$page_title = $lang['Viewing_profile'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
#
#-----[ DARUNTER EINFÜGEN ]---------------------------------------------------
#
include_once($phpbb_root_path . 'includes/bbcode.'.$phpEx);
$infos = ( $profiledata['user_infos'] != '' ) ? $profiledata['user_infos'] : '';
$infos_bbcode_uid = $profiledata['user_infos_bbcode_uid'];
if ( $board_config['allow_bbcode'] )
{
if ( $infos != '' && $infos_bbcode_uid != '' )
{
$infos = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($infos, $infos_bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $infos);
}
}
if ( $infos != '' )
{
$infos = make_clickable($infos);
}
if ( $board_config['allow_smilies'] )
{
if ( $profiledata['user_allowsmile'] && $infos != '' )
{
$infos = smilies_pass($infos);
}
}
if ( $infos != '' )
{
$infos = str_replace("\n", "\n<br />\n", $infos);
}
#
#-----[ FINDE ]---------------------------------------------------
#
'INTERESTS' => ( $profiledata['user_interests'] ) ? $profiledata['user_interests'] : ' ',
#
#-----[ DARUNTER EINFÜGEN ]---------------------------------------------------
#
'INFOS' => $infos,
#
#-----[ FINDE ]---------------------------------------------------
#
'L_INTERESTS' => $lang['Interests'],
#
#-----[ DARUNTER EINFÜGEN ]---------------------------------------------------
#
'L_INFOS' => $lang['Infos'],
#
#-----[ ÖFFNEN ]------------------------------------------
#
# includes/usercp_register.php
#
#-----[ FINDE (2x) ]---------------------------------------------------
#
$interests = stripslashes($interests);
#
#-----[ DARUNTER EINFÜGEN (2x) ]---------------------------------------------------
#
$infos = stripslashes($infos);
#
#-----[ FINDE ]---------------------------------------------------
#
$signature = prepare_message($signature, $allowhtml, $allowbbcode, $allowsmilies, $signature_bbcode_uid);
}
#
#-----[ DARUNTER EINFÜGEN ]---------------------------------------------------
#
if ( $infos != '' )
{
if ( $infos_bbcode_uid == '' )
{
$infos_bbcode_uid = ( $allowbbcode ) ? make_bbcode_uid() : '';
}
$infos = prepare_message($infos, $allowhtml, $allowbbcode, $allowsmilies, $infos_bbcode_uid);
}
#
#-----[ 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 EINFÜGEN ]---------------------------------------------------
#
, user_infos = '" . str_replace("\'", "''", $infos) . "', user_infos_bbcode_uid = '$infos_bbcode_uid'
#
#-----[ FINDE ]---------------------------------------------------
#
$interests = $userdata['user_interests'];
#
#-----[ DARUNTER EINFÜGEN ]---------------------------------------------------
#
$infos_bbcode_uid = $userdata['user_infos_bbcode_uid'];
$infos = ( $infos_bbcode_uid != '' ) ? preg_replace("/:(([a-z0-9]+:)?)$infos_bbcode_uid\]/si", ']', $userdata['user_infos']) : $userdata['user_infos'];
#
#-----[ FINDE ]---------------------------------------------------
#
display_avatar_gallery($mode, $avatar_category, $user_id, $email, $current_email, $coppa, $username, $email, $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);
#
#-----[ FINDE in dieser Zeile ]---------------------------------------------------
#
$user_dateformat
#
#-----[ DANACH EINFÜGEN ]---------------------------------------------------
#
, $infos
#
#-----[ FINDE (nur ein Auszug) ]--------------------------
#
$template->assign_vars(array(
.
.
.
.
'INTERESTS' => $interests,
#
#-----[ DARUNTER EINFÜGEN ]---------------------------------------------------
#
'INFOS' => str_replace('<br />', "\n", $infos),
'L_INFOS' => $lang['Infos'],
'L_INFOS_EXPLAIN' => $lang['Infos_explain'],
#
#-----[ ÖFFNEN ]------------------------------------------
#
# includes/usercp_avatar.php
#
#-----[ FINDE ]---------------------------------------------------
#
function display_avatar_gallery($mode, &$category, &$user_id, &$email, &$current_email, &$coppa, &$username, &$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 EINFÜGEN ]---------------------------------------------------
#
, &$infos
#
#-----[ 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 EINFÜGEN ]---------------------------------------------------
#
, 'infos'
#
#-----[ ÖFFNEN ]------------------------------------------
#
# admin/admin_users.php
#
#-----[ FINDE ]---------------------------------------------------
#
$interests = ( !empty($HTTP_POST_VARS['interests']) ) ? trim(strip_tags( $HTTP_POST_VARS['interests'] ) ) : '';
#
#-----[ DARUNTER EINFÜGEN ]---------------------------------------------------
#
$infos = ( !empty($HTTP_POST_VARS['infos']) ) ? trim(str_replace('<br />', "\n", $HTTP_POST_VARS['infos'] ) ) : '';
#
#-----[ FINDE (2x) ]---------------------------------------------------
#
$interests = htmlspecialchars(stripslashes($interests));
#
#-----[ DARUNTER EINFÜGEN (2x) ]---------------------------------------------------
#
$infos = htmlspecialchars(stripslashes($infos));
#
#-----[ FINDE ]---------------------------------------------------
#
//
// Avatar stuff
//
#
#-----[ DAVOR EINFÜGEN ]---------------------------------------------------
#
if( $infos != "" )
{
if ( $infos_bbcode_uid == '' )
{
$infos_bbcode_uid = ( $allowbbcode ) ? make_bbcode_uid() : '';
}
$infos = prepare_message($infos, $allowhtml, $allowbbcode, $allowsmilies, $infos_bbcode_uid);
}
#
#-----[ 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 EINFÜGEN ]---------------------------------------------------
#
, user_infos = '" . str_replace("\'", "''", $infos) . "', user_infos_bbcode_uid = '$infos_bbcode_uid'
#
#-----[ FINDE ]---------------------------------------------------
#
$interests = htmlspecialchars($this_userdata['user_interests']);
#
#-----[ DARUNTER EINFÜGEN ]---------------------------------------------------
#
$infos = ($this_userdata['user_infos_bbcode_uid'] != '') ? preg_replace('#:' . $this_userdata['user_infos_bbcode_uid'] . '#si', '', $this_userdata['user_infos']) : $this_userdata['user_infos'];
$infos = preg_replace($html_entities_match, $html_entities_replace, $infos);
#
#-----[ FINDE ]---------------------------------------------------
#
$s_hidden_fields .= '<input type="hidden" name="interests" value="' . str_replace("\"", """, $interests) . '" />';
#
#-----[ DARUNTER EINFÜGEN ]---------------------------------------------------
#
$s_hidden_fields .= '<input type="hidden" name="infos" value="' . str_replace("\"", """, $infos) . '" />';
#
#-----[ FINDE ]---------------------------------------------------
#
'INTERESTS' => $interests,
#
#-----[ DARUNTER EINFÜGEN ]---------------------------------------------------
#
'INFOS' => str_replace('<br />', "\n", $infos),
'L_INFOS' => $lang['Infos'],
'L_INFOS_EXPLAIN' => $lang['Infos_explain'],
#
#-----[ Ö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 EINFÜGEN ]---------------------------------------------------
#
<!-- BEGIN switch_edit_profile -->
<tr>
<td class="row1"><span class="gen">{L_INFOS}:</span><span class="gensmall"><br />{L_INFOS_EXPLAIN}<br /><br />{HTML_STATUS}<br />{BBCODE_STATUS}<br />{SMILIES_STATUS}</span></td>
<td class="row2">
<textarea name="infos"style="width: 300px" rows="6" cols="30" class="post">{INFOS}</textarea>
</td>
</tr>
<!-- END switch_edit_profile -->
#
#-----[ ÖFFNEN ]------------------------------------------
#
# templates/xxx/profile_view_body.tpl
#
#-----[ FINDE ]---------------------------------------------------
#
//--></script><noscript>{ICQ_IMG}</noscript></td>
</tr>
</table>
</td>
</tr>
#
#-----[ DARUNTER EINFÜGEN ]---------------------------------------------------
#
<tr>
<td colspan="2" class="catLeft" align="center" height="28"><b><span class="gen">{L_INFOS} </span></b></td>
</tr>
<tr>
<td colspan="2" class="row1"><span class="genmed">{INFOS}</span></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 EINFÜGEN ]---------------------------------------------------
#
<tr>
<td class="row1"><span class="gen">{L_INFOS}:</span><span class="gensmall"><br />{L_INFOS_EXPLAIN}<br /><br />{HTML_STATUS}<br />{BBCODE_STATUS}<br />{SMILIES_STATUS}</span></td>
<td class="row2"> <textarea class="post" name="infos"style="width: 300px" rows="6" cols="30">{INFOS}</textarea> </td>
</tr>
#############################################################################################################################################################################################
#############################################################################################################################################################################################
#############################################################################################################################################################################################