public function __construct($station_name, $simplepie_item) { // take a simplepie Item and extract the desired info // we assign a station name rather than reading it from the rss // results are consistent and nice that way $this->station_name = $station_name; $this->episode_name = $simplepie_item->get_title(); $this->description = $simplepie_item->get_description(); $this->mp3 = $simplepie_item->get_enclosure()->get_link(); // pretty is for printing, machine is for sorting $this->pretty_date = translate_date($simplepie_item->get_local_date('%A %e %B %Y')); $this->machine_date = $simplepie_item->get_date('U'); $this->fix_ugliness(); }
/** * Builds the reservation details div and makes sure it is clean data * @param array $res array of resrevation data * @return formatted HTML string for the content of the div */ function build_reservation_detail_div($res) { $html = ''; $html .= translate_date('general_date', $res['start_date']) . ' ' . Time::formatTime($res['starttime']) . ' -<br/>'; $html .= translate_date('general_date', $res['end_date']) . ' ' . Time::formatTime($res['endtime']) . '<br/><br/>'; $html .= $res['name'] . ' @ ' . $res['location'] . '<br/>'; $html .= $res['fname'] . ' ' . $res['lname'] . '<br/>'; if (!empty($res['summary'])) { $html .= '<br/><br/><i>' . preg_replace("/[\n\r]+/", '<br/>', addslashes($res['summary'])) . '</i>'; } return $html; }
</tr> </table> <h1>' . plog_tr('Front-End Options') . '</h1> <table class="option-table" cellspacing="0"> <tr class="alt"> <td class="left"><label for="date_format">' . plog_tr('Date Format') . ':</label></td> <td class="right"> <select id="date_format" name="date_format">'; foreach ($date_formats as $format) { $output .= "\n\t\t\t\t\t\t\t\t" . '<option value="' . $format . '"'; if ($config['date_format'] == $format) { $output .= ' selected="selected"'; } $output .= '>' . translate_date(date($format)) . '</option>'; } $output .= "\n\t\t\t\t\t\t\t" . '</select> </td> </tr> <tr> <td class="left"><label for="allow_dl" style="white-space: nowrap;">' . plog_tr('Allow Compressed Downloads') . ':</label></td> <td class="right">'; $checked = $config['allow_dl'] == 1 ? 'checked="checked"' : ''; $output .= '<input type="checkbox" id="allow_dl" name="allow_dl" value="1" ' . $checked . ' /></td> </tr> <tr class="alt"> <td class="left"><label for="allow_print">' . plog_tr('Allow Auto Print') . ':</label></td> <td class="right">'; $checked = $config['allow_print'] == 1 ? 'checked="checked"' : ''; $output .= '<input type="checkbox" id="allow_print" name="allow_print" value="1" ' . $checked . ' /></td>
/** * Prints all reservations for a given day * @param array $reservations array of all reservation data for this day * @param int $datestamp the unix datestamp for the first day shown * @param int $days number of days to print out * @param int $start_time starting time of the day for this reservation's schedule * @param int $end_time ending time of the day for this reservation's schedule * @param int $time_span the time span interval for this reservation's schedule * @param string $resource_name the name of this resource * @param bool $is_private if we are in privacy mode and should hide user details */ function print_signup_sheet($reservations, $datestamp, $days, $start_time, $end_time, $time_span, $resource_name, $is_private = false) { echo "<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\"><tr><td style=\"background-color:#ffffff;\">\n<table border=\"1\" bordercolor=\"#000000\" width=\"100%\" cellspacing=\"1\" cellpadding=\"3\">\n"; $date_vars = getdate($datestamp); $col_width = intval(100 / $days); $hour_line = array(); $date_cells_taken = array(); $datestamps = array(); // This will store the datestamp for each date on the calendar // Print out a date header for each date in the calendar view echo '<tr><td> </td>'; for ($day_count = 0; $day_count < $days; $day_count++) { $datestamps[$day_count] = mktime(0, 0, 0, $date_vars['mon'], $date_vars['mday'] + $day_count, $date_vars['year']); echo '<td width="' . $col_width . '%" align="center"><b>' . $resource_name . '</b><br/>' . translate_date('schedule_daily', $datestamps[$day_count]) . '</td>'; } echo "</tr>\n"; for ($i = 0; $i < count($reservations); $i++) { $reservations[$i]['starttime'] = Time::getAdjustedMinutes($reservations[$i]['starttime']); $reservations[$i]['endtime'] = Time::getAdjustedMinutes($reservations[$i]['endtime']); // If the reservation starts on a day other than the first day shown then just show it at the start time of the first day $day = $reservations[$i]['start_date'] >= $datestamp ? ($reservations[$i]['start_date'] - $datestamp) / SECONDS_IN_DAY : 0; // This will tell how many days ahead of the first day this reservation occurs // If the reseravtion ends on a day further from the last day shown, then make the endday equal to the last day $endday = $reservations[$i]['end_date'] <= $datestamps[$days - 1] ? ($reservations[$i]['end_date'] - $datestamp) / SECONDS_IN_DAY : $days - 1; // This will tell how many days ahead of the first day this reservation occurs // Get temporary start and end times for dates that are off the viewable days $starttime = $reservations[$i]['start_date'] >= $datestamp ? $reservations[$i]['starttime'] : $start_time; $endtime = $reservations[$i]['end_date'] <= $datestamps[$days - 1] ? $reservations[$i]['endtime'] : $end_time; $hour_line[$starttime][$day] =& $reservations[$i]; // If this is a multi day reservation, make sure we populate the $hour_line of the last day/time for this reservation if ($day != $endday) { for ($d = $day + 1; $d <= $endday; $d++) { $hour_line[$start_time][$d] =& $reservations[$i]; } } // Keep an array of the cells that are taken by the rowspan of another reservation if ($day != $endday) { // MULTIDAY for ($d = $day; $d <= $endday; $d++) { if ($d == $day) { for ($time = $starttime; $time < $end_time; $time += $time_span) { $date_cells_taken[$d][$time] = 1; } } else { if ($d == $endday) { for ($time = $start_time; $time < $endtime; $time += $time_span) { $date_cells_taken[$d][$time] = 1; } } else { for ($time = $start_time; $time < $end_time; $time += $time_span) { $date_cells_taken[$d][$time] = 1; } } } } } else { // SINGLE DAY for ($time = $starttime; $time < $endtime; $time += $time_span) { $date_cells_taken[$day][$time] = 1; } } } // The reservation data is stored in a 2D array of time (x axis) and date (y axis) // This simply loops through all time/date possibilities and prints out the reservation data for each cell for ($time = $start_time; $time < $end_time; $time += $time_span) { echo '<tr><td valign="top">' . Time::formatTime($time, false) . '</td>'; for ($date = 0; $date < $days; $date++) { if (isset($hour_line[$time][$date])) { $res = $hour_line[$time][$date]; if ($is_private) { $res['fname'] = 'Private'; $res['lname'] = ''; } $starttime = $res['starttime']; $endtime = $res['endtime']; // Set temporary start/end times for multiday reservations so that the rowspan is correct if ($res['start_date'] != $res['end_date']) { if ($res['start_date'] == $datestamps[$date]) { $endtime = $end_time; } else { $starttime = $start_time; } } $rowspan = intval(($endtime - $starttime) / $time_span); echo "<td valign=\"top\" rowspan=\"{$rowspan}\" class=\"\">• "; echo "{$res['fname']} {$res['lname']}"; if (!empty($res['parentid'])) { echo ' <img src="img/recurring.gif" width="15" height="15" alt="' . translate('Recurring') . '" title="' . translate('Recurring') . '"/>'; } if ($res['start_date'] != $res['end_date']) { echo ' <img src="img/multiday.gif" width="8" height="9" alt="' . translate('Multiple Day') . '" title="' . translate('Multiple Day') . '"/>'; } echo '</td>'; } else { if (!isset($date_cells_taken[$date][$time])) { echo '<td valign="top"> </td>'; // There is no reservation for this time, print out an empty cell } } } echo "</tr>\n"; // End the time row } echo "</table>\n</td></tr><table>\n"; }
function plogger_get_picture_date($format = '', $submitted = 0) { global $config; $row = $GLOBALS['current_picture']; if ($submitted) { $date_taken = $row['unix_date_submitted']; } else { $date_taken = !empty($row['unix_exif_date_taken']) ? $row['unix_exif_date_taken'] : $row['unix_date_submitted']; } if (!$format) { $format = $config['date_format']; } return translate_date(date($format, $date_taken)); }
/** * Formats a timezone-adjusted timestamp for a reservation with this date and time * @param int $res_ts the reservation start_date or end_date timestamp * @param int $res_time the reservation starttime or endtime as minutes * @param string $format the PHP format string for the resulting date * @return the adjusted and formatted timestamp for the reservation */ function formatReservationDate($res_ts, $res_time, $format = '', $format_key = '') { global $conf; global $dates; $start_ts = $res_ts + 60 * $res_time; $res_ts = Time::getAdjustedTime($start_ts); if (empty($format_key)) { $format_key = 'general_date'; } return translate_date($format_key, $res_ts); }
/** * Print welcome header message * This function prints out a table welcoming * the user. It prints links to My Control Panel, * Log Out, Help, and Email Admin. * If the user is the admin, an admin banner will * show up * @global $conf */ function printWelcome() { global $conf; // Print out logoImage if it exists echo !empty($conf['ui']['logoImage']) ? '<div align="left"><img src="' . $conf['ui']['logoImage'] . '" alt="logo" vspace="5" /></div>' : ''; ?> <table width="100%" border="0" cellspacing="0" cellpadding="5" class="mainBorder"> <tr> <td class="mainBkgrdClr"> <h4 class="welcomeBack"> <?php echo translate('Welcome Back', array($_SESSION['sessionName'], 1)); // Notify if the person logged in is admin echo Auth::isMailAdmin() ? ' (' . translate('Administrator') . ')' : ''; ?> </h4> <!--<p> <?php $this->link->doLink($this->dir_path . 'index.php?logout=true', translate('Log Out')); ?> | <?php $this->link->doLink($this->dir_path . 'summary.php', translate('My Control Panel')); ?> </p>--> </td> <td class="mainBkgrdClr" valign="top"> <div align="right"> <p> <?php echo translate_date('header', mktime()); ?> </p> <!--<p> <?php $this->link->doLink('javascript: help();', translate('Help')); ?> </p>--> </div> </td> </tr> </table> <?php }