vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 5.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=259)
-   -   Show Thread Enhancements - Social Buttons with Short Share URL (https://vborg.vbsupport.ru/showthread.php?t=307814)

vb_nils 05-30-2015 08:27 AM

Hello,

THose buttons are not asynchronous.
Bellow you will found the code for making them asynchronous (note that I didn't include G+ but can be added).

Code:

<vb:comment>START of Social Buttons Code - VT</vb:comment>
<vb:if condition="$page['view'] == 'thread'">
        <style>
                .share-buttons { float:{vb:stylevar left}; position:relative; padding:8px 10px; height:20px; margin-top:-37px; }
                .share-buttons.withRB { margin-{vb:stylevar left}:150px; }
                .share-div { float:{vb:stylevar left}; border:none; height:20px; margin-right:10px; }
                @media only screen and (max-width:767px) { .share-buttons.withRB { margin-{vb:stylevar left}: 100px; } }
                @media only screen and (max-width:636px) { .share-buttons { float: none; border: {vb:stylevar toolbar_border}; background:{vb:stylevar toolbar_background}; margin: 0; } .share-buttons.withRB { margin: 0; } }
        </style>
        <div class="share-buttons<vb:if condition="(isset($showReplyBtn) AND $showReplyBtn) OR (isset($showAll) AND $showAll) OR $showVmBtn"> withRB</vb:if>">
{vb:set starterRoute, {vb:raw conversation.starterroute}}
{vb:set starterPost.nodeid, {vb:raw conversation.starter}}
{vb:set threadurl, {vb:url {vb:raw starterRoute}, {vb:raw starterPost}}}
                <div class="share-div fb-like" data-href="http://EXAMPLE.COM/node/{vb:raw nodeid}" data-layout="button" data-action="recommend" data-show-faces="false" data-share="true"></div>
                <div class="share-div"><a href="https://twitter.com/share" class="twitter-share-button twitter"></a></div>
                <div id="fb-root"></div>
                <script>(function(d, s, id) {
                  var js, fjs = d.getElementsByTagName(s)[0];
                  if (d.getElementById(id)) return;
                  js = d.createElement(s); js.id = id;
                  js.src = "//connect.facebook.net/fr_FR/sdk.js#xfbml=1&version=v2.3";
                  fjs.parentNode.insertBefore(js, fjs);
                }(document, 'script', 'facebook-jssdk'));</script>
                <script>window.twttr = (function(d, s, id) {
                        var js, fjs = d.getElementsByTagName(s)[0], t = window.twttr || {};
                        if (d.getElementById(id)) return t;
                        js = d.createElement(s);
                        js.id = id;
                        js.src = "https://platform.twitter.com/widgets.js";
                        fjs.parentNode.insertBefore(js, fjs);

                        t._e = [];
                        t.ready = function(f) {
                                t._e.push(f);
                        };

                        return t;
                }(document, "script", "twitter-wjs"));</script>
        </div>
</vb:if>
<vb:comment>END of Social Buttons Code</vb:comment>


Haiwan88 08-27-2015 11:34 PM

does it work with vb 5.1.9 ?

shimei 10-20-2015 04:17 PM

Some reason, the facebook like and share buttons no longer display on my site. Only the tweet or google + 1 does. Version 5.1.9 ....

To note, it was working fine, did Facebook make a change?

friendlymela 10-21-2015 08:30 AM

Its useful thanks

DemOnstar 11-08-2015 01:55 PM

1 Attachment(s)
This one works well on 5.1.9.
I would prefer the little + symbol on the end to give people multiple choice though. It will save room in the toolbar.
I will try that one myself.

Thanks for your effort. . .

https://vborg.vbsupport.ru/attachmen...1&d=1446998119

Hectorsky 11-18-2015 01:43 PM

works fine , thanks

jnabird333 12-14-2015 07:44 PM

Looks like Google Plus changed their code so that doesn't work. I actually prefer @VB_Nils code but am having trouble getting the facebook buttons in english. v5.1.9

jnabird333 01-04-2016 03:23 PM

1 Attachment(s)
Does anyone know how to force or change the image that Facebook grabs on shared threads? This mod works great for me but the Facebook post grabs my logo in the header which isn't a 1:1 ratio so it looks crappy on Facebook.

Example Attached

hakancik 01-07-2016 09:00 PM

5.1.10 doesn't work

Hectorsky 01-23-2016 08:01 PM

On vb 5.2 doesn't work


All times are GMT. The time now is 06:35 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.01553 seconds
  • Memory Usage 1,739KB
  • 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
  • (1)bbcode_code_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