<?php
require 'facebook.php' ;
function _getCurrentUrl () {
$protocol = strpos ( strtolower ( $_SERVER['SERVER_PROTOCOL'] ) , 'https' ) === FALSE ? 'http' : 'https' ;
$host = $_SERVER['HTTP_HOST'] ;
$script = $_SERVER['SCRIPT_NAME'] ;
$params = $_SERVER['QUERY_STRING'] ;
if ( $params != '' ) {
return $protocol . '://' . $host . $script . '?' . $params ;
}else
return $protocol . '://' . $host . $script ;
}
$facebook = JxFacebook::getInstance ( _getCurrentUrl () ) ;
$facebook->setOpenGraph ( 'url' , $facebook->getUrl () ) ;
$facebook->setType ( 'blog' ) ;
?>
<html <?php echo $facebook->getHtml () ; ?>>
<head>
<?php echo $facebook->getHead () ; ?>
</head>
<body>
<?php echo $facebook->getScript () ; ?>
<?php echo $facebook->getPlugin ( 'comments' ) ; ?>
</body>
</html>
|