Hi bloc,
i think, it's a bug ...
I'm using the function todaybirstday ..
the function displays today (11. 29.) a person that have birstday on 12. 05. >:(
can you get my help?
Feline
Hm, it should not do that...is the forum a SMF 1.1RC1?
yes bloc .. it is.
SMF Paket SMF 1.1 RC1 SMF 1.1 RC1
Calendar.php 1.1 RC1 1.1 RC1
SSI.php 1.1 RC1 1.1 RC1
Calendar.template.php 1.1 RC1 1.1 RC1
Display:
Geburstage: PatriciaZ (43)
Profile:
Geburtsdatum: 1962 - 12 -05
Feline
Does it do this on default theme as well? or only on Black22 theme?
Also..just this member - or has it happened to several?
Hi Bloc,
does on all themes ... Black, Blue, and default
and this member .. no other birstdays on nov or dec.
my code:
$BirstDayMember= ssi_todaysBirthdays(''); flush();
if ($BirstDayMember) {
echo 'Geburstag: <b>';
foreach($BirstDayMember as $BDMember)
echo $BDMember['name'], (!$BDMember['is_last']) ? ', ' : '</b> ';
}
Fel
hi bloc,
wupii .. I have found ...
modify code in SSI.php
// Happy Birthday, guys and gals!
$context['calendar_birthdays'] = array();
// -removed for ($i = $now; $i < $now + $days_for_index; $i += 86400)
// -removed {
$i = $now; // -added
if (isset($bday[strftime('%Y-%m-%d', $i)]))
{
foreach ($bday[strftime('%Y-%m-%d', $i)] as $index => $dummy)
$bday[strftime('%Y-%m-%d', $i)][$index]['is_today'] = (strftime('%Y-%m-%d', $i)) == strftime('%Y-%m-%d', forum_time());
$context['calendar_birthdays'] = array_merge($context['calendar_birthdays'], $bday[strftime('%Y-%m-%d', $i)]);
}
//-removed }
this works fine ::)
Feline
It's actually supposed to do that...All the "Todays" ssi functions actually go like 1 week (U think) in the future.
yes winrules, that is the problem.
to display only today birthdays use this ...
new code block for function ssi_todaysBirthdays($output_method = 'echo')
// Show today's birthdays.
function ssi_todaysBirthdays($output_method = 'echo')
{
global $context, $scripturl, $modSettings;
if (!smf_loadCalendarInfo() || empty($context['calendar_birthdays']))
return array();
if (isset($modSettings['cal_today_birthday']))
$bday = unserialize($modSettings['cal_today_birthday']);
$i = forum_time();
$context['birthdays'] = array();
if (isset($bday[strftime('%Y-%m-%d', $i)]))
$context['birthdays'] = array_merge($context['birthdays'], $bday[strftime('%Y-%m-%d', $i)]);
if ($output_method != 'echo')
return $context['birthdays'];
foreach ($context['birthdays'] as $member)
echo '
<a href="', $scripturl, '?action=profile;u=', $member['id'], '">' . $member['name'] . (isset($member['age']) ? ' (' . $member['age'] . ')' : '') . '</a>' . (!$member['is_last'] ? ', ' : '');
}
No other changes necessary.
This will work for today and preview of birthdays also ...
feline
Good you solved it. :)
Strange that this hasn't been adressed over at Simplemachines.org..or maybe it has( but not discovered by me ::) )