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)
-   -   Mini Mods - share to facebook, twitter & google+ (https://vborg.vbsupport.ru/showthread.php?t=296710)

sukagwe 03-30-2013 11:00 PM

share to facebook, twitter & google+
 
1 Attachment(s)
this template modification will make user easier to share your page to the social network like facebook, twitter & google+

first, go to admincp -> style & template -> style manager than choose edit templates find widget templates at the bottom of templates's list. next find widget_conversationdisplay template. klik edit and add the following code at the top of the template.

Code:

<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/en_US/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

<fb:like send="false" width="450" show_faces="false"></fb:like>

<a href="https://twitter.com/share" class="twitter-share-button" data-text="{vb:raw conversationStarter.htmltitle}" data-via="your twitter account" data-lang="id" data-hashtags="your twitter account">Tweet</a>
<script>    !function (d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (!d.getElementById(id)) { js = d.createElement(s); js.id = id; js.src = "//platform.twitter.com/widgets.js"; fjs.parentNode.insertBefore(js, fjs); } } (document, "script", "twitter-wjs");</script>

<!-- Place this tag where you want the share button to render. -->
<div class="g-plus" data-action="share"></div>

<!-- Place this tag after the last share tag. -->
<script type="text/javascript">
    (function () {
        var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
        po.src = 'https://apis.google.com/js/plusone.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
    })();
</script>

note
remember to find and edit the following line, before you use this template modification
Code:

data-via="your twitter account" data-lang="id" data-hashtags="your twitter account"
enjoy it :D, this is my 1st post in template modification in vb.org :up:

demo
http://www.sukagwe.com
klik any thread, blog post you want :D

TheLastSuperman 04-01-2013 09:13 PM

Just a quick note to say that if your using this and it does not display properly then simply edit one line:

Code:

<script>
Change to:
Code:

<script type="text/javascript">

http://www.w3.org/TR/html4/interact/scripts.html
Scroll down to find: Local declaration of a scripting language

However the last bit of code should take care of it but just in case ;).

Antony80 09-06-2013 08:02 PM

hi ya is there away to align the fb an twitter or move them around so it looks more tidy

ARLreborn 01-19-2014 08:03 PM

Works on 5.0.5 - although as mentioned above, they could do with spacing closer together :\


All times are GMT. The time now is 05:26 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.01133 seconds
  • Memory Usage 1,722KB
  • 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
  • (4)bbcode_code_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