ElkArte Community

Project Support => Support => Topic started by: johnnyebu on May 04, 2016, 06:27:20 am

Title: Help with Today's birthdays on forum index
Post by: johnnyebu on May 04, 2016, 06:27:20 am
Greetings everyone, I commend the entire community for this wonderful and powerful script. The features are on point! I am currently using Elkarte to develop a forum for my Church. I need help regarding the birthday on the forum index.
All birthdays displays in the forum index as Upcoming Birthdays even those that are Today. I did suggest Today’s birthdays and Upcoming birthdays should be separated.
Thanks.
Title: Re: Help with Today's birthdays on forum index
Post by: radu81 on May 04, 2016, 06:45:35 am
Welcome to elkarte and happy birthday!

Are you using simple portal? If so you can display a block of "today birthday" with just a few clicks ;)
Title: Re: Help with Today's birthdays on forum index
Post by: johnnyebu on May 04, 2016, 08:01:00 am
Quote from: radu81 – Welcome to ElkArte and happy birthday!

Are you using simple portal? If so you can display a block of "today birthday" with just a few clicks ;)
@Radu, thanks for your prompt response. I don't intend to use Simple Portal. I want to keep my forum simple :) Can "today birthday" block be implemented in the forum index without using the simple portal addon? Thanks
Title: Re: Help with Today's birthdays on forum index
Post by: emanuele on May 04, 2016, 11:10:36 am
Hi and welcome. :)

At the moment, the only way to override that piece is modify the template.
A "quick&dirty" implementation could be to replace, in the file BoardIndex.template.php the code:
Code: [Select]
	// People's birthdays. Like mine. And yours, I guess. Kidding.
if (!empty($context['calendar_birthdays']))
{
echo '
<p class="inline">
<span class="birthday">', $context['calendar_only_today'] ? $txt['birthdays'] : $txt['birthdays_upcoming'], '</span>';

// Each member in calendar_birthdays has: id, name (person), age (if they have one set?), is_last. (last in list?), and is_today (birthday is today?)
foreach ($context['calendar_birthdays'] as $member)
echo '
<a href="', $scripturl, '?action=profile;u=', $member['id'], '">', $member['is_today'] ? '<strong class="fix_rtl_names">' : '', $member['name'], $member['is_today'] ? '</strong>' : '', isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a>', $member['is_last'] ? '' : ', ';

echo '
</p>';
}

with:
Code: [Select]
	// People's birthdays. Like mine. And yours, I guess. Kidding.
if (!empty($context['calendar_birthdays']))
{
echo '
<p class="inline">
<span class="birthday b-today">', $txt['birthdays'], '</span>';

// Each member in calendar_birthdays has: id, name (person), age (if they have one set?), is_last. (last in list?), and is_today (birthday is today?)
foreach ($context['calendar_birthdays'] as $member)
{
if ($member['is_today'])
{
echo '
<a href="', $scripturl, '?action=profile;u=', $member['id'], '">', $member['is_today'] ? '<strong>' : '', $member['name'], $member['is_today'] ? '</strong>' : '', isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a>', $member['is_last'] ? '' : ', ';
}
}

echo '
</p>
<p class="inline">
<span class="birthday b-not-today">', $context['calendar_only_today'] ? $txt['birthdays'] : $txt['birthdays_upcoming'], '</span>';

// Each member in calendar_birthdays has: id, name (person), age (if they have one set?), is_last. (last in list?), and is_today (birthday is today?)
foreach ($context['calendar_birthdays'] as $member)
{
if ($member['is_today'] === false)
{
echo '
<a href="', $scripturl, '?action=profile;u=', $member['id'], '">', $member['is_today'] ? '<strong>' : '', $member['name'], $member['is_today'] ? '</strong>' : '', isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a>', $member['is_last'] ? '' : ', ';
}
}

echo '
</p>';
}
Title: Re: Help with Today's birthdays on forum index
Post by: johnnyebu on May 04, 2016, 11:38:08 am
@emanuele , thank you very much. Keep up the good work :)
Title: Re: Help with Today's birthdays on forum index
Post by: emanuele on May 04, 2016, 11:55:24 am
You are welcome. :)
Title: Re: Help with Today's birthdays on forum index
Post by: meetdilip on May 04, 2016, 07:44:45 pm
Welcome to ElkArte @johnnyebu
Title: Re: Help with Today's birthdays on forum index
Post by: Mrs. Chaos on December 03, 2018, 06:15:19 am
Hello!
How can I show birthdays for today and tomorrow in EA version 1.1.5 ?
And how can the cake graphic be displayed for the todays birthdays?
Title: Re: Help with Today's birthdays on forum index
Post by: radu81 on December 03, 2018, 08:11:50 am
I use SPortal to display "today birhdays".
(Link-6227)
Title: Re: Help with Today's birthdays on forum index
Post by: Mrs. Chaos on December 03, 2018, 09:22:18 am
Thank you, but I don't use Simple Portal because I don't need a portal. And just because of the birthdays I don't want to install it.
Title: Re: Help with Today's birthdays on forum index
Post by: radu81 on December 03, 2018, 09:54:50 am
I agree with you, it doesn't make much sense to use a portal just to display birthdays. 
Title: Re: Help with Today's birthdays on forum index
Post by: Jorin on December 03, 2018, 10:00:45 am
Todays birthdays are displayed by default, but there seems to be no configuration possible in the admin section. I can't find any too.
Title: Re: Help with Today's birthdays on forum index
Post by: Mrs. Chaos on December 03, 2018, 11:05:41 am
Yes, I have set this simple birthday today variant. With "tomorrow" I would like it a little better...
And it would be nice if the cake could be displayed, which is still in the Images folder.

(https://www.elkarte.net/community/themes/default/images/cake.png)
Title: Re: Help with Today's birthdays on forum index
Post by: emanuele on December 04, 2018, 02:33:01 am
You mean you want to see "tomorrow" instead of the date or that the "Max days in advance on board index" setting is not enforced?
Title: Re: Help with Today's birthdays on forum index
Post by: Mrs. Chaos on December 05, 2018, 01:40:31 pm
I want to have something like this. And the cake shall than be centrally behind the name:


Todays Birthday:  emanuele  (https://www.elkarte.net/community/themes/default/images/cake.png)

Tomorrows Birthday:  Mrs. Chaos
Title: Re: Help with Today's birthdays on forum index
Post by: emanuele on December 06, 2018, 05:32:57 pm
I see.
This requires some modifications for sure to the template, not sure to the rest.
I'd need some time to work on it. If anyone else wants to give it a go feel free. ;)