}
*/
$dates = array_keys($latest);
-$latest = $latest[$dates[0]];
-$output .= '<p><b>Most recent breakfast</b>: '.$latest['cafe'].' on '.$latest['nicedate'].' with '.$latest['num'].' people</p>
+$eventdate = $dates[0];
+$latest = $latest[$eventdate];
+$output .= '<p><b>Most recent breakfast</b>: '.$latest['cafe'].' on '.$latest['nicedate'].' with '.$latest['num'].' people';
+if ($path = breakfast_has_photos($eventdate)) {
+ $output .= ' (<a href="'.$path.'">photos</a>) ';
+}
+
+$output .='</p>
'.((!empty($latest['overallcomment'])) ? '<p>'.$latest['overallcomment'].'</p>' : '').'
<table cellpadding="2" cellspacing="1" bgcolor="black" class="data">';
$categories = array();
if (IN_serendipity !== true) {
die ("Don't hack!");
}
-
+require_once(S9Y_INCLUDE_PATH.'/plugins/serendipity_plugin_gallery/lib.php');
function breaKfast_cafe_dropdown($selected=0) {
$output = '
return $sql .' ORDER BY e.date DESC, p.name';
}
+function breakfast_has_photos($date) {
+ global $serendipity;
+ $checkpath = SGN_DIR_ROOT.'/mbg/breakfast/'.date('Ymd',$date);
+ error_log("checking $checkpath");
+ $returnpath = $serendipity['baseURL'].'gallery/show/mbg/breakfast/'.date('Ymd',$date);
+ if (!file_exists($checkpath) || !is_dir($checkpath)) {
+ return false;
+ }
+ return $returnpath;
+}
+
?>
\ No newline at end of file
return false;
}
$dates = array_keys($latest);
- $latest = $latest[$dates[0]];
+ $eventdate = $dates[0];
+ $latest = $latest[$eventdate];
$attendee = $latest['attendees'][array_rand($latest['attendees'])];
$title = $this->title;
echo '
<td colspan="2" nowrap="nowrap"><b>Most recent breakfast:</b></td>
</tr>
<tr>
- <td colspan="2">'.$latest['cafe'].' on '.$latest['nicedate'].' with '.$latest['num'].' people</td>
+ <td colspan="2">'.$latest['cafe'].' on '.$latest['nicedate'].' with '.$latest['num'].' people';
+ if ($path = breakfast_has_photos($eventdate)) {
+ echo ' (<a href="'.$path.'">photos</a>) ';
+ }
+echo '</td>
</tr>
<tr>
<td colspan="2"><b>'.((!empty($attendee['alias'])) ? $attendee['alias'] : $attendee['name'])