From: Jacob Casper Date: Sun, 26 Jun 2022 21:17:18 +0000 (-0500) Subject: Allow clicking through to full quality images X-Git-Url: https://git.jacobcasper.com/?a=commitdiff_plain;h=2f6fa662ec699625a3d980679c90c104cde1317f;p=pics.git Allow clicking through to full quality images --- diff --git a/app.php b/app.php index a3f2597..06d5ff0 100644 --- a/app.php +++ b/app.php @@ -13,7 +13,12 @@ require_once __DIR__ . '/db.php'; $db = get_db(); $posts = $db->query('SELECT - p.ID, p.TIMESTAMP, pi.MIME_TYPE, pi.PIC_B64, c.BODY + p.ID as POST_ID, + p.TIMESTAMP, + pi.ID as PIC_ID, + pi.MIME_TYPE, + pi.PIC_B64, + c.BODY FROM posts p JOIN pics pi on p.id = pi.post_id JOIN comments c on p.id = c.post_id @@ -21,7 +26,8 @@ $posts = $db->query('SELECT while ($post = $posts->fetchArray()) { $mime_type = $post['MIME_TYPE']; $file_b64 = $post['PIC_B64']; - $post_id = $post['ID']; + $post_id = $post['POST_ID']; + $pic_id = $post['PIC_ID']; $comment_text = $post['BODY']; $img = new Imagick(); $img->readImageBlob(base64_decode($file_b64)); @@ -31,7 +37,7 @@ while ($post = $posts->fetchArray()) { echo "
"; - echo "$"; + echo " $"; echo "

{$comment_text}

"; echo '
'; }