Difference between revisions of "Widget:Improved Facebook Comments"

From Virtual Reality, Augmented Reality Wiki
Jump to: navigation, search
(Created page with "$wgExtensionFunctions[] = 'mww_fb_app_id'; function mww_fb_app_id() { global $wgOut; $wgOut->addHeadItem("fb:app_id", '<meta property="fb:app_id" content="{YOU...")
 
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
$wgExtensionFunctions[] = 'mww_fb_app_id';
+
<noinclude>__NOTOC__
function mww_fb_app_id() {
+
This widget allows you to add '''[http://developers.facebook.com/docs/reference/plugins/comments/ Improved Facebook Comments]''' widget to your wiki page.
        global $wgOut;
+
 
        $wgOut->addHeadItem("fb:app_id", '<meta property="fb:app_id" content="{YOUR-APP-ID}"/>');
+
== Copy to your site ==
}
+
To use this widget on your site, just install [https://www.mediawiki.org/wiki/Extension:Widgets MediaWiki Widgets extension] and copy the [{{fullurl:{{FULLPAGENAME}}|action=edit}} full source code] of this page to your wiki as page '''{{FULLPAGENAME}}'''.
 +
</noinclude><includeonly><!--{counter assign="fbAPIdivID" name="fbAPIdivID"}--><!--{if $fbAPIdivID eq 1}--><div id="fb-root"></div>
 +
<script>
 +
  window.fbAsyncInit = function() {
 +
    FB.init({
 +
      appId      : '<!--{$appID|escape:'urlpathinfo'}-->', // App ID
 +
      channelUrl : '//eagle-rock.org/channel.html', // Channel File
 +
      status    : true, // check login status
 +
      cookie    : true, // enable cookies to allow the server to access the session
 +
      xfbml      : true  // parse XFBML
 +
    });
 +
  };
 +
  (function(d){
 +
    var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
 +
    if (d.getElementById(id)) {return;}
 +
    js = d.createElement('script'); js.id = id; js.async = true;
 +
    js.src = "//connect.facebook.net/en_US/all.js";
 +
    ref.parentNode.insertBefore(js, ref);
 +
  }(document));</script><!--{/if}--><div class="fb-comments" data-href="<!--{$url|escape:'html'}-->" data-num-posts="<!--{$num|escape:'html'|default:5}-->" data-width="<!--{$width|escape:'html'|default:470}-->"<!--{if isset($dark)}--> data-colorscheme="dark"<!--{/if}-->></div></includeonly>

Latest revision as of 20:00, 16 October 2017

This widget allows you to add Improved Facebook Comments widget to your wiki page.

Copy to your site

To use this widget on your site, just install MediaWiki Widgets extension and copy the full source code of this page to your wiki as page Widget:Improved Facebook Comments.