Like Button
From Wiki.cyring.fr
(Difference between revisions)
(→header.php) |
|||
Line 40: | Line 40: | ||
} | } | ||
</syntaxhighlight><br /> | </syntaxhighlight><br /> | ||
+ | == MediaWiki == | ||
+ | ===== MonoBook.php ===== | ||
+ | <syntaxhighlight lang="html5"> | ||
+ | <div id="header"> | ||
+ | ... | ||
+ | <div id="fb-root"></div> | ||
+ | <script> | ||
+ | </syntaxhighlight> | ||
+ | <syntaxhighlight lang="javascript"> | ||
+ | (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')); | ||
+ | </syntaxhighlight> | ||
+ | <syntaxhighlight lang="html5"> | ||
+ | </script> | ||
+ | </div> | ||
+ | |||
+ | <div id="column-content"><div id="content"> | ||
+ | ... | ||
+ | <g:plusone size="small" href="<?php echo $this->data[serverurl] . $this->data['content_actions']['nstab-main']['href']; ?>"></g:plusone> | ||
+ | ... | ||
+ | </div></div> | ||
+ | </syntaxhighlight> |
Revision as of 12:26, 23 January 2013
Contents |
WordPress
header.php
<body <?php body_class(); ?>> ... <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/"+"<?php if(qtrans_getLanguage()=='fr') echo 'fr_FR'; else echo 'en_US'; ?>"+"/all.js#xfbml=1"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk')); </script> ...
loop.php
<div class="entry-utility"> ... <?php $oneLink=get_permalink(); if(($langPos=strrpos($oneLink, "?lang=")) != FALSE) $oneLink=substr($oneLink, 0, $langPos); ?> <div class="fb-like" data-href="<?php echo $oneLink; ?>" data-send="false" data-layout="button_count" data-width="90" data-show-faces="true"></div> <span class="meta-sep">|</span> ... </div><!-- .entry-utility -->
style.css
.fb_iframe_widget { top: 2px !important; }
MediaWiki
MonoBook.php
<div id="header"> ... <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> </div> <div id="column-content"><div id="content"> ... <g:plusone size="small" href="<?php echo $this->data[serverurl] . $this->data['content_actions']['nstab-main']['href']; ?>"></g:plusone> ... </div></div>