vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   gfycat bbcode? (https://vborg.vbsupport.ru/showthread.php?t=315648)

MattGarner 11-26-2014 05:12 PM

gfycat bbcode?
 
Anyone know a way of being able to embed the content from gfycat into posts/threads via BBCode? This vbulletin forum seems to have done it but not sure what code they have used:

http://hfboards.hockeysfuture.com/sh...php?p=83080515

kh99 11-26-2014 05:55 PM

This page tells basically how to do it: http://gfycat.com/about

You need to add some javascript to the page. The page you linked to appears to have it added to the end of the header template. If you want to use a plugin to do it instead, you could use hook location parse_templates and add it to the headinclude_javascript template hook, maybe like:
PHP Code:

$template_hook['headinclude_javascript'] .= " <script>
 (function(d, t) {
    var g = d.createElement(t),
        s = d.getElementsByTagName(t)[0];
    g.src = 'http://assets.gfycat.com/js/gfyajax-0.517d.js';
    s.parentNode.insertBefore(g, s);
}(document, 'script'));
</script> "


then you can create a custom bbcode, and the replacement would be
Code:

<img class="gfyitem" data-id="{param}" />

MattGarner 11-26-2014 07:48 PM

Quote:

Originally Posted by kh99 (Post 2524274)
This page tells basically how to do it: http://gfycat.com/about

You need to add some javascript to the page. The page you linked to appears to have it added to the end of the header template. If you want to use a plugin to do it instead, you could use hook location parse_templates and add it to the headinclude_javascript template hook, maybe like:
PHP Code:

$template_hook['headinclude_javascript'] .= " <script>
 (function(d, t) {
    var g = d.createElement(t),
        s = d.getElementsByTagName(t)[0];
    g.src = 'http://assets.gfycat.com/js/gfyajax-0.517d.js';
    s.parentNode.insertBefore(g, s);
}(document, 'script'));
</script> "


then you can create a custom bbcode, and the replacement would be
Code:

<img class="gfyitem" data-id="{param}" />

Thanks for that - Do you know if there is a way to keep them at a certain size or something? In case a big one was posted and it looks a bit silly when posted.

kh99 11-26-2014 07:59 PM

I don't know, that page doesn't say anything about limiting the size. It might be possible to add some html to the bbcode replacement to set a max size, but I'm not really an html person. Hopefully someone else will know.


All times are GMT. The time now is 07:02 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.01037 seconds
  • Memory Usage 1,726KB
  • 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
  • (2)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete