From ace85a48416dbe188d9a030630d0aa62cd2c8b99 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 22 Jul 2003 20:36:03 +0000 Subject: [PATCH] Finalized alphabetical profile listing functions. svn path=/trunk/boinc/; revision=1767 --- html/ops/gallery.inc | 39 ++++++--------------------------------- 1 file changed, 6 insertions(+), 33 deletions(-) diff --git a/html/ops/gallery.inc b/html/ops/gallery.inc index 31f56a36c1..048acaeeda 100644 --- a/html/ops/gallery.inc +++ b/html/ops/gallery.inc @@ -211,36 +211,6 @@ function build_profile_pages($members, $pageHead, $pageTitle, $rowsPerPage, $col } -// A generalized function to create a summary page for pages created by build_profile_pages. -// TODO: Check paths; probably have to add some more parameters. - -// TODO: REMOVE - -function build_profile_summary_page($members, $pageHead, $pageTitle, $columnHead, $filePath, $fileName) { - $elements = array_keys($members); - - $filename = $filePath . $baseFileName . ".html"; - $descriptor = fopen($filename, "w"); - - page_head($pageHead, null, $descriptor); - fwrite($descriptor, "

$pageTitle

Last updated " . gmdate("r") . " UTC

"); - - fwrite($descriptor, "\n"); - fwrite($descriptor, "\n"); - - foreach ($elements as $element) { - $numMembers = count($members[$element]); - - fwrite($descriptor, "\n\n"); - - } - - fwrite($descriptor, "
$columnHeadProfiles
$element$numMembers
"); - page_tail($descriptor); - - fclose($descriptor); -} - function build_country_summary_page($countryMembers) { $countries = array_keys($countryMembers); @@ -269,14 +239,17 @@ function build_country_summary_page($countryMembers) { function build_alpha_summary_page($characters) { // OK, so it's not quite the alphabet- whatever. - $alphabet = array('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',0,1,2,3,4,5,6,7,8,9); + $alphabet = array('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','0','1','2','3','4','5','6','7','8','9'); - $filename = "../html_user/" . PROFILE_PATH . "profile_alpha.html"; + $filename = "../html_user/profile_alpha.html"; $descriptor = fopen($filename, "w"); + // TODO: Add "other" to handle non-alphanumeric first characters. + foreach ($alphabet as $character) { if (in_array($character, $characters)) { - fwrite($descriptor, "$character "); + fwrite($descriptor, "$character "); + } else { fwrite($descriptor, "$character "); }