joppe / 10till10

Facebook Movie sharing
MIT License
0 stars 0 forks source link

SDK #2

Open mondayrunner opened 11 years ago

mondayrunner commented 11 years ago
<script>
  window.fbAsyncInit = function() {
    FB.init({
      appId      : '',
      channelUrl : '<?php echo site_url('channel') ?>',
      status     : true,
      cookie     : true,
      xfbml      : true
    });

    $(document).trigger('fb-ready', [
        '<?php echo $this->config->item('fb_id') ?>',
        '<?php echo site_url() ?>',
        '<?php echo $this->config->item('fb_permissions') ?>'
    ]);
  };

  // Load the SDK Asynchronously
  (function(d){
     var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
     js = d.createElement('script'); js.id = id; js.async = true;
     js.src = '//connect.facebook.net/en_US/all.js';
     d.getElementsByTagName('head')[0].appendChild(js);
   }(document));
</script>
mondayrunner commented 11 years ago

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

/**

     * Constructor for this controller
     */  
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Indexpage for application
     *
     * @access  public
     * @return  string
     */  
    public function index()
    {
        $this->view = FALSE;

        $cache_expire = 60*60*24*365;
        header("Pragma: public");
        header("Cache-Control: max-age=".$cache_expire);
        header('Expires: ' . gmdate('D, d M Y H:i:s', time()+$cache_expire) . ' GMT');

        echo '<script src="//connect.facebook.net/en_US/all.js"></script>';
    }

}```