Seite 1 von 3

Suche Mod der in der"Autorspalt" noch einen Zeile

Verfasst: 19.05.2004 22:23
von longjohnsilva
Hallo ich Suche einen Mod der im Profil und in der Autor-Spalte noch ein Zeile einfügt. Diese kann der User selbst über sein Profil bearbeiten.

Beispiel:
longjohnsilva
Administrator
[Bild]
Anmeldungsdatum: 15.05.2004
Beiträge: 11
Wohnort: XXX
Auto: Honda

Verfasst: 19.05.2004 23:38
von Markocat
Dazu braucht man nicht Unbedingt einen Mod
weiß jetzt auch nicht direkt ob es einen gibt

Ich kann aber erstmal sagen welche Dateien dafür bearbeitet werden müssen.

viewtopic.php
viewtopic_body.tpl
profile_add_body.tpl
profile_view_body.tpl
usercp_viewprofile.php
lang_main.php

mal sehn ob ich nichts vergessen habe

natürlich muss in der Datenbank noch der richtige Eintrag erstellt werden


Ich kann dir ja wenns jetzt keinen Mod oder Anleitung dazu gibt alles nötige zusammensuchen was geändert werden muss und eine Anleitung dazu machen.

Verfasst: 20.05.2004 00:11
von longjohnsilva
Wäre super wenn du mir da weiterhelfen könntest.

Verfasst: 20.05.2004 00:34
von Markocat
Ja kein Problem
ich schreib grade die Modanleitung

Verfasst: 20.05.2004 01:45
von Markocat
Bitte sehr :)
Das new kannst du durch deinen eigenen Namen ersetzen

Code: Alles auswählen

##############################################################
##
## MOD Title: Neues Feld im Profil erstellen
## MOD Author: Markocat <> http://www.dragon-heartz.de
##
## MOD Description:
## Durch die kleine Anleitung kann ein neues Feld im Profil angezeigt werden und 
## Optional auch in der Viewtopic wo der User den Text übers Profil selbst definieren kann.
## MOD Version: 1.00
##
## MOD Installation Level: easy
## MOD testet with phpBB: 2.0.8
## MOD Installation Time: 10 Minutes
##
## Files to edit: 8
## <phpBB2-Forum-Root>/includes/usercp_register.php
## <phpBB2-Forum-Root>/includes/usercp_viewprofile.php
## <phpBB2-Forum-Root>/language/lang_english/lang_main.php
## <phpBB2-Forum-Root>/language/lang_german/lang_main.php
## <phpBB2-Forum-Root>/templates/subSilver/profile_add_body.tpl
## <phpBB2-Forum-Root>/templates/subSilver/profile_view_body.tpl
## <phpBB2-Forum-Root>/viewtopic.php
## <phpBB2-Forum-Root>/templates/subSilver/viewtopic_body.tpl
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up Your Complete Database And All Files Related To This MOD !
##############################################################
##
## INSTALLATION:
##
##############################################################
#
#-----[ SQL ]-------------------------------------------------
#

ALTER TABLE phpbb_users ADD `user_new` varchar(255) default NULL AFTER `user_interests`;

#
#-----[ 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' => 'interests'

#
#-----[ IN-LINE AFTER ADD ]-----------------------------------
#

, 'new' => 'new'

#
#-----[ FIND ]------------------------------------------------
#

validate_optional_fields($icq, $aim, $msn, $yim, $website, $location, $occupation, $interests, $signature);

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

$interests,

#
#-----[ IN-LINE AFTER ADD ]-----------------------------------
#

 $new,

#
#-----[ FIND ]------------------------------------------------
#

$interests = stripslashes($interests);

#
#-----[ AFTER ADD ]-------------------------------------------
#

		$new = stripslashes($new);

#
#-----[ FIND ]------------------------------------------------
#

			$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 = $popup_pm, 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 . "
				WHERE user_id = $user_id";

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

, user_interests = '" . str_replace("\'", "''", $interests) . "'

#
#-----[ IN-LINE AFTER ADD ]-----------------------------------
#

, user_new = '" . str_replace("\'", "''", $new) . "'

