cvs: php-master-web /scripts event_listing

From: Date: Wed, 07 Feb 2007 21:46:04 +0000
Subject: cvs: php-master-web /scripts event_listing
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-34127@lists.php.net to get a copy of this message
bjori Wed Feb 7 21:46:04 2007 UTC Modified files: /php-master-web/scripts event_listing Log: "buffer" each category so we can sort the output as we want Move conference events to the top http://cvs.php.net/viewvc.cgi/php-master-web/scripts/event_listing?r1=1.6&r2=1.7&diff_format=u Index: php-master-web/scripts/event_listing diff -u php-master-web/scripts/event_listing:1.6 php-master-web/scripts/event_listing:1.7 --- php-master-web/scripts/event_listing:1.6 Wed Feb 7 18:57:24 2007 +++ php-master-web/scripts/event_listing Wed Feb 7 21:46:04 2007 @@ -31,6 +31,7 @@ "<h3>Upcoming Events <a href=\"/submit-event.php\">[add]</a></h3>\n" ); + $content = ""; $buffer = array(); // While we can read the events file while (TRUE) { @@ -64,24 +65,44 @@ // Start new category with a category header if ($ccat != (int) $cat) { - fwrite($out, '<h4>' . $cats[$cat] . "</h4>\n"); + if($ccat) { + // "buffer" the current content before we move onto next category + $buffer[$ccat] = $content; + } + + $content = '<h4>' . $cats[$cat] . "</h4>\n"; $ccat = $cat; } // There is no event with this description in this month already seen if (!isset($seen[$desc])) { - // Add event to sidebar - fwrite($out, "<span class=\"event_$ccode\">$d. <a href=\"/cal.php?id=$id\">" . + // Add event to the "buffer" + $content .= "<span class=\"event_$ccode\">$d. <a href=\"/cal.php?id=$id\">" . htmlspecialchars(stripslashes($desc)) . - "</a></span><br />\n" - ); + "</a></span><br />\n"; // Set seen flag $seen[$desc] = TRUE; } } - + // Add the last category to the "buffer" + $buffer[$ccat] = $content; + + // Organize the output + if ($buffer[2]) { // Conferences + fwrite($out, $buffer[2]); + } + if ($buffer[1]) { // User Group Events + fwrite($out, $buffer[1]); + } + if ($buffer[3]) { // Training + fwrite($out, $buffer[3]); + } + if ($buffer[0]) { // Unkown + fwrite($out, $buffer[0]); + } + // End heredoc string fwrite($out, "END_RSIDEBAR_DATA;\n");

« previous php.mirrors (#34127) next »