From 6d0fbeb0a7fde0cc8bae6c9944ea6b017d96968a Mon Sep 17 00:00:00 2001 From: Nathan Kinkade Date: Sun, 16 Mar 2008 20:42:30 +0000 Subject: Moved some external packages into lib to make system more self contained --- lib/adodb/rsfilter.inc.php | 61 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 lib/adodb/rsfilter.inc.php (limited to 'lib/adodb/rsfilter.inc.php') diff --git a/lib/adodb/rsfilter.inc.php b/lib/adodb/rsfilter.inc.php new file mode 100644 index 0000000..29662a2 --- /dev/null +++ b/lib/adodb/rsfilter.inc.php @@ -0,0 +1,61 @@ + $v) { + $arr[$k] = ucwords($v); + } + } + $rs = RSFilter($rs,'do_ucwords'); + */ +function &RSFilter($rs,$fn) +{ + if ($rs->databaseType != 'array') { + if (!$rs->connection) return false; + + $rs = &$rs->connection->_rs2rs($rs); + } + $rows = $rs->RecordCount(); + for ($i=0; $i < $rows; $i++) { + if (is_array ($fn)) { + $obj = $fn[0]; + $method = $fn[1]; + $obj->$method ($rs->_array[$i],$rs); + } else { + $fn($rs->_array[$i],$rs); + } + + } + if (!$rs->EOF) { + $rs->_currentRow = 0; + $rs->fields = $rs->_array[0]; + } + + return $rs; +} +?> \ No newline at end of file -- cgit v1.2.3