This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
cern:index [2020/05/13 11:27] – iwn | cern:index [2020/09/18 18:03] – iwn | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | Include this file in each directory of your website to display plots in a nice and searchable way ([[cern: | + | Include this file in each directory of your website to display plots in a nice and searchable way ([[cern: |
<file bash index.php> | <file bash index.php> | ||
Line 5: | Line 5: | ||
$pwd = preg_replace(" | $pwd = preg_replace(" | ||
$pwd = preg_replace(" | $pwd = preg_replace(" | ||
+ | preg_match(" | ||
+ | $pwdshort = preg_replace(" | ||
chdir($pwd); | chdir($pwd); | ||
- | $pwdshort = preg_replace(" | ||
?> | ?> | ||
< | < | ||
Line 114: | Line 115: | ||
$other_exts = array(' | $other_exts = array(' | ||
$filenames = glob(" | $filenames = glob(" | ||
+ | $keywords = explode(" | ||
foreach($filenames as $filename){ | foreach($filenames as $filename){ | ||
if(isset($_GET[' | if(isset($_GET[' | ||
- | $keywords | + | $matched |
- | | + | foreach($keywords as $keyword){ |
if(isset($_GET[' | if(isset($_GET[' | ||
- | if(!preg_match('/ | + | if(!preg_match('/ |
+ | $matched = False; | ||
+ | | ||
+ | } | ||
}else{ | }else{ | ||
- | if(!fnmatch(' | + | if(!fnmatch(' |
+ | $matched = False; | ||
+ | | ||
+ | } | ||
} | } | ||
- | | + | } |
+ | if(!$matched) continue; | ||
} | } | ||
array_push($displayed, | array_push($displayed, |