<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.yobi.be/index.php?action=history&amp;feed=atom&amp;title=Mediawiki_Google_PlusOne</id>
	<title>Mediawiki Google PlusOne - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.yobi.be/index.php?action=history&amp;feed=atom&amp;title=Mediawiki_Google_PlusOne"/>
	<link rel="alternate" type="text/html" href="https://wiki.yobi.be/index.php?title=Mediawiki_Google_PlusOne&amp;action=history"/>
	<updated>2026-05-25T00:58:29Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://wiki.yobi.be/index.php?title=Mediawiki_Google_PlusOne&amp;diff=7206&amp;oldid=prev</id>
		<title>PhilippeTeuwen at 08:28, 1 September 2011</title>
		<link rel="alternate" type="text/html" href="https://wiki.yobi.be/index.php?title=Mediawiki_Google_PlusOne&amp;diff=7206&amp;oldid=prev"/>
		<updated>2011-09-01T08:28:02Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 08:28, 1 September 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 30:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 30:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;And make sure you &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;purge&lt;/del&gt; the server &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;cached pages&lt;/del&gt;. One easy way is to [https://secure.wikimedia.org/wikipedia/mediawiki/wiki/Manual:$wgCacheEpoch add the following] to your LocalSettings.php to clean the cache whenever LocalSettings.php is edited:&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;And make sure you &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;invalidate&lt;/ins&gt; the server &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;cache&lt;/ins&gt;. One easy way is to [https://secure.wikimedia.org/wikipedia/mediawiki/wiki/Manual:$wgCacheEpoch add the following] to your LocalSettings.php to clean the cache whenever LocalSettings.php is edited:&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;source lang=php&amp;gt;&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;source lang=php&amp;gt;&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;$wgCacheEpoch = max( $wgCacheEpoch, gmdate( &#039;YmdHis&#039;, @filemtime( __FILE__ ) ) );&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;$wgCacheEpoch = max( $wgCacheEpoch, gmdate( &#039;YmdHis&#039;, @filemtime( __FILE__ ) ) );&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;!-- diff cache key mediawiki-mw_:diff:1.41:old-7205:rev-7206:wikidiff2=table:1.14.1:bc2a06be --&gt;
&lt;/table&gt;</summary>
		<author><name>PhilippeTeuwen</name></author>
	</entry>
	<entry>
		<id>https://wiki.yobi.be/index.php?title=Mediawiki_Google_PlusOne&amp;diff=7205&amp;oldid=prev</id>
		<title>PhilippeTeuwen: Created page with &quot;This is just a little hack to add the [http://www.google.com/+1/button/ Google +1 button] to a mediawiki installation. See technical notes on [https://www.google.com/intl/en/webm…&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.yobi.be/index.php?title=Mediawiki_Google_PlusOne&amp;diff=7205&amp;oldid=prev"/>
		<updated>2011-09-01T08:15:55Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;This is just a little hack to add the [http://www.google.com/+1/button/ Google +1 button] to a mediawiki installation. See technical notes on [https://www.google.com/intl/en/webm…&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This is just a little hack to add the [http://www.google.com/+1/button/ Google +1 button] to a mediawiki installation. See technical notes on [https://www.google.com/intl/en/webmasters/+1/button/index.html integrating Google +1 button for webmasters]&lt;br /&gt;
&lt;br /&gt;
Simply add the following snipped to your LocalSettings.php.&lt;br /&gt;
&lt;br /&gt;
Remarks:&lt;br /&gt;
* It will add a button between title and article content.&lt;br /&gt;
* I chose to move it to the right for aesthetic reasons, cf &amp;quot;div align=right&amp;quot;, feel free to modify&lt;br /&gt;
* I enforced the html attribute on g:plusone to avoid some special URLs to be taken into account instead of the canonical one, e.g. a button on http://wiki.yobi.be/index.php?title=Main_Page&amp;amp;action=print will actually link to http://wiki.yobi.be/wiki/Main_Page&lt;br /&gt;
* Because I used hook [https://secure.wikimedia.org/wikipedia/mediawiki/wiki/Manual:Hooks/ArticleViewHeader ArticleViewHeader], it will only display the button on article pages, and not on edition, history, etc.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=php&amp;gt;&lt;br /&gt;
# Google Plus&lt;br /&gt;
$wgHooks[&amp;#039;BeforePageDisplay&amp;#039;][]  = &amp;#039;fnPlusOneJavaScript&amp;#039;;&lt;br /&gt;
function fnPlusOneJavaScript( $out )&lt;br /&gt;
{&lt;br /&gt;
  $script = &amp;#039;&amp;lt;script type=&amp;quot;text/javascript&amp;quot; language=&amp;quot;javascript&amp;quot; src=&amp;quot;https://apis.google.com/js/plusone.js&amp;quot;&amp;gt;&amp;#039;&lt;br /&gt;
            . &amp;#039;&amp;lt;/script&amp;gt;&amp;#039;;&lt;br /&gt;
  $out-&amp;gt;addScript( $script);&lt;br /&gt;
  return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
$wgHooks[&amp;#039;ArticleViewHeader&amp;#039;][] = &amp;#039;fnPlusOneAnchor&amp;#039;;&lt;br /&gt;
function fnPlusOneAnchor( &amp;amp;$article, &amp;amp;$outputDone, &amp;amp;$pcache )&lt;br /&gt;
{&lt;br /&gt;
    global $wgOut;&lt;br /&gt;
    global $wgTitle;&lt;br /&gt;
    $wgOut-&amp;gt;addHTML(&amp;#039;&amp;lt;div align=right&amp;gt;&amp;lt;g:plusone size=&amp;quot;medium&amp;quot; href=&amp;quot;&amp;#039; . $wgTitle-&amp;gt;escapeLocalUrl() . &amp;#039;&amp;quot;&amp;gt;&amp;lt;/g:plusone&amp;gt;&amp;lt;/div&amp;gt;&amp;#039;);&lt;br /&gt;
    return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
And make sure you purge the server cached pages. One easy way is to [https://secure.wikimedia.org/wikipedia/mediawiki/wiki/Manual:$wgCacheEpoch add the following] to your LocalSettings.php to clean the cache whenever LocalSettings.php is edited:&lt;br /&gt;
&amp;lt;source lang=php&amp;gt;&lt;br /&gt;
$wgCacheEpoch = max( $wgCacheEpoch, gmdate( &amp;#039;YmdHis&amp;#039;, @filemtime( __FILE__ ) ) );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
From v1.17 of mediawiki you can use this instead:&lt;br /&gt;
&amp;lt;source lang=php&amp;gt;&lt;br /&gt;
$wgInvalidateCacheOnLocalSettingsChange = true;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>PhilippeTeuwen</name></author>
	</entry>
</feed>