Add X to profile - add option

Allgemeiner Support zum phpBB 2 Board und phpBB 2 Modifikationen
Forumsregeln
Auch wenn hier der Support für phpBB 2 weiterhin aufrecht erhalten bleibt, weisen wir darauf hin, dass das phpBB 2 nicht mehr offiziell unterstützt und weiterentwickelt wird!
Antworten
Benutzeravatar
skittles
Beiträge: 820
Registriert: So 04.Apr, 2004 01:07
Wohnort: Wien

Add X to profile - add option

Beitrag von skittles »

ich verzweifle! ich hab alles grad zum 3. mal durchkontrolliert und ich komme nicht drauf wo der Fehler im System ist.
folgendes hab ich im code durchgeführt

Code: Alles auswählen

################################################################################### 
## 
## Hack Titel:   Option (ja/nein) zu Profil hinzufügen
## Hack Version: 1.0 (ab phpBB 2.0.4)
## Autor:        Acid
## Support:	 http://www.phpbbhacks.com/forums oder http://www.phpbb.de/
##
## Beschreibung: Ein einfacher Weg um eine Auswahlmöglichkeit (ja/nein) ins Profil
##		 einzufügen, natürlich kann man "option" mit "wasauchimmer" ersetzen,
##		 sollte dabei auf die verschiedene Schreibweise achten (z.B. "OPTION",
##		 "option", "user_option").
##		 Wenn man mehrere Felder einfügen will, muss man die folgenden
##		 Schritte duplizieren und dabei jeweils "option" ändern (auf
##		 Schreibweise achten).
##		 Wenn man mehrere Auswahlmöglichkeiten anbieten will, kann man den
##		 "Gender" Hack von Niels als Anleitung nehmen.
##		 
##
## 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 eingefügt. 
##
##################################################################################### 
##
## Versionen:
##
## 1.0         - Veröffentlichung
##
##################################################################################### 
#
#-----[ SQL ]-------------------------------------------
#  
# Du solltest den Prefix angleichen.

ALTER TABLE phpbb_users ADD user_navi_on TINYINT(1) default '0' AFTER user_viewemail;

## 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 ]---------------------------------------------------
# 
$lang['Interests'] = 'Interessen';

# 
#-----[ DARUNTER EINFÜGEN ]---------------------------------------------------
# 
$lang['Navi_on'] = 'Linke Portal Spalte anzeigen';



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

# 
#-----[ DARUNTER EINFÜGEN ]---------------------------------------------------
# 
	'NAVI_ON' => ( $profiledata['user_navi_on'] == '0' ) ? $lang['No'] : $lang['Yes'],
	'L_NAVI_ON' => $lang['Navi_on'],



# 
#-----[ ÖFFNEN ]------------------------------------------ 
#  
# includes/usercp_register.php
# 
#-----[ FINDE ]---------------------------------------------------
# 
	$viewemail = ( isset($HTTP_POST_VARS['viewemail']) ) ? ( ($HTTP_POST_VARS['viewemail']) ? TRUE : 0 ) : 0;

# 
#-----[ DARUNTER EINFÜGEN ]---------------------------------------------------
# 
	$navi_on = ( isset($HTTP_POST_VARS['navi_on']) ) ? ( ($HTTP_POST_VARS['navi_on']) ? TRUE : 0 ) : 0;

# 
#-----[ 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_navi_on = $navi_on

# 
#-----[ 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 EINFÜGEN ]---------------------------------------------------
# 
, user_navi_on

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

# 
#-----[ DANACH EINFÜGEN ]---------------------------------------------------
# 
, $navi_on

# 
#-----[ FINDE ]---------------------------------------------------
# 
	$viewemail = $userdata['user_viewemail'];

# 
#-----[ DARUNTER EINFÜGEN ]---------------------------------------------------
# 
	$navi_on = $userdata['user_navi_on'];

# 
#-----[ 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 EINFÜGEN ]---------------------------------------------------
# 
, $user_navi

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

# 
#-----[ DARUNTER EINFÜGEN ]---------------------------------------------------
# 
		'NAVI_ON_YES' => ( $navi_on ) ? 'checked="checked"' : '',
		'NAVI_ON_NO' => ( !$navi_on ) ? 'checked="checked"' : '',



# 
#-----[ Ö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 EINFÜGEN ]---------------------------------------------------
# 
, &$navi_on

# 
#-----[ 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 ]---------------------------------------------------
# 
, 'navi_on'



# 
#-----[ ÖFFNEN ]------------------------------------------ 
#  
# admin/admin_users.php 
# 
#-----[ FINDE ]---------------------------------------------------
# 
		$viewemail = ( isset( $HTTP_POST_VARS['viewemail']) ) ? ( ( $HTTP_POST_VARS['viewemail'] ) ? TRUE : 0 ) : 0;

