vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   BB Code Enhancements - BBCode - Embed Google Documents Collection (BB Code) (https://vborg.vbsupport.ru/showthread.php?t=250780)

BirdOPrey5 09-18-2010 10:00 PM

BBCode - Embed Google Documents Collection (BB Code)
 
1 Attachment(s)
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) https://vborg.vbsupport.ru/external/2010/09/33.jpg
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) https://vborg.vbsupport.ru/external/2010/09/33.jpg
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) https://vborg.vbsupport.ru/external/2010/09/33.jpg
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:

sulasno 09-19-2010 01:34 AM

tagged and thanks

very good indeed

abumohamed 11-09-2010 04:31 AM

great work

Mellow 01-01-2011 09:02 PM

Make sure you put double quotes around the {parms}

BirdOPrey5 01-01-2011 11:44 PM

Always good to keep a lookout for BB Codes that don't properly enclose {param}'s in double quotes but if you look closely all of these are in double quotes, just with additional code in them.

For example:

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>
The param is between these quotes:
Code:

"https://docs.google.com/present/view?id={param}"

Cyamia 01-02-2011 01:10 AM

Thank you BirdOPrey5 so much!!

I have been always wanted a tool like this that would allows my community to share their presentation files. Your work is a great solution to my needs.

A quick question: when I setting up this BB code, that is a warning that say lthat some of the html attributes are not enclosed in " ". Is it fine to let it go like that? I just pushed the continue button but I am not sure if there would not be any issues some time in the future. Any thought?

BirdOPrey5 01-02-2011 01:15 AM

Cyamia-

Yes I believe it is OK to "continue" in that warning. Although {param} itself isn't in quotes, such as "{param}", there are indeed quotes a little later on in the code as explained in my post above yours. I believe this is sufficient to keep the code safe and I use it myself.

Cyamia 01-02-2011 01:30 AM

Thank you; I trust you.

Mellow 01-02-2011 01:55 AM

Thanks, I'll try the continue as well.

fluidswork 01-02-2011 02:48 AM

This will save me from lot of trouble .....

riskreward 03-02-2011 04:09 PM

I am very new to all of this. Hence this may sound silly.

But where do I insert the new BB code?

BirdOPrey5 03-02-2011 04:14 PM

In the Admin Control Panel. On the menu on the side scroll down to Custom BB Codes -> Add A New BB Code.

riskreward 03-03-2011 05:41 AM

Thank you.

Alfa1 03-04-2011 07:59 PM

This stuff should be default.

Rofo 03-06-2011 02:57 PM

Can't get this to work for a spreadsheet, would love to have it though!

4.1.1

BirdOPrey5 03-06-2011 03:38 PM

Quote:

Originally Posted by Rofo (Post 2170206)
Can't get this to work for a spreadsheet, would love to have it though!

4.1.1

If you're getting the warning:
Quote:

The following BB Code replacement may not be properly formed. All HTML attributes should be enclosed within double quotes.
You can safely hit continue and it will work.

Otherwise maybe re-read the instructions, it is still working for me, just made a new spreadsheet and re-confirmed in 4.x.

The example I just made is:
[gs]0AmOHO6Cm8vvAdGRyZUNhWnZCSWVKdjM0WUpfM2FzeFE[/gs]

You should see a simple, small spreadsheet.

Rofo 03-06-2011 03:54 PM

Got it to work, don't really know exactly what I changed to make it work... Thats ok :)

I have been wondering how i could get my spreadsheet on forums for a very long time, thank you very much for this.

Installed, rated.

Gamelobby 04-10-2011 02:59 AM

This only works for Google correct.?

What if we host it seperately, & use Logicians Webtemplates..? (any possibility in iframe) also to be able to update.

VanHuek 04-10-2011 12:05 PM

How can I get it too work for google forms?

BirdOPrey5 04-10-2011 05:56 PM

Quote:

Originally Posted by Gamelobby (Post 2182842)
This only works for Google correct.?

What if we host it seperately, & use Logicians Webtemplates..? (any possibility in iframe) also to be able to update.

I don't know how you'd host it separately or anything about Logician's Webtemplates... But yeah, only google, only hosted in google. Anywhere you can use BBCode you can use this.

Quote:

Originally Posted by VanHuek (Post 2182958)
How can I get it too work for google forms?

I never heard of Google Forms, do you have a link to them?

VanHuek 04-10-2011 08:38 PM

http://docs.google.com/support/bin/a...n&answer=87809

https://spreadsheets.google.com/view...J0Q0E6MQ#gid=0

BirdOPrey5 04-17-2011 10:11 PM

OK, to do a Google Form:

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

Example:
[gf]dDNJRFdVaXRxM2FTVXpnQlVlMHBZVnc6MQ[/gf]


Add a New BB Code

Title: Google Form
BB Code Tag Name: gf
Replacement:
Code:

<iframe src="https://spreadsheets.google.com/embeddedform?formkey={param}" width="760" height="1021" frameborder="0" marginheight="0" marginwidth="0">Loading...</iframe>
Example: [gf]dDNJRFdVaXRxM2FTVXpnQlVlMHBZVnc6MQ[/gf]
Description: Embed a Google Form.
Use Option: No
Button Image: (optional)
Remove Tag If Empty: Yes
All Disable Options: Yes

Gamelobby 04-21-2011 12:06 AM

BirdOPrey, I got this..?
Quote:

The following BB Code replacement may not be properly formed. All HTML attributes should be enclosed within double quotes.

