Php系统新闻 - 添加社交分享按钮

时间:2013-10-01 12:55:14

标签: php

我制作了一个用于在网站上添加,修改和删除新闻的php系统。

它适用于正常的While循环。

    <?php
    while ($row = mysql_fetch_assoc($result)) {
    $titolo = htmlentities($row['titolo']);
    $contenuto = html_entity_decode($row['contenuto']);
$autore = htmlentities($row['autore']);
$settimana = $arr_set[date("w", strtotime($row["data"]))];
$giorno = date("d", strtotime($row["data"]));
$mese = $arr_mesi[date("n", strtotime($row["data"]))-1];
$anno = date("Y", strtotime($row["data"]));

$data = "".$settimana."&nbsp;".$giorno."&nbsp;".$mese."&nbsp;".$anno."";

    ?>
    <table style="width:100%;" class="tabella_news">
    <tr>
    <td><?php echo "<h3>".$titolo."</h3>"; ?></td>
    </tr>
    <tr>
    <td><?php echo "<p class=\"autore\"><strong>Articolo scritto da:</strong> ".$autore."</p>"; ?></td>
    </tr>
    <tr>
    <td><?php echo "<p class=\"data\"><strong>In data:</strong> ".$data."</p>"; ?></td>
    </tr>
    <tr>
    <td><?php echo "<div class=\"contenuto_news\">".$contenuto."</div>"; ?></td>
    </tr>
    <tr>
    <td>
    <span class='st_facebook_vcount' displayText='Facebook'></span>
    <span class='st_twitter_vcount' displayText='Tweet'></span>
    <span class='st_googleplus_vcount' displayText='Google +'></span>
    </td>
    </tr>
    <tr>
    <td><div class="divider"></div></td>
    </tr>
    <?php
     }
    ?>
    </table>

完美无故障,每页显示3条新闻。 现在,他们要求我增加在Facebook,Twitter和Google +上分享每条新闻的可能性。

我该怎么办? 我尝试使用sharethis.com按钮在while循环中添加一个新行,但是当我去分享它时(显然)显示页面的链接(news.php)。

我怎样才能只显示单个新闻?

0 个答案:

没有答案
相关问题