Edit Display.php:
Find:
loadAttachmentContext(), right after where $attachmentData[$i] = array( is built, before the // If something is unapproved we'll note it so we can sort them. line)
Insert:
"@file_put_contents($boarddir . '/pdfbbc_autotrace.log', date('Y-m-d H:i:s') . ' AUTO-EMBED LOOP: ' . var_export($attachment, true) . "\n", FILE_APPEND);"
If `$boarddir` isn't already in that list, insert in the variable into the line below:
global $modSettings, $context, $boarddir, ...
It will display all attached PDFs and addition, test it with:
By DB ID:
[pdf=4790][/pdf]
By POST ID:
[pdf=1][/pdf]
From webroot:
[pdf]https://192.168.233.129/PIHKAL-PEA.pdf[/pdf]