# HG changeset patch # User m15o # Date 1682263781 -7200 # Sun Apr 23 17:29:41 2023 +0200 # Node ID f86d4a415a1165626f5605ed56c12e2bb0171955 # Parent 66cb53346512ea960742849f7943384dcbb80e80 add readme diff --git a/README.md b/README.md --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# MeBo +# piclog -MeBo is a simple message board system. +A place to upload and share your pictures. ## Requirements @@ -10,5 +10,6 @@ ## Installation 1. clone this repository to get the source -2. make a copy of public/includes/config-sample.php in public/includes/config.php. Update the constants to match your environment -3. push the public/ directory to your server \ No newline at end of file +2. rename `config-sample.php` to `config.php`. Update the constants to match your + environment +3. transfer files to your server \ No newline at end of file diff --git a/includes/header.php b/includes/header.php --- a/includes/header.php +++ b/includes/header.php @@ -3,16 +3,18 @@ - plog + piclog -
+
+
- -
- You account is pending activation. You will be notified by email when activated. -
- -getSession()->getFlash()): ?> +
+ +
+ You account is pending activation. You will be notified by email when activated. +
+ + getSession()->getFlash()): ?>

- - -
+ \ No newline at end of file diff --git a/index.php b/index.php --- a/index.php +++ b/index.php @@ -9,7 +9,9 @@

piclog

-

A little place to upload and share your pictures.

+

Hi! Here you can share your JPEG pictures with your friends. You can customize the CSS of your profile, and even add + a little widget to your site! The pictures are heavily compressed to keep the file + size small.

Subscribe via RSS

diff --git a/latest.php b/latest.php new file mode 100644 --- /dev/null +++ b/latest.php @@ -0,0 +1,17 @@ +getImage()->getFromUser($id, 1); +if (!count($images)) { + http_response_code(404); + exit; +} +$filename = file_path($id, $images['rows'][0]['filename']); + +header("Content-Type: image/jpeg"); +header("Content-Length: " . filesize($filename)); + +$fp = fopen($filename, 'rb'); + +fpassthru($fp); diff --git a/style.css b/style.css --- a/style.css +++ b/style.css @@ -1,7 +1,27 @@ +* { + box-sizing: border-box; +} + body { + font-family: monospace; + font-size: 16px; + background-color: midnightblue; +} + +.main-header, main { + max-width: 45em; + margin: 0 auto; background-color: aliceblue; - font-family: monospace; - max-width: 800px; + padding: 1em; +} + +.main-header { + background-color: paleturquoise; +} + +h1, h2 { + margin-top: 0; + color: midnightblue; } .title { diff --git a/upload.php b/upload.php --- a/upload.php +++ b/upload.php @@ -25,9 +25,8 @@ case 'image/jpeg': $orig = imagecreatefromjpeg($orig_path); break; - case 'image/png': - $orig = imagecreatefrompng($orig_path); - break; + default: + exit; } $new = imagecreatetruecolor($new_width, $new_height); @@ -38,9 +37,6 @@ case 'image/jpeg': $result = imagejpeg($new, $new_path, 5); break; - case 'image/png': - $result = imagepng($new, $new_path, 9); - break; } return $result; @@ -49,7 +45,7 @@ $message = ''; $resized = false; $errors = []; -$allowed_types = ['image/jpeg', 'image/png', 'image/gif']; +$allowed_types = ['image/jpeg']; $max_size = 524288; // 512 kb if ($_SERVER['REQUEST_METHOD'] == 'POST') { @@ -96,7 +92,7 @@
- + diff --git a/widget.php b/widget.php new file mode 100644 --- /dev/null +++ b/widget.php @@ -0,0 +1,12 @@ + + + +

Widget

+

Add the following snippet to your site to show your latest picture. Feel free to customize how it looks like!

+ +

+ +