diff options
author | Andreas Gohr <andi@splitbrain.org> | 2013-07-31 11:15:12 -0700 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2013-07-31 11:15:12 -0700 |
commit | 15754217312575b58b0594cd63f1e1db57623b42 (patch) | |
tree | 8d1e59c132c764889d2c3c9b7cefd19623be35c1 /inc/search.php | |
parent | 20587314b0587d68f5e18e442a0e2af152c22af2 (diff) | |
parent | 0320882f767e5685df9d7ac4bec5a3e3f1b1f216 (diff) | |
download | rpg-15754217312575b58b0594cd63f1e1db57623b42.tar.gz rpg-15754217312575b58b0594cd63f1e1db57623b42.tar.bz2 |
Merge pull request #244 from splitbrain/mediause_index
Index media usage data
Diffstat (limited to 'inc/search.php')
-rw-r--r-- | inc/search.php | 39 |
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 -------------- */ /** |