2000-03-06 08:12:43 +00:00
|
|
|
<?php
|
2000-03-08 22:59:34 +00:00
|
|
|
/* Helpful constants */
|
|
|
|
$tableHeadColor = '#737b9c';
|
|
|
|
$menuHeadColor = '#737b9c';
|
|
|
|
$menuBgColor = '#4b4f66';
|
2000-03-06 08:12:43 +00:00
|
|
|
/* Array functions */
|
|
|
|
// Search array for data
|
|
|
|
function inArray( $needle, $haystack )
|
|
|
|
{
|
|
|
|
$found = false;
|
|
|
|
|
|
|
|
for ( $ptr = 0 ; $ptr < count ( $haystack ) ; $ptr++ ) {
|
|
|
|
if ( $haystack[$ptr] == $needle ) {
|
|
|
|
$found = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return $found;
|
|
|
|
}
|
2000-03-08 02:11:42 +00:00
|
|
|
|
2000-03-16 12:17:56 +00:00
|
|
|
/* Network functions */
|
|
|
|
// Finger user @ host (for .plan)
|
|
|
|
function finger( $user, $host )
|
|
|
|
{
|
|
|
|
$fp = fsockopen( $host, 79, &$errno, &$errstr ) or die( "$errno: $errstr" );
|
|
|
|
fputs($fp, "$user\n");
|
|
|
|
while ( !feof( $fp ) ) {
|
|
|
|
echo fgets($fp, 128);
|
|
|
|
}
|
|
|
|
fclose($fp);
|
|
|
|
}
|
|
|
|
|
2000-03-08 02:11:42 +00:00
|
|
|
function progressKey() // Display key for progress bar
|
|
|
|
{
|
|
|
|
echo '<TR><TD> </TD><TD> </TD><TD align="center">' .
|
2000-03-08 17:45:31 +00:00
|
|
|
'<IMG src="/img/graph/ProgressBar.desc.png" ALT="0-33% Hackers, 34-67% Developers, 68-100% Users">' .
|
2000-03-08 02:11:42 +00:00
|
|
|
'</TD><TD> </TD><TD align="left" ></TD></TR>';
|
|
|
|
}
|
|
|
|
|
|
|
|
function progressBar( $name, $pct, $comments ) // display a 0-100% progress meter
|
|
|
|
{
|
|
|
|
$newPct = $pct - ($pct % 2);
|
|
|
|
$i = $pct;
|
|
|
|
$j = 100 - $newPct;
|
|
|
|
$result = '';
|
|
|
|
$result .= '<TR><TD align="right">' . $name . '</TD><TD> </TD><TD align="center">';
|
2000-03-08 17:45:31 +00:00
|
|
|
$result .= '<IMG src="/img/blank.gif" height="1" width="1" alt="' . $pct . '% Complete">';
|
2000-03-08 02:11:42 +00:00
|
|
|
for ( ; $i >= 20 ; $i -= 20 ) {
|
2000-03-08 18:20:51 +00:00
|
|
|
$result .= '<IMG src="/img/graph/ProgressBar.20.white.gif" alt=" ">';
|
2000-03-08 02:11:42 +00:00
|
|
|
}
|
|
|
|
for ( ; $i >= 10 ; $i -= 10 ) {
|
2000-03-08 18:20:51 +00:00
|
|
|
$result .= '<IMG src="/img/graph/ProgressBar.10.white.gif" alt=" ">';
|
2000-03-08 02:11:42 +00:00
|
|
|
}
|
|
|
|
for ( ; $i >= 2 ; $i -= 2 ) {
|
2000-03-08 18:20:51 +00:00
|
|
|
$result .= '<IMG src="/img/graph/ProgressBar.2.white.gif" alt=" ">';
|
2000-03-08 02:11:42 +00:00
|
|
|
}
|
|
|
|
for ( ; $j >= 20 ; $j -= 20 ) {
|
2000-03-08 18:20:51 +00:00
|
|
|
$result .= '<IMG src="/img/graph/ProgressBar.20.gray.gif" alt=" ">';
|
2000-03-08 02:11:42 +00:00
|
|
|
}
|
|
|
|
for ( ; $j >= 10 ; $j -= 10 ) {
|
2000-03-08 18:20:51 +00:00
|
|
|
$result .= '<IMG src="/img/graph/ProgressBar.10.gray.gif" alt=" ">';
|
2000-03-08 02:11:42 +00:00
|
|
|
}
|
|
|
|
for ( ; $j >= 2 ; $j -= 2 ) {
|
2000-03-08 18:20:51 +00:00
|
|
|
$result .= '<IMG src="/img/graph/ProgressBar.2.gray.gif" alt=" ">';
|
2000-03-08 02:11:42 +00:00
|
|
|
}
|
|
|
|
$result .= '</TD><TD> </TD><TD align="left" >' . $comments . '</TD></TR>';
|
|
|
|
echo $result;
|
|
|
|
}
|
2000-03-06 08:12:43 +00:00
|
|
|
|
|
|
|
/* Sections */
|
|
|
|
function isFocused( $name, $newname )
|
|
|
|
{
|
|
|
|
return ( strToLower( $name ) == strToLower( $newname ) ) ? 1 : 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
function iconLink ( $url, $img, $desc, $border )
|
|
|
|
{
|
2000-03-07 21:43:09 +00:00
|
|
|
echo '<A class="tabs" href="' . $url . '"><IMG src="' . $img . '" alt="' . $desc . '" border="' . $border . '" width="24" height="24"></A> ';
|
2000-03-06 08:12:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Menu functions */
|
|
|
|
// Create a Menu item
|
|
|
|
function menuItemLink( $url, $desc )
|
|
|
|
{
|
|
|
|
echo '<A CLASS="menus" HREF="' . $url . '">' . $desc . '</A><BR>';
|
|
|
|
}
|
|
|
|
// Create a Menu Section header
|
2000-03-08 22:59:34 +00:00
|
|
|
function menuSectionHeader( $name, $fgColor , $bgColor, $intBgColor )
|
2000-03-06 08:12:43 +00:00
|
|
|
{
|
2000-03-08 22:59:34 +00:00
|
|
|
echo "\n<!-- menuSectionHeader(" . $name . ') -->' .
|
|
|
|
'<TABLE cellSpacing="0" cellPadding="3" width="100%" border=0 bgColor="' . $bgColor . '">' .
|
|
|
|
' <TR bgColor="' . $bgColor . '">' .
|
|
|
|
' <TD align="center">' .
|
|
|
|
' <IMG src="/img/blank.gif" height="1" width="135" alt="" border="0"><BR>' .
|
|
|
|
' <SPAN class="titlebar">' . $name . '</SPAN>' .
|
|
|
|
' </TD>' .
|
|
|
|
' </TR>' .
|
|
|
|
' <TR align="right" bgColor="' . $intBgColor . '">' .
|
|
|
|
' <TD>';
|
2000-03-06 08:12:43 +00:00
|
|
|
}
|
|
|
|
// Create a Menu Section footer
|
|
|
|
function menuSectionFooter()
|
|
|
|
{
|
|
|
|
echo ' </TD>' .
|
|
|
|
' </TR>' .
|
|
|
|
'</TABLE>';
|
|
|
|
}
|
|
|
|
/* Table functions */
|
|
|
|
//
|
2000-03-08 22:59:34 +00:00
|
|
|
function tableBoxHeader( $bgColor, $intBgColor )
|
2000-03-06 08:12:43 +00:00
|
|
|
{
|
|
|
|
echo '<TABLE cellSpacing="0" cellPadding="1" width="100%" border="0" bgColor="' . $bgColor . '">' .
|
|
|
|
' <TR>' .
|
|
|
|
' <TD>' .
|
2000-03-08 22:59:34 +00:00
|
|
|
' <TABLE cellspacing="1" cellpadding="2" width="100%" border="0" bgcolor="' . $intBgColor . '">';
|
2000-03-06 08:12:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function tableBoxFooter()
|
|
|
|
{
|
|
|
|
echo ' </TABLE>' .
|
|
|
|
' </TD>' .
|
|
|
|
' </TR>' .
|
|
|
|
'</TABLE>';
|
|
|
|
}
|
2000-03-08 22:59:34 +00:00
|
|
|
|
|
|
|
function tableTitle($name, $cols, $bgColor)
|
|
|
|
{
|
|
|
|
echo ' <TR bgColor="' . $bgColor . '" align="center">' .
|
|
|
|
' <TD colspan="' . $cols . '">' .
|
|
|
|
' <SPAN class="titlebar">' . $name . '</SPAN>' .
|
|
|
|
' </TD>' .
|
|
|
|
' </TR>';
|
|
|
|
}
|
2000-03-08 02:11:42 +00:00
|
|
|
|
|
|
|
function tableHeader( $cols, $fgColor, $bgColor )
|
|
|
|
{
|
|
|
|
echo '<TABLE cellSpacing="0" cellPadding="0" width="100%" border="0" bgColor="' . $bgColor . '">';
|
|
|
|
}
|
|
|
|
|
|
|
|
function tableFooter()
|
|
|
|
{
|
|
|
|
echo '</TABLE>';
|
|
|
|
}
|
2000-03-06 08:12:43 +00:00
|
|
|
|
|
|
|
function tableNewsItem( $date, $user, $text )
|
|
|
|
{
|
|
|
|
echo '<TR><TD><DL><DT>Posted on ' . $date . ' by ' . $user . '</DT>' .
|
|
|
|
' <DD>' . $text . '</DD>' .
|
|
|
|
'</DL></TD></TR>';
|
|
|
|
}
|
2000-03-06 17:48:51 +00:00
|
|
|
|
2000-03-06 08:12:43 +00:00
|
|
|
function tableSpacer( $height, $width, $cols, $bgColor )
|
|
|
|
{
|
2000-03-08 22:59:34 +00:00
|
|
|
echo '<TD colSpan="' . $cols . '" width="' . $width . '" bgColor="' . $bgColor . '">' .
|
|
|
|
' <IMG src="/img/misc/blank.gif" height="' . $height . '" width="' . $width . '" border="0" alt="">' .
|
|
|
|
'</TD>';
|
2000-03-06 08:12:43 +00:00
|
|
|
}
|
|
|
|
?>
|