Module: LTVBBC.php ยท Class: LTVBBCode ยท Version: 1.9.0 ยท Date: 01-11-2026 Package id: Egerszegi.ae_and_Claude.ai:LTV-bbcode Authors: Andrew.human (Architect / Project Manager), Claude.ai (Lead Programmer / Debugging), Gemini.ai (Consultant / Theming)
Written for humans and for machines/AIs: section 1 is a plain summary, section 8 is a compact fact sheet.
[ltv] is an SMF BBCode tag with two jobs:
| Form | Job |
|---|---|
[ltv=inline]text[/ltv] |
Show the text between the tags, in full, in monospace in a themed card. BBCode between the tags ([b], [i], [color], [url], โฆ) is rendered; smileys are off. |
[ltv=autodisplay]x[/ltv] / [ltv=noautodisplay]x[/ltv] |
Per-post switch that auto-embeds the post's .txt / .text attachments in the same kind of card, via ISE_text_viewer.html, with BBCode rendered (v1.9.0; needs the Collaborative v6.5+ viewer). |
The tag name [ltv] was used by an older, retired "Lightweight Text Viewer" mod (v1.0โv2.7.1, archived as "LemonLib"). This is a different mechanism that reuses the name.
MsgTracker) and CollabCore RedBox >= 1.3. ltv_check_collabcore.php checks both at install time and stops the install with a message if they are missing.Sources/CollabCore/ISE_text_viewer.html present (same place listatt_bbcode and lmv_bbcode expect it). Needed for autodisplay only; inline does not use it.[ltv=inline] itself needs no message ID and no CollabMsgTracker.[ltv=inline][ltv=inline]
anything you type here
keeps its indentation and line breaks
[/ltv]
Behaviour:
[code]).[b], [i], [u], [color], [url] and so on work. Smileys are off, so :) stays text. To show a tag literally, wrap it: [nobbc][b][/nobbc].renderInline() runs the escaped text through parse_bbc($text, false), then turns the resulting <br /> and back into / spaces so the section 7 rules still hold.white-space: pre-wrap) rather than forcing a sideways scrollbar. To change this, edit the white-space / overflow-wrap part of the style attribute built in renderInline().v1.7.0) and the theme switcher. The theme choice is shared with autodisplay cards (localStorage key ise_ltv_theme).[ltv=inline] and one directly before [/ltv] are treated as layout, not content. Any further blank lines are kept.= is case-insensitive and trimmed.ltv tag is disabled in the forum's BBC settings, the content is dropped (existing behaviour for every [ltv] form).[ltv=autodisplay]x[/ltv] turn on auto-embed of this post's .txt/.text attachments (default is off)
[ltv=noautodisplay]x[/ltv] turn it off (same as the default)
autodisplay and noautodisplay do anything. Any other =value is ignored.CollabMsgTracker::current() returns 0 the tag shows a RedBox where it was typed (RedBoxBBCode::noMessageId()).{db_prefix}attachments (approved only, extensions txt and text, case-insensitive). Each is shown in a 500px-high iframe pointing at ISE_text_viewer.html?file=<dlattach url>&name=<filename>..txt attachments is separate and unaffected (ListAttBBC.php routes it to the same viewer).Install through the SMF Package Manager with ltv_bbcode_v<version>.zip.
| Branch | What the install does |
|---|---|
| 2.0.x | ltv_check_collabcore.php; copy LTVBBC.php to $sourcedir; ltv_register.php (registers LTVBBCode::integrate on integrate_bbc_codes and adds LTVBBC.php to integrate_pre_include); ltv_display_install_template.php (inserts the autodisplay call into Display.template.php). |
| 2.1.x | Same check and file copy; <hook> entries for integrate_bbc_codes and integrate_pre_parsebbc; same Display.template.php step. |
Uninstall reverses each step (ltv_unregister.php / hook reverse, ltv_display_uninstall_template.php, remove LTVBBC.php). The Display.template.php step uses targeted matching so it removes only LTV's own block even if other mods inserted theirs at the same anchor.
ltv_display_patch.xml is a legacy reference and is not used by the install steps.
LTV_manual.md and CHANGELOG.md are reference files in the zip; the installer does not copy them to the forum.
| File | Purpose |
|---|---|
LTVBBC.php |
The module: tag definition, inline renderer, autodisplay logic, card and theme code. |
package-info.xml |
Package definition for 2.0.x and 2.1.x. |
readme.txt |
Shown by the installer. |
ltv_check_collabcore.php |
Install-time dependency check (CollabCore, RedBox). |
ltv_register.php / ltv_unregister.php |
2.0.x hook registration / removal. |
ltv_display_install_template.php / ltv_display_uninstall_template.php |
Add / remove LTV's block in Display.template.php. |
ltv_display_patch.xml |
Legacy, not referenced. |
LTV_manual.md, CHANGELOG.md |
Documentation. |
inline works, and why (read before changing it)The tag is registered as type unparsed_equals_content. SMF hands the validate callback $data[0] (the text between the tags) and $data[1] (the value after =); whatever is left in $data[0] is the output.
What arrives in $data[0]: the stored post body โ already entity-escaped (<, &, โฆ), with newlines as <br> (<br /> on 2.0.x) and possibly for space runs.
What happens to the output afterwards (checked against SMF 2.1's parse_bbc(); 2.0.x source could not be fetched, so 2.0.x is assumed to match): the output is wrapped in newline markers, smileys are applied to the chunks between those markers, and a final "Cleanup whitespace" pass turns every "\n" into <br>, every double space into " ", and every back into a real "\n". Consequences for anything this tag returns:
"\n" โ it would become <br> inside the card's CSS and JavaScript (breaking both) and would shift the smiley chunking so smileys fire inside the text. Line breaks are therefore written as . inside the JavaScript (a syntax error). Card markup is collapsed to single spaces (flatten()); runs of spaces in the user's text are written as  , which the browser shows as an ordinary space.INLINE_TOKEN, is swapped for it), because flatten() collapses whitespace.< and > are escaped as a safety net, although SMF already escapes the body before it is stored.parse_bbc() caches slow messages, so a cached post can appear in a different position on a different page; a block relying on another block's assets could end up with none. Cost: roughly the card's CSS/JS size per block (a few KB).wrapCard() is shared with autodisplay and is deliberately untouched. Autodisplay is echoed by Display.template.php, not by parse_bbc(), so rules 1โ5 apply only to inline.
tag: ltv
parser type: unparsed_equals_content (not 'parameters' โ fails to populate value on this fork)
values: inline | autodisplay | noautodisplay (case-insensitive, trimmed)
inline output: div.ltv-card > header + pre.ltv-inline ; BBC rendered via parse_bbc($text,false), smileys off ; no message id needed
inline limits: none on length ; lines wrap ; one leading + one trailing newline dropped
autodisplay: per message ; default off ; needs CollabMsgTracker::current() > 0
theme storage: localStorage "ise_ltv_theme" ; default theme "indigo"
version const: LTVBBCode::VERSION
version shown: banner "v<version>" in every card header
requires: CollabCore >= 2.0 (MsgTracker >= 1.0), RedBox >= 1.3
hooks 2.0.x: integrate_bbc_codes (+ integrate_pre_include for LTVBBC.php)
hooks 2.1.x: integrate_bbc_codes, integrate_pre_parsebbc
template patch: Display.template.php, anchor "if ($attachment['is_image']"
inline.viewerUrl() adds &bbc=1. The viewer (v1.2+) then starts with its "Render BBCode" box ticked; the reader can untick it. Only b i u s sub sup color size url code nobbc are converted; anything else, and any tag that is unmatched or has a bad argument, shows as typed. An older viewer ignores &bbc=1 and shows raw text.inline calls parse_bbc() from inside a parse_bbc() tag callback. Believed safe (SMF does the same for some tags) but not run against a live forum here; test on Dev first.parse_bbc() behaviour in section 7 was verified against 2.1 source only. Test on a 2.0.19 install before relying on it.inline in this version.inline blocks in one post each repeat the card CSS/JS (see section 7, rule 5).In a test post, using [ltv=inline]:
[b]bold[/b] โ shows bold; [nobbc][b][/nobbc] shows literally.:) and 8) stay text (no smiley image).<b>, & and quotes โ shown as typed..txt attachment containing [b]bold[/b]: opens rendered (bold), the "Render BBCode" box is ticked, unticking shows the raw text, search still finds text in both modes.See CHANGELOG.md. Current: 1.9.0 (01-11-2026) โ [ltv=autodisplay] renders BBCode via the viewer.