TEAM CHECKPOINT — listatt_bbcode mod (SMF 2.0.x)GOALCustom BBCode [listatt][/listatt] that lists all attachments on thecurrent post (order #, filename, size) in an expandable box, sinceSMF's stock attachment list is too small/hard to read. Companion modto an existing, working pdf_bbcode mod (PDFBBCode class) on the samefork.ENVIRONMENTSMF 2.0.19-based fork. add_integration_function() on this fork onlytakes 3 args (hook, function, permanent) - NO file-basedauto-loading, unlike stock SMF 2.1. So the class file must be loadedseparately via integrate_pre_include, set by hand withupdateSettings() (add_integration_function() silently drops a 4tharg rather than erroring). This exact pattern is proven working viathe existing PDFBBCode mod (see its pdf_register.php).integrate_pre_parsebbc: registered as a fallback but not confirmed tofire on this fork (no error, just never observed firing in testingso far).Post_and_PM_Inline_Attachments (ILA) mod sets $context['ila']['msg']from inside parse_bbc() - this is the PROVEN way to get "whichmessage is currently being parsed" on this fork. On a fresh SMFinstall with no ILA mod, this is never set (confirmed via astandalone diagnostic script).CONFIRMED WORKING PIECES- Hook registration: integrate_bbc_codes -> ListAttBBC::addCode + integrate_pre_include -> ListAttBBC.php, both show correctly in the admin hook list, matching PDFBBCode's own working rows exactly.- Attachment data source: 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, and $context['attachments'] was confirmed empty even after a real parse_bbc() call in a standalone test). This matches how PDFBBCode itself gets attachment data (see its findPdfAttachment()). Confirmed via diagnostic script: direct query correctly returned all 6 real attachments on a real test message.- BBC tag type: MUST be 'unparsed_content' (open/close pair, validate writes into $data[0]) - NOT 'closed' type writing $tag['content']. The 'closed' approach was tried first and produced zero output on this fork, silently. PDFBBCode never uses 'closed' either - only unparsed_content / unparsed_equals_content.STILL UNRESOLVED[listatt]x[/listatt] on a brand new post (real content between thetags to dodge SMF's "message body was left empty" anti-blank-postcheck, which strips known BBC tags from the raw text before checkingif anything's left) - result unconfirmed. Last request was for theuser to paste exactly what renders in a post that successfully savedcontaining "test [listatt][/listatt] test" - never got a clean answerback before the user asked for this checkpoint.NEXT STEP FOR WHOEVER PICKS THIS UPGet a straight, literal copy-paste of what actually renders in asaved post's body where the tag is used with non-empty contentbetween [listatt] and [/listatt]. Everything else (hook registration,attachment query, tag type) is now believed correct/proven - this isthe one remaining unconfirmed link in the chain. If it still showsnothing, next suspect would be checking whether integrate_pre_parsebbcactually fires on this fork (no direct evidence either way yet), sincewithout ILA installed on a given install, currentMsgId() has noproven source at all.FILESCurrent working tree: ListAttBBC.php, listatt_register.php,listatt_unregister.php, package-info.xml, listatt.css, readme.txt -all packaged together as listatt_bbcode_v1.0.zip (already installedvia Package Manager on the test system as of this checkpoint).Reference/proven-working mod: pdf_bbcode (PDFBBC.php,pdf_register.php, pdf_unregister.php) - same author, same fork,confirmed working, used as the template for all registration patterndecisions above.[
html]
<font size='1'><table class='xdebug-error xe-notice' dir='ltr' border='1' cellspacing='0' cellpadding='1'>
<tr><th align='left' bgcolor='#f57900' colspan="5"><span style='background-color: #cc0000; color: #fce94f; font-size: x-large;'>( ! )</span> Notice: Undefined variable: row in /var/www/html/smf20/listatt_diag.php on line
35 </th></tr>
<tr><th align='left' bgcolor='#e9b96e' colspan='5'>Call Stack</th></tr>
<tr><th align='center' bgcolor='#eeeeec'>#</th><th align='left' bgcolor='#eeeeec'>Time</th><th align='left' bgcolor='#eeeeec'>Memory</th><th align='left' bgcolor='#eeeeec'>Function</th><th align='left' bgcolor='#eeeeec'>Location</th></tr>
<tr><td bgcolor='#eeeeec' align='center'>1</td><td bgcolor='#eeeeec' align='center'>0.0005</td><td bgcolor='#eeeeec' align='right'>416984</td><td bgcolor='#eeeeec'>{main}( )</td><td title='/var/www/html/smf20/listatt_diag.php' bgcolor='#eeeeec'>.../listatt_diag.php
: 0</td></tr>
</table></font>
Topic id: 5
Raw body (first 200 chars): &#91;listatt&#93; list all the attachments &#91;/listatt&#93;
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
loadAttachmentContext() function not found.
context['attachments'] keys before parse: (empty/not set)
AFTER parse_bbc():
context['ila']: (not set)
context['attachments'] keys: (empty/not set)
Parsed output (first 500 chars):
&#91;listatt&#93; list all the attachments &#91;/listatt&#93;
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[/html]
What is this bullshit ? ?
attach-index // post generator
ATTACH-INDEX
post generator — v0.1 — builds an attachment table for the post body
Attachments (0 )
Markdown output
copy