First commit.

This commit is contained in:
Niels Serup
2011-08-02 19:57:57 +02:00
commit 0cc9d8fdc5
623 changed files with 28299 additions and 0 deletions

1
subsites/pictures/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
img/

1
subsites/pictures/.htaccess Executable file
View File

@@ -0,0 +1 @@
ErrorDocument 404 /show.php

5
subsites/pictures/about Executable file
View 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
View 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");
?>

View 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>

View 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
View 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("&lt;<a href='$1'>$1</a>&gt;", "[<a href='$1'>$1</a>]"), $txt);
//$txt = preg_replace('/<(.*)>/', "&lt;<a href='$1'>$1</a>&gt;", $txt);
//$txt = preg_replace('/\[(.*)\]/', "[<a href='$1'>$1</a>]", $txt);
return preg_replace(array('/<(.*)>/', '/\[([^]]*)\]/'), array("&lt;<a href='$1'>$1</a>&gt;", "[<a href='$1'>$1</a>]"), $txt);
return $txt;
}
?>

26
subsites/pictures/index.php Executable file
View 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>

View 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].

View 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].

View 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]

View 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]

View File

@@ -0,0 +1 @@
It's a candle in the public domain.

View File

@@ -0,0 +1,3 @@
cc-by-sa Niels Serup
[catcool.xcf]

View File

@@ -0,0 +1,3 @@
CC BY-SA 3.0.
Also see [catcool.jpg].

View File

@@ -0,0 +1 @@
GIMP. Public domain. See also [coolcircle.xcf].

View File

@@ -0,0 +1 @@
GIMP. Public domain. See also [coolcircle.png].

View File

@@ -0,0 +1,3 @@
It wasn't me!
CC-BY-SA 3.0
[deadinsect-wshd.jpg]

View File

@@ -0,0 +1,3 @@
I honestly didn't kill it.
CC-BY-SA 3.0
[deadinsect-wshd-red.jpg]

View File

@@ -0,0 +1,3 @@
Or is it?
Public domain.

View File

@@ -0,0 +1,3 @@
It's a foot.
CC-BY-SA 3.0
Also check out [foot-neon.png] and [foot-morbid.png].

View File

@@ -0,0 +1,3 @@
It's a foot.
CC-BY-SA 3.0
Also check out [foot-base.png] and [foot-neon.png].

View File

@@ -0,0 +1,3 @@
It's a foot.
CC-BY-SA 3.0
Also check out [foot-base.png] and [foot-morbid.png].

View File

@@ -0,0 +1 @@
public domain

View File

@@ -0,0 +1 @@
public domain

View File

@@ -0,0 +1 @@
It's just a couple 'o warm 'n fuzzy colors. Public domain.

View 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.

View File

@@ -0,0 +1,3 @@
Watch out!
CC-BY-SA 3.0
[skelhand.xcf]

View File

@@ -0,0 +1 @@
GIMP-specific. See [skelhand.png].

View File

@@ -0,0 +1,5 @@
Scary!
CC BY-SA 3.0 Unported
[snegle.xcf]

View File

@@ -0,0 +1,5 @@
U-U-h
CC BY-SA 3.0 Unported
[snegle.png]

View File

@@ -0,0 +1 @@
WTFPL 2.0

View File

@@ -0,0 +1 @@
=?

View 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].

View File

@@ -0,0 +1,7 @@
Stamtræ for Knud Romers "Papa Schneider blinzelt nicht!"
^^^^^^^^^
in Danish
--------------------
cc-by-sa Niels Serup

View File

@@ -0,0 +1,3 @@
See also [tube1.png], [tube2.png], [tube3.png] and [tube3m.png].
Public domain.

View File

@@ -0,0 +1,3 @@
See also [tube0.png], [tube2.png], [tube3.png] and [tube3m.png].
Public domain.

View File

@@ -0,0 +1,3 @@
See also [tube0.png], [tube1.png], [tube3.png] and [tube3m.png].
Public domain.

View File

@@ -0,0 +1,3 @@
See also [tube0.png], [tube1.png], [tube2.png] and [tube3m.png].
Public domain.

View File

@@ -0,0 +1,3 @@
See also [tube0.png], [tube1.png], [tube2.png] and [tube3.png].
Public domain.

View File

@@ -0,0 +1,2 @@
It's just a vortex. Public domain.
[vortex.xcf]

View File

@@ -0,0 +1 @@
See [vortex.png].

View File

@@ -0,0 +1 @@
Eh..

View File

@@ -0,0 +1,3 @@
<?php
$saved_crypt_pass = '$1$wlUEyRSB$ToGtvkc3kt69fdn/YiNce.';
?>

37
subsites/pictures/show.php Executable file
View 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>

View 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>

View 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>