Advertisement:

Author Topic: Todays birthday  (Read 23002 times)

Offline metallica48423

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,842
  • Gender: Male
  • Professional Multislacker!
    • Zentendo
Re: Todays birthday
« Reply #20 on: October 30, 2007, 04:09:48 AM »
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

Quote
Microsoft 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
     

Offline Owain

  • Jr. Member
  • **
  • Posts: 115
  • Gender: Male
    • TractionKiting.co.uk
Re: Todays birthday
« Reply #21 on: October 30, 2007, 05:42:52 AM »
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

Offline metallica48423

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,842
  • Gender: Male
  • Professional Multislacker!
    • Zentendo
Re: Todays birthday
« Reply #22 on: October 30, 2007, 01:18:57 PM »
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

Quote
Microsoft 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
     

Offline Owain

  • Jr. Member
  • **
  • Posts: 115
  • Gender: Male
    • TractionKiting.co.uk
Re: Todays birthday
« Reply #23 on: October 30, 2007, 07:10:24 PM »
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

Offline metallica48423

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,842
  • Gender: Male
  • Professional Multislacker!
    • Zentendo
Re: Todays birthday
« Reply #24 on: October 30, 2007, 11:12:38 PM »
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

Quote
Microsoft 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
     

Offline Owain

  • Jr. Member
  • **
  • Posts: 115
  • Gender: Male
    • TractionKiting.co.uk
Re: Todays birthday
« Reply #25 on: November 21, 2007, 03:18:29 AM »
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

Offline Dragooon

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 6,738
  • Gender: Male
  • I'm batman
    • ShitizGarg on Facebook
    • Dragooon on GitHub
    • dragooon on LinkedIn
    • SMF-Media
Re: Todays birthday
« Reply #26 on: November 21, 2007, 03:23:26 AM »
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?

Offline Owain

  • Jr. Member
  • **
  • Posts: 115
  • Gender: Male
    • TractionKiting.co.uk
Re: Todays birthday
« Reply #27 on: November 21, 2007, 04:39:43 AM »
Or :

Todays Birthdays:
Todays Events:

Upcoming Birthdays:
Upcoming Events:

:)

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

Offline Owain

  • Jr. Member
  • **
  • Posts: 115
  • Gender: Male
    • TractionKiting.co.uk
Re: Todays birthday
« Reply #28 on: November 22, 2007, 09:38:38 AM »
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

Offline capabmx

  • Sr. Member
  • ****
  • Posts: 724
  • Gender: Male
    • The Hangout Spot
Re: Todays birthday
« Reply #29 on: November 22, 2007, 10:07:36 AM »
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
Code: [Select]
$txt['calendar3b'] = 'Upcoming Birthdays:';
$txt['calendar4b'] = 'Upcoming Events:';

add after
Code: [Select]
$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.

Offline capabmx

  • Sr. Member
  • ****
  • Posts: 724
  • Gender: Male
    • The Hangout Spot
Re: Todays birthday
« Reply #30 on: November 22, 2007, 10:16:34 AM »
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
Code: [Select]
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.

Offline metallica48423

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,842
  • Gender: Male
  • Professional Multislacker!
    • Zentendo
Re: Todays birthday
« Reply #31 on: November 22, 2007, 01:01:04 PM »
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

Quote
Microsoft 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
     

Offline Owain

  • Jr. Member
  • **
  • Posts: 115
  • Gender: Male
    • TractionKiting.co.uk
Re: Todays birthday
« Reply #32 on: November 23, 2007, 04:30:22 AM »
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

Offline Owain

  • Jr. Member
  • **
  • Posts: 115
  • Gender: Male
    • TractionKiting.co.uk
Re: Todays birthday
« Reply #33 on: November 27, 2007, 05:16:53 AM »
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

Offline capabmx

  • Sr. Member
  • ****
  • Posts: 724
  • Gender: Male
    • The Hangout Spot
Re: Todays birthday
« Reply #34 on: November 28, 2007, 09:02:03 AM »
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.

Offline Owain

  • Jr. Member
  • **
  • Posts: 115
  • Gender: Male
    • TractionKiting.co.uk
Re: Todays birthday
« Reply #35 on: November 29, 2007, 04:20:40 AM »
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

Offline Bulakbol

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,220
  • Gender: Male
  • JohnyB
Re: Todays birthday
« Reply #36 on: November 29, 2007, 06:45:39 PM »
Sorry, I tried it but too buggy hehe. You can try it. Improve it or play with it. BoardIndex.template.php

Code: [Select]
// 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.
« Last Edit: November 30, 2007, 12:15:13 AM by JohnyB »
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Offline Owain

  • Jr. Member
  • **
  • Posts: 115
  • Gender: Male
    • TractionKiting.co.uk
Re: Todays birthday
« Reply #37 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.
www.tractionkiting.co.uk
Dedicated to promoting Kiting in Scotland

Offline Bulakbol

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,220
  • Gender: Male
  • JohnyB
Re: Todays birthday
« Reply #38 on: November 30, 2007, 02:22:35 PM »
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.

Code: [Select]
// 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>
« Last Edit: December 02, 2007, 03:12:13 AM by JohnyB »
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Offline metallica48423

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,842
  • Gender: Male
  • Professional Multislacker!
    • Zentendo
Re: Todays birthday
« Reply #39 on: December 15, 2007, 09:33:16 PM »
Did that one work for you?
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

Quote
Microsoft 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