i used this function:
ssi_todaysBirthdays();
it displays:
birthday1, birthday2, birthday3
i want it to display:
Birthday1
Birthday2
Birthday3
How? :-\
edit the ssi code that determines birthdays. (not recommended though)
The other thing you can do, especially if you want it in a block, is to copy the SSI code, paste it into a block and edit the code there.
global $context, $scripturl;
require_once ("SSI.php");
if (!smf_loadCalendarInfo() || empty($context['calendar_birthdays']))
echo 'No birthdays today';
else {
foreach ($context['calendar_birthdays'] as $member)
echo '<a href="', $scripturl, '?action=profile;u=', $member['id'], '">' . $member['name'] . (isset($member['age']) ? ' (' . $member['age'] . ')' : '') . '</a>' . (!$member['is_last'] ? '<br />' : '');
}
thank you :)
You're welcome. :)
JPDeni i there is one error in the code.
echo 'No birthdays today";
i replaced " with '
:)
----
by the way, how about the holidays and events?
i thought i would be nice to include them too and list in one line each like the birthdays.
thanks again.
Good job for noticing. I'll fix it in the original code. I also made another small change that might make a difference.
Do you want them all in the same block or separate ones? For the same block, use
global $context, $scripturl;
require_once ("SSI.php");
if (!smf_loadCalendarInfo() || empty($context['calendar_birthdays']))
echo 'No birthdays today';
else {
foreach ($context['calendar_birthdays'] as $member)
echo '<a href="', $scripturl, '?action=profile;u=', $member['id'], '">' . $member['name'] . (isset($member['age']) ? ' (' . $member['age'] . ')' : '') . '</a>' . (!$member['is_last'] ? '<br />' : '');
}
if (!smf_loadCalendarInfo() || empty($context['calendar_holidays']))
echo 'No holidays today';
else
echo implode('<br />', $context['calendar_holidays']);
if (!smf_loadCalendarInfo() || empty($context['calendar_events']))
echo 'No events';
else {
foreach ($context['calendar_events'] as $event) {
if ($event['can_edit'])
echo '
<a href="' . $event['modify_href'] . '" style="color: #FF0000;">*</a> ';
echo '
' . $event['link'] . (!$event['is_last'] ? '<br />' : '');
}
}
If you want three separate, use
Holidays:
global $context;
require_once ("SSI.php");
if (!smf_loadCalendarInfo() || empty($context['calendar_holidays']))
echo 'No holidays today';
else
echo implode('<br />', $context['calendar_holidays']);
Events:
global $context;
require_once ("SSI.php");
if (!smf_loadCalendarInfo() || empty($context['calendar_events']))
echo 'No events';
else {
foreach ($context['calendar_events'] as $event) {
if ($event['can_edit'])
echo '
<a href="' . $event['modify_href'] . '" style="color: #FF0000;">*</a> ';
echo '
' . $event['link'] . (!$event['is_last'] ? '<br />' : '');
}
}
thanks.
i combined it with the Calendar block to display the names and events one line per entry. the original code in the Calendar displays the entries continously separating them with commas.