Forum Index > Help > Geeklog le CMS New Topic Post Reply
 Add Facebook, Twitter and Google+ to Geeklog
   
Ben
 30 septembre 2012 - 09:04 (Read 5104 times)  
AAAAA
Admin

Status: offline


Registered: 18/10/2006
Posts: 128
This code adds Facebook, Twitter and Google+ to Geeklog CMS:

PHP Formatted Code

        <div style="float:left;" 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/fr_FR/all.js#xfbml=1";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, 'script', 'facebook-jssdk'));</script>
        <div style="float:left;margin-right:10px;"><fb:like href="{article_url}" send="false" layout="button_count" width="90" show_faces="false"></fb:like></div>
        <div style="float:left;margin-right:-20px;"><a href="https://twitter.com/share" class="twitter-share-button" data-url="{article_url}" data-text="{story_title}" data-counturl="{article_url}" data-lang="en" data-size="small" data-count="hortizontal">Tweet</a>
        </div><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="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs); } }(document,"script","twitter-wjs");</script>
        <div style="float:left;" class="g-plusone" data-size="medium" data-href="{article_url}"></div>
        <div class="g-plus" data-action="share" data-annotation="bubble" data-href="{article_url}"></div>
        <div style="clear:both;"></div>

Customise it and put it where you need it in the story template files. Add also in your header:

PHP Formatted Code
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>


Demo on any article on geeklog.fr

 
Profile Email Website
 Quote
kristof
 14 octobre 2012 - 20:52  
++---
Junior

Status: offline


Registered: 20/02/2012
Posts: 29
C'est un complément du plugin SocialShare ?

Merci pour l'astuce ! Big Grin

 
Profile Email Website
 Quote
Ben
 15 octobre 2012 - 08:28  
AAAAA
Admin

Status: offline


Registered: 18/10/2006
Posts: 128
C'est un complément du plugin SocialShare ?

Non ce code est indépendant et permet de se passer du plugin SocialShare si l'on a besoin que des boutons facebook, twitter et google+ Cool

 
Profile Email Website
 Quote
Content generated in: 0,56 seconds
New Topic Post Reply

Normal Topic Normal Topic
Sticky Topic Sticky Topic
Locked Topic Locked Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Anonymous users can post 
Filtered HTML Allowed 
Censored Content