* */ //filtered users $filterid = (int) $vars['entity']->index_todayfilterid; if (!$filterid) { $filterid = 0; } print '<div class="user_settings"><p style="text-align:right">' . elgg_echo('today_celebrations:today') . ' <strong>' . printcelebrationsdate(1, time()) . '</strong></p>'; $row_celebrations = user_celebrations(0, 'next', $filterid); // list of celebrations if (!empty($row_celebrations)) { print '<table width="100%">'; foreach ($row_celebrations as $key => $val) { $sendcelebrationsmessage = ''; if ($val['type'] != 'dieday' && $val['id'] != elgg_get_logged_in_user_guid()) { $sendcelebrationsmessage = '<a class="privatemessages" href="' . elgg_get_site_url() . 'messages/compose?send_to=' . $val['id'] . '" > </a>'; } if (elgg_get_plugin_setting("replaceage", "celebrations") == 'yes' && $val['type'] == 'birthdate') { $age = showage($val['date']) . ' ' . elgg_echo('celebrations:age'); } else { $age = ''; } $even_odd = 'F3F3F3' != $even_odd ? 'F3F3F3' : 'FFFFFF'; echo "<tr bgcolor=\"#{$even_odd}\">"; print '<td><img class="user_mini_avatar" src="' . $val['icon'] . '"> <a href="' . $val['url'] . '" title="' . $val['fullname'] . '">' . $val['name'] . '</a></td><td align="right">' . elgg_echo('today_celebrations:' . $val['type']) . '</td><td align="right">' . $age . '</td><td align="right">' . $sendcelebrationsmessage . '</td></tr>'; } print '</table>'; } else { print "<p>" . elgg_echo('today_celebrations:nocelebrations') . "</p>"; } print '</div>';
// Let's call it for individual lines so we can add extra info like marriages, children, links etc. $celebrations_day = gmdate('d', $val['date']); $current_day = date('d', time()); $celebrations_month = gmdate('m', $val['date']); $current_month = date('m', time()); $celebrations_date = printcelebrationsdate(2, $val['date']); // now display a single line echo "<tr bgcolor=\"#{$even_odd}\">"; echo '<td>' . elgg_echo('celebrations:day') . ': ' . $val['rest'] . '</td><td>'; echo '<img class="user_mini_avatar" src="' . $val['icon'] . '"> <a href="' . $val['url'] . '">' . $val['fullname'] . '</a>'; echo '</td>'; // show type of celebration echo '<td>' . elgg_echo('today_celebrations:' . $val['type']) . '</td>'; if ($val['format'] == 'day_anniversary') { if (elgg_get_plugin_setting("replaceage", "celebrations") == 'yes' && $val['type'] == 'birthdate') { echo "<td>" . showage($val['date']) . ' ' . elgg_echo('celebrations:age') . "</td>"; } else { echo "<td>" . $celebrations_date . "</td>"; } } else { echo "<td> </td>"; } if ($celebrations_month == $current_month && $celebrations_day == $current_day) { if ($val['type'] == 'dieday' || $val['id'] == elgg_get_logged_in_user_guid()) { echo "<td> </td>"; } else { $sendcelebrationsmessage = '<a class="privatemessages" href="' . elgg_get_site_url() . 'messages/compose?send_to=' . $val['id'] . '" > </a>'; echo '<td>' . $sendcelebrationsmessage . '</td>'; } } else { echo "<td> </td>";