Since Share Social extension is not updated (yet?) i ended up with social share kit:
I'm bad in javascript and this is a really lame and temporary approach, you typically should avoid using it unless you really want those share buttons right now.
- Download the latest ssk release.
- Create a
ssk
directory in your Flarum root and put required files from downloaded archive:
ssk
├── css
│ └── social-share-kit.css
├── fonts
│ ├── social-share-kit.eot
│ ├── social-share-kit.svg
│ ├── social-share-kit.ttf
│ └── social-share-kit.woff
└── social-share-kit.min.js
- Put this code in your custom header in admin panel:
<link rel="stylesheet" href="/ssk/css/social-share-kit.css" type="text/css">
<div id="shareButtons" class="ssk-sticky ssk-right ssk-center ssk-sm" style="display: none !important">
<a href="#" class="ssk ssk-facebook"></a>
<a href="#" class="ssk ssk-vk"></a>
<a href="#" class="ssk ssk-twitter"></a>
<a href="#" class="ssk ssk-google-plus"></a>
<a href="#" class="ssk ssk-linkedin"></a>
<a href="#" class="ssk ssk-email"></a>
</div>
<script type="text/javascript" src="/ssk/social-share-kit.min.js"></script>
<script type="text/javascript">
SocialShareKit.init();
function manageShare() {
if (window.location.href != manageShare.href) {
manageShare.href = window.location.href
var shareButtons = document.getElementById("shareButtons");
if ((window.location.href.indexOf('/p/') > -1) || (window.location.href.indexOf('/d/') > -1)) {
shareButtons.setAttribute("style", "display:block !important");
} else {
shareButtons.setAttribute("style", "display:none !important");
}
}
}
setInterval(manageShare,500);
</script>
That's all, you can enjoy your sharing buttons.
If anyone have anything to add (especially on how to get rid of href checking every 500ms) - you're welcome.