The ShareThis Extension is a MediaWiki extension for adding links to popular social bookmarking and news sites. The links can either be included directly in articles, or presented as a portlet in the sidebar.
It is released under The MIT License.
Contents |
This extension requires:
require_once('extensions/ShareThis.php');
Once installed, you can add links to the social bookmarking or news sites to any page.
To do so, simply add the following to the the article where the links are to appear:
<sharethis />
Here's an example:
All steps listed in the following sections are optional.
If you'd like the "Share This" sidebar to be displayed, simply add the following to your LocalSettings.php:
$wgShowShareThisSidebar = true;
Note: This works by hooking into 'MonoBookTemplateToolboxEnd'. If you're using a skin which doesn't call this hook, then the above will not work.
If you'd like to remove the bullets from the items in the ShareThis sidebar:
#p-sharethis li {
list-style-type: none;
list-style-image: none;
}
#p-sharethis ul {
margin-left: 0.5em;
}
The sidebar header is controlled by a system message so it is easy to change - either for personal preference, or for internationalization purposes.
To modify the header text:
Note that due to page caching, this change will not immediately be reflected on all pages. See the MediaWiki FAQ Page for information on purging the cache.
If a particular social bookmarking or news site is not listed by default, you can add it!
$wgShareThisSiteList['PopularService'] = 'http://some.site/path/to/script?url=$1&title=$2';
For example, here's how you would add a new entry for submitting links to dzone.com.
$wgShareThisSiteList['dzone'] = 'http://www.dzone.com/links/add.html?url=$1&title=$2&description=$2';
Important: This must come after the require_once() call that pulls in the extension (as described in #Installation).
If a particular social bookmarking or news site is on the list by default, but you don't want it, you can remove it!
unset($wgShareThisSiteList['PopularService']);
For example, here's how you would remove the entry for digg.com:
unset($wgShareThisSiteList['digg']);
Important: This must come after the require_once() call that pulls in the extension (as described in #Installation).
or, read what others have said ...