summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Palmer <nick@sluggardy.net>2008-02-17 01:57:08 +0000
committerNick Palmer <nick@sluggardy.net>2008-02-17 01:57:08 +0000
commit604a903db3561c55aa72ee1e1a244e8b90df513d (patch)
treef6d95988688d6f3c61f56c348f3060b24028af48
parent1b44d7b3b2e135f1527082e1b3dc7deb5c9e6557 (diff)
downloadsearch-604a903db3561c55aa72ee1e1a244e8b90df513d.tar.gz
search-604a903db3561c55aa72ee1e1a244e8b90df513d.tar.bz2
search-604a903db3561c55aa72ee1e1a244e8b90df513d.zip
Fix hrefs after slice since it is much cheaper to operate on the smaller list post slice. Duh! I am WAY too tired.
-rw-r--r--search_lib.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/search_lib.php b/search_lib.php
index 313e81f..c3b9271 100644
--- a/search_lib.php
+++ b/search_lib.php
@@ -1,6 +1,6 @@
<?php
/**
- * $Header: /cvsroot/bitweaver/_bit_search/search_lib.php,v 1.40 2008/02/17 00:47:42 nickpalmer Exp $
+ * $Header: /cvsroot/bitweaver/_bit_search/search_lib.php,v 1.41 2008/02/17 01:57:08 nickpalmer Exp $
*
* Copyright (c) 2004 bitweaver.org
* Copyright (c) 2003 tikwiki.org
@@ -8,7 +8,7 @@
* All Rights Reserved. See copyright.txt for details and a complete list of authors.
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details
*
- * $Id: search_lib.php,v 1.40 2008/02/17 00:47:42 nickpalmer Exp $
+ * $Id: search_lib.php,v 1.41 2008/02/17 01:57:08 nickpalmer Exp $
* @author Luis Argerich (lrargerich@yahoo.com)
* @package search
*/
@@ -255,14 +255,14 @@ class SearchLib extends BitBase {
/* Sort it */
uasort($ret, 'search_relevance_sort');
+ /* slice it */
+ $ret = array_slice($ret, $pParamHash['offset'], $pParamHash['offset'] + $pParamHash['max_records']);
+
/* Set the hrefs. */
foreach ($ret as $content_id => $data) {
- $ret[$content_id]['href'] = BIT_ROOT_URL . "index.php?content_id=" . $content_id;
+ $ret[$content_id]['href'] = BIT_ROOT_URL . "index.php?content_id=" . $data['content_id'];
}
- /* slice it */
- $ret = array_slice($ret, $pParamHash['offset'], $pParamHash['offset'] + $pParamHash['max_records']);
-
return $ret;
}