Is there any way to get the upcoming birthday to change to read "Todays birthday" for people who have birthdays on that day?
Cheers,
O.
Did you want to separate "today's birthdays" from the upcoming birthdays or do you have the calendar set to only display events from the current day?
I would like to seperate the upcoming events from todays events. Is this possible?
i.e.
Todays Events: Owain's Birthday
Upcoming Events: Christmas Day
Do you want it to look like this:
Today's Birthdays: Owain (age), othermember (age), ...
Upcoming Birthdays: Member1 (age), Member2 (age), ...
Upcoming Events: Christmas Day
or this:
Today's Birthdays: Owain (age), othermember (age), ...
Upcoming Events: Christmas Day
SMF already seperates birthdays and events, so it's just a matter of seperating today's birthdays from upcoming ones (which is relatively easy to accomplish).
erm, so many options :)
I guess it would be good to have Today's Birthdays: Owain (age), othermembers(age),......
Upcoming Birthdays: Blah(age)
Upcoming Events: Christmas
Cheers,
O.
Weres the code for this? im interested on how to do this for my forums.
Ye, Im really interested in getting this on my forum as well.....
O.
How do you do this??????? You tease us by saying it can be done and then don't tell us how!
O.
Can it be done???
O.
Sorry for the lack of response. I was out of town most of last week (starting last Wednesday) and just got back earlier today. I'm really tired right now, but I will take a look at it tomorrow when I'm not as tired.
Excellent :) Thanks....
O.
sorry to keep asking but I have a birthday coming up tomorrow and I would like to test the code by then :)
O.
the quick fix is to put the number of days to display ahead as -1
it works, even tho its wierd!
I guess that only works for the day the event happens?
I would like to have it show, upcoming events and birthdays but also show "Todays Events and Birthdays"
O.
Any help with this?
O.
Hmm this thread died. I need to change my codes too so if anyone can help here, that'd be great.
damn... i need that function and nobody answers >:(
I'd also like to have this change on my board. one of my members birthdays is today yet he's still listed as upcoming.
is this resolved or do you still require assistance?
If i remember correctly, today's events are bolded?
I might have to grab Oldiesmann to look at this, though.
Hi!
Nope, its not resolved. I would still like to have Today's Birthdays and Today's Events shown and below them Upcoming Birthdays and Upcoming Events....will this be possible?
Cheers,
O.
this thread has been active forever and a day lol..
I'll look tomorrow (i've marked this thread unread to remind me) BUt i'll also notify oldiesmann
If we wait until December then it will be 2 years since I made the first request :)
All good things come to those who wait!!
Looks forward to hopefully behing able to mod my forum to do this.
O.
i could always lock it until then ;)
Sent a message to oldiesmann -- took a look but can't quite get it -- interested in learning to do this though for the future
Ive actually just started programming PHP and I may have a look in to this myself. Will let you know how I get on.
I would imagine its just a case of querying the database and setting different conditions depending on whether the date in the calander matches the current date.
O.
It may be as simple as checking a variable ;)
Remember, today's events are bolded, meaning that it has a way to check that something is today's event ;)
Has anyone else had a chance to look at this?
Not had time myself :(
O.
I am gonna say this again but something like this?
Todays Birthday : Bla
Upcoming Birthdays : Again blah
Upcoming events : And again blah
If I get you right?
Or :
Todays Birthdays:
Todays Events:
Upcoming Birthdays:
Upcoming Events:
:)
O.
Any luck with this?
I might actually have time to look in to this myself tonight! How annoying it would be if I manage to do it tonight just by digging about a bit in the code :D
O.
Since, nobody seems to have gotten anywhere thus far, here is what I've found at the moment.
You might want to first go to themes/default/languages/index.english.php
find $txt['calendar3b'] = 'Upcoming Birthdays:';
$txt['calendar4b'] = 'Upcoming Events:';
add after $txt['calendar3c'] = 'Todays Birthdays:';
@txt['calendar4c'] = Today's Event's:';
Ok, give me a sec yet, I'm still trying to work out getting it to show on the forum index.
Ok, if maybe someone could tell me exactly which file has the table that shows upcoming events, because all you have to do is add a table named Today's events beneath it and I think insert this
if (!empty($context['calendar_birthdays']))
{
echo '
<span style="color: #', $modSettings['cal_bdaycolor'], ';">', $context['calendar_only_today'] ? $txt['calendar3'] : $txt['calendar3b'], '</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'] ? '<b>' : '', $member['name'], $member['is_today'] ? '</b>' : '', isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a>', $member['is_last'] ? '<br />' : ', ';
}
// Events like community get-togethers.
if (!empty($context['calendar_events']))
{
echo '
I'm not sure though, because I'm still trying to figure it out, from the code, it almost looks like it is meant to show Today's Birthdays as Today's and not upcoming so now I'm confused.
todays is shown in bold. they are just not physically separated. it should be boardindex.template.php
As always, I didnt get a chance to look in to this last night!
Its good to see some code snippets on the thread though, I think I can see a light at the end of the tunnel.....either that or its a train!!!
O.
Any more progress??
Just trying to keep this thread alive as I don't want to wait another 2 years for a solution :)
O.
Sorry :), just got finished moving into a new house, I'll get right on this again.
Thanks! That would be great :) I had a look but don't have the time to work it all out just now.....
O.
Sorry, I tried it but too buggy hehe. You can try it. Improve it or play with it. BoardIndex.template.php
// People's birthdays. Like mine. And yours, I guess. Kidding.
if (!empty($context['calendar_birthdays']))
{
echo '
<span style="color: #', $modSettings['cal_bdaycolor'], ';">';
/* 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?) */
$brokendown = array
(
'now' => array(),
'soon' => array(),
);
$celebnow = 0; // celebrant counter
$celebsoon = 0;
foreach ($context['calendar_birthdays'] as $key => $member)
if ($member['is_today']) // birthday today
{
$brokendown['now'][] = &$context['calendar_birthdays'][$key];
$celebnow++;
}
else // birthday soon
{
$brokendown['soon'][] = &$context['calendar_birthdays'][$key];
$celebsoon++;
}
// Any birthday celebrant today?
if ($celebnow > 0)
{
echo 'Today\'s ', $txt['calendar3'], ' ';
foreach ($brokendown['now'] as $broken)
{
echo '<a href="', $scripturl, '?action=profile;u=', $broken['id'], '">';
if (!empty($broken['color']))
echo '<span style="color: ', $broken['color'], '"><strong>', $broken['name'], '</strong>';
else
echo '<span style="color: #', $modSettings['cal_holidaycolor'], ';"><strong>', $broken['name'], '</strong>';
echo isset($broken['age']) ? '(' . $broken['age'] . ')' : '', '</a>', !$broken['is_last'] ? ', ' : '';
}
echo '</span><br />';
}
// upcoming birthdays
if ($celebsoon > 0)
{
echo $txt['calendar3b'], ' ';
foreach ($brokendown['soon'] as $broken)
{
echo '<a href="', $scripturl, '?action=profile;u=', $broken['id'], '">';
if (!empty($broken['color']))
echo '<span style="color: ', $broken['color'], '">', $broken['name'];
else
echo '<span style="color: #', $modSettings['cal_holidaycolor'], ';">', $broken['name'];
echo isset($broken['age']) ? '(' . $broken['age'] . ')' : '', '</a>', !$broken['is_last'] ? ', ' : '';
}
echo '</span><br />';
}
echo '</span>';
}
// Events like community get-togethers.
That's great. I might try and edit it so it shows another section saying "Today's Events" but apart from that its been worth the 2 year wait :)
If anyone else has another version please do post it as it will help others.
O.
Quote from: Owain on November 30, 2007, 07:37:23 AM
That's great. I might try and edit it so it shows another section saying "Today's Events" but apart from that its been worth the 2 year wait :)
If anyone else has another version please do post it as it will help others.
O.
2 years? lol. It's not that important I guess that's why no one bothers to try it.
<EDIT>
Here's bug-free.
// People's birthdays. Like mine. And yours, I guess. Kidding.
if (!empty($context['calendar_birthdays']))
{
/* 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?) */
$brokendown = array
(
'now' => array(),
'soon' => array(),
);
$celebnow = 0; // celebrant counter
$celebsoon = 0;
foreach ($context['calendar_birthdays'] as $key => $member)
if ($member['is_today']) // birthday today
{
$brokendown['now'][] = &$context['calendar_birthdays'][$key];
$celebnow++;
}
else // birthday soon
{
$brokendown['soon'][] = &$context['calendar_birthdays'][$key];
$celebsoon++;
}
// Any birthday celebrant today?
if ($celebnow)
{
echo '
<span style="color: #', $modSettings['cal_bdaycolor'], ';">Today\'s ', $txt['calendar3'], ' ';
foreach ($brokendown['now'] as $broken)
{
$celebnow--;
echo '<a href="', $scripturl, '?action=profile;u=', $broken['id'], '">';
if (isset($broken['color']))
echo '<span style="color: ', $broken['color'], ';"><strong>', $broken['name'], '</strong>';
else
echo '<span><strong>', $broken['name'], '</strong>';
echo isset($broken['age']) ? '(' . $broken['age'] . ')' : '', '</a>', $celebnow ? ', ' : '';
}
echo '</span><br />';
}
// upcoming birthdays
if ($celebsoon)
{
echo '<span style="color: #', $modSettings['cal_bdaycolor'], ';">', $txt['calendar3b'], ' ';
foreach ($brokendown['soon'] as $broken)
{
$celebsoon--;
echo '<a href="', $scripturl, '?action=profile;u=', $broken['id'], '">';
if (isset($broken['color']))
echo '<span style="color: ', $broken['color'], ';">', $broken['name'];
else
echo '<span>', $broken['name'];
echo isset($broken['age']) ? '(' . $broken['age'] . ')' : '', '</a>', !$broken['is_last'] ? ', ' : '';
}
echo '</span><br />';
}
}
// Events like community get-togethers.
</EDIT>
Did that one work for you?