Go Back   vb.org Archive > vBulletin Modifications > vBulletin 3.8 Modifications > vBulletin 3.8 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: 3.8.x Rating:
Released: 08-12-2010 Last Update: Never Installs: 26
Supported
Re-useable Code Translations  

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: here.

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

yotsume has found a bug where VB drop down menus (like "thread tools") may get hidden behind the PDF if the menu overlaps the same screen space as the PDF. For now please leave some extra lines before embedding a PDF at the top of the first post if you need to use the drop down menus.

Screenshots

File Type: jpg ss_pdfembed.jpg (62.5 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 08-15-2010, 02:56 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've been playing with z-index values all morning but this is apparently a common issue with flash too and there is no solution for that either- when something loads via a plugin all bets are off on how it displays Will keep looking but it does not look good.
Reply With Quote
  #13  
Old 08-15-2010, 05:10 PM
trotskid trotskid is offline
 
Join Date: Feb 2009
Posts: 204
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice BB code, but page on forum doesn't scroll with mouse wheel on Firefox.
Reply With Quote
  #14  
Old 08-15-2010, 07:24 PM
SublimeBoa SublimeBoa is offline
 
Join Date: Nov 2009
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by trotskid View Post
Nice BB code, but page on forum doesn't scroll with mouse wheel on Firefox.
I had the same glitch with FF no matter where I clicked, then it just started working right.
Reply With Quote
  #15  
Old 08-16-2010, 03:24 AM
yotsume's Avatar
yotsume yotsume is offline
 
Join Date: Dec 2006
Posts: 844
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by BirdOPrey5 View Post
I've been playing with z-index values all morning but this is apparently a common issue with flash too and there is no solution for that either- when something loads via a plugin all bets are off on how it displays Will keep looking but it does not look good.
The flash issue is actually easy to solve. This PDF issue however requires you to wrap it in an iframe and then use a lower z-index then the popup menu. Its a pain but for now not a big issue for me. Maybe Adobe will fix it in a new plugin update???
Reply With Quote
  #16  
Old 08-16-2010, 03:34 AM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I actually tried the iframe 'solution' I found posted but in fact it still wasn't working for me even with the iframe-div-iframe codes I found.
Reply With Quote
  #17  
Old 08-16-2010, 06:46 AM
yotsume's Avatar
yotsume yotsume is offline
 
Join Date: Dec 2006
Posts: 844
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by BirdOPrey5 View Post
I actually tried the iframe 'solution' I found posted but in fact it still wasn't working for me even with the iframe-div-iframe codes I found.
I think the iframe and z-index solution will only work if code is added to the navbar template to define its z-index. So that way the navbar popups will be higher then the PDF iframe. That should allow the menus to open over the PDF. It might be worth it to ask over at vBulletin for some help or maybe with some of the big names over here even...
Reply With Quote
  #18  
Old 08-16-2010, 01:24 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't think the navbar template is the issue, to the browser it's all the same web page, it doesn't know if some code is in the navbar template and some code is in showthread or postbit etc... also using this in the navbar is out of the question anyway for obvious reasons.

I put a lot of time searching the web for an answer for this and it always comes back to just not possible because the way plugins are handled by the browser.
Reply With Quote
  #19  
Old 08-16-2010, 11:55 PM
SublimeBoa SublimeBoa is offline
 
Join Date: Nov 2009
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, I been messing with this over at the forum, and it does seem to have a hang up in FF. I tried IE and works fine. In FF it loads everything just fine, but the scroll will only work on the PDF. No matter where you click on the forum, it doesn't remedy it.

BUT, you can get around it by keeping your bookmarks sidebar open, and after you load a page with a PDF, click the scroll bar on the sidebar, and it fixes things in the browser for some reason. ???? This is very consistent as well, using FF 2.x and 3.x.

Does this sound like something you can remedy for us FF users? Or should we just deal with it and use the back door I found? Not really that much of a pain now that I know how to get around it, but it would be nice if we didn't have to.

Other then that, I gotta say I still like it. :up:
Reply With Quote
  #20  
Old 08-17-2010, 01:15 AM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yeah sorry there's nothing I'm going to be able to do about that unfortunately- I'm pretty much stuck with however the plugin and browser is programmed to behave.
Reply With Quote
  #21  
Old 08-22-2010, 06:41 PM
yotsume's Avatar
yotsume yotsume is offline
 
Join Date: Dec 2006
Posts: 844
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Question... Is there a way with the bb code to block the ability to download the embedded PDF file. Meaning the save button on the toolbar would not show or be whited out?
Reply With Quote
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 01:18 AM.


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.04571 seconds
  • Memory Usage 2,337KB
  • Queries Executed 26 (?)
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
  • (1)bbcode_code
  • (3)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
  • (2)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (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_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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete