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: Attachment index generator ·  (Read 9 times)

Offline Chip (OP)

  • Server Admin
  • Hero Member
  • *****
  • Administrator
  • *****
  • Join Date: Dec 2014
  • Location: Australia
  • Posts: 7301
  • Reputation Power: 0
  • Chip has hidden their reputation power
  • Gender: Male
  • Last Login:Today at 04:55:38 AM
  • Deeply Confused Learner
  • Profession: IT Engineer now retired
Attachment index generator ·
« on: Today at 01:02:57 AM »
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=&#39;1&#39;><table class=&#39;xdebug-error xe-notice&#39; dir=&#39;ltr&#39; border=&#39;1&#39; cellspacing=&#39;0&#39; cellpadding=&#39;1&#39;>
<tr><th align=&#39;left&#39; bgcolor=&#39;#f57900&#39; colspan="5"><span style=&#39;background-color: #cc0000; color: #fce94f; font-size: x-large;&#39;>( ! )</span> Notice: Undefined variable: row in /var/www/html/smf20/listatt_diag.php on line 35</th></tr>
<tr><th align=&#39;left&#39; bgcolor=&#39;#e9b96e&#39; colspan=&#39;5&#39;>Call Stack</th></tr>
<tr><th align=&#39;center&#39; bgcolor=&#39;#eeeeec&#39;>#</th><th align=&#39;left&#39; bgcolor=&#39;#eeeeec&#39;>Time</th><th align=&#39;left&#39; bgcolor=&#39;#eeeeec&#39;>Memory</th><th align=&#39;left&#39; bgcolor=&#39;#eeeeec&#39;>Function</th><th align=&#39;left&#39; bgcolor=&#39;#eeeeec&#39;>Location</th></tr>
<tr><td bgcolor=&#39;#eeeeec&#39; align=&#39;center&#39;>1</td><td bgcolor=&#39;#eeeeec&#39; align=&#39;center&#39;>0.0005</td><td bgcolor=&#39;#eeeeec&#39; align=&#39;right&#39;>416984</td><td bgcolor=&#39;#eeeeec&#39;>{main}(  )</td><td title=&#39;/var/www/html/smf20/listatt_diag.php&#39; bgcolor=&#39;#eeeeec&#39;>.../listatt_diag.php:0</td></tr>
</table></font>
Topic id: 5
Raw body (first 200 chars): &#38;#91;listatt&#38;#93; list all the attachments &#38;#91;/listatt&#38;#93;



xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

loadAttachmentContext() function not found.

context[&#39;attachments&#39;] keys before parse: (empty/not set)

AFTER parse_bbc():
context[&#39;ila&#39;]: (not set)
context[&#39;attachments&#39;] keys: (empty/not set)

Parsed output (first 500 chars):
&#38;#91;listatt&#38;#93; list all the attachments &#38;#91;/listatt&#38;#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

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: Today at 04:07:51 AM by Chip »
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