function show_next_celebrations() { $ViewReminder = elgg_get_plugin_setting("ViewReminder", "celebrations"); if (!$ViewReminder) { $ViewReminder = "no"; } if ($ViewReminder = "yes") { $nextdaysCelebrations = elgg_get_plugin_setting("nextdaysCelebrations", "celebrations"); if (!$nextdaysCelebrations) { $nextdaysCelebrations = 7; } $celebrations = user_celebrations($nextdaysCelebrations, 'next', 0); //draw celebrations if (!empty($celebrations)) { foreach ($celebrations as $key => $val) { if ($val['rest'] == 0) { $days = elgg_echo('next_celebrations:today'); } elseif ($val['rest'] == 1) { $days = elgg_echo('next_celebrations:dayleft'); } else { $days = elgg_echo('next_celebrations:in') . ' ' . $val['rest'] . ' ' . elgg_echo('next_celebrations:daysleft'); } system_message($days . elgg_echo('next_celebrations:celebrate') . $val['fullname'] . elgg_echo('next_celebrations:genitive') . elgg_echo('today_celebrations:' . $val['type']) . '.'); } } } return true; }
<?php /** * Celebrations Plugin * * Index page Todays Celebrations widget for Widget Manager plugin * */ //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>';
<div align='center'> <table border=0 width=100%> <?php $filterid = $vars['filterid']; $month = $vars['month']; // checks for users celebrating something this month $row = user_celebrations(1, 'month', $filterid, $month); // start the draw of celebrations $row2 = array(); if (!empty($row)) { // we calculate the day to order the array foreach ($row as $key => $val) { if ($val['format'] == 'day_anniversary') { $celebrations_day = gmdate('d', $val['date']); } else { $celebrations_day = date('d', $val['date']); } $val['rest'] = $celebrations_day; $row2[$key] = $val; } uasort($row2, 'orderdate'); //sort by day if (!empty($row2)) { foreach ($row2 as $key => $val) { $even_odd = 'F3F3F3' != $even_odd ? 'F3F3F3' : 'FFFFFF'; // 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());