#
#-----[ FIND ]------------------------------------------------
#

			$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("\'", "''", $new_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, $popup_pm, $user_timezone, '" . str_replace("\'", "''", $user_dateformat) . "', '" . str_replace("\'", "''", $user_lang) . "', $user_style, 0, 1, ";

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

, user_interests

#
#-----[ IN-LINE AFTER ADD ]-----------------------------------
#

, user_new

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

, '" . str_replace("\'", "''", $interests) . "'

#
#-----[ IN-LINE AFTER ADD ]-----------------------------------
#

, '" . str_replace("\'", "''", $new) . "'

#
#-----[ FIND ]------------------------------------------------
#

'INTERESTS' => $interests,

#
#-----[ AFTER ADD ]-------------------------------------------
#

					'NEW' => $new,

#
#-----[ FIND ]------------------------------------------------
#

$interests = stripslashes($interests);

#
#-----[ AFTER ADD ]-------------------------------------------
#

	$new = stripslashes($new);

#
#-----[ FIND ]------------------------------------------------
#

$interests = $userdata['user_interests'];

#
#-----[ AFTER ADD ]-------------------------------------------
#

	$new = $userdata['user_new'];

#
#-----[ FIND ]------------------------------------------------
#

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, $popup_pm, $notifyreply, $attachsig, $allowhtml, $allowbbcode, $allowsmilies, $allowviewonline, $user_style, $user_lang, $user_timezone, $user_dateformat, $userdata['session_id']);

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

, $interests

#
#-----[ IN-LINE AFTER ADD ]-----------------------------------
#

, $new

#
#-----[ FIND ]------------------------------------------------
#

'INTERESTS' => $interests,

#
#-----[ AFTER ADD ]-------------------------------------------
#

		'NEW' => $new,

#
#-----[ FIND ]------------------------------------------------
#

'L_INTERESTS' => $lang['Interests'],

#
#-----[ AFTER ADD ]-------------------------------------------
#

		'L_NEW' => $lang['New'],

#
#-----[ OPEN ]------------------------------------------------
#

includes/usercp_viewprofile.php

#
#-----[ FIND ]------------------------------------------------
#

'INTERESTS' => ( $profiledata['user_interests'] ) ? $profiledata['user_interests'] : '&nbsp;',

#
#-----[ AFTER ADD ]-------------------------------------------
#

	'NEW' => ( $profiledata['user_new'] ) ? $profiledata['user_new'] : '&nbsp;',

#
#-----[ FIND ]------------------------------------------------
#

'L_INTERESTS' => $lang['Interests'],

#
#-----[ AFTER ADD ]-------------------------------------------
#

	'L_NEW' => $lang['New'],

#
#-----[ OPEN ]------------------------------------------------
#

language/lang_english/lang_main.php

#
#-----[ FIND ]------------------------------------------------
#

$lang['Interests'] = 'Interests';

#
#-----[ AFTER ADD ]-------------------------------------------
#

$lang['New'] = 'New';

#
#-----[ OPEN ]------------------------------------------------
#

language/lang_german/lang_main.php

#
#-----[ FIND ]------------------------------------------------
#

$lang['Interests'] = 'Interessen';

#
#-----[ AFTER ADD ]-------------------------------------------
#

$lang['New'] = 'Neu';

#
#-----[ OPEN ]------------------------------------------------
#

templates/subSilver/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>

#
#-----[ AFTER ADD ]-------------------------------------------
#

	<tr> 
	  <td class="row1"><span class="gen">{L_NEW}:</span></td>
	  <td class="row2"> 
		<input type="text" class="post"style="width: 200px"  name="new" size="35" maxlength="150" value="{NEW}" />
	  </td>
	</tr>

#
#-----[ OPEN ]------------------------------------------------
#

templates/subSilver/profile_view_body.tpl

#
#-----[ FIND ]------------------------------------------------
#

		<tr> 
		  <td valign="top" align="right" nowrap="nowrap"><span class="gen">{L_INTERESTS}:</span></td>
		  <td> <b><span class="gen">{INTERESTS}</span></b></td>
		</tr>

#
#-----[ AFTER ADD ]-------------------------------------------
#

		<tr> 
		  <td valign="top" align="right" nowrap="nowrap"><span class="gen">{L_NEW}:</span></td>
		  <td> <b><span class="gen">{NEW}</span></b></td>
		</tr>


#
#-----[ OPEN ]------------------------------------------------
#
# Optional

Viewtopic.php

#
#-----[ FIND ]------------------------------------------------
#

$sql = "SELECT u.username, u.user_id, u.user_posts, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_avatar, u.user_avatar_type, u.user_allowavatar, u.user_allowsmile, p.*,  pt.post_text, pt.post_subject, pt.bbcode_uid
	FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . POSTS_TEXT_TABLE . " pt
	WHERE p.topic_id = $topic_id

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

, u.user_from

#
#-----[ IN-LINE AFTER ADD ]-----------------------------------
#

, u.user_new

#
#-----[ FIND ]------------------------------------------------
#

$poster_from = ( $postrow[$i]['user_from'] && $postrow[$i]['user_id'] != ANONYMOUS ) ? $lang['Location'] . ': ' . $postrow[$i]['user_from'] : '';

#
#-----[ AFTER ADD ]-------------------------------------------
#

	$poster_new = ( $postrow[$i]['user_new'] && $postrow[$i]['user_id'] != ANONYMOUS ) ? $lang['New'] . ': ' . $postrow[$i]['user_new'] : '';

#
#-----[ FIND ]------------------------------------------------
#

'POSTER_FROM' => $poster_from,

#
#-----[ AFTER ADD ]-------------------------------------------
#

		'POSTER_NEW' => $poster_new,

#
#-----[ OPEN ]------------------------------------------------

templates/subSilver/viewtopic_body.tpl

#
#-----[ FIND ]------------------------------------------------
#

{postrow.POSTER_FROM}

#
#-----[  IN-LINE AFTER ADD ]-----------------------------------
#

{postrow.POSTER_NEW}


##############################################################
#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------------
#
#
Müsste alles so gehen habs auf nen lehren phpBB 2.0.8 selbst getestet :grin:

Verfasst: 21.05.2004 01:48
von longjohnsilva
Super hat geklappt. Danke dir vielmals.

Verfasst: 24.05.2004 13:54
von longjohnsilva
Hallo.

Ich müsste unterhalb des Feldes im Profil noch ein "Explain-Feld" einbaun, so wie es z.b. bei dem Passwort, oder derSignatur gelöst ist.

Wie kann ich das bewerkstelligen?

Verfasst: 25.05.2004 13:27
von longjohnsilva
up

Verfasst: 25.05.2004 13:58
von Markocat
Hallo,

versuch mal folgendes
das new wieder durch deinen Namen ersetzen

öffne includes/usercp_register.php

such nach

Code: Alles auswählen

      'L_NEW' => $lang['New'],
füge danach ein

Code: Alles auswählen

		'L_NEW_EXPLAIN' => $lang['New_explain'],
öffne language/lang_german/lang_main.php
language/lang_englisch/lang_main.php

suche nach

Code: Alles auswählen

$lang['New']
füge danach ein

Code: Alles auswählen

$lang['New_explain'] = 'Hier dein Text'
öffne templates/subSilver/profile_add_body.tpl

suche nach

Code: Alles auswählen

   <tr> 
     <td class="row1"><span class="gen">{L_NEW}:</span></td> 
     <td class="row2"> 
      <input type="text" class="post"style="width: 200px"  name="new" size="35" maxlength="150" value="{NEW}" /> 
     </td> 
   </tr>
ersetze mit

Code: Alles auswählen

	<tr> 
	  <td class="row1"><span class="gen">{L_NEW}: </span><br />
		<span class="gensmall">{L_NEW_EXPLAIN}</span></td>
	  <td class="row2"> 
		<input type="text" class="post" style="width: 200px" name="new" size="35" maxlength="150" value="{NEW}" />
	  </td>
versuch mal obs so geht

Verfasst: 25.05.2004 15:29
von longjohnsilva
Perfekt danke...