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 [2018/05/02 11:45] – iwn | cern:index [2020/05/13 11:29] – 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> | ||
+ | <?php | ||
+ | $pwd = preg_replace(" | ||
+ | $pwd = preg_replace(" | ||
+ | chdir($pwd); | ||
+ | $pwdshort = preg_replace(" | ||
+ | ?> | ||
< | < | ||
< | < | ||
- | < | + | < |
+ | <link rel=" | ||
<style type=' | <style type=' | ||
- | body { | + | |
font-family: | font-family: | ||
font-size: 9pt; | font-size: 9pt; | ||
line-height: | line-height: | ||
- | } | + | |
- | div.pic h3 { | + | div.pic h3 { |
- | font-size: | + | font-size: |
margin: 0.5em 1em 0.2em 1em; | margin: 0.5em 1em 0.2em 1em; | ||
- | } | + | |
- | div.pic p { | + | div.pic p { |
font-size: 11pt; | font-size: 11pt; | ||
margin: 0.2em 1em 0.1em 1em; | margin: 0.2em 1em 0.1em 1em; | ||
- | } | + | |
- | div.pic { | + | div.pic { |
display: block; | display: block; | ||
float: left; | float: left; | ||
Line 27: | Line 34: | ||
text-align: center; | text-align: center; | ||
margin: 2px 10px 10px 2px; | margin: 2px 10px 10px 2px; | ||
- | -moz-box-shadow: | + | -moz-box-shadow: |
- | -webkit-box-shadow: | + | -webkit-box-shadow: |
- | box-shadow: | + | box-shadow: |
width: 320px; | width: 320px; | ||
- | } | + | min-height: 330px; |
- | a { text-decoration: | + | max-height: 380px; |
- | a:hover { text-decoration: | + | |
- | div.dirlinks h2 { margin-bottom: | + | h1 { color: rgb(40, |
- | div.dirlinks { margin: 0 24pt; } | + | h2 { padding-top: |
- | div.dirlinks a { | + | h2 a { color: rgb(20, |
+ | h3 a { color: rgb(40, | ||
+ | | ||
+ | a:hover { text-decoration: | ||
+ | div.dirlinks h2 { padding-top: | ||
+ | div.dirlinks { margin: 0 15pt; } | ||
+ | div.dirlinks a { | ||
font-size: 11pt; font-weight: | font-size: 11pt; font-weight: | ||
padding: 0 0.5em; | padding: 0 0.5em; | ||
- | } | + | } |
+ | pre { | ||
+ | font-family: | ||
+ | max-width: | ||
+ | white-space: | ||
+ | white-space: | ||
+ | white-space: | ||
+ | white-space: | ||
+ | word-wrap: | ||
+ | | ||
</ | </ | ||
</ | </ | ||
< | < | ||
- | < | + | < |
+ | < | ||
<?php | <?php | ||
$has_subs = false; | $has_subs = false; | ||
- | foreach (glob(" | + | foreach(glob(" |
- | if (is_dir($filename) && !preg_match("/ | + | if(is_dir($filename) && !preg_match("/ |
- | $has_subs = true; | + | $has_subs = true; |
- | break; | + | break; |
} | } | ||
} | } | ||
- | if ($has_subs) { | + | if($has_subs){ |
print "< | print "< | ||
print "< | print "< | ||
print "<a href=\" | print "<a href=\" | ||
- | foreach (glob(" | + | foreach(glob(" |
- | if (is_dir($filename) && ($_SERVER[' | + | if(is_dir($filename) && ($_SERVER[' |
- | print " <a href=\" | + | print " <a href=\" |
- | } | + | } |
} | } | ||
+ | print "</ | ||
+ | }else{ | ||
+ | print "< | ||
+ | print "< | ||
print "</ | print "</ | ||
} | } | ||
- | foreach (array(" | + | foreach(array(" |
- | if (file_exists($readme)) { | + | if(file_exists($readme)){ |
- | print "< | + | |
+ | $readmeblock = file_get_contents($readme); | ||
+ | # | ||
+ | $readmeblock = preg_replace(" | ||
+ | $readmeblock = preg_replace(" | ||
+ | print "< | ||
} | } | ||
} | } | ||
Line 72: | Line 104: | ||
< | < | ||
- | < | + | < |
<div> | <div> | ||
<?php | <?php | ||
$displayed = array(); | $displayed = array(); | ||
- | if ($_GET[' | + | |
+ | if($_GET[' | ||
print "Plots will not be displayed.\n"; | print "Plots will not be displayed.\n"; | ||
- | } else { | + | }else{ |
- | $other_exts = array(' | + | $other_exts = array(' |
- | $filenames = glob(" | + | $filenames = glob(" |
- | foreach ($filenames as $filename) { | + | foreach($filenames as $filename){ |
- | if (isset($_GET[' | + | if(isset($_GET[' |
- | | + | |
- | if (!preg_match('/ | + | // |
- | | + | |
- | if (!fnmatch(' | + | if(!preg_match('/ |
- | | + | }else{ |
+ | if(!fnmatch(' | ||
+ | } | ||
+ | //} | ||
} | } | ||
array_push($displayed, | array_push($displayed, | ||
- | $brfname = str_replace(" | + | $brfname = str_replace(" |
print "< | print "< | ||
print "< | print "< | ||
- | print "<a href=\" | + | print "<a href=\" |
$others = array(); | $others = array(); | ||
- | foreach ($other_exts as $ex) { | + | foreach($other_exts as $ex){ |
$other_filename = str_replace(' | $other_filename = str_replace(' | ||
- | if (file_exists($other_filename)) { | + | if(file_exists($other_filename)){ |
- | array_push($others, | + | array_push($others, |
- | if ($ex != ' | + | if($ex != ' |
} | } | ||
} | } | ||
- | if ($others) print "< | + | if($others) print "< |
print "</ | print "</ | ||
} | } | ||
Line 108: | Line 144: | ||
?> | ?> | ||
</ | </ | ||
+ | |||
<div style=" | <div style=" | ||
< | < | ||
<ul> | <ul> | ||
- | <? | + | <?php |
- | foreach (glob(" | + | foreach(glob(" |
- | if ($_GET[' | + | if($_GET[' |
- | if (isset($_GET[' | + | if(isset($_GET[' |
- | | + | if(isset($_GET[' |
- | if (!preg_match('/ | + | if(!preg_match('/ |
- | | + | }else{ |
- | if (!fnmatch(' | + | if(!fnmatch(' |
- | | + | } |
} | } | ||
- | if (is_dir($filename)) { | + | if(is_dir($filename)){ |
- | print "< | + | print "< |
- | } else { | + | }else{ |
- | print "< | + | print "< |
} | } | ||
} | } | ||
Line 131: | Line 168: | ||
</ul> | </ul> | ||
</ | </ | ||
+ | <br> | ||
</ | </ | ||
</ | </ | ||
</ | </ |