News:

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

Main Menu

"member" isn't defined for today_is_birthday?

Started by profzelonka, March 12, 2017, 12:56:09 PM

Previous topic - Next topic

profzelonka


',
($context['member']['today_is_birthday'] ? '<div>Happy Birthday!<>' : '');


I'm only a self-taught beginner.. The code above gives me "Undefined index: member" error.

I changed it to this:
if (!empty($context['member']['today_is_birthday'])) {
echo '<div>Happy Birthday!<>'; }


The error is gone, but now it only displays the "Happy Birthday!" when on the Profile page, instead of all pages.
I have this code in my header below my menu in index.template.php

I'm just trying to display a Happy Birthday if today is their birthday.

Illori

that is because that code is only used when in the profile and not on every page to have it show up as you want it to.

profzelonka

Oh I see. Thanks.

Is it a complex code to do what I'd like?

Advertisement: