Applied sortSubcategories() to submission form picker, admin category
list, and admin subcategory checkboxes. Added the helper function to
admin.html since it's a standalone file.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Admin panel: new "Käyttäjät" section showing all registered users with
post count, likes count, email and join date.
Posts: submissions by logged-in users show a green "Vahvistettu" badge,
while guest submissions show a random code (e.g. #L01U51) for tracking.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Same spam protection as the post submission and comment forms:
hidden honeypot field and a simple math captcha question.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace mailto link with original contact form (name, email, message fields)
- Add contact API endpoint that sends email via mail() and saves to messages.json
- Restore .contact-form CSS styles and translation keys
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- User auth: register (nickname + password + email), login, logout with PHP sessions
- Persistent likes: logged-in users' likes saved to users.json, anonymous via session
- "Tykkäämäni" filter button next to search — filter liked posts, combinable with search
- Hide empty/sparse categories from filter buttons until posts exist
- Replace broken contact form with simple mailto link (info@tykkaa.fi)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Clicking anywhere on a card opens the post modal. Like button and
like count have stopPropagation so they work independently. Added
cursor:pointer to card for visual affordance.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Clicking any image in a post modal opens it full-screen with a dark
overlay. Close by clicking outside, the ✕ button, or pressing Escape.
Added zoom-in cursor and hover opacity to signal clickability.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When user selects Reseptit category, recipe fields (time, servings,
ingredients, steps) appear automatically. All other categories show
the post body field instead. Removed the manual toggle buttons and
cleaned up related CSS.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- api.php: lisätään 'Muut'-alikategoria Resepteihin, Neulomiseen ja Vinkkeihin
- api.php: getOrInitCategories() lisää puuttuvat alikategoriat automaattisesti
- admin.html: poistetaan emoji-kenttä (emoji tulee kategoriasta automaattisesti)
- admin.html: alikategoriat checkboxeina → voi valita useamman samanaikaisesti
- script.js: subcategory tallennetaan aina taulukkona
- script.js: filterPosts tukee pilkulla eroteltuja alikategorioita (postSubs.includes)
- script.js: renderCards kirjoittaa subcategory-arrayn pilkulla eroteltuna data-attribuuttiin
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Tagline: "Jaa asioita joista tykkäät"
- Hero: kuka tahansa voi jakaa
- About: avoin yhteisö kaikille
- Footer: "Avoin yhteisö kaikille"
- About-emoji 👩🍳 → 🤝
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Ainesluettelon vieressä 'Kopioi ostoslista' -nappi: kopioi
julkaisun nimen ja ainesosat ostoslistamuodossa leikepöydälle
- Tykkäykset tallennetaan localStorage:en — muistetaan vaikka
PHP-sessio vanhenisi (selain muistaa oman tykkäyshistoriansa)
- Latauksessa yhdistetään server-sessio ja localStorage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- upload.php: ob_start()+error_reporting(0) estää PHP-varoitusten
sekoittumisen JSON-vastaukseen; ob_clean() ennen jokaista echoa
- script.js + admin.html: lue vastaus ensin tekstinä, yritä sitten
JSON-parsinta ja näytä tarkka virheviesti (HTTP-koodi + raakavastaus)
jos JSON ei onnistu
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>