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)

whodah 05-23-2014 05:51 PM

OK - so for Google charts, we are a bit stuck because ideally we would have 4 {param}'s available. As it stands now, we have two:
{param}
{option}

So I've set option = google charts "oid", and param = google charts chart number. I've hard coded the width to 800 and height to 600, and let users know they need to size their published charts to this size. Shy of installing a mod allowing multiple {param}'s, this is where we are. But it works well.
:)

Title: Google Chart
BB Code Tag Name: BB Code Tag Name
Replacement:

Code:

<iframe height=600 width=800 src="http://docs.google.com/spreadsheets/d/{param}/gviz/chartiframe?oid={option}" seamless frameborder=0 scrolling=no></iframe>
Example:
Code:

[gc=408452327]1enPIPGRIyIHTYF2-IJokCPVUXWsRw7v_ZZUljfGAyTo[/gc]
Description:
Quote:

Embed a Google Spreadsheet Chart. The chart will render at 800x600, so be sure to size your chart accordingly at Google Docs/Drive/Charts. This one is a bit tricky to use... The 'oid' of the link needs to be the option (i.e. [gc=oid_number]) and the chart number the parameter. It is just the way google charts does it.
Use {option}: yes
Button Image (Optional): -- create an image if you desire --
Remove Tag If Empty: yes
All other Disable options: yes

Feel free to clean it up more, but that gets it going at least. :)

klaush 05-26-2014 07:55 PM

Thanks; this made my day!

Quote:

Originally Posted by kylek (Post 2495786)
Just surfing on google and found this: https://support.google.com/drive/answer/3541068

"Starting in March and April 2014, Google Sheets users creating new spreadsheets will be automatically directed to the new Sheets. All previously created spreadsheets will remain in the older version of Sheets for now. If you need to create a spreadsheet using the old Sheets, you can do so at g.co/oldsheets"


Pittski 06-17-2014 03:22 AM

Hmm, I tried messing around with it but can't seem to get it to work. The new spreadsheet link that is.

Anyone else get it working?

Key= has been replaced with /d/ now


Edit: I think I fixed it. Not positive. But here is the new code.

Code:

<div align="center"><iframe width='95%' height='500' frameborder='0' src='https://docs.google.com/spreadsheets/d/{param}/edit#gid=0&hl=en&single=true&output=html&widget=true'>IFRAME Not Available. <a href="https://docs.google.com/spreadsheets/d/{param}/edit#gid=0&hl=en&single=true&output=html">Direct Link to Spreadsheet.</a></iframe></div>
I replaced the /Key= part with /d/{param}/edit#gid=0 in both html lines, and it worked for me.

Edit 2:when it loads the spreadsheet it sends you to the top of the page. also if you click in the spreadsheet after clicking out of it, it will send you to top of the page. No idea how to stop that.

Grimholtt 10-16-2014 07:10 PM

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:

https://vborg.vbsupport.ru/external/2014/10/9.png

What I'm actually seeing:

https://vborg.vbsupport.ru/external/2014/10/10.png

Any way to clean this up that anyone knows about?

kylek 05-01-2015 05:46 PM

Does the same for me shows everything, guess will stick to using the iframe code they give for the embed share link.

willie53 03-15-2017 04:51 PM

Ok tried for about 3 weeks to get google spreadsheets working on vb 5.2.6 then on vb 5.3.0 alpha as it is something i really needed the way i was getting them to display the sheet was to embed it with iframe and to do this i had to enable html which is not a good idea so it was left to me do update the sheets.
I finally got it working the solution was staring me in the face i got the google docs working no problem but the spreadsheet would not so i compared the 2 sets of replacement code the spreadsheet code used single qoute ' instead of double qoute " so this is the amended code i am using now and works a treat

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>
Many thanks for this.
Regards Willie

willie53 04-14-2017 07:27 PM

Here is a quick and easy way to install these bbcodes it can be done in admincp or in phpmyadmin simply run the sql query below i have tested this method on all versions of vbulletin from vb3.6.8 through 5.3.0 and it works on all versions though you may need to edit 1 word depending if you set a prefix for db tables the simply put the prefix in front of bbcode example is vbbbcode

Code:

INSERT INTO `bbcode` (`bbcodeid`, `bbcodetag`, `bbcodereplacement`, `bbcodeexample`, `bbcodeexplanation`, `twoparams`, `title`, `buttonimage`, `options`) VALUES

