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: PDF BBCode Tag to Automatically Display All PDFs  (Read 13 times)

Offline Chip (OP)

  • Server Admin
  • Hero Member
  • *****
  • Administrator
  • *****
  • Join Date: Dec 2014
  • Location: Australia
  • Posts: 7275
  • Reputation Power: 0
  • Chip has hidden their reputation power
  • Gender: Male
  • Last Login:Yesterday at 10:13:08 PM
  • Deeply Confused Learner
  • Profession: IT Engineer now retired
PDF BBCode Tag to Automatically Display All PDFs
« on: Yesterday at 09:00:11 PM »
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]

« Last Edit: Yesterday at 10:42:08 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