este es el scrip que me mada facebook
Código Javascript :
<div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/es_LA/sdk.js#xfbml=1&version=v2.8"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script>
este es el codigo para los comentarios
Código HTML :
<div class="fb-comments" data-href="http://akastudio.com.mx/blog-detail.php?id_post=<?php echo $idb; ?>" data-numposts="5" data-width="100%"></div>
el numero de post se envía por url capturandolo mediante método GET $idb=$_GET['id_post'];
este es el codigo completo de la pagina
Código HTML :
<?php header("Content-Type: text/html;charset=utf-8"); $idb=$_GET['id_post']; session_start(); if(isset($_SESSION['user'])){ $id= $_SESSION['id']; //id user Grabado $user= $_SESSION['user']; //user Grabado $_SESSION['estatus']; //estatus $foto= $_SESSION['img']; //imagen //echo "Si existe"; }else{ //echo "No existe"; } ?> <!Doctype html> <!--[if IE 7 ]> <html lang="en-gb" class="isie ie7 oldie no-js"> <![endif]--> <!--[if IE 8 ]> <html lang="en-gb" class="isie ie8 oldie no-js"> <![endif]--> <!--[if IE 9 ]> <html lang="en-gb" class="isie ie9 no-js"> <![endif]--> <!--[if (gt IE 9)|!(IE)]><!--> <html lang="es-MX" class="no-js"> <!--<![endif]--> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Blog</title> <meta name="description" content="Blog"> <!--[if lt IE 9]> <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" /> <!-- **CSS - stylesheets** --> <link id="default-css" rel="stylesheet" href="style.css" type="text/css" media="all" /> <!-- **Additional - stylesheets** --> <link href="css/animations.css" rel="stylesheet" type="text/css" media="all" /> <link id="shortcodes-css" href="css/shortcodes.css" rel="stylesheet" type="text/css" media="all"/> <link id="skin-css" href="skins/red/style.css" rel="stylesheet" media="all" /> <link href="css/isotope.css" rel="stylesheet" type="text/css" media="all" /> <link href="css/prettyPhoto.css" rel="stylesheet" type="text/css" /> <link href="css/pace.css" rel="stylesheet" type="text/css" /> <link rel="stylesheet" href="css/responsive.css" type="text/css" media="all"/> <script src="js/modernizr.js"></script> <!-- Modernizr --> <link id="light-dark-css" href="dark/dark.css" rel="stylesheet" media="all" /> <link rel="stylesheet" href="css/font-awesome.min.css" type="text/css" /> </head> <body> <div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/es_LA/sdk.js#xfbml=1&version=v2.8"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> <div class="wrapper"> <div class="inner-wrapper"> <div id="header-wrapper" class="dt-sticky-menu"> <!-- **header-wrapper Starts** --> <div id="header" class="header"> <div class=" container menu-container"> <ul> <a class="logo" href="index.php"><img alt="Logo" src="images/logo.png"></a> <a class="logo" href="index.php"><h1> Inicio </h1></a> <a class="logo" href="about.php"><h1> Quienes Somos? </h1></a> <a class="logo" href="gallery.php"><h1> Gallery </h1></a> <a class="logo" href="#"><h1> Tienda </h1></a> <a class="logo" href="blog.php"><h1><font color="red"> Blog </font></h1></a> <a class="logo" href="contact.php"><h1> Contacto </h1></a> <a class="logo" href="cursos.php"><h1> Cursos </h1></a> </ul> </div> </div> </div><!-- **header-wrapper Ends** --> <div id="main"> <div class="breadcrumb"><!-- *BreadCrumb Starts here** --> <div class="container"> <br><br> <h2>Blog <span>AkaStudio</span></h2> </div> </div><!-- *BreadCrumb Ends here** --> <section id="primary" class="content-full-width"> <!-- **Primary Starts Here** --> <div class="fullwidth-section"><!-- Full-width section Starts Here --> <div class="container"> <article class="blog-post"><!-- **Blog-post Starts Here** --> <?php require 'funciones.php'; $objdatabase = new Database(); try{ $sql = 'SELECT * FROM blog WHERE id='.$idb.''; $result = $objdatabase->query($sql); $rows = $result->fetchAll(); foreach ($rows as $row) { ?> <div class="entry-thumb"> <img src="<?php echo $row["img"]; ?>"> </div> <div class="entry-details"><!-- entry-details Starts Here --> <div class="entry-title"> <h3><?php echo $row["titulo"]; ?></h3> </div> <div class="entry-metadata"> <p class="date"> <i></i> <?php echo $row["fch"]; ?> </p> <p class="author"> <i></i> By : <a title="ram"> <?php echo $row["autor"]; ?> </a> </p> </div> <div class="entry-body"> <p><?php echo utf8_decode($row["des"]); ?></p> </div> <?php } }catch(PDOException $e){ echo "ERROR: " . $e->getMessage(); } ?> </div><!-- entry-details Ends Here --> </article><!-- **Blog-post Ends Here** --> <div class="commententries"> <ul class="commentlist" style="position:absolute; background-color:white"> <div class="fb-comments" data-href="http://akastudio.com.mx/blog-detail.php?id_post=<?php echo $idb; ?>" data-numposts="5" data-width="100%"></div> </ul> </div> </div> </div><!-- Full-width section Ends Here --> </section> <footer id="footer" class="animate" data-animation="fadeIn" data-delay="100"> <div class="container"> </div> </footer> </div><!-- Main Ends Here--> </div> </div><!-- **Wrapper Ends** --> <!-- **jQuery** --> <script src="js/jquery-1.11.2.min.js" type="text/javascript"></script> <script src="js/jquery.tabs.min.js"></script> <script type="text/javascript" src="js/jquery-migrate.min.js"></script> <script src="js/jquery.validate.min.js" type="text/javascript"></script> <script src="js/jsplugins.js" type="text/javascript"></script> <script src="js/custom.js"></script> </body> </html>