summaryrefslogtreecommitdiff
path: root/inc/search.php
diff options
context:
space:
mode:
authorMichael Hamann <michael@content-space.de>2013-07-31 17:57:58 +0200
committerMichael Hamann <michael@content-space.de>2013-07-31 18:05:43 +0200
commit0320882f767e5685df9d7ac4bec5a3e3f1b1f216 (patch)
treec241380a07ecb046a21c988e1e38c4ac31241e87 /inc/search.php
parentffec100965184c6bf045f0096101768def108b43 (diff)
downloadrpg-0320882f767e5685df9d7ac4bec5a3e3f1b1f216.tar.gz
rpg-0320882f767e5685df9d7ac4bec5a3e3f1b1f216.tar.bz2
Remove search_references() and the refshow configuration option
The refshow configuration option wasn't used as described anymore already in the latest release and after the introduction of the media usage index the parameter is also no longer relevant for internal optimization. The only place where it was still used is the no longer used search_references()-function which is removed here, too.
Diffstat (limited to 'inc/search.php')
-rw-r--r--inc/search.php39
1 files changed, 0 insertions, 39 deletions
diff --git a/inc/search.php b/inc/search.php
index 6927fff5f..884aa7b23 100644
--- a/inc/search.php
+++ b/inc/search.php
@@ -273,45 +273,6 @@ function search_allpages(&$data,$base,$file,$type,$lvl,$opts){
return true;
}
-/**
- * Reference search
- * This fuction searches for existing references to a given media file
- * and returns an array with the found pages. It doesn't pay any
- * attention to ACL permissions to find every reference. The caller
- * must check if the user has the appropriate rights to see the found
- * page and eventually have to prevent the result from displaying.
- *
- * @param array $data Reference to the result data structure
- * @param string $base Base usually $conf['datadir']
- * @param string $file current file or directory relative to $base
- * @param char $type Type either 'd' for directory or 'f' for file
- * @param int $lvl Current recursion depht
- * @param mixed $opts option array as given to search()
- *
- * $opts['query'] is the demanded media file name
- *
- * @author Andreas Gohr <andi@splitbrain.org>
- * @author Matthias Grimm <matthiasgrimm@users.sourceforge.net>
- */
-function search_reference(&$data,$base,$file,$type,$lvl,$opts){
- global $conf;
-
- //we do nothing with directories
- if($type == 'd') return true;
-
- //only search txt files
- if(substr($file,-4) != '.txt') return true;
-
- //we finish after 'cnt' references found. The return value
- //'false' will skip subdirectories to speed search up.
- $cnt = $conf['refshow'] > 0 ? $conf['refshow'] : 1;
- if(count($data) >= $cnt) return false;
-
- $reg = '\{\{ *\:?'.$opts['query'].' *(\|.*)?\}\}';
- search_regex($data,$base,$file,$reg,array($opts['query']));
- return true;
-}
-
/* ------------- helper functions below -------------- */
/**