[Add-on] User Age into viewprofile

Mod that adds a birthday field to the users profile, theire age are displayed beside the posts, and on there birthday they will have a greeting popup
Forum rules
The content in this forum is dated Dec. 21 2005 and can be used as Archive only. This Forum is LOCKED and READ ONLY !

Postby fjtbeers on Sat 03. Sep, 2005 03:25

For showing the age below the users birthdate.....this code

Code: Select all
#
#-----[ 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" class="explaintitle"><span class="gensmall">{L_BIRTHDAY}:</span></td>
        <td><b><span class="gensmall">{BIRTHDAY}</span></b></td>
      </tr>
#
#-----[ AFTER, ADD ]------------------------------------------------
#
      <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 ]--------------------------------
#


...works fine for me with 1.5.7..... :wink:
fjtbeers
Poster
Poster
 
Posts: 14
Joined: Sat 09. Jul, 2005 09:14

Postby fjtbeers on Sat 03. Sep, 2005 03:25

For showing the age below the users birthdate.....this code

Code: Select all
#
#-----[ 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" class="explaintitle"><span class="gensmall">{L_BIRTHDAY}:</span></td>
        <td><b><span class="gensmall">{BIRTHDAY}</span></b></td>
      </tr>
#
#-----[ AFTER, ADD ]------------------------------------------------
#
      <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 ]--------------------------------
#


...works fine for me with 1.5.7..... :wink:
fjtbeers
Poster
Poster
 
Posts: 14
Joined: Sat 09. Jul, 2005 09:14

Postby fjtbeers on Sat 03. Sep, 2005 03:25

#
#-----[ 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" class="explaintitle"><span class="gensmall">{L_BIRTHDAY}:</span></td>
<td><b><span class="gensmall">{BIRTHDAY}</span></b></td>
</tr>
#
#-----[ AFTER, ADD ]------------------------------------------------
#
<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 ]--------------------------------
#
fjtbeers
Poster
Poster
 
Posts: 14
Joined: Sat 09. Jul, 2005 09:14

Postby fjtbeers on Sat 03. Sep, 2005 03:26

Code: Select all
#
#-----[ 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" class="explaintitle"><span class="gensmall">{L_BIRTHDAY}:</span></td>
        <td><b><span class="gensmall">{BIRTHDAY}</span></b></td>
      </tr>
#
#-----[ AFTER, ADD ]------------------------------------------------
#
      <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 ]--------------------------------
#
fjtbeers
Poster
Poster
 
Posts: 14
Joined: Sat 09. Jul, 2005 09:14

Postby fjtbeers on Sat 03. Sep, 2005 03:26

#
#-----[ 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" class="explaintitle"><span class="gensmall">{L_BIRTHDAY}:</span></td>
<td><b><span class="gensmall">{BIRTHDAY}</span></b></td>
</tr>
#
#-----[ AFTER, ADD ]------------------------------------------------
#
<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 ]--------------------------------
#
fjtbeers
Poster
Poster
 
Posts: 14
Joined: Sat 09. Jul, 2005 09:14

Postby fjtbeers on Sat 03. Sep, 2005 03:30

This problem has a very simple solution, there is just no way i can post it here..... (i tried for about ten times, but keep getting an error, even when i use the bbcode "Code" or "Quote"....) so i just stop trying........

Anyone who is interested can PM me.....
fjtbeers
Poster
Poster
 
Posts: 14
Joined: Sat 09. Jul, 2005 09:14

Postby fjtbeers on Sat 03. Sep, 2005 03:30

This problem has a very simple solution, there is just no way i can post it here..... (i tried for about ten times, but keep getting an error, even when i use the bbcode "Code" or "Quote"....) so i just stop trying........

Anyone who is interested can PM me.....
fjtbeers
Poster
Poster
 
Posts: 14
Joined: Sat 09. Jul, 2005 09:14

Postby fjtbeers on Sat 03. Sep, 2005 11:17

test
fjtbeers
Poster
Poster
 
Posts: 14
Joined: Sat 09. Jul, 2005 09:14

PreviousNext

Return to Birthday [2.0.10/EM]

Who is online

Users browsing this forum: No registered users and 1 guest

cron