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
  #82  
Old 06-21-2013, 07:44 AM
RazKaziRo RazKaziRo is offline
 
Join Date: May 2013
Posts: 30
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by BirdOPrey5 View Post
And you put in a post, for example:

[pdf]http://www.qapla.com/ju/PDFOpenParameters.pdf[/pdf]

??
yes i put exactly like that
Reply With Quote
  #83  
Old 06-21-2013, 09:40 AM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Then I don't know what to tell you, sorry. It works on dozens, maybe hundreds, of other VB forums.

You don't have any "Replacement Variables" setup that could be interfering, do you?
Reply With Quote
  #84  
Old 06-23-2013, 11:43 AM
ar15dcm ar15dcm is offline
 
Join Date: Apr 2012
Location: Georgia
Posts: 114
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The document view when I use it is skewed to right and down. Also when the post I have it embedded in comes up the browser looses focuses and focus is controlled by the embedded .pdf window.

I used the adobe .pdf document that discusses the controls and switches when embedding .pdf files and one of the controls is

http://www.xxxxx.com$fitH

This is suppsed to fit the document wigth wise in the viewable window... not.
Reply With Quote
  #85  
Old 06-23-2013, 05:38 PM
Snowhog's Avatar
Snowhog Snowhog is offline
 
Join Date: Oct 2011
Location: Andover, MN
Posts: 423
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just added this BBCode and tested in Chromium Browser. Had to download Google Chrome .deb package, extract the contents and copy the libpdf.so file to /usr/lib/chromium-browser as Chromium doesn't have a .pdf plug-in (Google Chrome does). Restarted Chromium and went to your demo page and voila, embedded .pdf document! Just too cool.

Even though this MOD is from 2010, I've marked it as recommended for MOTM and of course, rated it Excellent. BOP5 continues to amaze me with his skills at providing improvements to vBulletin.
Reply With Quote
  #86  
Old 06-24-2013, 03:55 PM
Digital Jedi's Avatar
Digital Jedi Digital Jedi is offline
 
Join Date: Oct 2006
Location: PopCulturalReferenceLand
Posts: 5,171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by RazKaziRo View Post
thanks for the help but i check 3 times for the code and download all pdf viewer there is and try from 3 different computers and 3 different browsers

any ideas?
It really does look like there's an error in your HTML Replacement code. There's a dot where there should be a quotation mark. In addition, it almost looks like you have the code in there twice. Double check that you also don't have a plugin that automatically tries to parse PDFs installed.
Reply With Quote
  #87  
Old 06-27-2013, 10:55 AM
RazKaziRo RazKaziRo is offline
 
Join Date: May 2013
Posts: 30
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Digital Jedi View Post
It really does look like there's an error in your HTML Replacement code. There's a dot where there should be a quotation mark. In addition, it almost looks like you have the code in there twice. Double check that you also don't have a plugin that automatically tries to parse PDFs installed.
i triple check it i copied the text exactly and follow the instructions
can you help me ?
i can give you admin premission for testing

thanks

Raz
Reply With Quote
  #88  
Old 07-06-2013, 09:28 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry guys... This is a simple bbcode, if it doesn't work I don't know why, it works on dozens of other sites.

There is nothing I can change in this mod to make it magically work on a site it doesn't work on now- the issue is external from this code.

I am marking this as unsupported because I do not have time to give the support some people are asking for.

I would suggest anyone having issues-
1) Try with a different browser
2) Make sire you have Adobe PDF Reader Plugin for your browser installed
3) Double/triple check the correct code in the BB Code Manager
4) Try from another computer
Reply With Quote
  #89  
Old 08-18-2013, 05:44 PM
xtragic xtragic is offline
 
Join Date: Feb 2012
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by BirdOPrey5 View Post
Sorry guys... This is a simple bbcode, if it doesn't work I don't know why, it works on dozens of other sites.

There is nothing I can change in this mod to make it magically work on a site it doesn't work on now- the issue is external from this code.

I am marking this as unsupported because I do not have time to give the support some people are asking for.

I would suggest anyone having issues-
1) Try with a different browser
2) Make sire you have Adobe PDF Reader Plugin for your browser installed
3) Double/triple check the correct code in the BB Code Manager
4) Try from another computer
Actually it doesn't work. I've tried this on my forums and know how to write xhtml, xml, PHP and LUA. I can only figure there has to be something in one of the VB updates that is preventing it from property embedding.
Reply With Quote
  #90  
Old 08-22-2013, 10:33 AM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It works fine on my 3.8.7 and 4.2.1 forums.

Can you see the PDF on this page? http://www.qapla.com/mods/showthread...e-Embedded-PDF

This is what it looks like to me (working):

Attached Images
File Type: jpg vb4-pdf-bbcode.jpg (77.6 KB, 0 views)
Reply With Quote
  #91  
Old 09-02-2013, 03:12 AM
xtragic xtragic is offline
 
Join Date: Feb 2012
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

After reinstalling it a second time, it now works on 4.1.11. Not sure why it wouldn't work the first time, unless I copied the code wrong. =/
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 12:33 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.05109 seconds
  • Memory Usage 2,345KB
  • 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
  • (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
  • (4)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (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
  • 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
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete