KuzuhaScriptPHP+ (ksphp-plus) Installation Guidance
Scope: link-image thumbnail feature (js/imgthumb.js) /
       JavaScript internationalization (window.KSPHP_LANG)
Timestamp format: ISO 8601 (minute precision), timezone UTC
Created: 2026-07-17T05:05 UTC

============================================================
[What this zip contains]
------------------------------------------------------------
This is a diff package containing only the files added or changed
in this pass, separate from the full board script bundle. The
folder structure is kept as-is (sub/, js/, language/, doc/).

  bbs.php                      ... added language-data output for JS
  sub/template.html            ... added <script> load/embed tags
  js/imgthumb.js               ... new: shows thumbnails for image
                                    links in posts
  js/ayashiibreaker.js         ... internationalized (modified)
  js/upthumb.js                ... internationalized (modified)
  js/vanish.js                 ... internationalized (modified,
                                    including a detection-logic
                                    bugfix)
  js/admin.js                  ... internationalized (modified)
  language/english.txt         ... new keys added
  language/japanese.txt        ... new keys added
  doc/changelog-2026-07-16-01.txt ... consolidated changelog
                                       (includes this pass)
  doc/CSScheck.txt             ... previous CSS survey report
                                    (included for reference)
  Installation Guidance.txt    ... this file

  * language/*.txt is a single file shared and referenced by both
    the existing board script side and the JS side -- the files are
    not split per side.

============================================================
[1. Link-image thumbnail feature (js/imgthumb.js)]
------------------------------------------------------------
When a URL in a post body points to an actual image file (supported
extensions by default: jpg/jpeg/png/gif/webp/bmp/avif/svg), a
thumbnail is automatically displayed to the right of that URL.

  - This is a separate file, independent from the existing
    js/upthumb.js (which targets the known directory structure of a
    specific uploader). Both can be enabled at the same time.
  - Before displaying, it confirms via a HEAD request that the URL
    actually exists and that its Content-Type is image/* (it does
    not judge by file extension alone).
  - A "Link thumbnails" checkbox is added next to the post form (on
    the same line as the existing "Uploader thumbnails"). Its
    on/off state is stored in the browser's localStorage and is
    never sent to the server.
  - Which extensions are targeted can be narrowed down from a group
    of checkboxes automatically added to the personal settings
    screen (?setup=1). All are selected by default. This too is
    localStorage-only and is not included when the settings form is
    submitted.

  [Installation steps]
  1. Place js/imgthumb.js into the js/ directory.
  2. Replace sub/template.html (a line adding
     <script src="js/imgthumb.js" defer></script> has been inserted
     into the script-loading section inside <head>).
  3. Replace bbs.php (includes the window.KSPHP_LANG embedding
     described below).
  4. Replace language/english.txt and language/japanese.txt (12 new
     keys have been added; existing keys are unchanged).
  No special configuration is required -- simply placing the files
  is enough to enable it.

============================================================
[2. JavaScript internationalization (window.KSPHP_LANG)]
------------------------------------------------------------
Until now, the board itself (the PHP templates) had been
internationalized via the language files (language/*.txt), but text
inside the scripts under js/ (button labels, etc.) was out of
scope and always displayed as fixed text.

This pass adds a mechanism where bbs.php turns the contents of the
language file into JSON and embeds it inside <head>, before any
other script, as:

    <script>window.KSPHP_LANG = { ... };</script>

This lets scripts under js/ reference text defined in
language/*.txt directly, in the form:

    window.KSPHP_LANG.KEY_NAME

(example: window.KSPHP_LANG.MAKE_LINE_BREAKS_BTN)

  [Files updated to use this mechanism in this pass]
  The 5 files js/ayashiibreaker.js, js/upthumb.js, js/imgthumb.js,
  js/vanish.js, and js/admin.js.

  [Internationalizing a new JS file going forward]
  1. Add the key and its Japanese/English text to both
     language/english.txt and language/japanese.txt (one line per
     entry, in the existing KEY=value format, matching the existing
     key/value style).
  2. Reference `window.KSPHP_LANG.KEY_NAME` from the JS file. It is
     recommended to provide a fallback in case it hasn't loaded yet,
     in the form
     `(window.KSPHP_LANG && window.KSPHP_LANG.KEY_NAME) || "default value"`.
  3. No server-side (PHP) changes are needed (window.KSPHP_LANG is
     automatically output on every page).

============================================================
[Verified working]
------------------------------------------------------------
- All PHP files: no syntax errors under php -l
- All JS files (modified and new): no syntax errors under
  node --check
- language/english.txt and language/japanese.txt: key counts match
  (216 entries), no duplicate keys
- Confirmed HTTP 200, no leftover {PLACEHOLDER} markup, and valid
  JSON output for window.KSPHP_LANG, across every route (main board,
  past-log search, tree view, admin login (GET/POST), personal
  settings screen, admin menu) under both the Japanese and English
  LANGUAGE_FILE settings.
