MyBB Community Forums

Full Version: Showing "Birth Month/Birth Year" on header
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hello
I want to show "birth month" and "birth year" of members on header_welcomeblock_member.
I know I must take the month and year from member's profile. But I don't know how to do that.

How can I do that?
Thanks in advance.

This is the example:

[attachment=5272]
hello

open ./global.php

Find
eval("\$welcomeblock = \"".$templates->get("header_welcomeblock_member")."\";");
Above it add
if($mybb->user['birthday'] != '')
	{
		$birthday = "Birthday: ".$mybb->user['birthday'];
	}

Now in header_welcomeblock_member template add
{$birthday}

in an apropriate place you find.

regards
zaher1988 Wrote:hello

open ./global.php

Find
eval("\$welcomeblock = \"".$templates->get("header_welcomeblock_member")."\";");
Above it add
if($mybb->user['birthday'] != '')
	{
		$birthday = "Birthday: ".$mybb->user['birthday'];
	}

Now in header_welcomeblock_member template add
{$birthday}

in an apropriate place you find.

regards

Thanks but that's not I want.
This shows the full birthday (DAY MONTH YEAR).

I want to show birth month and birth year SEPARATELY. (I gave a screenshot in my first post)

Can you do this please?
Sure..

Alright so instead of

if($mybb->user['birthday'] != '')
    {
        $birthday = "Birthday: ".$mybb->user['birthday'];
    } 

use
if($mybb->user['birthday'] != '')
	{
		$birthday = explode("-",$mybb->user['birthday']);	
		$year = "Year: ".$birthday[2];
		$month = "Month: ".date("M",mktime(0,0,0,$birthday[1]));
	}

this will give you TEXT month seperate, and an INT Year, in 2 independent variables.

now you will have to use
{$month}<br />{$year}

instead of {$birthday}

Regards
Thank you very much.
You are great.
were in the code in header_welcomeblock_member template does this actually go

{$month}<br />{$year}
you can put it anywhere you like.... it depends on where you want to display it.

If you face a trouble .. point the exact location for me..and i will tell you where to put the code.
this is wots in mine


<span style="float:right;">{$lang->welcome_current_time}</span>
		{$lang->welcome_back} (<a href="{$mybb->settings['bburl']}/usercp.php"><strong>{$lang->welcome_usercp}</strong></a>{$admincplink} &mdash; <a href="{$mybb->settings['bburl']}/member.php?action=logout&amp;uid={$mybb->user['uid']}">{$lang->welcome_logout}</a>)<br />
				<span class="links">
					<a href="#" onclick="MyBB.popupWindow('misc.php?action=buddypopup', 'buddyList', 170, 300);">{$lang->welcome_open_buddy_list}</a>{$shoutbox_link}
				</span>
				<a href="search.php?action=getnew">{$lang->welcome_newposts}</a> | <a href="search.php?action=getdaily">{$lang->welcome_todaysposts}</a> | <a href="private.php">{$lang->welcome_pms}</a> {$lang->welcome_pms_usage

done it now but any chance of making it in color ?? Big Grin
Well this is a basic coloring of red , and positioning below Open buddy list.

<span style="float:right;">{$lang->welcome_current_time}</span>
{$lang->welcome_back} (<a href="{$mybb->settings['bburl']}/usercp.php"><strong>{$lang->welcome_usercp}</strong></a>{$admincplink} &mdash; <a href="{$mybb->settings['bburl']}/member.php?action=logout&amp;uid={$mybb->user['uid']}">{$lang->welcome_logout}</a>)<br />
<span class="links">
<a href="#" onclick="MyBB.popupWindow('misc.php?action=buddypopup', 'buddyList', 170, 300);">{$lang->welcome_open_buddy_list}</a><br><span style="color:#FF0000">{$month}<br />{$year}</span>{$shoutbox_link}
</span>
<a href="search.php?action=getnew">{$lang->welcome_newposts}</a> | <a href="search.php?action=getdaily">{$lang->welcome_todaysposts}</a> | <a href="private.php">{$lang->welcome_pms}</a> {$lang->welcome_pms_usage

Modify it to accoriding to ur theme.

The coloring part is
style="color:#FF0000"
just change the HEX color.
Month: Sep - Year: 1960 << added it but still not color just black zaher
Pages: 1 2