CakePHP Facebook plugin (webtechnick) only 'share' working -
i'm trying use facebook plugin webtechnick cakephp 1.3.10 app. i've followed directions install , have functionalities available:
- downloaded package , installed in app/plugins/facebook
- created app/config/facebook.php app's id, key , secret numbers, based on example config file
- included $helpers = array('facebook.facebook') in app_controller.php
- echoed $this->facebook->html() function in layout (replcing default html tag)
- echoed $this->facebook->init() function @ bottom of layout, before
then, use code in view:
echo $this->facebook->share('link'); echo $this->facebook->like(); echo $this->facebook->comments(); but share button, not or comments. missing step? if echo inside facebook helper like() function example, prints in in view, it's calling function, not generating facbook element. ideas? don't know else try, believe i've followed steps...
----------update--------------------------
with firebug see script error: fb.provide not function
the file error comes http://connect.facebook.net/es_es/all.js, assume plugin calls it. since it's in facebook's servers, can it? mean there's problem on end? don't see many more things can in end. ideas?
it appears all.js file causes problems in both ie , firefox. i'm using ie8 , firefox 7.
after looking @ following...stack overflow answer , facebook bug report able solve both. fix me editing facebook.php helper , adding following...
ie fix
fb.uiserver.setactivenode = function(a,b){fb.uiserver._active[a.id]=b;} firefox fix
window.fb = null; fb = null; complete init() function
function init($options = array()){ if(facebookinfo::getconfig('appid')){ $appid = facebookinfo::getconfig('appid'); $session = json_encode($this->session->read('fb.session')); $init = '<div id="fb-root"></div>'; $init .= $this->html->scriptblock( " window.fbasyncinit = function() { fb.init({ appid : '{$appid}', session : {$session}, // don't refetch session when php has status : true, // check login status cookie : true, // enable cookies allow server access session xfbml : true // parse xfbml }); /* ie fix */ fb.uiserver.setactivenode = function(a,b){fb.uiserver._active[a.id]=b;} /**********/ // whenever user logs in, refresh page fb.event.subscribe('auth.login', function() { window.location.reload(); }); }; (function() { /* firefox fix */ window.fb = null; fb = null; /**********/ var e = document.createelement('script'); e.src = document.location.protocol + '//connect.facebook.net/{$this->locale}/all.js'; e.async = true; document.getelementbyid('fb-root').appendchild(e); }()); ", $options ); return $init; } else { return "<span class='error'>no facebook configuration detected. please add facebook configuration file config folder.</span>"; } } a little late hope helps someone!
Comments
Post a Comment