Uses the portable Mozilla PDF Javascript Library[/b
2. Will display PDF files:
2.1 By DB id
2.2 By Post attachment id (almost finished)
2.3 By URL to web root
2.4 By automatically displaying every attached PDF file
Debugging
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, ...
Test it out:
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]