Ik had eerst Birthdaymods geïnstalleerd, maar ik heb ze intussen weggehaald.
Edit: Ok, ik heb dus intussen een Birthdaymod opnieuw geïnstalleerd, ondertussen heb ik ook elders op dit forum deze oplossing gevonden:
Abbadon schreef:Het is me gelukt en het werkt prima.
Voor diegene die geintereseerd zijn hierbij de [Add-on]
Code: Selecteer alles
################################################################################################################
## [Add-on]: Age display instead of birthdate in (view) profile (by Abbadon - member of http://www.phpbb.nl)
(Voor Leeftijd weergave in plaats van geboorte datum in het profiel)
## [Add-on] for MOD Title: Birthday
## MOD Author: Niels < ncr@db9.dk > (Niels Chr. Rød) http://mods.db9.dk
## MOD Description: This mod will add a birthday field into your
## user's profile and make users age viewable
## to others when viewing posts.
## MOD Version: 1.5.7
## Compatibility: 2.0.6 =>
##
## Installation Level: easy
## Installation Time: 3 Minutes (1mn by EasyMOD of Nuttzy)
## Files To Edit: 2
## usercp_viewprofile.php
## profile_view_body.tpl
#
#-----[ OPEN ]------------------------------------------------
#
includes/usercp_viewprofile.php
#
#-----[ FIND ]------------------------------------------------
#
$user_birthday = realdate($lang['DATE_FORMAT'], $profiledata['user_birthday']);
#
#-----[ AFTER, ADD ]------------------------------------------------
#
$this_year = create_date('Y', time(), $board_config['board_timezone']);
$this_date = create_date('md', time(), $board_config['board_timezone']);
$user_birthdate = realdate('md', $profiledata['user_birthday']);
$user_age = $this_year - realdate ('Y',$profiledata['user_birthday']);
if ($this_date < $user_birthdate)
{
$user_age--;
}
#
#-----[ FIND ]------------------------------------------------
#
'BIRTHDAY' => $user_birthday,
#
#-----[ AFTER, ADD ]------------------------------------------------
#
'AGE' => $user_age,
'L_AGE' => $lang['Age'],
#
#-----[ OPEN ]------------------------------------------------
#
templates/{TEMPLATENAME}/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" class="explaintitle"><span
class="gensmall">{L_AGE}:</span></td>
<td><b><span class="gensmall">{AGE}</span></b></td>
</tr>
#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------------
#
Dat is alles! ;)
That all folks

Dit werkt goed, maar bij dit stukje code:
Code: Selecteer alles
'LOCATION' => ( $profiledata['user_from'] ) ? $profiledata['user_from'] : ' ',
'OCCUPATION' => ( $profiledata['user_occ'] ) ? $profiledata['user_occ'] : ' ',
'INTERESTS' => ( $profiledata['user_interests'] ) ? $profiledata['user_interests'] : ' ',
'BIRTHDAY' => ( $profiledata['user_birthday']!=999999) ?
$poster_birthday=realdate($lang['DATE_FORMAT'],
$profiledata['user_birthday']) : $poster_birthday=$lang['No_birthday_specify'],
'GENDER' => $gender,
'AVATAR_IMG' => $avatar_img,
... moet ik dit doen:
Code: Selecteer alles
#-----[ FIND ]------------------------------------------------
#
$user_birthday = realdate($lang['DATE_FORMAT'], $profiledata['user_birthday']);
#
#-----[ AFTER, ADD ]------------------------------------------------
#
$this_year = create_date('Y', time(), $board_config['board_timezone']);
$this_date = create_date('md', time(), $board_config['board_timezone']);
$user_birthdate = realdate('md', $profiledata['user_birthday']);
$user_age = $this_year - realdate ('Y',$profiledata['user_birthday']);
if ($this_date < $user_birthdate)
{
$user_age--;
}
Dit lukt nog:
Code: Selecteer alles
'LOCATION' => ( $profiledata['user_from'] ) ? $profiledata['user_from'] : ' ',
'OCCUPATION' => ( $profiledata['user_occ'] ) ? $profiledata['user_occ'] : ' ',
'INTERESTS' => ( $profiledata['user_interests'] ) ? $profiledata['user_interests'] : ' ',
'BIRTHDAY' => ( $profiledata['user_birthday']!=999999) ?
$poster_birthday=realdate($lang['DATE_FORMAT'],
$profiledata['user_birthday']) : $poster_birthday=$lang['No_birthday_specify'],
$this_year = create_date('Y', time(), $board_config['board_timezone']),
$this_date = create_date('md', time(), $board_config['board_timezone']),
$user_birthdate = realdate('md', $profiledata['user_birthday']),
$user_age = $this_year - realdate ('Y',$profiledata['user_birthday']),
'GENDER' => $gender,
'AVATAR_IMG' => $avatar_img,
Maar als ik dit - voor de nog niet meetellen van de nog niet-verjaarden dat jaar - toevoeg, loopt het fout:
Foute code:
Code: Selecteer alles
'LOCATION' => ( $profiledata['user_from'] ) ? $profiledata['user_from'] : ' ',
'OCCUPATION' => ( $profiledata['user_occ'] ) ? $profiledata['user_occ'] : ' ',
'INTERESTS' => ( $profiledata['user_interests'] ) ? $profiledata['user_interests'] : ' ',
'BIRTHDAY' => ( $profiledata['user_birthday']!=999999) ?
$poster_birthday=realdate($lang['DATE_FORMAT'],
$profiledata['user_birthday']) : $poster_birthday=$lang['No_birthday_specify'],
$this_year = create_date('Y', time(), $board_config['board_timezone']),
$this_date = create_date('md', time(), $board_config['board_timezone']),
$user_birthdate = realdate('md', $profiledata['user_birthday']),
$user_age = $this_year - realdate ('Y',$profiledata['user_birthday']);
if ($this_date < $user_birthdate)
{
$user_age--;
}
'GENDER' => $gender,
'AVATAR_IMG' => $avatar_img,
Waarschijnlijk ergens een { of } of ; verkeerd gezet, of te veel/te weinig?
Ziet iemand mijn fout?
Dankjewel voor de tijd!