CVSROOT    : /cvsroot/undernet-ircu
Module     : homepage
Commit time: 2003-01-11 22:27:31 UTC

Modified files:
     bugs.php cvs.php index.php lhs.php members.php policy.php

Added files:
     button.php headfoot.php images.php inc.php

Log message:

Author: Kev <[EMAIL PROTECTED]>
Log message:

Revamp the button bar and do away with the need for header.php and
footer.php by replacing them with php functions.  Also unify button bar
with the output of the lhs() function and add an explicit link for our
project page; sourceforge logo now points to sourceforge top-level.

---------------------- diff included ----------------------
Index: homepage/bugs.php
diff -u homepage/bugs.php:1.3 homepage/bugs.php:1.4
--- homepage/bugs.php:1.3       Thu Jan  9 23:20:43 2003
+++ homepage/bugs.php   Sat Jan 11 14:27:20 2003
@@ -1,20 +1,8 @@
-<? include("header.php"); include("lhs.php"); ?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
-"http://www.w3.org/TR/REC-html40/loose.dtd";>
-<!--
-  Author:   Sarah Kuehnle
-  Company:  The Design Girl
-  Web Site: http://www.thedesigngirl.com/
-  Email:    [EMAIL PROTECTED]
--->
-<html lang="en">
-<head>
-<meta http-equiv="Content-Type" content=
-"text/html; charset=windows-1252">
-<meta http-equiv="Content-Language" content="en-us">
-<title>Reporting Bugs - Undernet Ircd Development</title>
-</head>
-<body bgcolor="#FFFFFF">
+<?php
+include("inc.php");
+
+head('bugs');
+?>
 <div align="center">
 <table border="0" width="600" cellspacing="5" cellpadding="5"
 summary="Main layout table.">
@@ -61,6 +49,4 @@
 </tr>
 </table>
 </div>
-</body>
-</html>
-<? include("footer.php"); ?>
+<?php foot(); ?>
Index: homepage/button.php
diff -u /dev/null homepage/button.php:1.1
--- /dev/null   Sat Jan 11 14:27:31 2003
+++ homepage/button.php Sat Jan 11 14:27:20 2003
@@ -0,0 +1,5 @@
+<?php
+require("inc.php");
+
+button_image($_GET['text'], $_GET['active'], $_GET['emph']);
+?>
Index: homepage/cvs.php
diff -u homepage/cvs.php:1.3 homepage/cvs.php:1.4
--- homepage/cvs.php:1.3        Thu Jan  9 23:20:43 2003
+++ homepage/cvs.php    Sat Jan 11 14:27:20 2003
@@ -1,20 +1,8 @@
-<? include("header.php"); include("lhs.php"); ?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
-"http://www.w3.org/TR/REC-html40/loose.dtd";>
-<!--
-  Author:   Sarah Kuehnle
-  Company:  The Design Girl
-  Web Site: http://www.thedesigngirl.com/
-  Email:    [EMAIL PROTECTED]
--->
-<html lang="en">
-<head>
-<meta http-equiv="Content-Type" content=
-"text/html; charset=windows-1252">
-<meta http-equiv="Content-Language" content="en-us">
-<title>Online CVS Repository - Undernet Ircd Development</title>
-</head>
-<body bgcolor="#FFFFFF">
+<?php
+include("inc.php");
+
+head('cvs');
+?>
 <div align="center">
 <table border="0" width="600" cellspacing="5" cellpadding="5"
 height="540" summary="Main layout table.">
@@ -89,6 +77,4 @@
 </tr>
 </table>
 </div>
-</body>
-</html>
-<? include("footer.php"); ?>
+<?php foot(); ?>
Index: homepage/headfoot.php
diff -u /dev/null homepage/headfoot.php:1.1
--- /dev/null   Sat Jan 11 14:27:31 2003
+++ homepage/headfoot.php       Sat Jan 11 14:27:20 2003
@@ -0,0 +1,117 @@
+<?php
+
+function head($link) {
+  ?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+
+<HTML>
+<HEAD>
+<TITLE><?php echo $GLOBALS['link_map'][$link]['title']; ?></TITLE>
+<LINK REL="stylesheet" TYPE="text/css" HREF="main.css">
+
+<script language="JavaScript">
+<!--
+function MM_preloadImages() { //v2.0
+  if (document.images) {
+    var imgFiles = MM_preloadImages.arguments;
+    if (document.preloadArray==null) document.preloadArray = new Array();
+    var i = document.preloadArray.length;
+    with (document) for (var j=0; j<imgFiles.length; j++) if 
+(imgFiles[j].charAt(0)!="#"){
+      preloadArray[i] = new Image;
+      preloadArray[i++].src = imgFiles[j];
+  } }
+}
+
+function MM_swapImgRestore() { //v2.0
+  if (document.MM_swapImgData != null)
+    for (var i=0; i<(document.MM_swapImgData.length-1); i+=2)
+      document.MM_swapImgData[i].src = document.MM_swapImgData[i+1];
+}
+
+function MM_swapImage() { //v2.0
+  var i,j=0,objStr,obj,swapArray=new Array,oldArray=document.MM_swapImgData;
+  for (i=0; i < (MM_swapImage.arguments.length-2); i+=3) {
+    objStr = MM_swapImage.arguments[(navigator.appName == 'Netscape')?i:i+1];
+    if ((objStr.indexOf('document.layers[')==0 && document.layers==null) ||
+        (objStr.indexOf('document.all[')   ==0 && document.all   ==null))
+      objStr = 'document'+objStr.substring(objStr.lastIndexOf('.'),objStr.length);
+    obj = eval(objStr);
+    if (obj != null) {
+      swapArray[j++] = obj;
+      swapArray[j++] = (oldArray==null || oldArray[j-1]!=obj)?obj.src:oldArray[j];
+      obj.src = MM_swapImage.arguments[i+2];
+  } }
+  document.MM_swapImgData = swapArray; //used for restore
+}
+//-->
+</script>
+</HEAD>
+
+<BODY link="#456496" alink="#456496" vlink="#456496" bgcolor="#F0F0F0"
+ leftmargin="0" topmargin="0" marginheight="0" marginwidth="0">
+<table cellspacing="0" cellpadding="0" border="0" width="100%" height="100%">
+<tr>
+    <td colspan="2" height="94" width="100%" bgcolor="#456395" 
+background="design/top_bg.gif" valign="top" align="left"><a 
+href="http://www.undernet.org";><img src="design/logo4.jpg" width=261 height=94 
+alt="Welcome to the undernet IRC network" border="0"></a>
+</td>
+</tr>
+<tr>
+    <td bgcolor="#D9D9D9" colspan="2" height="1"><img src="design/trsp.gif" width=1 
+height=1 border="0" alt=""></td>
+</tr>
+<tr>
+    <td bgcolor="#000000" colspan="2" height="1"><img src="design/trsp.gif" width=1 
+height=1 border="0"  alt=""></td>
+</tr>
+<tr>
+    <td bgcolor="#FFFFFF" colspan="2" height="1"><img src="design/trsp.gif" width=1 
+height=1 border="0" alt=""></td>
+</tr>
+<tr>
+    <td bgcolor="#AAAAAA" colspan="2" height="18"><img src="design/trsp.gif" width=1 
+height=18 border="0" alt=""></td> </tr>
+<tr>
+    <td bgcolor="#000000" colspan="2" height="1"><img src="design/trsp.gif" width=1 
+height=1 border="0" alt=""></td>
+</tr>
+<tr>
+    <td bgcolor="#FFFFFF" colspan="2" height="1"><img src="design/trsp.gif" width=1 
+height=1 border="0" alt=""></td>
+</tr>
+
+
+<tr>
+<!-- here comes the anoying menu code -->
+
+    <td bgcolor="#CCCCCC" colspan="2" height="18"><?php button_linkbar($link); ?></td>
+
+</tr>
+<tr>
+    <td bgcolor="#000000" colspan="2" height="1"><img src="/design/trsp.gif" width=1 
+height=1 border="0" alt=""></td>
+</tr>
+<tr>
+    <td bgcolor="#ffffff" colspan="2" height="7"><img src="/design/trsp.gif" width=1 
+height=1 border="0" alt=""></td>
+</tr>
+<tr>
+    <td bgcolor="#C9C9C9" colspan="2" height="1"><img src="/design/trsp.gif" width=1 
+height=1 border="0" alt=""></td>
+</tr>
+<tr>
+    <td colspan="2" height="100%" valign="top">
+<!-- content begins -->
+<?php
+}
+
+function foot() {
+  ?>
+<!-- content ends -->
+    </td>
+</tr>
+<tr>
+    <td bgcolor="#C9C9C9" colspan="2" height="1"><img src="design/trsp.gif" width=1 
+height=1 border="0" alt=""></td>
+</tr>
+<tr>
+    <td bgcolor="#ffffff" colspan="2" height="3"><img src="design/trsp.gif" width=1 
+height=3 border="0" alt=""></td>
+</tr>
+<tr>
+    <td bgcolor="#B8C2D8" colspan="2" height="19" valign="middle" align="center"><img 
+src="design/trsp.gif" width=1 height=19 border="0" hspace="10" alt=""><font size="2" 
+color="#545649" face="verdana,tahoma,arial,helvetica">Copyright &copy;  1994 - 2002 - 
+<a href="http://www.undernet.org/webmasters.php";>Copyright notice and contacts</a>. 
+Please read our <a 
+href="http://www.undernet.org/user-com/documents/aup.html";>Acceptable use policy</a> 
+</font></td>
+</tr>
+</table>
+</BODY>
+</HTML>
+<?php
+}
+
+?>
Index: homepage/images.php
diff -u /dev/null homepage/images.php:1.1
--- /dev/null   Sat Jan 11 14:27:31 2003
+++ homepage/images.php Sat Jan 11 14:27:20 2003
@@ -0,0 +1,93 @@
+<?php
+// Image button functions
+
+// This function determines the size of the resultant image
+function button_size($short, $emph) {
+  $bbox = imagettfbbox($GLOBALS['font_size'], 0,
+                      $emph ? $GLOBALS['font_emfile'] : $GLOBALS['font_file'],
+                      $GLOBALS['link_map'][$short]['text']);
+  return array($bbox[2] - $bbox[0] + $GLOBALS['font_lrpad'] * 2 +
+              ($GLOBALS['link_map'][$short]['pos'] ? 1 : 0),
+              $GLOBALS['font_size'] + $GLOBALS['font_tbpad'] * 2);
+}
+
+// This function formulates the cache file name
+function button_filename($short, $active, $emph) {
+  return $GLOBALS['font_cachedir'] . "/button_" . $short .
+    ($active ? "_active" : "") . ($emph ? "_emph" : "") . ".png";
+}
+
+// Output the button image
+function button_image($short, $active, $emph) {
+  if (!$GLOBALS['link_map'][$short])
+    return;
+
+  $cache = button_filename($short, $active, $emph);
+
+  if (!is_file($cache)) { // Generate image file
+    list($width, $height) = button_size($short, $emph);
+
+    $left = 0 + ($GLOBALS['link_map'][$short]['pos'] &&
+                $GLOBALS['link_map'][$short]['pos'] == 'first' ? 1 : 0);
+    $right = $width - ($GLOBALS['link_map'][$short]['pos'] &&
+                      $GLOBALS['link_map'][$short]['pos'] == 'last' ? 2 : 1);
+
+    // Create an image
+    $im = imagecreate($width, $height);
+
+    // Allocate the necessary colors
+    $black = imagecolorallocate($im, 0, 0, 0);
+    $white = imagecolorallocate($im, 255, 255, 255);
+    $bg = ($active ? imagecolorallocate($im, 164, 164, 164) :
+          imagecolorallocate($im, 204, 204, 204));
+
+    // Fill the image with the base color
+    imagefill($im, 0, 0, $bg);
+
+    // Draw the black and white separator lines
+    if ($left)
+      imageline($im, 0, 0, 0, $height - 1, $white);
+    imageline($im, $left, 0, $left, $height - 1, $black);
+    imageline($im, $right, 0, $right, $height - 1, $white);
+    if ($right != $width - 1)
+      imageline($im, $width - 1, 0, $width - 1, $height - 1, $black);
+
+    // Draw the text
+    imagettftext($im, $GLOBALS['font_size'], 0,
+                $GLOBALS['font_lrpad'] - 1 + $left,
+                $height - $GLOBALS['font_tbpad'], $black,
+                $emph ? $GLOBALS['font_emfile'] : $GLOBALS['font_file'],
+                $GLOBALS['link_map'][$short]['text']);
+
+    // Output the image to the cache file and clean up
+    imagepng($im, $cache);
+    imagedestroy($im);
+  }
+
+  // output the image to the browser
+  header("Content-type: image/png");
+  readfile($cache);
+}
+
+function button_linkbar($page) {
+  echo "<img src=\"design/trsp.gif\" width=15 height=1 border=\"0\" alt=\"\">";
+  $imgno = 1;
+  foreach ($GLOBALS['link_order'] as $link) {
+    $linkinfo = $GLOBALS['link_map'][$link];
+    if ($link != $page)
+      echo "<a href=\"" . $linkinfo['url'] . "\" " .
+       "onMouseOut=\"MM_swapImgRestore()\" " .
+       "onMouseOver=\"MM_swapImage('document.Image$imgno', ".
+       "'document.Image$imgno', 'button.php?text=$link&active=true', " .
+       "'#1')\">";
+    list ($width, $height) = button_size($link, $link == $page);
+    echo "<img src=\"button.php?text=$link" .
+      ($link == $page ? "&emph=true" : "") .
+      "\" width=$width height=$height " .
+      "alt=\"".$linkinfo['text']."\" border=\"0\" name=\"Image$imgno\">";
+    if ($link != $page)
+      echo "</a>";
+    $imgno++;
+  }
+}
+?>
\ No newline at end of file
Index: homepage/inc.php
diff -u /dev/null homepage/inc.php:1.1
--- /dev/null   Sat Jan 11 14:27:31 2003
+++ homepage/inc.php    Sat Jan 11 14:27:20 2003
@@ -0,0 +1,38 @@
+<?php
+require("conf.php");
+
+require("headfoot.php");
+require("images.php");
+require("lhs.php");
+
+$link_map = array('index'    => array('text' => 'Home',
+                                     'title'=> 'Undernet Ircd Development',
+                                     'pos'  => 'first',
+                                     'url'  => 'index.php'),
+                 'bugs'     => array('text' => 'Reporting bugs',
+                                     'title'=> 'Reporting Bugs',
+                                     'url'  => 'bugs.php'),
+                 'cvs'      => array('text' => 'CVS Repository',
+                                     'title'=> 'Online CVS Repository',
+                                     'url'  => 'cvs.php'),
+                 'viewcvs'  => array('text' => 'CVS Interface',
+                                     'url'  => 'http://cvs.undernet.org/' .
+                                     'cgi-bin/viewcvs.cgi/undernet-ircu/'),
+                 'policy'   => array('text' => 'Policy',
+                                     'title'=> 'Current Policy Guidelines',
+                                     'url'  => 'policy.php'),
+                 'members'  => array('text' => 'Members',
+                                     'title'=> 'Membership of Coder-com',
+                                     'url'  => 'members.php'),
+                 'gnuworld' => array('text' => 'GNUWorld services',
+                                     'url'  => 'http://gnuworld.undernet.' .
+                                     'org/'),
+                 'project'  => array('text' => 'SourceForge Project page',
+                                     'pos'  => 'last',
+                                     'url'  => 'http://sourceforge.net/' .
+                                     'projects/undernet-ircu/')
+                 );
+
+$link_order  = array('index', 'bugs', 'cvs', 'viewcvs', 'policy', 'members',
+                    'gnuworld', 'project');
+?>
Index: homepage/index.php
diff -u homepage/index.php:1.3 homepage/index.php:1.4
--- homepage/index.php:1.3      Thu Jan  9 23:20:43 2003
+++ homepage/index.php  Sat Jan 11 14:27:20 2003
@@ -1,20 +1,8 @@
-<? include("header.php"); include("lhs.php"); ?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
-"http://www.w3.org/TR/REC-html40/loose.dtd";>
-<!--
-  Author:   Sarah Kuehnle
-  Company:  The Design Girl
-  Web Site: http://www.thedesigngirl.com/
-  Email:    [EMAIL PROTECTED]
--->
-<html lang="en">
-<head>
-<meta http-equiv="Content-Type" content=
-"text/html; charset=windows-1252">
-<meta http-equiv="Content-Language" content="en-us">
-<title>Undernet Ircd Development</title>
-</head>
-<body bgcolor="#FFFFFF">
+<?php
+include("inc.php");
+
+head('index');
+?>
 <div align="center">
 <table border="0" width="600" cellspacing="5" cellpadding="5"
 height="591" summary="Main layout table.">
