vBulletin Mods

The Official vBulletin Modifications Site
http://www.vbulletin.org/forum/showthread.php?t=250780

BBCode - Embed Google Documents Collection (BB Code)
by BirdOPrey5
18 Sep 2010 23:23

7 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=1C1arwoUzUyzxnzk9yD7ysx6vyMfcDuDXXzQTqnngh2c&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:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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:

sulasno 19 Sep 2010 02:34

tagged and thanks

very good indeed

abumohamed 09 Nov 2010 05:31

great work

Mellow 01 Jan 2011 22:02

Make sure you put double quotes around the {parms}

BirdOPrey5 02 Jan 2011 00:44

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:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

The param is between these quotes:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Cyamia 02 Jan 2011 02:10

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 02 Jan 2011 02:15

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 02 Jan 2011 02:30

Thank you; I trust you.

Mellow 02 Jan 2011 02:55

Thanks, I'll try the continue as well.

fluidswork 02 Jan 2011 03:48

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

riskreward 02 Mar 2011 17:09

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

But where do I insert the new BB code?

BirdOPrey5 02 Mar 2011 17:14

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

riskreward 03 Mar 2011 06:41

Thank you.

Alfa1 04 Mar 2011 20:59

This stuff should be default.

Rofo 06 Mar 2011 15:57

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

4.1.1


All times are GMT. The time now is 15:55.

Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright ©2001 - , vbulletin.org. All rights reserved.