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)

iBinJubair 01-31-2014 11:00 PM

Social Buttons with Short Share URL
 
1 Attachment(s)
Description:
This Modification will help you to add social buttons in thread conversation toolbar
  • using your site short urls e.g. http://example.com/node/xxxx
  • using original social buttons code
  • only one template modification
  • supporting vb5 responsive style
  • supporting LTR and RTL style
  • supporting style variables



Screenshots:

https://vborg.vbsupport.ru/attachmen...hmentid=148043

https://vborg.vbsupport.ru/attachmen...hmentid=148044



Instructions:
  • Open your site [Admin CP]
  • Go to [Styles & Templates] > [Search Templates]
  • Select your style from [Search in Style]. Put the following code in [Search for Text] and press [Find] button
    Code:

    <vb:if condition="!empty($showSubscriberFilter)">

  • Select the template named [conversation_toolbar]
  • Find the above line in the [conversation_toolbar] template code as shown bellow
    Code:

    ... ... ...
    ... ... ...
          </vb:if>
        </ul>
      </div>

      <vb:if condition="!empty($showSubscriberFilter)">
        <vb:comment>
          This form will be hidden and will not be shown at all but this will be programmatically used for paginating and sorting the Subscriber header 'Last Activity' in Subscription widget.
        </vb:comment>
    ... ... ...
    ... ... ...


  • Add the the following code above the red line
  • Note 1: You must replace "EXAMPLE.COM" with your website naked domain. There are 3 links.
  • Note 2: If your vBulletin files installed inside a folder, add the folder. e.g. example.com/vb
    Code:

    <vb:comment>START of Social Buttons Code</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-buttons iframe { float:{vb:stylevar left}; border:none; height:20px; }
                    .share-buttons .facebook { width:135px; }
                    .share-buttons .twitter { width:90px; }
                    .share-buttons #___plusone_0 { width:72px !important; float:{vb:stylevar left} !important; }
                    @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}}}
                    <iframe class="facebook" src="//www.facebook.com/plugins/like.php?href=http://EXAMPLE.COM/node/{vb:raw nodeid}&layout=button_count&action=like&show_faces=false&share=true&width=135&height=20" scrolling="no" frameborder="0" allowTransparency="true"></iframe>
                    <iframe class="twitter" src="//platform.twitter.com/widgets/tweet_button.html?text={vb:raw conversation.title}%0A&url=http://EXAMPLE.COM/node/{vb:raw nodeid}&counturl={vb:raw threadurl}" scrolling="no" frameborder="0" allowTransparency="true"></iframe>
                    <div class="g-plusone" data-size="medium" data-width="68" data-href="http://EXAMPLE.COM/node/{vb:raw nodeid}"></div>
                    <script type="text/javascript">(function() {var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; po.src = '//apis.google.com/js/plusone.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);})();</script>
            </div>
    </vb:if>
    <vb:comment>END of Social Buttons Code</vb:comment>



Tags: Social, Share, button, buttons, Facebook, Twitter, Google+, Google Plus, Thread, Short, URL, Link

GamerUnguided 02-02-2014 12:43 PM

Sweet :) just what i was looking for, thanks for this .... guaranteed that this is installed

heredia21 02-03-2014 10:52 AM

Perfect! Thanks for sharing, works well on mobile devices as well.

crystalduna 02-25-2014 01:57 PM

When I click conversion_toolbar it wont let me customize it

bxb 03-07-2014 07:02 PM

Works, thanks a bunch! VB5.0.5

ecihanuysal 03-17-2014 11:43 AM

works, thank you so mch

Macgiber 04-28-2014 01:45 AM

thanks

fionix 05-21-2014 03:51 PM

Any udate for the latest version 5.1.1 ? it seems this line we have to find isn't there any longer.

Thanks.

Daryn 05-21-2014 09:18 PM

Tested and works on 5.1.1.

It seems like though it sends the right URL's to Facebook, the title it sends out as a share is pretty generic. Will fiddle some more with that.

Razgritz 06-24-2014 07:27 AM

This work.


All times are GMT. The time now is 11:29 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.01179 seconds
  • Memory Usage 1,743KB
  • 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
  • (3)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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