User Tools

Site Tools


cern:index

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
cern:index [2020/05/13 11:27] iwncern: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:website|full instructions]]). Made by Giovanni.+Include this file in each directory of your website to display plots in a nice and searchable way ([[cern:website|full instructions]]). Made by Giovanni. (Replace the location of your website's icon ''favicon.ico''.)
  
 <file bash index.php> <file bash index.php>
Line 5: Line 5:
 $pwd = preg_replace("|^\/((\w)\w+)\/|","/eos/user/$2/$1/www/",$_SERVER["REQUEST_URI"]); $pwd = preg_replace("|^\/((\w)\w+)\/|","/eos/user/$2/$1/www/",$_SERVER["REQUEST_URI"]);
 $pwd = preg_replace("(\?.*)","",$pwd); $pwd = preg_replace("(\?.*)","",$pwd);
 +preg_match("|^\/(\w+)\/|",$_SERVER["REQUEST_URI"],$usr);
 +$pwdshort = preg_replace("(.*www/)","$usr[1]/",$pwd);
 chdir($pwd); chdir($pwd);
-$pwdshort = preg_replace("(.*www/)","ineuteli/",$pwd); 
 ?> ?>
 <html> <html>
Line 114: Line 115:
     $other_exts = array('.pdf','.jpg','.jpeg','.jpg','.cxx','.eps','.root','.txt','.tex','.log','.dir','.info','.psd');     $other_exts = array('.pdf','.jpg','.jpeg','.jpg','.cxx','.eps','.root','.txt','.tex','.log','.dir','.info','.psd');
     $filenames = glob("*.png"); natsort($filenames);     $filenames = glob("*.png"); natsort($filenames);
 +    $keywords = explode(" ",$_GET['match']);
     foreach($filenames as $filename){     foreach($filenames as $filename){
         if(isset($_GET['match'])){         if(isset($_GET['match'])){
-          $keywords split("+",$_GET['match'])+          $matched True
-          //foreach($keywords as $keyword){+          foreach($keywords as $keyword){
             if(isset($_GET['regexp']) && $_GET['regexp']){             if(isset($_GET['regexp']) && $_GET['regexp']){
-              if(!preg_match('/.*'.$_GET['match'].'.*/', $filename)) continue;+              if(!preg_match('/.*'.$keyword.'.*/', $filename))
 +                $matched = False; 
 +                continue; 
 +              }
             }else{             }else{
-              if(!fnmatch('*'.$_GET['match'].'*', $filename)) continue;+              if(!fnmatch('*'.$keyword.'*', $filename))
 +                $matched = False; 
 +                continue; 
 +              }
             }             }
-          //}+          } 
 +          if(!$matched) continue;
         }         }
         array_push($displayed, $filename);         array_push($displayed, $filename);
cern/index.txt · Last modified: 2023/10/04 16:10 by iwn