[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 Sun 04. Sep, 2005 00:10

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

Postby fjtbeers on Mon 05. Sep, 2005 00:41

AnaRQy wrote:Is there a way to do this without the chinese zodiac info? I don't have that mod installed, so I'm pretty sure making this change to my forums would cause errors.

How can "age" be added to viewprofile without taking zodiac or chinese zodiac into account?


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 ]--------------------------------
#



Remember to apply the template part to every template/style your using...

;-)
fjtbeers
Poster
Poster
 
Posts: 14
Joined: Sat 09. Jul, 2005 09:14

Birthday v.1.5.7

Postby sersib on Fri 16. Sep, 2005 13:16

Bonjour,
J'aimerais savoir simplement et en francais svp :cry: , comment afficher l'age sur un profil a la place de la date d'anniverssaire...
J'ai parcouru une grande partie de ce post, mais clairement, les modifs sont ???
Merci bcp d'avance...
sersib
Poster
Poster
 
Posts: 1
Joined: Fri 16. Sep, 2005 13:04

Postby galixte on Tue 01. Nov, 2005 23:33

User avatar
galixte
Poster
Poster
 
Posts: 16
Joined: Tue 27. Apr, 2004 15:14
Location: France

Previous

Return to Birthday [2.0.10/EM]

Who is online

Users browsing this forum: No registered users and 1 guest

cron