MyBB Community Forums

Full Version: Request Google Documents BBcode
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Any chance to someone provide Google Documents Bbcode
So we have this:
Document Link:
https://docs.google.com/document/pub?id=1k822aIv0GDbe_trv7MODDJ0Rf-sDb-DqAsb4gN1hqyY

Embed Code:
<iframe src="https://docs.google.com/document/pub?id=1k822aIv0GDbe_trv7MODDJ0Rf-sDb-DqAsb4gN1hqyY&amp;embedded=true"></iframe>

Here we go:
Regular Expression:
\[gdoc\](https?\://[^\r\n"<>&]+?)\[/gdoc\]

Replacement:
<iframe src="$1" width="700px" height="300px"></iframe>

Example:
[gdoc]https://docs.google.com/document/pub?id=1k822aIv0GDbe_trv7MODDJ0Rf-sDb-DqAsb4gN1hqyY[/gdoc]

Hope it helps.
where you find this code i only have code like this
https://docs.google.com/viewer?a=v&pid=explorer&chrome=true&srcid=1wvDPpnd0EcZWNSDX5kunKSKUjeQk-CwdmstCYX_SeJYDkO1zdb10-x4jR0tR&hl=hr
I have never used Google Docs before and thought it was always the same code, maybe somebody can help more here Undecided
yes,and thank you for trying
Hi, I've tested this code and it works.
Regular Expression:
\[gdoc](.*?)\[\/gdoc\]

Replacement:
<div class="codeblock">
<div class="title">Google Document:</div>
<div class="body">
<iframe src="https://docs.google.com/document/pub?id=$1" width="100%" height="300px"></iframe>
</div>
</div>
</div>

Example:
[gdoc]1k822aIv0GDbe_trv7MODDJ0Rf-sDb-DqAsb4gN1hqyY[/gdoc]

All you need is the ID, which can be obtained from any of the following(bold texts are the examples of the IDs):
https://docs.google.com/document/d/1apveaUwdaYevtuVIb8Q1vp4VTxyEejc22TAHLhaPSYw/edit?hl=en_US
https://docs.google.com/document/pub?id=1apveaUwdaYevtuVIb8Q1vp4VTxyEejc22TAHLhaPSYw
https://docs.google.com/viewer?a=v&pid=e...true&srcid=1wvDPpnd0EcZWNSDX5kunKSKUjeQk-CwdmstCYX_SeJYDkO1zdb10-x4jR0tR&hl=hr
thank you works
Glad I could help you, and for anyone who wants it as an install-able plugin, I've attached it in this post.

Quote:A simple MyCode which able you to embed Google Docs into your posts easily.

Usage
-------
All you need is the ID. For example, these are the 3 links which can be found at the document you're viewing:

- Editing the document
https://docs.google.com/document/d/1apveaUwdaYevtuVIb8Q1vp4VTxyEejc22TAHLhaPSYw/edit?hl=en_US

OR

https://docs.google.com/viewer?a=v&pid=e...true&srcid=1wvDPpnd0EcZWNSDX5kunKSKUjeQk-CwdmstCYX_SeJYDkO1zdb10-x4jR0tR&hl=hr

OR

https://docs.google.com/leaf?id=0B6g1fNYZpYWvMWEwZDA0MzMtZmY0NC00NzhkLWI3ZGUtNmI1NTQxMDliNTY4&hl=en_US

- Publishing the document
https://docs.google.com/document/pub?id=1apveaUwdaYevtuVIb8Q1vp4VTxyEejc22TAHLhaPSYw

And the tag is:
[gdoc]ID[/gdoc]

P.s. Currently waiting approval at the mods page.
ACROXX Does not work..nothing shows in firefox or IE. Set to public view a well.

http://www.bringit2u.com/forum/thread-5132.html
(2011-08-14, 07:43 AM)acrox999 Wrote: [ -> ]Hi, I've tested this code and it works.

It works, but replace in Replacement field:

https://docs.google.com/document/pub?id=$1

with

https://docs.google.com/file/d/$1 
Pages: 1 2