# 
#-----[ DARUNTER EINFÜGEN ]---------------------------------------------------
# 
		$navi_on = ( isset( $HTTP_POST_VARS['navi_on']) ) ? ( ( $HTTP_POST_VARS['navi_on'] ) ? TRUE : 0 ) : 0;

# 
#-----[ 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 EINFÜGEN ]---------------------------------------------------
# 
, user_navi_on = $navi_on

# 
#-----[ FINDE ]---------------------------------------------------
# 
		$viewemail = $this_userdata['user_viewemail'];

# 
#-----[ DARUNTER EINFÜGEN ]---------------------------------------------------
# 
		$navi_on = $this_userdata['user_navi_on'];

# 
#-----[ FINDE ]---------------------------------------------------
# 
			$s_hidden_fields .= '<input type="hidden" name="viewemail" value="' . $viewemail . '" />';

# 
#-----[ DARUNTER EINFÜGEN ]---------------------------------------------------
# 
			$s_hidden_fields .= '<input type="hidden" name="navi_on" value="' . $navi_on . '" />';

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

# 
#-----[ DARUNTER EINFÜGEN ]---------------------------------------------------
# 
			'NAVI_ON_YES' => ($navi_on) ? 'checked="checked"' : '',
			'NAVI_ON_NO' => (!$navi_on) ? 'checked="checked"' : '',
			'L_NAVI_ON' => $lang['Navi_on'],



# 
#-----[ Ö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 ]---------------------------------------------------
# 
	<tr> 
	  <td class="row1"><span class="gen">{L_NAVI_ON}:</span></td>
	  <td class="row2"> 
		<input type="radio" name="navi_on" value="1" {NAVI_ON_YES} />
		<span class="gen">{L_YES}</span>   
		<input type="radio" name="navi_on" value="0" {NAVI_ON_NO} />
		<span class="gen">{L_NO}</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_NAVI_ON}</span></td>
	  <td class="row2"> 
		<input type="radio" name="navi_on" value="1" {NAVI_ON_YES} />
		<span class="gen">{L_YES}</span>   
		<input type="radio" name="navi_on" value="0" {NAVI_ON_NO} />
		<span class="gen">{L_NO}</span></td>
	</tr>

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

und mein Problem ist, dass wenn ich auf profil klicke und somit auf die profile.php?mode=edit oder so komme, wird der text L_NAVI_ON nicht angezeigt!
wenn ich jedoch im ACP auf benutzer gehe, und es dort versuche wird der text sehr wohl angezeigt!
Obwohl der Code in den Templat Files ident ist
Auch in der admin/user_edit.php und in der includes/usercp_viewprofile.php sind die Passagen in denen das 'L_NAVI_ON' => $lang['Navi_on'], vorkommt ident!
Ich seh mich echt vor lauter navi_on. navi_user_on und so nicht mehr raus!
Wäre super wenn jemand kurz zeit hätte und mir sagen könnte wo hier der Hund begraben liegt!
Ich sitz jetzt echt schon eine ewigkeit an dem Teil! (gestern eingebaut und noch mal kontrolliert und heute noch mal alles durchgegangen)
Was ich nicht versteh ist, dass es im ACP angezeigt wird, bei den Usern aber nicht! das leutet mir nicht ein! :confused:
Zuletzt geändert von skittles am Do 13.Mai, 2004 22:13, insgesamt 1-mal geändert.
Benutzeravatar
oxpus
Administrator
Beiträge: 28735
Registriert: Mo 27.Jan, 2003 22:13
Wohnort: Bad Wildungen
Kontaktdaten:

Beitrag von oxpus »

Dieser Part hier in der usercp_register.php und admin_users.php:

Code: Alles auswählen

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

# 
#-----[ DARUNTER EINFÜGEN ]--------------------------------------------------- 
# 
      'NAVI_ON_YES' => ( $navi_on ) ? 'checked="checked"' : '', 
      'NAVI_ON_NO' => ( !$navi_on ) ? 'checked="checked"' : '', 
Da muss noch danach rein:

Code: Alles auswählen

'L_NAVI_ON' => $lang['Navi_on'];
Ist ein Fehler in der Vorlage...
Karsten Ude
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
Benutzeravatar
skittles
Beiträge: 820
Registriert: So 04.Apr, 2004 01:07
Wohnort: Wien

Beitrag von skittles »

mit

Code: Alles auswählen

'L_NAVI_ON' => $lang['Navi_on'],
hats dann hingehaun!
Besten Dank!
[center]Populanten von transparenten Domizilen sollten
mit fester Materie keine transzendenten Bewegungen durchf?hren.
[/center]


Bild
Benutzeravatar
oxpus
Administrator
Beiträge: 28735
Registriert: Mo 27.Jan, 2003 22:13
Wohnort: Bad Wildungen
Kontaktdaten:

Beitrag von oxpus »

Sag ich doch. Ist eben ein Fehler in der Mod-"Vorlage".
Karsten Ude
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
Antworten