Actions

Mediawiki Google Plus +1

From Mike Beane's Blog

References:

  • Edit LocalSettings.php and include the code provided by Google's page above.
    • Example:
$wgHooks['BeforePageDisplay'][]  = 'MyExtensionJavaScript';
    function MyExtensionJavaScript( $out ) 
    {
    # Add Google +1
    $script = '<script type="text/javascript" language="javascript" src="https://apis.google.com/js/plusone.js">'
                    . '</script>';
    $out->addScript( $script);
    return true;
    }    
  • Edit your skin template (mine is SGuMax.php) and add <g:plusone size="small" href="/"></g:plusone>
    • Example:
<h1 class="firstHeading"><?php $this->data['displaytitle']!=""?$this->html('title'):$this->text('title') ?> <g:plusone size="small" href="/"></g:plusone></h1>