•<iframe src="https://spreadsheets.google.com/embeddedform?formkey={param}" width="760" height="1021" frameborder="0" marginheight="0" marginwidth="0">Loading...</iframe>
{param} is in bold

I hit continue, & it seems fine except it works for Google spreadsheets, but not Google docs.

*edit*
nevermind, i just realized this mod was originally for docs, so i need to try it first.



*edit2*
Whats the difference between a Doc, a Presentation, & a Form.?

Here is what im trying to make work.

BirdOPrey5 04-21-2011 05:34 PM

Google has various types of "documents."

Docs - which are like word documents, usually text mostly
Spreadsheets
Presentations
Drawings
and now Forms

It looks like yours is a "docs" document, you should try the instructions for the very first bbcode in this thread "Google Document."

FReeSTER 10-23-2011 07:38 PM

Man this sucks, Im trying out the spread sheet and is showing just a blank iframe

Any ideas Bird?

thanks mate I really need this

BirdOPrey5 10-23-2011 11:20 PM

Does the example spreadsheet show on your forum?

[gs]0AmOHO6Cm8vvAdFR2b0dMMnVwMUE0MlpXYnowWnowWWc[/gs]

You can see how the example should look here.

FReeSTER 10-24-2011 04:20 AM

Quote:

Originally Posted by BirdOPrey5 (Post 2260714)
Does the example spreadsheet show on your forum?

[gs]0AmOHO6Cm8vvAdFR2b0dMMnVwMUE0MlpXYnowWnowWWc[/gs]

You can see how the example should look here.

yes the sample works mate. Im trying this one in bold https://docs.google.com/spreadsheet/...cXBRTXZNZ0E&hl but all I get is a white iframe on the post.

BirdOPrey5 10-24-2011 08:46 AM

I get the message: We're sorry. This document is not published.

Here is how to Publish your document: https://docs.google.com/support/bin/...&topic=1360911

Note: It is NOT the same as setting your document's visibility.

FReeSTER 10-24-2011 10:54 AM

Thank you Joe, I fix the link sorry. I have try so many ways to add the link or the
{param} 0AuZfwFwa96-AdEpiTzFCX1Z6YWRpOEFZcXBRTXZNZ0E and it doesnt
work at all I was wondering if this is cause because that document have a - on the param?

BirdOPrey5 10-24-2011 11:40 AM

If the sample works on your forum th BBCode is entered correctly.

Your problem is you need to "Publish" your document in Google Docs- instructions were in the link in my previous post.

The dash (-) in the param doesn't matter.

FReeSTER 10-24-2011 01:44 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2260924)
If the sample works on your forum th BBCode is entered correctly.

Your problem is you need to "Publish" your document in Google Docs- instructions were in the link in my previous post.

The dash (-) in the param doesn't matter.

Thank you very much, it worked thanks for your time Joe as always

sweetpotato 10-31-2011 01:50 AM

Thank you for the nice mod. The SpreadSheet work well for single sheet but for multisheets I have to strip out
Code:

&single=true
in your code.
May I suggest that you use full link and put double quotes for the security purpose like this
Code:

<div align="center"><iframe width="95%" height="500" frameborder="0" src="{param}">IFRAME Not Available. <a href="{param}">Direct Link to Spreadsheet.</a></iframe></div>

BirdOPrey5 10-31-2011 11:11 AM

Thanks for the info on the multi-sheet.

However your second suggestion is a HUGE security risk. Anyone could use the code to open an IFRAME of an arbitrary website.

My original implementation is safe- the warning VB gives can be ignored- VB itself doesn't have a great way of scanning for the {param} between quotes.

beduino 10-31-2011 01:48 PM

I will use in my boards
Thank you joe

grc 05-01-2012 03:52 PM

Does this still work? The GD shared link no longer has id= in it and I'm getting a "not found" message when the id section of the link is used with the tags.

BirdOPrey5 05-01-2012 06:30 PM

it still works...

http://www.qapla.com/mods/showthread...readsheet-test

Instead of the id you take the long string before /edit:

Example:
Code:

https://docs.google.com/document/d/1bhtK-AhiXqfWK5bGJcULvEO3zMahcFgnJEsT1YvYsuc/edit
Take the code in red and pot it between:

[gd]1bhtK-AhiXqfWK5bGJcULvEO3zMahcFgnJEsT1YvYsuc[/gd]

grc 05-01-2012 06:47 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2325318)
it still works...

http://www.qapla.com/mods/showthread...readsheet-test

Instead of the id you take the long string before /edit:

Example:
Code:

https://docs.google.com/document/d/1bhtK-AhiXqfWK5bGJcULvEO3zMahcFgnJEsT1YvYsuc/edit
Take the code in red and pot it between:

[gd]1bhtK-AhiXqfWK5bGJcULvEO3zMahcFgnJEsT1YvYsuc[/gd]

Thanks. I hadn't gone to File/Publish to the Web -- missed that step.

JabirA 05-21-2012 10:37 AM

Does it work in 4.1.12?

BirdOPrey5 05-21-2012 06:46 PM

BBCodes work in all VB versions.

JabirA 05-21-2012 08:35 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2263136)
Thanks for the info on the multi-sheet.

However your second suggestion is a HUGE security risk. Anyone could use the code to open an IFRAME of an arbitrary website.

My original implementation is safe- the warning VB gives can be ignored- VB itself doesn't have a great way of scanning for the {param} between quotes.

I have this problem too.
Do you have a safer suggestion?


All times are GMT. The time now is 06:18 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01281 seconds
  • Memory Usage 1,843KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (10)bbcode_code_printable
  • (10)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete