",$HOME_BASE_COLOR,$page_top); $page_top = ereg_replace("<@PROJECTS_BASE@>",$HOME_BASE_COLOR,$page_top); $page_top = ereg_replace("<@PUBLICATIONS_BASE@>",$HOME_BASE_COLOR,$page_top); $page_top = ereg_replace("<@PEOPLE_BASE@>",$HOME_BASE_COLOR,$page_top); $page_top = ereg_replace("<@DEMOS_BASE@>",$HOME_BASE_COLOR,$page_top); $page_top = ereg_replace("<@INTERNAL_BASE@>",$HOME_BASE_COLOR,$page_top); $page_top = ereg_replace("<@HOME_ON@>",$HOME_ON_COLOR,$page_top); $page_top = ereg_replace("<@PROJECTS_ON@>",$HOME_ON_COLOR,$page_top); $page_top = ereg_replace("<@PUBLICATIONS_ON@>",$HOME_ON_COLOR,$page_top); $page_top = ereg_replace("<@PEOPLE_ON@>",$HOME_ON_COLOR,$page_top); $page_top = ereg_replace("<@DEMOS_ON@>",$HOME_ON_COLOR,$page_top); $page_top = ereg_replace("<@INTERNAL_ON@>",$HOME_ON_COLOR,$page_top); //other colors: $page_top = ereg_replace("<@HEAD1@>",$HEAD1_COLOR,$page_top); $page_top = ereg_replace("<@HEAD2@>",$HEAD2_COLOR,$page_top); $page_top = ereg_replace("<@HEAD3@>",$HEAD3_COLOR,$page_top); $page_top = ereg_replace("<@HEAD4@>",$HEAD4_COLOR,$page_top); $page_top = ereg_replace("<@MENU1@>",$MENU1_COLOR,$page_top); $page_top = ereg_replace("<@MENU2@>",$MENU2_COLOR,$page_top); $page_top = ereg_replace("<@SIDE@>",$SIDE_COLOR,$page_top); $page_top = ereg_replace("<@MAIN@>",$MAIN_COLOR,$page_top); $page_top = ereg_replace("<@BODY@>",$BODY_COLOR,$page_top); //dimensions: $page_top = ereg_replace("<@MAIN_HEIGHT@>",$MAIN_HEIGHT,$page_top); $page_top = ereg_replace("<@SIDE_TITLE_HEIGHT@>",$SIDE_TITLE_HEIGHT,$page_top); $page_top = ereg_replace("<@SIDE_TITLE_TOP@>",$SIDE_TITLE_TOP,$page_top); $page_top = ereg_replace("<@SIDE_TITLE_BOTTOM@>",$SIDE_TITLE_BOTTOM,$page_top); $page_top = ereg_replace("<@SIDE_BELOW_HEIGHT@>",$SIDE_BELOW_HEIGHT,$page_top); $page_top = ereg_replace("<@PAGE_WIDTH@>",$PAGE_WIDTH,$page_top); //$page_top =ereg_replace("AI VISION: %s\n",$pagename); printf("%s",$page_top); } function parseItem($str) { $item=array(); if (preg_match_all("/,[ \t\n]*([^ ,\t\n=]+)[ \t\n]*=[ \t\n]*\"([^\"]*)\"/",$str,$matches)) { $i=0; foreach ($matches[1] as $match) { $item[$match]=$matches[2][$i++]; } } return $item; } function showProjects($filename,$label) { $fd=fopen($filename,"r"); $contents=fread($fd,filesize($filename)); fclose($fd); $pattern="/@".$label."{[^}]*}/"; if (preg_match_all($pattern,$contents,$matches)) { foreach ($matches[0] as $match) { $item=parseItem($match); if ($item["name"]!="") { if ($item["url"]!="") { printf("%s
\n",$item["url"],$item["name"]); } else { printf("%s
\n",$item["name"]); } if ($item["logo"]!="") { printf("
\n",$item["logo"]); } else { printf("
\n"); } if ($item["blurb"]!="") { printf("%s\n",$item["blurb"]); } } printf("

\n"); } } } function showPeople($label,$filename,$heading) { $fd=fopen($filename,"r"); $contents=fread($fd,filesize($filename)); fclose($fd); $pattern="/@".$label."{[^}]*}/"; if (preg_match_all($pattern,$contents,$matches)) { printf("%s

",$heading); foreach ($matches[0] as $match) { $item=parseItem($match); if ($item["name"]!="") { if ($item["email"]!="") { printf("\n",$item["email"],"../images/email.gif"); } else { printf("   \n"); } if ($item["url"]!="") { printf("%s\n",$item["url"],$item["name"]); } else { printf("%s\n",$item["name"]); } } printf("
\n"); } printf("

\n"); } } ?>