First commit.
This commit is contained in:
1
subsites/pictures/.gitignore
vendored
Normal file
1
subsites/pictures/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
img/
|
||||
1
subsites/pictures/.htaccess
Executable file
1
subsites/pictures/.htaccess
Executable file
@@ -0,0 +1 @@
|
||||
ErrorDocument 404 /show.php
|
||||
5
subsites/pictures/about
Executable file
5
subsites/pictures/about
Executable file
@@ -0,0 +1,5 @@
|
||||
...--' About '--...
|
||||
|
||||
I choose a copyleft license when I want to protect a picture from being
|
||||
abused by people who do not want to allow sharing and editing. When a
|
||||
picture isn't worth protecting, I just throw it in the public domain.
|
||||
26
subsites/pictures/edit/edit.php
Executable file
26
subsites/pictures/edit/edit.php
Executable file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
header('Content-type: text/plain; charset=UTF-8');
|
||||
|
||||
$img = $_POST['image'];
|
||||
$info = $_POST['uptext'];
|
||||
$pass = $_POST['uppass'];
|
||||
$info_path = "../info/$img.info";
|
||||
|
||||
// Password check
|
||||
include('../saved_crypt_pass.php');
|
||||
$crypt_pass = crypt($pass, $saved_crypt_pass);
|
||||
|
||||
if ($crypt_pass != $saved_crypt_pass) {
|
||||
echo "Password error";
|
||||
die();
|
||||
}
|
||||
|
||||
$info = str_replace('\\\'', '\'', str_replace('\"', "\"", $info));
|
||||
|
||||
// Info file
|
||||
$f = fopen($info_path, 'w');
|
||||
fwrite($f, $info);
|
||||
fclose($f);
|
||||
|
||||
header("Location: http://pictures.metanohi.org/$img");
|
||||
?>
|
||||
30
subsites/pictures/edit/index.php
Executable file
30
subsites/pictures/edit/index.php
Executable file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
header('Content-type: text/html; charset=UTF-8');
|
||||
$img = $_GET['i'];
|
||||
|
||||
$info_path = "../info/$img.info";
|
||||
|
||||
// Info file
|
||||
$f = fopen($info_path, 'r');
|
||||
$c = fread($f, filesize($info_path));
|
||||
fclose($f);
|
||||
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns='http://www.w3.org/1999/xhtml'>
|
||||
<head>
|
||||
<meta name='description' content='Edit the info text of a picture. Owner only.' />
|
||||
<meta http-equiv='content-language' content='en' />
|
||||
<meta http-equiv='content-type' content='text/html; charset=utf-8' />
|
||||
<title>Edit info text</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<form action='edit.php' method='post'>
|
||||
<input type='hidden' name='image' value='<?php echo $img; ?>' />
|
||||
<p><textarea name='uptext' rows='10' cols='80'><?php echo $c; ?></textarea></p>
|
||||
<p><input name='uppass' type='password' /></p>
|
||||
<p><input type='submit' value='Change text' /></p>
|
||||
</form>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
3
subsites/pictures/edit/php_errorlog
Executable file
3
subsites/pictures/edit/php_errorlog
Executable file
@@ -0,0 +1,3 @@
|
||||
[19-Oct-2009 05:02:21] PHP Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' in /home/metanohi/public_html/pictures/edit/edit.php on line 19
|
||||
[19-Oct-2009 05:04:08] PHP Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' in /home/metanohi/public_html/pictures/edit/edit.php on line 20
|
||||
[19-Oct-2009 05:33:58] PHP Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/metanohi/public_html/pictures/edit/edit.php on line 18
|
||||
13
subsites/pictures/get_info.php
Executable file
13
subsites/pictures/get_info.php
Executable file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
function get_info($img) {
|
||||
$txt = @file_get_contents("info/$img.info");
|
||||
if (!$txt || $txt == '')
|
||||
return 'No information available.';
|
||||
|
||||
//return preg_replace(array('/<(.*)>/', '/[(.*)]/'), array("<<a href='$1'>$1</a>>", "[<a href='$1'>$1</a>]"), $txt);
|
||||
//$txt = preg_replace('/<(.*)>/', "<<a href='$1'>$1</a>>", $txt);
|
||||
//$txt = preg_replace('/\[(.*)\]/', "[<a href='$1'>$1</a>]", $txt);
|
||||
return preg_replace(array('/<(.*)>/', '/\[([^]]*)\]/'), array("<<a href='$1'>$1</a>>", "[<a href='$1'>$1</a>]"), $txt);
|
||||
return $txt;
|
||||
}
|
||||
?>
|
||||
26
subsites/pictures/index.php
Executable file
26
subsites/pictures/index.php
Executable file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
header('Content-type: text/html; charset=UTF-8');
|
||||
$imgs = scandir('img');
|
||||
array_splice($imgs, 0, 2);
|
||||
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns='http://www.w3.org/1999/xhtml'>
|
||||
<head>
|
||||
<meta name='description' content='Pictures.' />
|
||||
<meta name='keywords' content='pictures of varying quality, stuff' />
|
||||
<meta http-equiv='content-language' content='en' />
|
||||
<meta http-equiv='content-type' content='text/html; charset=utf-8' />
|
||||
<title>Pictures</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<ul>
|
||||
<li><a href='upload/'>New</a></p></li>
|
||||
<li><a href='about'>About</a></p></li>
|
||||
</ul>
|
||||
<h1>Pictures</h1><?php
|
||||
foreach ($imgs as $x) {
|
||||
echo "<p><a href='$x'>$x</a></p>\n";
|
||||
}
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
6
subsites/pictures/info/Akiba_squirrel.jpg.info
Executable file
6
subsites/pictures/info/Akiba_squirrel.jpg.info
Executable file
@@ -0,0 +1,6 @@
|
||||
This picture is released under the Creative Commons Attribution-ShareAlike 3.0
|
||||
Unported license. The author is Niels Serup, and it's based on the pictures
|
||||
found at <http://commons.wikimedia.org/wiki/File:Akiba_denkigai.jpg> and at
|
||||
<http://commons.wikimedia.org/wiki/File:Squirrel_in_Seurasaari_autumn.JPG>,
|
||||
both also released under CC BY-SA 3.0.
|
||||
See also [Akiba_squirrel.xcf] and [ssq.png].
|
||||
7
subsites/pictures/info/Akiba_squirrel.xcf.info
Executable file
7
subsites/pictures/info/Akiba_squirrel.xcf.info
Executable file
@@ -0,0 +1,7 @@
|
||||
This picture is released under the Creative Commons Attribution-ShareAlike 3.0
|
||||
Unported license. The author is Niels Serup, and it's based on the pictures
|
||||
found at <http://commons.wikimedia.org/wiki/File:Akiba_denkigai.jpg> and at
|
||||
<http://commons.wikimedia.org/wiki/File:Squirrel_in_Seurasaari_autumn.JPG>,
|
||||
both also released under CC BY-SA 3.0.
|
||||
This file can be opened in GIMP.
|
||||
See also [Akiba_squirrel.jpg] and [ssq.png].
|
||||
4
subsites/pictures/info/Gnou_Thoiry_19803_modbw4.png.info
Normal file
4
subsites/pictures/info/Gnou_Thoiry_19803_modbw4.png.info
Normal file
@@ -0,0 +1,4 @@
|
||||
Based on <http://commons.wikimedia.org/wiki/File:Gnou_Thoiry_19803.jpg> in PD.
|
||||
This also in the public domain.
|
||||
|
||||
See also [Gnou_Thoiry_19803_modwb4.png]
|
||||
4
subsites/pictures/info/Gnou_Thoiry_19803_modwb4.png.info
Normal file
4
subsites/pictures/info/Gnou_Thoiry_19803_modwb4.png.info
Normal file
@@ -0,0 +1,4 @@
|
||||
Based on <http://commons.wikimedia.org/wiki/File:Gnou_Thoiry_19803.jpg> in PD.
|
||||
This also in the public domain.
|
||||
|
||||
See also [Gnou_Thoiry_19803_modbw4.png]
|
||||
1
subsites/pictures/info/bloklys.png.info
Executable file
1
subsites/pictures/info/bloklys.png.info
Executable file
@@ -0,0 +1 @@
|
||||
It's a candle in the public domain.
|
||||
3
subsites/pictures/info/catcool.jpg.info
Normal file
3
subsites/pictures/info/catcool.jpg.info
Normal file
@@ -0,0 +1,3 @@
|
||||
cc-by-sa Niels Serup
|
||||
|
||||
[catcool.xcf]
|
||||
3
subsites/pictures/info/catcool.xcf.info
Normal file
3
subsites/pictures/info/catcool.xcf.info
Normal file
@@ -0,0 +1,3 @@
|
||||
CC BY-SA 3.0.
|
||||
|
||||
Also see [catcool.jpg].
|
||||
1
subsites/pictures/info/coolcircle.png.info
Executable file
1
subsites/pictures/info/coolcircle.png.info
Executable file
@@ -0,0 +1 @@
|
||||
GIMP. Public domain. See also [coolcircle.xcf].
|
||||
1
subsites/pictures/info/coolcircle.xcf.info
Executable file
1
subsites/pictures/info/coolcircle.xcf.info
Executable file
@@ -0,0 +1 @@
|
||||
GIMP. Public domain. See also [coolcircle.png].
|
||||
3
subsites/pictures/info/deadinsect-wshd-red.jpg.info
Executable file
3
subsites/pictures/info/deadinsect-wshd-red.jpg.info
Executable file
@@ -0,0 +1,3 @@
|
||||
It wasn't me!
|
||||
CC-BY-SA 3.0
|
||||
[deadinsect-wshd.jpg]
|
||||
3
subsites/pictures/info/deadinsect-wshd.jpg.info
Executable file
3
subsites/pictures/info/deadinsect-wshd.jpg.info
Executable file
@@ -0,0 +1,3 @@
|
||||
I honestly didn't kill it.
|
||||
CC-BY-SA 3.0
|
||||
[deadinsect-wshd-red.jpg]
|
||||
3
subsites/pictures/info/end.png.info
Executable file
3
subsites/pictures/info/end.png.info
Executable file
@@ -0,0 +1,3 @@
|
||||
Or is it?
|
||||
|
||||
Public domain.
|
||||
3
subsites/pictures/info/foot-base.png.info
Executable file
3
subsites/pictures/info/foot-base.png.info
Executable file
@@ -0,0 +1,3 @@
|
||||
It's a foot.
|
||||
CC-BY-SA 3.0
|
||||
Also check out [foot-neon.png] and [foot-morbid.png].
|
||||
3
subsites/pictures/info/foot-morbid.png.info
Executable file
3
subsites/pictures/info/foot-morbid.png.info
Executable file
@@ -0,0 +1,3 @@
|
||||
It's a foot.
|
||||
CC-BY-SA 3.0
|
||||
Also check out [foot-base.png] and [foot-neon.png].
|
||||
3
subsites/pictures/info/foot-neon.png.info
Executable file
3
subsites/pictures/info/foot-neon.png.info
Executable file
@@ -0,0 +1,3 @@
|
||||
It's a foot.
|
||||
CC-BY-SA 3.0
|
||||
Also check out [foot-base.png] and [foot-morbid.png].
|
||||
1
subsites/pictures/info/laseronwall.png.info
Normal file
1
subsites/pictures/info/laseronwall.png.info
Normal file
@@ -0,0 +1 @@
|
||||
public domain
|
||||
1
subsites/pictures/info/laseronwall2.png.info
Normal file
1
subsites/pictures/info/laseronwall2.png.info
Normal file
@@ -0,0 +1 @@
|
||||
public domain
|
||||
1
subsites/pictures/info/ldit.png.info
Executable file
1
subsites/pictures/info/ldit.png.info
Executable file
@@ -0,0 +1 @@
|
||||
It's just a couple 'o warm 'n fuzzy colors. Public domain.
|
||||
6
subsites/pictures/info/me1.jpg.info
Normal file
6
subsites/pictures/info/me1.jpg.info
Normal file
@@ -0,0 +1,6 @@
|
||||
A picture of me sitting in a chair reading about something on Wikipedia (I think)
|
||||
|
||||
This picture is released under the Creative Commons Attribution-ShareAlike 3.0
|
||||
Unported license. The author is Niels Serup.
|
||||
|
||||
I didn't take this picture (my parents did), but they have transferred their copyright to me.
|
||||
3
subsites/pictures/info/skelhand.png.info
Executable file
3
subsites/pictures/info/skelhand.png.info
Executable file
@@ -0,0 +1,3 @@
|
||||
Watch out!
|
||||
CC-BY-SA 3.0
|
||||
[skelhand.xcf]
|
||||
1
subsites/pictures/info/skelhand.xcf.info
Executable file
1
subsites/pictures/info/skelhand.xcf.info
Executable file
@@ -0,0 +1 @@
|
||||
GIMP-specific. See [skelhand.png].
|
||||
5
subsites/pictures/info/snegle.png.info
Normal file
5
subsites/pictures/info/snegle.png.info
Normal file
@@ -0,0 +1,5 @@
|
||||
Scary!
|
||||
|
||||
CC BY-SA 3.0 Unported
|
||||
|
||||
[snegle.xcf]
|
||||
5
subsites/pictures/info/snegle.xcf.info
Normal file
5
subsites/pictures/info/snegle.xcf.info
Normal file
@@ -0,0 +1,5 @@
|
||||
U-U-h
|
||||
|
||||
CC BY-SA 3.0 Unported
|
||||
|
||||
[snegle.png]
|
||||
1
subsites/pictures/info/sq.png.info
Normal file
1
subsites/pictures/info/sq.png.info
Normal file
@@ -0,0 +1 @@
|
||||
WTFPL 2.0
|
||||
1
subsites/pictures/info/sqrt-n.png.info
Normal file
1
subsites/pictures/info/sqrt-n.png.info
Normal file
@@ -0,0 +1 @@
|
||||
=?
|
||||
6
subsites/pictures/info/ssq.png.info
Executable file
6
subsites/pictures/info/ssq.png.info
Executable file
@@ -0,0 +1,6 @@
|
||||
This picture is released under the Creative Commons Attribution-ShareAlike 3.0
|
||||
Unported license. The author is Niels Serup, and it's based on the picture
|
||||
found at
|
||||
<http://commons.wikimedia.org/wiki/File:Squirrel_in_Seurasaari_autumn.JPG>,
|
||||
also released under CC BY-SA 3.0.
|
||||
See also [Akiba_squirrel.xcf] and [Akiba_squirrel.jpg].
|
||||
7
subsites/pictures/info/stam.png.info
Normal file
7
subsites/pictures/info/stam.png.info
Normal file
@@ -0,0 +1,7 @@
|
||||
Stamtræ for Knud Romers "Papa Schneider blinzelt nicht!"
|
||||
|
||||
^^^^^^^^^
|
||||
in Danish
|
||||
|
||||
--------------------
|
||||
cc-by-sa Niels Serup
|
||||
3
subsites/pictures/info/tube0.png.info
Normal file
3
subsites/pictures/info/tube0.png.info
Normal file
@@ -0,0 +1,3 @@
|
||||
See also [tube1.png], [tube2.png], [tube3.png] and [tube3m.png].
|
||||
|
||||
Public domain.
|
||||
3
subsites/pictures/info/tube1.png.info
Normal file
3
subsites/pictures/info/tube1.png.info
Normal file
@@ -0,0 +1,3 @@
|
||||
See also [tube0.png], [tube2.png], [tube3.png] and [tube3m.png].
|
||||
|
||||
Public domain.
|
||||
3
subsites/pictures/info/tube2.png.info
Normal file
3
subsites/pictures/info/tube2.png.info
Normal file
@@ -0,0 +1,3 @@
|
||||
See also [tube0.png], [tube1.png], [tube3.png] and [tube3m.png].
|
||||
|
||||
Public domain.
|
||||
3
subsites/pictures/info/tube3.png.info
Normal file
3
subsites/pictures/info/tube3.png.info
Normal file
@@ -0,0 +1,3 @@
|
||||
See also [tube0.png], [tube1.png], [tube2.png] and [tube3m.png].
|
||||
|
||||
Public domain.
|
||||
3
subsites/pictures/info/tube3m.png.info
Normal file
3
subsites/pictures/info/tube3m.png.info
Normal file
@@ -0,0 +1,3 @@
|
||||
See also [tube0.png], [tube1.png], [tube2.png] and [tube3.png].
|
||||
|
||||
Public domain.
|
||||
2
subsites/pictures/info/vortex.png.info
Executable file
2
subsites/pictures/info/vortex.png.info
Executable file
@@ -0,0 +1,2 @@
|
||||
It's just a vortex. Public domain.
|
||||
[vortex.xcf]
|
||||
1
subsites/pictures/info/vortex.xcf.info
Executable file
1
subsites/pictures/info/vortex.xcf.info
Executable file
@@ -0,0 +1 @@
|
||||
See [vortex.png].
|
||||
1
subsites/pictures/info/xcf.png.info
Executable file
1
subsites/pictures/info/xcf.png.info
Executable file
@@ -0,0 +1 @@
|
||||
Eh..
|
||||
3
subsites/pictures/saved_crypt_pass.php
Executable file
3
subsites/pictures/saved_crypt_pass.php
Executable file
@@ -0,0 +1,3 @@
|
||||
<?php
|
||||
$saved_crypt_pass = '$1$wlUEyRSB$ToGtvkc3kt69fdn/YiNce.';
|
||||
?>
|
||||
37
subsites/pictures/show.php
Executable file
37
subsites/pictures/show.php
Executable file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
include('get_info.php');
|
||||
header('Content-type: text/html; charset=UTF-8');
|
||||
$u = $_SERVER['REQUEST_URI'];
|
||||
if (strpos($u, 'show.php?') == 1)
|
||||
$img = $_SERVER['QUERY_STRING'];
|
||||
else
|
||||
$img = substr($u, 1);
|
||||
|
||||
$suf = explode('.', $img);
|
||||
$suf = $suf[sizeof($suf)-1];
|
||||
$suf = strtolower($suf);
|
||||
if ($suf == 'xcf')
|
||||
$img_file = 'xcf.png';
|
||||
else
|
||||
$img_file = $img;
|
||||
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns='http://www.w3.org/1999/xhtml'>
|
||||
<head>
|
||||
<meta name='description' content='Pictures.' />
|
||||
<meta name='keywords' content='pictures of varying quality, stuff' />
|
||||
<meta http-equiv='content-language' content='en' />
|
||||
<meta http-equiv='content-type' content='text/html; charset=utf-8' />
|
||||
<title><?php echo $img; ?></title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<a href='http://pictures.metanohi.org/'>Index</a>
|
||||
<h1><?php echo $img; ?></h1>
|
||||
<p><a href='img/<?php echo $img; ?>'><img alt='<?php echo $img; ?>' title='<?php echo $img; ?>' style='max-width: 590px;' src='img/<?php echo $img_file; ?>' /></a></p>
|
||||
<h2>Information</h2>
|
||||
<pre>
|
||||
<?php echo get_info($img); ?>
|
||||
</pre>
|
||||
<a href='/edit/?i=<?php echo $img; ?>'>Edit</a>
|
||||
</body>
|
||||
</html>
|
||||
22
subsites/pictures/upload/index.php
Executable file
22
subsites/pictures/upload/index.php
Executable file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
header('Content-type: text/html; charset=UTF-8');
|
||||
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns='http://www.w3.org/1999/xhtml'>
|
||||
<head>
|
||||
<meta name='description' content='Upload a picture. Owner only.' />
|
||||
<meta http-equiv='content-language' content='en' />
|
||||
<meta http-equiv='content-type' content='text/html; charset=utf-8' />
|
||||
<title>Upload picture</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<form enctype='multipart/form-data' action='upload.php' method='post'>
|
||||
<p><input name='upfile' type='file' /></p>
|
||||
<p><textarea name='uptext' rows='10' cols='80'></textarea></p>
|
||||
<p><input name='uppass' type='password' /></p>
|
||||
<p><input type='submit' value='Upload file' /></p>
|
||||
</form>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
42
subsites/pictures/upload/upload.php
Executable file
42
subsites/pictures/upload/upload.php
Executable file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
header('Content-type: text/html; charset=UTF-8');
|
||||
|
||||
$file = $_FILES['upfile'];
|
||||
$filename = basename($file['name']);
|
||||
$info = $_POST['uptext'];
|
||||
$pass = $_POST['uppass'];
|
||||
$img_path = "../img/$filename";
|
||||
$info_path = "../info/$filename.info";
|
||||
|
||||
// Password check
|
||||
include('../saved_crypt_pass.php');
|
||||
$crypt_pass = crypt($pass, $saved_crypt_pass);
|
||||
|
||||
if ($crypt_pass != $saved_crypt_pass)
|
||||
$msg = "Password error";
|
||||
else {
|
||||
// Image file
|
||||
if (move_uploaded_file($file['tmp_name'], $img_path)) {
|
||||
$msg = "'<a href='http://pictures.metanohi.org/$filename'>$filename</a>' uploaded";
|
||||
if (!(file_exists($info_path) && $info == '')) {
|
||||
$info = str_replace('\\\'', '\'', str_replace('\"', "\"", $info));
|
||||
// Info file
|
||||
$f = fopen($info_path, 'w');
|
||||
fwrite($f, $info);
|
||||
fclose($f);
|
||||
}
|
||||
}
|
||||
else
|
||||
$msg = "Upload error";
|
||||
}
|
||||
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns='http://www.w3.org/1999/xhtml'>
|
||||
<head>
|
||||
<title>Uploader</title>
|
||||
</head>
|
||||
<body>
|
||||
<p><?php echo $msg; ?></p>
|
||||
<a href='index.php'>New</a>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user