News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Birthday in News?

Started by Jerri Blank, March 06, 2008, 01:11:09 AM

Previous topic - Next topic

[SiNaN]

I copied that code from you, what this then:

« Last Edit: Today at 20:46 by ccbtimewiz »

:P
Former SMF Core Developer | My Mods | SimplePortal

ccbtimewiz

Quote from: [SiNaN] on August 01, 2008, 01:50:33 PM
I copied that code from you, what this then:

« Last Edit: Today at 20:46 by ccbtimewiz »

:P

<<

>>

:P

JustJa

Well now I don´t get any error, but nothing shows up on the news ?!?! Am I missing something still?

[SiNaN]

Quote from: [SiNaN] on July 25, 2008, 11:07:15 AM
And why you cannot see is, it just appears when its the birthday of the user viewing the board. I mean, if today is my birthday, then when I see your boardindex, it says me "happy birthday".

If you want to display all the users you need to use the birthday list in the context array I guess. Ccbtimewiz could help you I hope.
Former SMF Core Developer | My Mods | SimplePortal

JustJa

Oh.. I was thinking that this would show the message so everyone knows it, from the guys that are listed on : Upcoming Birthdays  :)
oops

[SiNaN]

Seems like it will be used. Maybe I can work on it.
Former SMF Core Developer | My Mods | SimplePortal

ccbtimewiz

I'll try building something like that too. ;)

Bulakbol

if (!empty($context['calendar_birthdays']))
foreach ($context['calendar_birthdays'] AS $member)
{
if ($member['is_today'])
echo 'Happy Birthday ', $member['name'], '!<br />';
else
echo 'Your Birthday is coming ', $member['name'], '<br />';
}
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

MissyNL

Quote from: JohnyB on August 01, 2008, 03:19:07 PM
if (!empty($context['calendar_birthdays']))
foreach ($context['calendar_birthdays'] AS $member)
{
if ($member['is_today'])
echo 'Happy Birthday ', $member['name'], '!<br />';
else
echo 'Your Birthday is coming ', $member['name'], '<br />';
}



and where should i implement this?
Sorry for my poor English, but i think it's probably better then your Dutch :)

ccbtimewiz

index.template.php file, I believe. :)

[SiNaN]

It will just work on BoardIndex.template.php, cause the data is gathered only in BoardIndex.php file.
Former SMF Core Developer | My Mods | SimplePortal

MissyNL

oke... but because i am a code noob :(  i want to know where and before what lines.. please :D
Sorry for my poor English, but i think it's probably better then your Dutch :)

Kylezz

Its easier if you just create a section news and just post it there. Done way easier :)
Why do i post alot? I am not a leecher.

[SiNaN]

Just do this:

BoardIndex.template.php

Find:

// Show the news fader?  (assuming there are things to show...)

Replace:

// Show us some birthday too.
if (!empty($context['calendar_birthdays']))
   foreach ($context['calendar_birthdays'] AS $member)
   {   
      if ($member['is_today'])
         $context['fader_news_lines'][] = 'Happy Birthday ' . $member['name'] . '!';
      else
         $context['fader_news_lines'][] = 'Your Birthday is coming ' . $member['name'] . '.';
   }

// Show the news fader?  (assuming there are things to show...)


This code will add the birthdays to the news fader in the BoardIndex.
Former SMF Core Developer | My Mods | SimplePortal

MissyNL

thanks!!! i will do that... as soon as i have fixed some errors :(
Sorry for my poor English, but i think it's probably better then your Dutch :)

Advertisement: