Is there any way to have it centered on the Sidebar?
Thanks in advance! /Joakim
Is there any way to have it centered on the Sidebar?
Thanks in advance! /Joakim
Hooks syntax looks perfect not changed in mediawiki 1.35 but still not working maybe raw html support removed. if anyone have solutions then please give reply
Just as this extension:
http://www.mediawiki.org/wiki/Extension:Add_to_Any_Share/Save/Bookmark_Button
or this:
http://multiplethreads.blogspot.com.es/2011/07/embedding-1-google-plus-on-mediawiki.html
Any help on how to do this?
Thanks!
This extension was exactly what I was looking for, however I tweaked it a little to fit my needs. Perhaps you can merge my changes into your code for others to use? Everything is hard coded since it's only for me so it needs to be cleaned up a little bit.
<?php
/**
* MediaWiki extension to add a social sidebar in a portlet in the sidebar.
* Installation instructions can be found on
* https://www.mediawiki.org/wiki/Extension:Social_Sidebar
*
* This extension will not add the Social Sidebar portlet to *any* skin
* that is used with MediaWiki. Because of inconsistencies in the skin
* implementation, it will not be add to the following skins:
* cologneblue, standard, nostalgia
*
* @addtogroup Extensions
* @author Joachim De Schrijver
* @license LGPL
*
* Social Sidebar
*/
/**
* Exit if called outside of MediaWiki
*/
if( !defined( 'MEDIAWIKI' ) ) {
echo( "This file is an extension to the MediaWiki software and cannot be used standalone.\n" );
die( 1 );
}
/**
* SETTINGS
* --------
* The description of the portlet can be changed in [[MediaWiki:Socialsidebar]].
*/
$wgExtensionCredits['other'][] = array(
'name' => 'Social Sidebar',
'version' => '0.2',
'author' => '[https://www.mediawiki.org/wiki/User:Joa_ds Joachim De Schrijver]',
'description' => 'Adds [http://www.twitter.com Twitter] and [http://www.facebook.com Facebook] links to the sidebar',
'url' => 'https://www.mediawiki.org/wiki/Extension:Social_Sidebar',
);
// Hook to modify the sidebar
$wgHooks['SkinBuildSidebar'][] = 'SocialSidebar::SocialLinks';
// Class & functions
class SocialSidebar {
function SocialLinks( $skin, &$bar ) {
$bar['Social'] = "\n";
// Facebook
$bar['Social'] .= '<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 class="fb-like" data-send="false" \
data-layout="button_count" data-width="140" data-show-faces="false"></div>'."\n\n";
// Twitter
$bar['Social'] .= '<a href="https://twitter.com/share" class="twitter-share-button">Tweet</a><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="//platform.twitter.com/widgets.js";\
fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>'."\n\n";
// Linked In
$bar['Social'] .= '<script src="//platform.linkedin.com/in.js" type="text/javascript"></script>\
<script type="IN/Share" data-counter="right"></script>'."\n\n";
// +1
$bar['Social'] .= '<g:plusone size="medium" annotation="inline" width="140"></g:plusone>\
<script type="text/javascript">(function() {var po = document.createElement("script"); po.type = "text/javascript"; \
po.async = true;po.src = "https://apis.google.com/js/plusone.js";var s = document.getElementsByTagName("script")[0]; \
s.parentNode.insertBefore(po, s);})();</script>'."\n\n";
return true;
}
}
I get this after install: Parse error: syntax error, unexpected T_VARIABLE in /home/content/65/6092565/html/scientolipedia/LocalSettings.php on line 204
Is that enough to give you an idea what I need to fix? Thanks MediaWiki 1.18.0 (Semantic Bundle Version 2011-08-24.20111208-dev) PHP 5.2.17 (cgi-fcgi) MySQL 5.0.91-log
Nice extension, first of all, many thanks! Question though, is there something I can set to change the width of the Follow button or to insert a linebreak? MountWiki is just about short enough to display but my Twitter name is akerbeltzalba, which makes the last -a creep into my text body area. Any hints would be greatly appreaciated! Akerbeltz 19:27, 20 November 2011 (UTC)
ERROR!
Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method SocialSideBar::FBTwitter() should not be called statically in C:\xampp\htdocs\includes\Hooks.php on line 158
Localsettings code:
$wgFBImage = "/extensions/SocialSideBar/facebook.png";
$wgFBLink = "http://www.facebook.com/pages/Cole-Stuff/162794417087497";
$wgTwitterImage = "/extensions/SocialSideBar/twitter.png";
$wgTwitterLink = "http://www.twitter.com/colejohnson66";
Updated to 0.2, now this:
Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method SocialSideBar::FBTwitter() should not be called statically in C:\xampp\htdocs\includes\Hooks.php on line 158
Localsettings.php
require_once("$IP/extensions/SocialSideBar/SocialSideBar.php");
$wgFB = "http://www.facebook.com/pages/Cole-Stuff/162794417087497";
$wgTwitter = "colejohnson66";
That is really strange.
I am testing all my extensions on 15.5 and have no problems, so not really sure what is causing it.
Could you try to add 'static' to the FBTwitter function (in SocialSideBar.php): So it should look like
// Class & functions
class SocialSideBar {
static function FBTwitter( $skin, &$bar ) {
....
And let me know if this fixes it