(3, 'gd', '<div align="center"><iframe src="https://docs.google.com/document/pub?id=%1$s&amp;embedded=true&single=true&gid=0&output=html&widget=true" width="95%%" height="500">IFRAME Not Available. <a href="https://{option}.google.com/document/pub?id=%1$s">Direct Link to Google Document</a>.</iframe></div>', '[gd]1bhtK-AhiXqfWK5bGJcULvEO3zMahcFgnJEsT1YvYsuc[/gd]', '[gd]1bhtK-AhiXqfWK5bGJcULvEO3zMahcFgnJEsT1YvYsuc[/gd]', 0, 'Google Docs', '', 31),
(5, 'gs', '<div align="center"><iframe width="95%%" height="900" frameborder="0" src="https://spreadsheets.google.com/pub?key=%1$s"&hl=en&single=true&gid=0&output=html&widget=true\'>IFRAME Not Available. <a href="https://spreadsheets.google.com/pub?key=%1$s"&hl=en&single=true&gid=0&output=html">Direct Link to Spreadsheet.</a></iframe></div>', '[gs]14pmOx9znK02UTHeY7BdQKe792MML1f81CtO7I4DAnfM[/gs]', '', 0, 'Google Spreadsheet', '', 31),
(6, 'gp', '<div align="center"><iframe src="https://docs.google.com/present/embed?id=%1$s" frameborder="0" width="700" height="559">IFRAME Not Available. <a href="https://docs.google.com/present/view?id=%1$s">Direct Link to Presentation.</a></iframe></div>', '[gp]dcjktv94_1fcpptwqc[/gp]', '', 0, 'Google Presentation', '', 31);


BirdOPrey5 04-15-2017 05:32 PM

Quote:

Originally Posted by willie53 (Post 2585321)
Here is a quick and easy way to install these bbcodes it can be done in admincp or in phpmyadmin simply run the sql query below i have tested this method on all versions of vbulletin from vb3.6.8 through 5.3.0 and it works on all versions though you may need to edit 1 word depending if you set a prefix for db tables the simply put the prefix in front of bbcode example is vbbbcode

Code:

INSERT INTO `bbcode` (`bbcodeid`, `bbcodetag`, `bbcodereplacement`, `bbcodeexample`, `bbcodeexplanation`, `twoparams`, `title`, `buttonimage`, `options`) VALUES

(3, 'gd', '<div align="center"><iframe src="https://docs.google.com/document/pub?id=%1$s&amp;embedded=true&single=true&gid=0&output=html&widget=true" width="95%%" height="500">IFRAME Not Available. <a href="https://{option}.google.com/document/pub?id=%1$s">Direct Link to Google Document</a>.</iframe></div>', '[gd]1bhtK-AhiXqfWK5bGJcULvEO3zMahcFgnJEsT1YvYsuc[/gd]', '[gd]1bhtK-AhiXqfWK5bGJcULvEO3zMahcFgnJEsT1YvYsuc[/gd]', 0, 'Google Docs', '', 31),
(5, 'gs', '<div align="center"><iframe width="95%%" height="900" frameborder="0" src="https://spreadsheets.google.com/pub?key=%1$s"&hl=en&single=true&gid=0&output=html&widget=true\'>IFRAME Not Available. <a href="https://spreadsheets.google.com/pub?key=%1$s"&hl=en&single=true&gid=0&output=html">Direct Link to Spreadsheet.</a></iframe></div>', '[gs]14pmOx9znK02UTHeY7BdQKe792MML1f81CtO7I4DAnfM[/gs]', '', 0, 'Google Spreadsheet', '', 31),
(6, 'gp', '<div align="center"><iframe src="https://docs.google.com/present/embed?id=%1$s" frameborder="0" width="700" height="559">IFRAME Not Available. <a href="https://docs.google.com/present/view?id=%1$s">Direct Link to Presentation.</a></iframe></div>', '[gp]dcjktv94_1fcpptwqc[/gp]', '', 0, 'Google Presentation', '', 31);


VB 5.x doesn't have a plugin system to which this code would be compatible, FYI.

willie53 04-15-2017 10:28 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2585386)
VB 5.x doesn't have a plugin system to which this code would be compatible, FYI.

It is actually running on my main site which can be seen @ this post https://cometbar.co.uk/forum/darts/4...pionship-stats

also have it installed on various versions of vb

BirdOPrey5 04-16-2017 02:56 PM

My bad I thought you were supplying plugin code. Your code makes direct alterations to the BBCode table. Guess I should have looked closer.

I would still advise caution, there are reasons manual edits to database tables are last resorts. People shouldn't get in the habit of inserting BB Codes via direct queries. One mistake/typo and you can screw up your site.


All times are GMT. The time now is 09:07 AM.

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.01317 seconds
  • Memory Usage 1,762KB
  • 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
  • (6)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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