• Welcome to NIWA Community Forums.
 

Tweet/Facebook Buttons

Started by Koroku, June 23, 2011, 03:32:30 AM

Previous topic - Next topic

Koroku

So, I added these to Wikimon, and if anyone is interested in my hackjob of a mod, here it is:

For the bottom, underneath the content:

In MonoBook.php, find:<?php if($this->data['catlinks']) { $this->html('catlinks'); } ?>and add this after:
<!-- BEGIN SHARE BOX -->
<hr width="100%" align="center" />
<div width="100%" align="center" style="padding-top: 10px;">
<div style="float: left; padding-left: 150px;"><a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical" data-via="digiwikimon">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div>
<div style="float: right; padding-right: 150px;"><script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script><g:plusone size="tall"></g:plusone></div>
<?php $url "http" . ((!empty($_SERVER['HTTPS'])) ? "s" "") . "://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; ?>
<iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo urlencode($url); ?>&amp;layout=standard&amp;show_faces=true&amp;width=300&amp;action=recommend&amp;font=trebuchet+ms& amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height:50px"></iframe>
</div>
<!-- END SHARE BOX -->


If you want the Tweet/Facebook icons over in the sidebar, right under the logo... in MonoBook.php, find<script type="<?php $this->text('jsmimetype'?>"> if (window.isMSIE55) fixalpha(); </script>
<?php
$sidebar $this->data['sidebar'];
and add above:<!-- begin of banner1 -->
        <div class='generated-sidebar portlet'>
        <div style="border: none;" align="center">
<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-via="digiwikimon">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
<?php $url "http" . ((!empty($_SERVER['HTTPS'])) ? "s" "") . "://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; ?>
<iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo urlencode($url); ?>&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;font=trebuchet+ms& amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:100px; height:30px"></iframe>
        </div></div>
<!-- end of banner1 -->



Hackjobs,  but a bit of social media never hurt anyone :-D

Oh, and for the Twitter ones, make sure to change data-via="digiwikimon" to your own Twitter usernames~

tacopill

grabs for Lylat Wiki, WikiBound and Fire Emblem Wiki.

Thanks Koroku!







KidIcarus

How long did it take to make these? Would it be easy to make a Pinterest button as well?