Browse Source

Forgot FB appid

FOr got FB appid
pull/31/merge v1.5
Danang Probo Sayekti 11 years ago
parent
commit
f30a857608
2 changed files with 4 additions and 2 deletions
  1. +1
    -0
      config/config.ini.example
  2. +3
    -2
      system/includes/functions.php

+ 1
- 0
config/config.ini.example View File

@ -23,6 +23,7 @@ breadcrumb.home = "Home"
comment.system = "disable" comment.system = "disable"
;Facebook comments ;Facebook comments
fb.appid = ""
fb.num = "5" fb.num = "5"
fb.color = "light" fb.color = "light"


+ 3
- 2
system/includes/functions.php View File

@ -909,19 +909,20 @@ EOF;
function facebook() { function facebook() {
$comment = config('comment.system'); $comment = config('comment.system');
$appid = config('fb.appid');
$script = <<<EOF $script = <<<EOF
<div id="fb-root"></div> <div id="fb-root"></div>
<script>(function(d, s, id) { <script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0]; var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return; if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id; js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=1423304737912599";
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId={$appid}";
fjs.parentNode.insertBefore(js, fjs); fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script> }(document, 'script', 'facebook-jssdk'));</script>
<style>.fb-comments, .fb_iframe_widget span, .fb-comments iframe {width: 100%!important;}</style> <style>.fb-comments, .fb_iframe_widget span, .fb-comments iframe {width: 100%!important;}</style>
EOF; EOF;
if($comment == 'facebook') {
if(!empty($appid) && $comment == 'facebook') {
return $script; return $script;
} }


Loading…
Cancel
Save