commit 415eae4374ec2d1dee9c505ab4a07a4c3713ee08 Author: dusk Date: Sun Aug 29 00:43:04 2021 +0200 First diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f53c63a --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +content/* +favicon.apng diff --git a/README.md b/README.md new file mode 100644 index 0000000..6d382be --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# Kino-PHP +## What is this +PHP script that allows the navigation of folders and shows files within the "/content" folder. + +It is styled with a custom css that you may edit. It is also in catalan, which you may also change. diff --git a/index.php b/index.php new file mode 100644 index 0000000..f2caa44 --- /dev/null +++ b/index.php @@ -0,0 +1,71 @@ + + + + + + Dusk Kino + + + + +

Dusk Kino

+ + "); + echo("Inici
"); + + //Solve ocurrences where url has ?q=./ + if (dirname($_GET["q"]) == ".") { + $parentdir = ""; + } + else $parentdir = dirname($_GET["q"]); + + echo("Arrere
"); + echo(""); + } + + echo("
"); + + $is_there_files = false; + + //Show folder links + $dirs = scandir($currentdir); + echo("

Carpetes

"); + foreach($dirs as $file) { + if ($file[0] != '.' && is_dir("$currentdir/$file")) { + echo("/$file/
\n"); + } + if(!is_dir("$currentdir/$file")) $is_there_files = true; + } + + if($is_there_files){ + echo("
"); + + //Show file links + echo("

Fitxers

"); + + echo("
"); + foreach($dirs as $file) { + if ($file[0] != '.' && !is_dir("$currentdir/$file")) { + echo("$file
\n"); + } + } + echo("
"); + } + printf('

/%s

', $_GET["q"]); + ?> + + diff --git a/normal.css b/normal.css new file mode 100644 index 0000000..077b6a6 --- /dev/null +++ b/normal.css @@ -0,0 +1,59 @@ +body { + background-color: #2e2e2e; + color: #d6d6d6; + font-family: "Courier New", monospace; + font-size: 1.25em; + margin: 75px 20%; + text-align: center; +} + +h1 { + font-size: 4em; +} + /* unvisited link */ +a:link { + color: #e87d3e; + text-decoration: none; +} + +/* visited link */ +a:visited { + color: #e87d3e; + text-decoration: none; +} + +/* mouse over link */ +a:hover { + color: #2e2e2e; + background-color: #e87d3e; + transition: color 0.1s, background-color 0.1s; +} + +/* selected link */ +/*a:active { +} */ + +#navigation { + border: 2px dashed #d6d6d6; + padding: 10px; + display: inline-block; + margin-bottom: 20px; +} + +#files { + padding: 20px; + text-align: left; + display: inline-block; + border: 2px dashed #d6d6d6; +} + +.path { + font-style: italic; + font-size: 0.75em; + color: rgba(255,255,255,0.5); +} + +hr { + border: 1.5px solid #d6d6d6; +} +