Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
BBCode: Embed PDF Files (No JavaScript/No iFrames) (BB Code) Details »»
BBCode: Embed PDF Files (No JavaScript/No iFrames) (BB Code)
Version: 1.00, by BirdOPrey5 (Senior Member) BirdOPrey5 is offline
Developer Last Online: Aug 2023 Show Printable Version Email this Page

Category: BB Code Enhancements - Version: 4.0.x Rating:
Released: 08-12-2010 Last Update: Never Installs: 144
Re-useable Code Translations  
No support by the author.

This is <embed> BB Code to embed a PDF file into your forum. The user needs a compatible PDF Reader such as Adobe's free PDF Reader. If they don't have one they will still see a link to view the PDF directly.

I am aware <embed> is not "proper" HTML but it works fine in all major browsers (IE/FF/Chrome/Opera/Safari) while <object> was not working for me in IE. If you prefer to keep to strict HTML guidelines and don't care about IE users then simply change the two instances of "embed" in the replacement code to "object".

This has been confirmed working in the latest releases of IE, FF, Chrome, Safari, and Opera.

I am also aware there are at least 2 other PDF BB Codes out there... I believe this implementation is better because one of them uses JavaScript and another uses an iFrame and relies on a 3rd party website (google) to display the PDF. My implementation uses no JavaScript and does not reply on any other websites.

Demo: http://www.juot.net/forums/showthread.php?t=46803

Add a new BBCode

Title: Embed PDF
BB Code Tag Name: pdf
Replacement:
Code:
<div align="center">
<p align="center">
<embed src="{param}" type="application/pdf" width="700" height="900">
<br />
<a href="{param}">Click here to view or download the file directly.</a>
<br />
</embed>
</p></div>
Example: [pdf]http://www.qapla.com/ju/PDFOpenParameters.pdf[/pdf]
(I suggest using your own example if possible.)
Use Option: No
Button Image: (optional)
Remove Tag If Empty: Yes
All Disable Options: Yes

Overall this tag acts a lot like the built in [img] tags.

Please mark as installed if you use this.

Check My Profile for other BB Code enhancements. They work on all versions.

Screenshot Attached:
https://vborg.vbsupport.ru/attachmen...1&d=1281727562

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
4 благодарности(ей) от:
ITDarasgah, Judith2, synseal, Toorak Times

Comments
  #52  
Old 04-15-2012, 03:43 PM
lemonadesoda lemonadesoda is offline
 
Join Date: Nov 2009
Posts: 80
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lewenhaupt View Post
...the bbcode appears to be working perfectly in firefox. But I switched to chrome a while ago, and there the attachments won't show up. (edit:
PDF files that are hosted on the site - uploaded to a folder through ftp - do work on chrome - but not through inline "attachments".)
I have the same issue, hence my post a year ago https://vborg.vbsupport.ru/showpost....7&postcount=12

I have fixed it. How?

1./ Update to LATEST Acrobat Reader 10.1.3
2./ Update to latest Chrome
3./ Launch chrome
4./ In address bar type chrome://plugins
5./ Enable Acrobat Reader plugin (which will automatically disable Chrome PDF reader plugin)

Inline attachments should now work also within the bbcode as PDF inline read. There seems to be a bug in the embedded Chrome PDF reader that is not caching or cannot resolve the indirect link to the attachment PDF. This problem doesnt not occur with IE, and was a solution discovered by trial and error. No logic there!

Try it out and report back to see if this is a general solution, or just worked for me.
Reply With Quote
Благодарность от:
BirdOPrey5
  #53  
Old 04-15-2012, 08:19 PM
etca etca is offline
 
Join Date: Feb 2011
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

installed on 4.1.12
Reply With Quote
  #54  
Old 09-30-2012, 04:43 PM
stl7997 stl7997 is offline
 
Join Date: Nov 2009
Location: Germany
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is this working for anybody that has 4.2? I just get a empty gray box. I've tried Chrome, FF, and IE and it's all the same. Just curious.
Reply With Quote
  #55  
Old 09-30-2012, 05:02 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by stl7997 View Post
Is this working for anybody that has 4.2? I just get a empty gray box. I've tried Chrome, FF, and IE and it's all the same. Just curious.
It should work... do you have a PDF reader installed on your computer/browser?

If you can post a link to a page with the problem.
Reply With Quote
  #56  
Old 09-30-2012, 05:19 PM
stl7997 stl7997 is offline
 
Join Date: Nov 2009
Location: Germany
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've got a PDF reader. Here's a link to one of the embeds.

http://forum.wapscalc.com/showthread...romotion-Study
Reply With Quote
  #57  
Old 09-30-2012, 06:27 PM
Snowhog's Avatar
Snowhog Snowhog is offline
 
Join Date: Oct 2011
Location: Andover, MN
Posts: 423
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

BOP5@

Your demo doesn't work for me either - it seems to specifically want the Adobe plug-in. I'm running Kubuntu 12.04, 64-bit, with Okular version 0.15.1. Okular is an Adobe Reader compliant Linux .pdf viewer/reader.
Reply With Quote
  #58  
Old 09-30-2012, 08:50 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by stl7997 View Post
I've got a PDF reader. Here's a link to one of the embeds.

http://forum.wapscalc.com/showthread...romotion-Study
The file you are linking to does't exist:

Code:
http://forum.wapscalc.com/pdfs/NCOpromotion.pdf
check the spelling maybe... ?m
Reply With Quote
  #59  
Old 09-30-2012, 08:52 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Snowhog View Post
BOP5@

Your demo doesn't work for me either - it seems to specifically want the Adobe plug-in. I'm running Kubuntu 12.04, 64-bit, with Okular version 0.15.1. Okular is an Adobe Reader compliant Linux .pdf viewer/reader.
There's nothing in the code that can specify a specific PDF reader. It's simply your PDF viewer may not work embedded in web documents.
Reply With Quote
  #60  
Old 11-18-2012, 04:32 PM
ikorolis's Avatar
ikorolis ikorolis is offline
 
Join Date: Sep 2006
Location: Athens , Greece
Posts: 144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks nice plug in but no working to my vb 4.2pl3 any browser testing

uninstalled

i see only one box with html code no pdf.
Reply With Quote
  #61  
Old 11-18-2012, 05:28 PM
Mr_Running Mr_Running is offline
 
Join Date: May 2010
Posts: 536
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Works for me 4.2pl3 in Firefox 16 and IE9
Reply With Quote
Благодарность от:
BirdOPrey5
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:41 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06900 seconds
  • Memory Usage 2,343KB
  • Queries Executed 28 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (6)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete