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.
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
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:
// 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:
// 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>';
}
@emanuele , thank you very much. Keep up the good work :)
You are welcome. :)
Welcome to ElkArte
@johnnyebu
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?
I use SPortal to display "today birhdays".
(Link-6227)
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.
I agree with you, it doesn't make much sense to use a portal just to display birthdays.
Todays birthdays are displayed by default, but there seems to be no configuration possible in the admin section. I can't find any too.
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)
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?
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
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. ;)