diff --git a/lib/array.php b/lib/array.php index 61f2df3..680c53f 100644 --- a/lib/array.php +++ b/lib/array.php @@ -4,8 +4,7 @@ Array-handling function library - Copyright (C) 2000 Contributors of the QuakeForge Project - Please see the file "AUTHORS" for a list of contributors + Copyright (C) 2000, 2001 Jeff Teunissen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -25,18 +24,19 @@ 59 Temple Place - Suite 330 Boston, MA 02111-1307, USA. */ + define ('_ARRAY_', 1); /* inArray Search an array for data */ - function inArray( $needle, $haystack ) + function inArray ($needle, $haystack) { $found = false; - for ( $ptr = 0 ; $ptr < count ( $haystack ) ; $ptr++ ) { - if ( $haystack[$ptr] == $needle ) { + for ($ptr = 0; $ptr < count ($haystack); $ptr++) { + if ($haystack[$ptr] == $needle) { $found = true; } } @@ -48,18 +48,17 @@ Add an element to an array */ - function addToArray( $var, &$arr ) + function addToArray ($var, &$arr) { if (!inArray ($var, $arr)) { if (isset ($arr)) { - $arr[count( $arr )] = $var; + $arr[count ($arr)] = $var; } else { $arr = array ($var); } } } - define('_ARRAY_', 1); addToArray ('array', $has); addToArray ('array', $needs); ?> diff --git a/lib/auth.php b/lib/auth.php index c498937..92fd600 100644 --- a/lib/auth.php +++ b/lib/auth.php @@ -4,8 +4,7 @@ Authentication/Authorization function library - Copyright (C) 2000 Contributors of the QuakeForge Project - Please see the file "AUTHORS" for a list of contributors + Copyright (C) 2000, 2001 Jeff Teunissen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -25,7 +24,6 @@ 59 Temple Place - Suite 330 Boston, MA 02111-1307, USA. */ - have ('auth'); need ('table'); @@ -69,31 +67,31 @@ CREATE TABLE members ( - + - + - + - + - + - +
@@ -132,7 +130,7 @@ CREATE TABLE members ( { $digest = md5 (time ()); $cookie = "$userName-$encryptedPassWord-$digest"; - SetCookie ("loginInfo", $cookie, (time() + EXPIRY)); + SetCookie ("loginInfo", $cookie, (time () + EXPIRY)); $query = "UPDATE members SET u_secret='$digest'" . " WHERE u_username='$userName'"; @@ -165,7 +163,7 @@ CREATE TABLE members ( */ function authCookie ($cookie, $userName, $password) { - $cookie_var = split("-", $cookie); + $cookie_var = split ("-", $cookie); $cUserName = $cookie_var[0]; $cPassword = $cookie_var[1]; $secret = $cookie_var[2]; diff --git a/lib/date.php b/lib/date.php index 265e362..4adcd25 100644 --- a/lib/date.php +++ b/lib/date.php @@ -4,8 +4,7 @@ Date data and functions - Copyright (C) 2000 Contributors of the QuakeForge Project - Please see the file "AUTHORS" for a list of contributors + Copyright (C) 2000, 2001 Jeff Teunissen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -28,21 +27,21 @@ have('date'); - $shortMonths = array( 1=>'Jan', 2=>'Feb', 3=>'Mar', 4=>'Apr', + $shortMonths = array ( 1=>'Jan', 2=>'Feb', 3=>'Mar', 4=>'Apr', 5=>'May', 6=>'Jun', 7=>'Jul', 8=>'Aug', 9=>'Sep', 10=>'Oct', 11=>'Nov', 12=>'Dec'); - function fileParseDate($date) + function fileParseDate ($date) { global $shortMonths; - return substr( $date, 3 ) . ' ' . $shortMonths[substr( $date, 1, 2 )]; + return substr ($date, 3) . ' ' . $shortMonths[substr ($date, 1, 2)]; } - function dateFromSQLDateTime( $sqlDateTime ) + function dateFromSQLDateTime ($sqlDateTime) { - $time = explode( ' ', $sqlDateTime ); - $date = explode( '-', $time[0] ); - return strftime( '%d %b %Y', mktime( 0, 0, 0, $date[1], $date[2], $date[0])); + $time = explode ( ' ', $sqlDateTime); + $date = explode ( '-', $time[0]); + return strftime ( '%d %b %Y', mktime (0, 0, 0, $date[1], $date[2], $date[0])); } ?> diff --git a/lib/file.php b/lib/file.php index 4d12d96..558c255 100644 --- a/lib/file.php +++ b/lib/file.php @@ -4,8 +4,7 @@ File processing function library - Copyright (C) 2000 Contributors of the QuakeForge Project - Please see the file "AUTHORS" for a list of contributors + Copyright (C) 2000, 2001 Jeff Teunissen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -25,7 +24,6 @@ 59 Temple Place - Suite 330 Boston, MA 02111-1307, USA. */ - have ('file'); /* @@ -33,20 +31,20 @@ Display a file with email addresses and URLs translated to links. */ - function fileTranslateUrl( $filename ) { + function fileTranslateUrl ($filename) { - $file = fopen( $filename, "r"); + $file = fopen ($filename, "r"); - while ($line = fgets( $file, 2048 )) { - if ( preg_match( "/\/", "", $words[1]); + while ($line = fgets ($file, 2048)) { + if (preg_match ("/\/", "", $words[1]); echo '' . $words[0] . '
'; } else { - $line = preg_replace( "/http:\/\/(.*)/", "http://\\1
", $line ); + $line = preg_replace ("/http:\/\/(.*)/", "http://\\1
", $line); echo $line; } } - fclose( $file ); + fclose ($file); } ?> diff --git a/lib/graph.php b/lib/graph.php index 53ea575..bec4c76 100644 --- a/lib/graph.php +++ b/lib/graph.php @@ -4,8 +4,7 @@ Graphing function library - Copyright (C) 2000 Contributors of the QuakeForge Project - Please see the file "AUTHORS" for a list of contributors + Copyright (C) 2000,2001 Jeff Teunissen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -25,7 +24,6 @@ 59 Temple Place - Suite 330 Boston, MA 02111-1307, USA. */ - have ('graph'); /* @@ -33,30 +31,37 @@ Return HTML for a 0-100% meter 250 pixels wide and 10 pixels high. */ - function barGraph( $pct ) + function barGraph ($pct) { $newPct = $pct - ($pct % 2); $i = $pct; $j = 100 - $newPct; $result = ''; - for ( ; $i >= 20 ; $i -= 20 ) { + + for (; $i >= 20; $i -= 20) { $result .= ' '; } - for ( ; $i >= 10 ; $i -= 10 ) { + + for (; $i >= 10; $i -= 10) { $result .= ' '; } - for ( ; $i >= 2 ; $i -= 2 ) { + + for (; $i >= 2; $i -= 2) { $result .= ' '; } - for ( ; $j >= 20 ; $j -= 20 ) { + + for (; $j >= 20; $j -= 20) { $result .= ' '; } - for ( ; $j >= 10 ; $j -= 10 ) { + + for (; $j >= 10; $j -= 10) { $result .= ' '; } - for ( ; $j >= 2 ; $j -= 2 ) { + + for (; $j >= 2; $j -= 2) { $result .= ' '; } + return $result; } ?> diff --git a/lib/network.php b/lib/network.php index 97a534c..303679f 100644 --- a/lib/network.php +++ b/lib/network.php @@ -4,8 +4,7 @@ Network function library - Copyright (C) 2000 Contributors of the QuakeForge Project - Please see the file "AUTHORS" for a list of contributors + Copyright (C) 2000,2001 Jeff Teunissen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -26,19 +25,21 @@ Boston, MA 02111-1307, USA. */ have ('network'); + /* finger Connect to a finger daemon and get information about a user. */ - function finger( $user, $host ) + 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 ); + $fp = fsockopen ($host, 79, &$errno, &$errstr) or die ("$errno: $errstr"); + + fputs ($fp, "$user\n"); + while (!(feof ($fp))) { + echo fgets ($fp, 128); } - fclose( $fp ); + fclose ($fp); } ?> diff --git a/lib/news.php b/lib/news.php index 6fca1ba..5bf6070 100644 --- a/lib/news.php +++ b/lib/news.php @@ -4,8 +4,8 @@ SQL-based news reading library - Copyright (C) 2000 Contributors of the QuakeForge Project - Please see the file "AUTHORS" for a list of contributors + Copyright (C) 2000,2001 Jeff Teunissen + Copyright (C) 2000 Daniel David Olson This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -30,7 +30,6 @@ function newsItem ($date, $user, $text) { - if ($user == "Theoddone33") $user = "theoddone33"; echo '' . ' ' . '
' . @@ -45,7 +44,6 @@ { need ("date"); - if ($array[n_user] == "Theoddone33") $user = "theoddone33"; return '' . ' ' . '
' . diff --git a/lib/sql.php b/lib/sql.php index ec24820..6bad7da 100644 --- a/lib/sql.php +++ b/lib/sql.php @@ -4,8 +4,7 @@ SQL function library - Copyright (C) 2000 Contributors of the QuakeForge Project - Please see the file "AUTHORS" for a list of contributors + Copyright (C) 2000,2001 Jeff Teunissen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/lib/table.php b/lib/table.php index 263b6f4..e115284 100644 --- a/lib/table.php +++ b/lib/table.php @@ -4,8 +4,7 @@ Table function library - Copyright (C) 2000 Contributors of the QuakeForge Project - Please see the file "AUTHORS" for a list of contributors + Copyright (C) 2000,2001 Jeff Teunissen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License