最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

php - Facebook share text - Stack Overflow

programmeradmin2浏览0评论

I have these links on my site

<a rel="nofollow" href=".php?u=<;url>" class="fb_share_button" onclick="return fbs_click('')" target="_blank" style="text-decoration:none;"></a>
<a rel="nofollow" href=".php?u=<;url>" class="fb_share_button" onclick="return fbs_click('')" target="_blank" style="text-decoration:none;"></a>
<a rel="nofollow" href=".php?u=<;url>" class="fb_share_button" onclick="return fbs_click('')" target="_blank" style="text-decoration:none;"></a>
<a rel="nofollow" href=".php?u=<;url>" class="fb_share_button" onclick="return fbs_click('')" target="_blank" style="text-decoration:none;"></a>
<a rel="nofollow" href=".php?u=<;url>" class="fb_share_button" onclick="return fbs_click('')" target="_blank" style="text-decoration:none;"></a>

with this javascript

<script>
function fbs_click(location_place) {
        u=location_place;
        t=document.title;
        window.open('.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');
        return false;
    }
</script>

and i want to know if there is a way to add text or some sort to each one uniquely so that each link as a different body ..here is my code working but where and how do i add a description of some sort

I have these links on my site

<a rel="nofollow" href="http://www.facebook./share.php?u=<;url>" class="fb_share_button" onclick="return fbs_click('http://site./profile/4')" target="_blank" style="text-decoration:none;"></a>
<a rel="nofollow" href="http://www.facebook./share.php?u=<;url>" class="fb_share_button" onclick="return fbs_click('http://site./profile/5')" target="_blank" style="text-decoration:none;"></a>
<a rel="nofollow" href="http://www.facebook./share.php?u=<;url>" class="fb_share_button" onclick="return fbs_click('http://site./profile/8')" target="_blank" style="text-decoration:none;"></a>
<a rel="nofollow" href="http://www.facebook./share.php?u=<;url>" class="fb_share_button" onclick="return fbs_click('http://site./profile/9')" target="_blank" style="text-decoration:none;"></a>
<a rel="nofollow" href="http://www.facebook./share.php?u=<;url>" class="fb_share_button" onclick="return fbs_click('http://site./profile/10')" target="_blank" style="text-decoration:none;"></a>

with this javascript

<script>
function fbs_click(location_place) {
        u=location_place;
        t=document.title;
        window.open('http://www.facebook./sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');
        return false;
    }
</script>

and i want to know if there is a way to add text or some sort to each one uniquely so that each link as a different body ..here is my code working but where and how do i add a description of some sort

Share Improve this question asked Apr 12, 2011 at 15:15 Matt ElhotibyMatt Elhotiby 44.1k91 gold badges224 silver badges328 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 4

You should add Open Graph tags to the pages that you wish to share - that's how the sharer picks them up, and the nice thing is that if someone decides to just share a link in their feed the same information is picked up. The Facebook URL Linter is a great tool for figuring out what Facebook sees when it's looking for Open Graph information.

Edit: Read the OP wrong... As far as I know/have found, you can't adjust the body text of what gets displayed in the share dialog using facebook./sharer.php. You may have to look into the other methods of social interaction with facebook api.

If my memory is good, you can add a parameter in the facebook./sharer.php? url like so :

facebook./sharer.php?u=yourlinke&t=The text you want it to be in the textarea

发布评论

评论列表(0)

  1. 暂无评论