From 3302d0d493c207b9649f78761d93080020d73c56 Mon Sep 17 00:00:00 2001 From: lkehresman Date: Mon, 22 Nov 1999 16:43:47 +0000 Subject: [PATCH] updated functions git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@13 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/array.php3 | 41 ++++++++ functions/date.php3 | 161 ++++++++++++++++++++++++++++++++ functions/display_messages.php3 | 50 ++++++++++ functions/imap.php3 | 20 ++++ functions/mailbox.php3 | 123 ++++++++++++++++++++++++ functions/mailbox_display.php3 | 50 ++++++++++ functions/page_header.php3 | 30 ++++++ functions/strings.php3 | 30 ++++++ 8 files changed, 505 insertions(+) create mode 100644 functions/array.php3 create mode 100644 functions/date.php3 create mode 100644 functions/display_messages.php3 create mode 100644 functions/imap.php3 create mode 100644 functions/mailbox.php3 create mode 100644 functions/mailbox_display.php3 create mode 100644 functions/page_header.php3 create mode 100644 functions/strings.php3 diff --git a/functions/array.php3 b/functions/array.php3 new file mode 100644 index 00000000..049f63ca --- /dev/null +++ b/functions/array.php3 @@ -0,0 +1,41 @@ +col and $this->dir in a class + // Would beat using globals + if(!is_array($col)){ + $col = array("$col"); + } + $GLOBALS["col"] = $col; // Column or Columns as an array + $GLOBALS["dir"] = $dir; // Direction, a positive number for ascending a negative for descending + + function comp2($a,$b,$i = 0) { + global $col; + global $dir; + $c = count($col) -1; + if ($a["$col[$i]"] == $b["$col[$i]"]){ + $r = 0; + while($i < $c && $r == 0){ + $i++; + $r = comp2($a,$b,$i); + } + } elseif($a["$col[$i]"] < $b["$col[$i]"]){ + $r = -1 * $dir; // Im not sure why you must * dir here, but it wont work just before the return... + } else { + $r = 1 * $dir; + } + return $r; + } + + usort($ary,comp2); + return $ary; + } +?> diff --git a/functions/date.php3 b/functions/date.php3 new file mode 100644 index 00000000..b24b46fa --- /dev/null +++ b/functions/date.php3 @@ -0,0 +1,161 @@ + Mon, Tue, Wed + ** $dateParts[1] == 23 + ** $dateParts[2] == Jan, Feb, Mar + ** $dateParts[3] == 1999 + ** $dateParts[4] ==