dopetalk does not endorse any advertised product nor does it accept any liability for it's use or misuse


Our Discord Notification Server invitation link is https://discord.gg/jB2qmRrxyD

Author Topic: Add a "List Attachments (by Hyperlinks)" Dynamic HTML Table To Your Post  (Read 330 times)

Offline Chip (OP)

  • Server Admin
  • Hero Member
  • *****
  • Administrator
  • *****
  • Join Date: Dec 2014
  • Location: Australia
  • Posts: 7335
  • Reputation Power: 0
  • Chip has hidden their reputation power
  • Gender: Male
  • Last Login:Today at 06:47:38 PM
  • Deeply Confused Learner
  • Profession: IT Engineer now retired
Add a "List Attachments (by Hyperlinks)" Dynamic HTML Table To Your Post



Version 5.0 adds automatic "Open with" functionality

Current version: listatt_bbcode_v5.1 for 2.1.x for 2.0.x and 2.1.x -- Download using the table below:

📎 Click on me to view the list of attachments
ListAttBBC  |  v6.4.1  |  2026-08-25  |  Andrew.human & Claude.ai
#FileSizeDownloadsInfoDL
00PIHKAL-PEA.PDF126.6 KB8ℹ️⬇️
01attachment-index-generator.html7.4 KB6ℹ️⬇️
02Benzodiazepine+equivalents-DASSA-August2014.pdf96.9 KB11ℹ️⬇️
031,4-Butanediol Overview_250130.pdf7.4 MB8ℹ️⬇️
04Claude PDF Project Contines.pdf902.9 KB8ℹ️⬇️
05attachment-index-generator.html7.4 KB8ℹ️⬇️
06listatt_diag_pkg2.zip2.3 KB8ℹ️⬇️
07Context window reconstruction and the ILA free attachment lister BBCode by Andrew and Claude.pdf2.9 MB11ℹ️⬇️
08MD_SYNTAX_MANUAL.md7.8 KB0ℹ️⬇️
09Demo Text File.txt1.2 KB0ℹ️⬇️
10Amphetamine Advert.png4.4 MB1ℹ️⬇️
11Amphetamine Advert.png_thumb1.8 MB0ℹ️⬇️
12
MG-Party.mp4
30.3 MB27ℹ️⬇️
13
deeper, slower (details withheld until I know what Im doing).mp3
8.7 MB26ℹ️⬇️
14test.html119.2 KB0ℹ️⬇️
15listatt_bbcode_v5.1.zip15.5 KB1ℹ️⬇️
16listatt-file-support.md767 B0ℹ️⬇️


Spread of attachmnet filetypes at timeof writing:
Code: [Select]
  1875 files     405.0 MB  .jpg
   670 files    2512.9 MB  .pdf
   469 files     607.4 MB  .png
   369 files       8.3 MB  .txt
   252 files     219.1 MB  .application/octet-stream
    73 files      87.4 MB  .zip
    68 files      23.1 MB  .gif
    41 files       0.0 MB  .application/x-empty
    37 files     518.7 MB  .mp3
    30 files       2.7 MB  .doc
    23 files     618.6 MB  .mp4
    13 files      25.4 MB  .message/rfc822
    12 files       0.2 MB  .text/x-python
    10 files       3.4 MB  .html
     9 files       0.0 MB  .text/x-java
     7 files       0.4 MB  .text/x-php
     5 files     167.6 MB  .wav
     4 files       0.7 MB  .image/x-ms-bmp
     3 files       0.1 MB  .application/x-gzip
     2 files       0.5 MB  .video/3gpp
     2 files       0.0 MB  .text/x-shellscript
     2 files       0.0 MB  .text/x-msdos-batch
     2 files       0.0 MB  .text/x-c++
     2 files       0.0 MB  .text/x-c
     1 files       6.6 MB  .application/epub+zip
     1 files       0.0 MB  .image/x-ico

📝 listatt-file-support.md

listatt — Inline File Viewing

Click a filename to view it in-browser; a separate ⬇️ link always downloads instead.

CategoryExtensionsBehavior
Images.png .jpg .jpeg .gif .bmp .webp .svg .icoOpens inline
Audio.mp3 .wav .ogg .m4a .flacBuilt-in player, autoplay
Video.mp4 .webm .mov .ogv .3gpBuilt-in player, autoplay
Documents.pdf .txt .log .csv .jsonOpens inline
Markdown.mdRendered via LMV (falls back to plain text if LMV isn't installed)
HTML.html .htmSandboxed iframe — renders visually, scripts blocked
Everything else.zip .doc(m) .epub etc.Downloads normally — no browser can launch a desktop app


Suggested invocation:

[size=15pt][listatt=Click on me to view the list of attachments][/listatt][/size]

NB: The hyperlinks could be modifed for custom processing of the attachments (like PDF viewing etc.) and is on my TO-DO list ...



TEAM CHECKPOINT by Claude.ai — listatt_bbcode mod (SMF 2.0.x) — RESOLVED/SHIPPED

STATUS: DONE. Confirmed working on Andrew's live production forum
(screenshot verified - real filenames, real sizes, correct order
numbers, working expandable panel).

WHAT IT DOES:

[nobbc][listatt=Title][/listatt][/nobbc] - renders a
collapsible box listing every attachment on the current post (order
#, filename, size). Companion mod to the existing, working pdf_bbcode
(PDFBBCode class), same fork, same author.

FINAL ARCHITECTURE (v4.0):

- Message-id capture: NOT a Display.php line-insertion, NOT reliance
  on the ILA (Post_and_PM_Inline_Attachments) mod. Instead: a global
  function listatt_parse_bbc() (defined in ListAttBBC.php, outside
  the class) wraps core parse_bbc(). listatt_display_patch.xml uses
  <search position="replace"> to rename the ONE parse_bbc() call site
  inside Display.php's per-message loop from parse_bbc(...) to
  listatt_parse_bbc(...) - a straight function-name swap, easier to
  verify than an inserted line (grep Display.php for the new name -
  present or not, no ambiguity about where a new line landed).
  The wrapper sets $context['ila']['msg'] itself (same key ILA uses)
  AND its own ListAttBBC::$currentDisplayMsgId, then calls real
  parse_bbc() and returns its result unchanged. This makes the mod
  fully self-contained - confirmed via reasoning (not direct testing)
  that it should coexist fine with a real ILA install too, since our
  wrapper's value always agrees with what ILA would set, and
  currentMsgId() checks our own tracker first regardless.
- Attachment data: direct query against {db_prefix}attachments WHERE
  id_msg = X - NOT $context['attachments'], NOT loadAttachmentContext()
  (that function doesn't exist on SMF 2.0.x at all; $context['attachments']
  confirmed empty at BBC-parse time via a standalone diagnostic even
  after a real parse_bbc() call). Matches how PDFBBCode itself sources
  attachment data.
- BBC tag type: 'unparsed_content' (plain form) + 'unparsed_equals_content'
  (=Title form for a custom heading) - both routed through the same
  render() validate callback, matching PDFBBCode's own two-entry
  pattern. 'closed' type was tried first and produced silent zero
  output on this fork - abandoned.
- Hook registration: same fork-specific pattern as pdf_register.php -
  add_integration_function() only takes 3 args here (hook, function,
  permanent - no file-based auto-loading), so integrate_pre_include is
  set by hand via updateSettings() in listatt_register.php/
  listatt_unregister.php.

KEY DEBUGGING LESSON FOR THIS FORK (worth remembering for future mods)
Stock SMF source (any version) is NOT a reliable reference for how
hooks/registration actually behave on Andrew's customized 2.0.19 fork.
The only reliable references are: (1) his own already-working mods'
actual source (pdf_bbcode was the template for everything here), and
(2) direct diagnostic scripts run against the real server. Guessing
from stock SMF source repeatedly produced confidently-wrong fixes
this session before that lesson landed.

DEBUG TOOL BUILT THIS SESSION (kept intentionally, not removed)
listatt_diag.php / listatt_diag_pkg.zip - a standalone SSI-based
diagnostic, installed like any other package, visited as a URL
(?msg=N) - checks integrate_pre_include's raw value, function_exists(),
class_exists(), file-on-disk, runs a direct attachments-table query,
and calls listatt_parse_bbc() itself to reproduce real behavior in
isolation. Proved decisive for finding the actual bugs, faster than
live post/save cycles. Worth reusing this pattern for future mod
debugging on this fork rather than trial-and-error via real posts.

TWO LISTATT TRACE LINES ARE DELIBERATELY LEFT IN ListAttBBC.php's
render() - Andrew explicitly wants these kept as an ongoing debugging
aid (matches his PDFBBC TRACE habit), not stripped for a "clean"
release.

OPEN/NOT YET DONE
- CSS (listatt.css) not yet added to Andrew's live stylesheet project
  (deliberately not auto-installed - he adds it by hand like his other
  CSS work)
- No toolbar/editor button yet (pdf_bbcode has one via
  integrate_bbc_buttons - listatt doesn't yet)
- Real-world test with the ILA mod actually reinstalled alongside
  listatt v3.0 hasn't been done - expected to work fine per the
  architecture above, but unconfirmed
</parameter>

Not this shocker:

attach-index // post generator

ATTACH-INDEX

post generator — v0.1 — builds an attachment table for the post body

Add attachment

Order number is assigned automatically by row position. Use ↑ / ↓ in the table to reorder, × to remove.

Attachments (0)

#SubjectFilenameSize

Markdown output

Preview

« Last Edit: August 12, 2026, 08:48:35 PM by smfadmin »
friendly
0
funny
0
informative
0
agree
0
disagree
0
like
0
dislike
0
No reactions
No reactions
No reactions
No reactions
No reactions
No reactions
No reactions
Our Discord Server invitation link is https://discord.gg/jB2qmRrxyD

Tags:
 


dopetalk does not endorse any advertised product nor does it accept any liability for it's use or misuse





TERMS AND CONDITIONS

In no event will d&u or any person involved in creating, producing, or distributing site information be liable for any direct, indirect, incidental, punitive, special or consequential damages arising out of the use of or inability to use d&u. You agree to indemnify and hold harmless d&u, its domain founders, sponsors, maintainers, server administrators, volunteers and contributors from and against all liability, claims, damages, costs and expenses, including legal fees, that arise directly or indirectly from the use of any part of the d&u site.


TO USE THIS WEBSITE YOU MUST AGREE TO THE TERMS AND CONDITIONS ABOVE


Founded December 2014
SimplePortal 2.3.6 © 2008-2014, SimplePortal