@@ -109,7 +97,4 @@
 </tr>
 </table>
 </div>
-</body>
-</html>
-
-<? include("footer.php"); ?>
+<?php foot(); ?>
Index: homepage/lhs.php
diff -u homepage/lhs.php:1.1 homepage/lhs.php:1.2
--- homepage/lhs.php:1.1        Thu Jan  9 23:20:43 2003
+++ homepage/lhs.php    Sat Jan 11 14:27:21 2003
@@ -1,44 +1,24 @@
 <?php
-$pages = array("index", "bugs", "cvs", "viewcvs", "policy", "members",
-              "gnuworld");
-$pageinfo = array("index"    => array("url"  => "index.php",
-                                     "text" => "Home"),
-                 "bugs"     => array("url"  => "bugs.php",
-                                     "text" => "Reporting Bugs"),
-                 "cvs"      => array("url"  => "cvs.php",
-                                     "text" => "CVS Repository Access"),
-                 "viewcvs"  => array("url"  => "http://cvs.undernet.org/"; .
-                                     "cgi-bin/viewcvs.cgi/undernet-ircu/",
-                                     "text" => "HTML Interface to CVS"),
-                 "policy"   => array("url"  => "policy.php",
-                                     "text" => "Current Policy Guidelines"),
-                 "members"  => array("url"  => "members.php",
-                                    "text" => "Members/Contributors"),
-                 "gnuworld" => array("url"  => "http://gnuworld.undernet.org";,
-                                     "text" => "GNUWorld services")
-                 );
-
 function lhs($src) {
-  global $pages, $pageinfo;
   ?>
-<p align="center"><a href="http://sourceforge.net/projects/undernet-ircu/";><img
+<p align="center"><a href="http://sourceforge.net/";><img
 src="http://sourceforge.net/sflogo.php?group_id=63470&amp;type=5";
 width="210" height="62" border="0" alt="SourceForge Logo"></a></p>
 <p align="center"><img border="0" src="images/logo.jpg" width=
 "205" height="120" alt="Undernet Coder Committee."></p>
 <ul>
 <?php
-   foreach ($pages as $page) {
+   foreach ($GLOBALS['link_order'] as $link) {
      echo '<li>';

-     if ($page == $src)
+     if ($link == $src)
        echo '<i>';
      else
-       echo '<a href="' . $pageinfo[$page]["url"] . '">';
+       echo '<a href="' . $GLOBALS['link_map'][$link]['url'] . '">';

-     echo $pageinfo[$page]["text"];
+     echo $GLOBALS['link_map'][$link]['text'];

-     if ($page == $src)
+     if ($link == $src)
        echo '</i>';
      else
        echo '</a>';
Index: homepage/members.php
diff -u homepage/members.php:1.3 homepage/members.php:1.4
--- homepage/members.php:1.3    Thu Jan  9 23:20:43 2003
+++ homepage/members.php        Sat Jan 11 14:27:21 2003
@@ -1,21 +1,8 @@
-<? include("header.php"); include("lhs.php"); ?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
-"http://www.w3.org/TR/REC-html40/loose.dtd";>
-<!--
-  Author:   Sarah Kuehnle
-  Company:  The Design Girl
-  Web Site: http://www.thedesigngirl.com/
-  Email:    [EMAIL PROTECTED]
--->
-<html lang="en">
-<head>
-<meta http-equiv="Content-Type" content=
-"text/html; charset=windows-1252">
-<meta http-equiv="Content-Language" content="en-us">
-<title>Membership of Coder-com - Undernet Ircd
-Development</title>
-</head>
-<body bgcolor="#FFFFFF">
+<?php
+include("inc.php");
+
+head('members');
+?>
 <div align="center">
 <table border="0" width="600" cellspacing="5" cellpadding="5"
 height="540" summary="Main layout table.">
@@ -121,6 +108,4 @@
 </tr>
 </table>
 </div>
-</body>
-</html>
-<? include("footer.php"); ?>
+<?php foot(); ?>
Index: homepage/policy.php
diff -u homepage/policy.php:1.3 homepage/policy.php:1.4
--- homepage/policy.php:1.3     Thu Jan  9 23:20:43 2003
+++ homepage/policy.php Sat Jan 11 14:27:21 2003
@@ -1,21 +1,8 @@
-<? include("header.php"); include("lhs.php"); ?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
-"http://www.w3.org/TR/REC-html40/loose.dtd";>
-<!--
-  Author:   Sarah Kuehnle
-  Company:  The Design Girl
-  Web Site: http://www.thedesigngirl.com/
-  Email:    [EMAIL PROTECTED]
--->
-<html lang="en">
-<head>
-<meta http-equiv="Content-Type" content=
-"text/html; charset=windows-1252">
-<meta http-equiv="Content-Language" content="en-us">
-<title>Current Policy Guidelines - Undernet Ircd
-Development</title>
-</head>
-<body bgcolor="#FFFFFF">
+<?php
+include("inc.php");
+
+head('policy');
+?>
 <div align="center">
 <table border="0" width="600" cellspacing="5" cellpadding="5"
 height="540" summary="Main layout table.">
@@ -533,6 +520,4 @@
 </tr>
 </table>
 </div>
-</body>
-</html>
-<? include("footer.php"); ?>
+<?php foot(); ?>
----------------------- End of diff -----------------------

Reply via email to