MyBB Community Forums

Full Version: MyCode for Google Drive documents?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I try to embed a Google Drive document (pdf) on my forum

First, I tried to post the original code, but I saw only the text(code) not the embed document:

<iframe src="https://docs.google.com/file/d/0B8pXhrmzWDGXdFVHcXNFc25OdDg/preview" width="640" height="480"></iframe>

For youtube the situation is the same, but mybb has a TV icon on the format bar, that help me to embed the videos.

I read that must to use MyCode, and i added this MyCode, but my forum show the same text(code) instead of the desired document, even if in the SandBox (test area) I see the pdf:
[attachment=29654]

Please, can someone give me a solution? What code must to write in posts in order to view the Google document?

Thanks,
Firstly, regular expression is the one to be used in posts. Not exactly like the one in settings though. To bold a post you don't use <b>hello world</b>, nor \[b\](.*)\[/b\], you use:
[b]hello world[/b]
It's like that or similar for most MyCodes. For your it would be:
[iframe]http://www.yoursite.net/forum/YOURSTUFFHERE[/iframe]
NOTE: the http://www.yoursite.net/forum/ must be included in this MyCode and the yoursite.net should be address to your forum, otherwise it wouldn't work.

Secondly, if you see the note above, the code isn't supposed to work for Google Documents - it's a secure iFrame which doesn't allow external links. Try this instead (plugin required and it's less secure): http://community.mybb.com/thread-114231....+documents
Or try this MyCode: http://community.mybb.com/thread-101724....+documents It may be better than solution above, surely more secure.
Thank you,


It works only this code, but replace in Replacement field:

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

with

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