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 Google Documents Collection (BB Code) Details »»
BBCode - Embed Google Documents Collection (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: 09-18-2010 Last Update: 09-18-2010 Installs: 69
Re-useable Code Translations  
No support by the author.

Embed Various Google Docs

Live Demo: Here

Google Docs is a free service by Google. Google Docs are a professional collection of "Office" applications like a Word Processor, Spreadsheet, Presentation Designer, and Drawing tool. Google Docs is a serious alternative to the very expensive Microsoft Office. Documents are stored online, can be shared among users, and in the case of this BB Code they can be embedded in other web pages.

There are several BB Codes in this collection, Google Doc (Document), Google Spreadsheet and Google Presentation. Google Drawings can be embedded using the standard [img] tags but I will give an example here anyway.

You may get a warning message saying the {param}s aren't enclosed in quotes. You can hit "continue" to ignore this error. As you can see in the code there are eventually double-quotes.

When working on any Google Document in the top right of the window will be a "Share" button with drop-down arrow. Click on this arrow and choose "Publish to Web" or "Publish / Embed" and you will be given code to link to and/or embed the document. You will be given a URL such as:
https://docs.google.com/document/pub?id=1bhtK-AhiXqfWK5bGJcULvEO3zMahcFgnJEsT1YvYsuc

What you need is the document ID which is the long string of characters after "id=" or "key=" and before the ampersand (&) if present, in this case your id is:
1bhtK-AhiXqfWK5bGJcULvEO3zMahcFgnJEsT1YvYsuc

In all cases you put the ID between the appropriate tag for the type of document.

Google Document (Word Processor Document)
[gd]1bhtK-AhiXqfWK5bGJcULvEO3zMahcFgnJEsT1YvYsuc[/gd]

Google Spreadsheet
[gs]0AmOHO6Cm8vvAdFR2b0dMMnVwMUE0MlpXYnowWnowWWc[/gs]

Google Presentation
[gp]dcjktv94_1fcpptwqc[/gp]

Google Drawing
No special BB Code is needed to embed a drawing because it's rendered as any other image. Just put the URL given between IMG tags...
[IMG]https://docs.google.com/drawings/pub?id=1C1arwoUzUyzxnzk9yD7ysx6vyMfcDuDXXzQTqnngh2 c&w=640&h=480[/IMG]

To add one or more of these BB Codes follow any of the below instructions:

Add a New BB Code

Title: Google Document
BB Code Tag Name: gd
Replacement:
Code:
<div align="center"><iframe src="https://docs.google.com/document/pub?id={param}&amp;embedded=true&gid=0&output=html&widget=true" width="95%" height="500">IFRAME Not Available. <a href="https://{option}.google.com/document/pub?id={param}">Direct Link to Google Document</a>.</iframe></div>
Example:[gd]1bhtK-AhiXqfWK5bGJcULvEO3zMahcFgnJEsT1YvYsuc[/gd]
Description: Embed a Google Document.
Use Option: No
Button Image: (optional)
Remove Tag If Empty: Yes
All Disable Options: Yes

------

Add a New BB Code

Title: Google Spreadsheet
BB Code Tag Name: gs
Replacement:
Code:
<div align="center"><iframe width='95%' height='500' frameborder='0' src='https://spreadsheets.google.com/pub?key={param}&hl=en&single=true&gid=0&output=html&widget=true'>IFRAME Not Available. <a href="https://spreadsheets.google.com/pub?key={param}&hl=en&single=true&gid=0&output=html">Direct Link to Spreadsheet.</a></iframe></div>
Example: [gs]0AmOHO6Cm8vvAdFR2b0dMMnVwMUE0MlpXYnowWnowWWc[/gs]
Description: Embed a Google Spreadsheet.
Use Option: No
Button Image: (optional)
Remove Tag If Empty: Yes
All Disable Options: Yes

------

Add a New BB Code

Title: Google Presentation
BB Code Tag Name: gp
Replacement:
Code:
<div align="center"><iframe src="https://docs.google.com/present/embed?id={param}" frameborder="0" width="700" height="559">IFRAME Not Available. <a href="https://docs.google.com/present/view?id={param}">Direct Link to Presentation.</a></iframe></div>
Example:[gp]dcjktv94_1fcpptwqc[/gp]
Description: Embed a Google Presentation.
Use Option: No
Button Image: (optional)
Remove Tag If Empty: Yes
All Disable Options: Yes

------

In any of the above codes you can edit the height and width attributes to suit your needs.

------

------------------------------------------------------

Please "Mark as Installed" if you use this.
Donations always appreciated. :up:
Nominate MOTM if you LOVE it!

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

Download the .txt file for a copy of the Install instructions.

Screenshots Attached:

Download Now

File Type: txt GoogleDocsBBCodev4.txt (4.0 KB, 238 views)

Screenshots

File Type: png ss_googledocs.png (28.2 KB, 0 views)
File Type: png ss_googlespreadsheet.png (20.5 KB, 0 views)
File Type: png ss_googlepresentation.png (17.9 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Благодарность от:
blind-eddie

Comments
  #72  
Old 04-16-2017, 04:49 PM
willie53's Avatar
willie53 willie53 is offline
 
Join Date: Nov 2016
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I do agree there if you are not comfortable altering the database then leave it alone this is why i always use one of my my testing sites on my laptop before i put anything on my live site also i backup the database beforehand.
Reply With Quote
  #73  
Old 08-31-2017, 06:12 AM
IggyP IggyP is offline
 
Join Date: May 2012
Posts: 252
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Grimholtt View Post
Can anyone assist with this? After the changes were made by Google, I use the /d/ now and it loads the spreadsheet just fine, but now instead of just the cells appearing, I get the entire Spreadsheet including the Tools at the top.

For example:

I'm looking to see just this:



What I'm actually seeing:



Any way to clean this up that anyone knows about?
i am curious of this too....the extra header can be a security concern would be nice to hide it....also it now added a chat as well, which we dont really want....i tried hiding them by css, even tho its loading the main sheet from google, but fail...not sure what else to even try...

also have got errors loading spreadsheets like this:

Quote:
GET filesystem:htt ps://docs.google.c om/persistent/docs/fonts/cCwcoZCh95jEfkePtzfl9_k_vArhqVIZ0nv9q090hN8.woff2 net::ERR_FILE_NOT_FOUND
Quote:
Refused to display 'htt ps://docs.google.c om/sharing/init?id=14pmOx9znK02UTHeY7BdQKe792MML1f81CtO7I4DAn fM&foreignService=ritz&gaiaService=wise&shareServi ce=ritz&subapp=10&popupWindowsEnabled=true&shareUi Type=default&hl=en&authuser=0&rand=1504167017294' in a frame because it set 'X-Frame-Options' to 'sameorigin'.
Quote:
GET ht tps://docs.google.c om/sharing/init?id=14pmOx9znK02UTHeY7BdQKe792MML1f81CtO7I4DAn fM&foreignService=ritz&gaiaService=wise&shareServi ce=ritz&subapp=10&popupWindowsEnabled=true&shareUi Type=default&hl=en&authuser=0&rand=1504167017294[/url] net::ERR_BLOCKED_BY_RESPONSE

be nice to clean it up and secure it a little better but seems to basically work..vb4.2.5 php 5.6


oh and btw, that is result by using this replacement code which is the one that seemed to work for me
Code:
<div align="center"><iframe width="95%" height="800px" frameborder="0" src="https://docs.google.com/spreadsheets/d/{param}"&hl=en&single=true&gid=0&output=html&widget=true'>IFRAME Not Available. <a href="https://docs.google.com/spreadsheets/d/{param}"&hl=en&single=true&gid=0&output=html">Direct Link to Spreadsheet.</a></iframe></div>
Reply With Quote
  #74  
Old 08-31-2017, 09:50 AM
Kane@airrifle's Avatar
Kane@airrifle Kane@airrifle is offline
 
Join Date: Jun 2011
Location: ZA
Posts: 181
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Add
HTML Code:
headers=false
to your bbcode remove the toolbars.

Eg:

HTML Code:
<div align="center"><iframe width='95%' height='600' frameborder='0' src="https://docs.google.com/spreadsheets/d/{param}/pubhtml?widget=true&amp;headers=false"></iframe></div>
Reply With Quote
  #75  
Old 09-01-2017, 02:15 AM
IggyP IggyP is offline
 
Join Date: May 2012
Posts: 252
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Kane@airrifle View Post
Add
HTML Code:
headers=false
to your bbcode remove the toolbars.

Eg:

HTML Code:
<div align="center"><iframe width='95%' height='600' frameborder='0' src="https://docs.google.com/spreadsheets/d/{param}/pubhtml?widget=true&amp;headers=false"></iframe></div>
that works perfectly thank you....i tried the same however for the google docs and didnt seem to work..is it slightly different there? i know that first part at least is the same with the updated "htt ps://docs.google.co m/document/d/{param}" format but the after part i tried matching your ss code then a few other ways and still failed..
Reply With Quote
  #76  
Old 09-01-2017, 06:58 AM
Kane@airrifle's Avatar
Kane@airrifle Kane@airrifle is offline
 
Join Date: Jun 2011
Location: ZA
Posts: 181
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by IggyP View Post
that works perfectly thank you....i tried the same however for the google docs and didnt seem to work..is it slightly different there? i know that first part at least is the same with the updated "htt ps://docs.google.co m/document/d/{param}" format but the after part i tried matching your ss code then a few other ways and still failed..
Try this for a Google Doc.

Code:
<div align="center"><iframe width='95%' height='600' frameborder='0' src="https://docs.google.com/document/d/e/{param}/pub?embedded=true"></iframe></div>
Reply With Quote
Благодарность от:
willie53
  #77  
Old 09-01-2017, 11:41 AM
IggyP IggyP is offline
 
Join Date: May 2012
Posts: 252
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

works if you take the /e out thanks
Reply With Quote
  #78  
Old 10-21-2018, 09:03 AM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Someone PMed me this question-

Quote:
Hi BOP5...

This mod seems to work beautifully to embed Google Docs spreadsheets on my vB4 test forum, as long as I'm on something with a large screen. When I view an embedded sheet on the vB mobile style on a small device, the rendering seems all compressed. On my S7 phone it displays only the cells containing text (in this case, the first 4 rows) and the sheet's footer bar is strangely right across the middle of them. Have you seen this before? Do you know of an easy fix?

...
Thanks in advance!
There was a screenshot.

Unfortunately I do not know of any fix. It was never intended for mobile devices, sorry.

If anyone finds a mobile friendly bbcode feel free to release it here or as your own mod, no permission needed.
Reply With Quote
  #79  
Old 10-21-2018, 05:24 PM
edgeless edgeless is offline
 
Join Date: Mar 2013
Posts: 115
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by BirdOPrey5 View Post
Unfortunately I do not know of any fix. It was never intended for mobile devices, sorry.
Thanks for taking the time to respond, BOP.

All I know is the problem seems to stem from something vB's default directives are controlling. This seems so because I can alter the replacement code parameters in a multitude of ways but the footer bar & tab across the content area issue persists no matter what changes I make. I should also note that it's the 'height' aspect that's compressed and frozen when a sheet is viewed on a narrow, mobile screen. That results in the footer bar and the sheet tab perpetually obstructing the sheet's content. They remain there even when using Google's own generated embedment code, and even with the widget directive set to false (which should toggle off the sheet tab that appears on the overlapping footer bar). Also, when the mobile style is viewed on a larger screen, all aspects become rendered correctly (i.e., the footer bar, the sheet tab, etc. are each in place). So it seems vB is restricting the height of the display area for embedded documents on the mobile style. As such, if I could learn how to get my vB4 to allow mobile style height flexibility I'm guessing it would fix the problem. Someone smarter then I would have to determine how that might be done, though.

Edit: Just some further information. The scope of this problem is somewhat different from my initial assumption. I've tested the issue on two Samsung mobile devices. As it turns out, when in vB full desktop version mode the iframed sheets display in the identically compressed and distorted state that I'm seeing in vB mobile mode. Oh, and the issue is browser independent as well... at least among the three mobile browser versions I have tested (i.e., Google Chrome, Firefox, and the browser that comes pre-loaded on Samsung devices). So to summarize, the iframed Google sheets simply will not render properly on these mobile devices - through iframes on vBulletin forum sites at least. But they render amazingly well with full synch'ing/linking control and visibility on my desktop and laptop computers. They even present quite well in vB mobile mode on those computers. Therefore, the screen dimensions on my phone are obviously not the issue. I can't imagine what it would take to get this working on these phones.

Edit2: I've been able to get it to display on my mobile device without the obstructive sheet tab bar blocking the sheet's content on the phones. However, sheet cells are not editable under the required configuration. It is thus exclusive to displaying the sheet's data. So for editing the sheets, I've employed a workaround by adding another bbcode item that can quickly and easily be toggled and saved through a post edit, then switched back to the frozen data display mode using the original bbcode tags, allowing the data to again be seen on mobile devices. I can also add some buttons to the editor, making it even a bit more convenient.

Reply With Quote
  #80  
Old 05-23-2021, 10:47 PM
Hostboard's Avatar
Hostboard Hostboard is offline
 
Join Date: May 2002
Location: CT
Posts: 843
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have not been able to get this to work with the original code nor the code provided by others. Does anyone have this working or know how to? The Google Docs is my primary need.
Reply With Quote
  #81  
Old 05-24-2021, 12:32 AM
lange's Avatar
lange lange is offline
 
Join Date: Apr 2003
Location: Montreal (Canada)
Posts: 282
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try this:
Code:
File/Publish to the web/Embed
<iframe src="https://docs.google.com/document/d/e/2PACX-1vSP991tBybGIo8Y8EsLbsRi2QUmuugQC85slx153HELeU_0qgy4V0a9PB1zJ08_TBDuz51_32ESLUhH/pub?embedded=true"></iframe></div>
Google Docs
gd
Replacement: <div align="center"><iframe src="https://docs.google.com/document/d/e/{param}/pub?embedded=true"></iframe></div>
Example:[gd]2PACX-1vSP991tBybGIo8Y8EsLbsRi2QUmuugQC85slx153HELeU_0qgy4V0a9PB1zJ08_TBDuz51_32ESLUhH[/gd]
Description: Embed a Google Document.
Use Option: No
Button Image: (optional)
Remove Tag If Empty: Yes
All Disable Options: Yes
Reply With Quote
Благодарность от:
Hostboard
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:58 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.04890 seconds
  • Memory Usage 2,381KB
  • 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
  • (6)bbcode_code
  • (4)bbcode_html
  • (8)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
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (3)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
  • (4)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_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_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