Seite 1 von 1

[Birthday MOD]: Anzeige von Alter statt Datum im Profil

Verfasst: 23.05.2008 09:32
von amadeus0815
[Birthday MOD]: Anzeige von Alter statt Datum im Profil

Hallo zusammen!

Nachdem ich über die Suchfunktion des FORUM nicht das gewünschte Ergebnis erzielt habe hier nun jetzt meine Frage in einem eigenen Thread:

Ich habe in meinem "phpBB2 2.0.22 Board" den "Birthday-MOD" eingebaut und stelle mir nun die Frage wie ich am schnellsten und einfachsten die Anzeige des Geburtsdatums im Profil (SubSilver: "profile_view_body.tpl") durch die Anzeige des aktuelle Alters, genauso wie in den Member-Details links neben jedem Post.

Das genaue Geburtsdatum soll also nicht sofort ersichtlich sein!

Vielen Dank für eure Unterstützung! 8)

Verfasst: 02.06.2008 22:35
von Red-Benz
Hi

Nimm das

Code: Alles auswählen

##############################################################
## MOD Title: User Age in Profiles
## MOD Author: easygo < webmaster@net4seven.de >
## MOD Description: This hack will display only the Age in user profiles.
## MOD Version: 1.07
##
## Note: Birthday MOD by Niels required
##
## Installation Level: easy
## Installation Time: 2-3 minutes
## Files To Edit: 4
##                includes/usercp_viewprofile.php
##                templates/subSilver/profile_view_body.tpl
##                language/lang_english/lang_main.php
##                language/lang_german/lang_main.php
##
##############################################################
## For security purposes, please check: http://www.net4seven.de/
## for the latest version of this MOD. Downloading this MOD from other
## sites could cause malicious code to enter into your forums.
##############################################################
## Before adding this MOD to your forums, you should back up all files related to this MOD.
##############################################################
## MOD History:
##
##	2005-07-14 - Initial Release
##	2005-07-18 - Bugfixing
##
##############################################################

#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_viewprofile.php

#
#-----[ FIND ]------------------------------------------
#
// Start add - Birthday MOD
if ($profiledata['user_birthday']!=999999)
{
	$user_birthday = realdate($lang['DATE_FORMAT'], $profiledata['user_birthday']);
}
else
{
	$user_birthday = $lang['No_birthday_specify'];
}
// End add - Birthday MOD

#
#-----[ REPLACE WITH ]-----------------------------------
#
// Start add - Birthday MOD
if ($profiledata['user_birthday']!=999999)
{
	//$user_birthday = realdate($lang['DATE_FORMAT'], $profiledata['user_birthday']);
	$user_birthdate = realdate('md', $profiledata['user_birthday']);
	$this_year = create_date('Y', time(), $board_config['board_timezone']);
	$this_date = create_date('md', time(), $board_config['board_timezone']);
	$user_age = $this_year - realdate('Y', $profiledata['user_birthday']);
	if ( $this_date < $user_birthdate )
	{
		$user_age--;
	}
}
else
{
	//$user_birthday = $lang['No_birthday_specify'];
	$user_age = '';
}
// End add - Birthday MOD

#
#-----[ FIND ]-------------------------------------------
#
	'BIRTHDAY' => $user_birthday,

#
#-----[ REPLACE WITH ]-----------------------------------
#
	//'BIRTHDAY' => $user_birthday,
	'L_AGE' => $lang['Age'],
	'L_YEARS' => $lang['Years'],
	'USER_AGE' => $user_age,

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/profile_view_body.tpl

#
#-----[ FIND ]------------------------------------------
#
		<tr>
			<td valign="top" align="right" nowrap="nowrap"><span class="gen">{L_BIRTHDAY}:</span></td>
			<td><b><span class="gen">{BIRTHDAY}</span></b></td>
		</tr>

#
#-----[ REPLACE WITH ]-----------------------------------
#
		<tr>
			<td valign="top" align="right" nowrap="nowrap"><span class="gen">{L_AGE}:</span></td>
			<td><b><span class="gen">{USER_AGE}{L_Years}</span></b></td>
		</tr>

#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php

#
#-----[ FIND ]------------------------------------------
#
//
// That's all Folks!

#
#-----[ BEFORE, ADD ]-----------------------------------
#
// mod: User Age in Profile
$lang['Years'] = ' Years';

#
#-----[ OPEN ]------------------------------------------
#
language/lang_german/lang_main.php

#
#-----[ FIND ]------------------------------------------
#
//
// That's all Folks!

#
#-----[ BEFORE, ADD ]-----------------------------------
#
// mod: User Age in Profile
$lang['Years'] = ' Jahre';

#
#-----[ SAVE/CLOSE ALL FILES ]---------------------------------
#
# EoM

Gruß

Red Benz

Verfasst: 03.06.2008 15:37
von amadeus0815
Hi Red-Benz!

Vielen Dank für deine Hilfe! Deine Anleitung funzt einwandfrei. Genau so wollte ich das haben.

Vielleicht kannst du ja auch hier und/oder hier und/oder hier helfen? Das wäre Spitzensahne!!! (Achtung: Thema-Wechsel!)

Vielen Dank! 8)