PDA

View Full Version : Mini Mods - share to facebook, twitter & google+


sukagwe
31 Mar 2013, 15:05
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.

<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
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
01 Apr 2013, 23:13
Just a quick note to say that if your using this and it does not display properly then simply edit one line:

<script>

Change to:
<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
06 Sep 2013, 22:02
hi ya is there away to align the fb an twitter or move them around so it looks more tidy

ARLreborn
19 Jan 2014, 21:03
Works on 5.0.5 - although as mentioned above, they could do with spacing closer together :\