bratsun
5/20/2015 - 3:45 PM

Social buttons

Social buttons

<?php
$url = 'http://'.$_SERVER['HTTP_HOST'].'/'.drupal_get_path_alias(current_path());
$title = drupal_get_title();
?>

<a href="http://twitter.com/share?url=<?php print $url; ?>&text=<?php print $title; ?>" target=" title="Share on Twitter" target="_blank" class="btn btn-twitter">Twitter</a>

<a href="https://www.facebook.com/sharer/sharer.php?u=<?php print $url; ?>&t=<?php print $title; ?>" title="Share on Facebook" target="_blank" class="btn btn-facebook">Facebook</a>

<a href="https://plus.google.com/share?url=<?php print $url; ?>" title="Share on Google+" target="_blank" class="btn btn-googleplus">Google+</a>

<a href="http://www.linkedin.com/shareArticle?mini=true&url=<?php print $url; ?>&title=<?php print $title; ?>" title="Share on LinkedIn" target="_blank" class="btn btn-linkedin">LinkedIn</a>
/* social */

.btn-twitter {
    background: #00acee;
    border-radius: 0;
    color: #fff
}
.btn-twitter:link, .btn-twitter:visited {
    color: #fff
}
.btn-twitter:active, .btn-twitter:hover {
    background: #0087bd;
    color: #fff
}
.btn-facebook {
    background: #3b5998;
    border-radius: 0;
    color: #fff
}
.btn-facebook:link, .btn-facebook:visited {
    color: #fff
}
.btn-facebook:active, .btn-facebook:hover {
    background: #30477a;
    color: #fff
}
.btn-googleplus {
    background: #e93f2e;
    border-radius: 0;
    color: #fff
}
.btn-googleplus:link, .btn-googleplus:visited {
    color: #fff
}
.btn-googleplus:active, .btn-googleplus:hover {
    background: #ba3225;
    color: #fff
}
.btn-linkedin {
    background: #0e76a8;
    border-radius: 0;
    color: #fff
}
.btn-linkedin:link, .btn-linkedin:visited {
    color: #fff
}
.btn-linkedin:active, .btn-linkedin:hover {
    background: #0b6087;
    color: #fff
}