Photos in posts and replies: a "Fotó" button in the new thread form and the reply boxes. The browser makes the picture small before uploading it (1600 pixels at most, WebP, JPEG where WebP cannot be made); the forum checks it is a still picture, strips its metadata and makes a square preview (forum-photos/ in the storage). Five a member a day, five a post; one taken off before sending is deleted and does not count. Under the post a row of square previews; a click opens a viewer paged with arrows, swipes and keys. Seen by whoever may read the thread (long public cache only for public topics). Unsent photos go after a day, those of removed posts after a year; removed with the account and listed in the data export. Terms and privacy notice updated. The forum's bottom menu keeps its five items in one row (the fifth wrapped to a second row). On iPhones, when the keyboard goes away without the usual tap (a photo picker opening over it), the page is put back in place instead of the menu floating mid-screen over an empty strip. The browser's own confirm() and prompt() windows (23 places: deleting, revoking, blocking, muting, moderators' reasons, admin actions) are replaced by a question window in the site's look, following the forum's light or dark theme, with named buttons and a text box for reasons. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
19 lines
948 B
SQL
19 lines
948 B
SQL
-- Photos in posts: resized in the browser, checked and stripped of their
|
|
-- metadata by the forum, kept in the object storage (forum-photos/), with a
|
|
-- square preview. Uploaded first (post_id NULL), attached when the post is
|
|
-- sent; unattached ones go after a day. At most five a member a day.
|
|
CREATE TABLE forum.photos (
|
|
id uuid PRIMARY KEY,
|
|
owner_id uuid NOT NULL REFERENCES users ON DELETE CASCADE,
|
|
post_id bigint REFERENCES forum.posts ON DELETE CASCADE,
|
|
-- Files in the bucket's forum-photos/ folder: the picture and its preview.
|
|
file text NOT NULL,
|
|
thumb text NOT NULL,
|
|
width integer NOT NULL,
|
|
height integer NOT NULL,
|
|
bytes integer NOT NULL,
|
|
created_at timestamptz NOT NULL DEFAULT now()
|
|
);
|
|
CREATE INDEX photos_post_idx ON forum.photos (post_id, created_at) WHERE post_id IS NOT NULL;
|
|
CREATE INDEX photos_owner_idx ON forum.photos (owner_id, created_at DESC);
|