summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatthiasgrimm <matthiasgrimm@users.sourceforge.net>2005-06-26 17:32:07 +0200
committermatthiasgrimm <matthiasgrimm@users.sourceforge.net>2005-06-26 17:32:07 +0200
commite28299cce10577f1cc60f8111785b3f118f099ec (patch)
tree0d236861cf262ea8da465b88e6dd336b91cb531b
parent90eb8392cdad2d4e8e8b8b6731f5400c37849ed3 (diff)
downloadrpg-e28299cce10577f1cc60f8111785b3f118f099ec.tar.gz
rpg-e28299cce10577f1cc60f8111785b3f118f099ec.tar.bz2
redefine reference check options
This patch correct the meaning of the reference check configuration options. They become more logical. refcheck boolean Enable/Disable the reference checker. If set to '0' the existence of references is not checked and vica versa. recshow int defines how many references should be displayed If set to '0' no references are shown at all. This meaning is more logical. The first parameter switches the checker on/off and the second would be set, if the user wanted to see where the references are and how many should be displayed. darcs-hash:20050626153207-7ef76-0800eb2e394bf1b9f4233e7698b4d894f4b58e5b.gz
-rw-r--r--conf/dokuwiki.php4
-rw-r--r--inc/search.php5
2 files changed, 5 insertions, 4 deletions
diff --git a/conf/dokuwiki.php b/conf/dokuwiki.php
index 504c0ffdb..127b36d0a 100644
--- a/conf/dokuwiki.php
+++ b/conf/dokuwiki.php
@@ -33,8 +33,8 @@ $conf['maxseclevel'] = 3; //Up to which level create editable se
$conf['camelcase'] = 0; //Use CamelCase for linking? (I don't like it) 0|1
$conf['deaccent'] = 1; //convert accented chars to unaccented ones in pagenames?
$conf['useheading'] = 0; //use the first heading in a page as its name
-$conf['refcheck'] = 5; //check for references before deleting media files
-$conf['refshow'] = 0; //show where media files are still in use
+$conf['refcheck'] = 1; //check for references before deleting media files
+$conf['refshow'] = 0; //how many references should be shown, 5 is a good value
/* Antispam Features */
diff --git a/inc/search.php b/inc/search.php
index 8216d98e5..d949dc6de 100644
--- a/inc/search.php
+++ b/inc/search.php
@@ -356,9 +356,10 @@ function search_reference(&$data,$base,$file,$type,$lvl,$opts){
//only search txt files
if(!preg_match('#\.txt$#',$file)) return true;
- //we finish after 'n' references found. The return value
+ //we finish after 'cnt' references found. The return value
//'false' will skip subdirectories to speed search up.
- if(count($data) >= $conf['refcheck']) return false;
+ $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']));