News:

Wondering if this will always be free?  See why free is better.

Main Menu

Todays birthday

Started by Owain, December 20, 2005, 10:48:29 AM

Previous topic - Next topic

metallica48423

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
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

Owain

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.
www.tractionkiting.co.uk
Dedicated to promoting Kiting in Scotland

metallica48423

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
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

Owain

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.
www.tractionkiting.co.uk
Dedicated to promoting Kiting in Scotland

metallica48423

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 ;)
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

Owain

Has anyone else had a chance to look at this?

Not had time myself :(

O.
www.tractionkiting.co.uk
Dedicated to promoting Kiting in Scotland

Dragooon

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?

Owain

Or :

Todays Birthdays:
Todays Events:

Upcoming Birthdays:
Upcoming Events:

:)

O.
www.tractionkiting.co.uk
Dedicated to promoting Kiting in Scotland

Owain

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.
www.tractionkiting.co.uk
Dedicated to promoting Kiting in Scotland

capabmx

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.
Always looking to take on a web design/ programming job :], PM me if interested.

capabmx

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.
Always looking to take on a web design/ programming job :], PM me if interested.

metallica48423

todays is shown in bold. they are just not physically separated. it should be boardindex.template.php
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

Owain

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.
www.tractionkiting.co.uk
Dedicated to promoting Kiting in Scotland

Owain

Any more progress??

Just trying to keep this thread alive as I don't want to wait another 2 years for a solution :)

O.
www.tractionkiting.co.uk
Dedicated to promoting Kiting in Scotland

capabmx

Sorry :), just got finished moving into a new house, I'll get right on this again.
Always looking to take on a web design/ programming job :], PM me if interested.

Owain

Thanks! That would be great :) I had a look but don't have the time to work it all out just now.....

O.
www.tractionkiting.co.uk
Dedicated to promoting Kiting in Scotland

Bulakbol

#36
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.
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Owain

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.
www.tractionkiting.co.uk
Dedicated to promoting Kiting in Scotland

Bulakbol

#38
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>
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

metallica48423

Did that one work for you?
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

Advertisement: