Facebook分享按钮显示所有页面

时间:2015-02-22 13:58:47

标签: php mysql

如何让facebook的共享btn只分享1个主题而不是所有页面?

目:

<head>
<meta property="og:title" content="<?php echo $nome; ?>" />
<meta property="og:description" content="<?php echo $desc; ?>" />
<meta property="og:image" content="<?php echo $link; ?>" />

php和body:

<?php
$run = mysql_query("SELECT * FROM topic ORDER BY id DESC LIMIT 10") or die(mysql_error());
while($row = mysql_fetch_array($run, MYSQL_ASSOC))
{
    $nome = $row['nome'];
    $desc = $row['desc'];
    $link = $row['link'];
    $categoria = $row['categoria'];
    //title, image and description
    echo "<div id='space'></div><center><strong><h1>" . $nome . "</strong></h1></center></p>";
    echo "<center><div id='space'></div><div style='border: 1px solid #CCC; padding: 1px; display: inline-block;'><img src=" . $link . " width='800px' height:'800px' alt='imagem'" . "</img></div></center>";
    echo "<div id='space'></div><center><h2>" . $desc . "</h2></center>";
    //facebook like and share btn
    echo "<center><div id='space'><div class='fb-like' data-href='http://webservertestes.no-ip.org/testes/market/index.php' data-layout='button' data-action='like' data-show-faces='true' data-share='true'></div></div><div id='separator'></div></center>";
}
?>
<!-- facebook API -->
<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/en_US/sdk.js#xfbml=1&version=v2.0";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
</div>
<!-- END OF FACEBOOK API -->
</div>

</body>

我想让分享按钮只显示1个图像,1个描述和1个标题,因为每个主题都是分开的

0 个答案:

没有答案