繁体   English   中英

使用facebook sharer.php显示货币符号

[英]Display currency symbols using facebook sharer.php

我在facebook页面标签应用程序上运行了folloiwng facebook sharer.php脚本。 在我尝试使用以下方法添加货币符号之前,该共享非常有效

htmlentities(money_format("%10.2n", $numrows[price]))

有趣的是,此共享选项以及currecny符号在页面上,并且currecny符号正确显示

这是完整的代码。

<?php
    $title=urlencode(''.$numrows['title'].' | '. htmlentities(money_format("%10.2n", $numrows[price])).' '.$currency_code.'');
    $url=urlencode(''.$token.'');
    $summary=urlencode(''.$numrows['description'].'');
    $image=urlencode(''.$numrows['img1'].'');
?>
<a id="button" onClick="window.open('http://www.facebook.com/sharer.php?s=100&amp;p[title]=<?php echo $title;?>&amp;p[summary]=<?php echo $summary;?>&amp;p[url]=<?php echo $url; ?>&amp;&p[images][0]=<?php echo $image;?>', 'sharer', 'toolbar=0,status=0,width=550,height=400');" target="_parent" href="javascript: void(0)">
<input type='submit' class='btn' title='Share This Item With Friends' value='Share On Facebook'></form>  
</a>  

预先感谢,这已经让我发疯了好几天了

显示符号是一回事,但是将其添加到查询字符串中则完全不同。 我不确定调用htmlentities(money_format(...))的结果是什么,因为我不是PHP程序员,但是我想您需要对其进行url编码才能将其添加到querystring中,就像用'=','?' 和“&”。

话虽如此,您应该知道不建议使用Facebook共享,并且不再支持该共享,您可以在文档中阅读:

不赞成使用“共享”按钮,而喜欢“喜欢”按钮,并且不再支持该按钮。 请尽可能使用“赞”按钮为您的应用带来最大流量。

(参考: http : //developers.facebook.com/docs/share/

和:

旧的“共享”按钮发生了什么?

我们在启动“赞”按钮时不赞成使用“共享”按钮,因为“赞”按钮通过允许用户单击一次即可连接,并允许他们查看哪些朋友已经连接,从而提高了点击率。

(参考: http : //developers.facebook.com/docs/reference/plugins/like/

您应该切换“赞”按钮,但是您也需要对该内容进行网址编码。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM