Skip to content

Instantly share code, notes, and snippets.

@thomaswelton
Created March 26, 2014 15:39
Show Gist options
  • Save thomaswelton/9786240 to your computer and use it in GitHub Desktop.
Save thomaswelton/9786240 to your computer and use it in GitHub Desktop.
<?php
//redirect for the website
$isFB = strripos($_SERVER['HTTP_USER_AGENT'], 'facebookexternalhit');
if($isFB === false && is_null(JRequest::getVar('signed_request',NULL)) && is_null(JRequest::getVar('nr',NULL)) && is_null(JRequest::getVar('task',NULL)) && JRequest::getVar('view') != 'entrylist' ) {
//Facebook needs to see this page on our domain to get the og tags, but users should be redirected to the tab version
$redirectUrl = 'http://apps.facebook.com/'.$facebook->getAppId().'/?app_data='.json_encode($app_data);
$mainframe->redirect($redirectUrl);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment