日書隨筆

語法筆記:twitter, plurk, facebook推文按鈕

facebook的語法來自〈側欄或文章加入推到facebook+plurk!+twitter按鈕〉一文。其餘兩者的語法來自〈如何在WordPress加入twitter、Plurk噗浪推文按鈕?(圖文教學)!〉。以下語法摘要為自用保存。請勿隨意轉載。其中,FB已有提供官方分享語法,但是因為用那個語法我不會換圖片(恥orz),所以還是用網友開發的版本。

  成果請見右下角。要注意的是,這些按鈕若是在首頁(沒有進入單篇頁面連結位置)的話,是不會出現單獨一篇文章的連結,而會改成全站的連結。另一點則是下文中暗紅色的地方為圖片的連結位置,可以隨意更動為自己喜歡的圖片或是連結空間。

<div class=”twitter、Plurk噗浪推文語法”><p class=”text-right”>
<a href=”javascript: void(window.open(‘http://twitter.com/home/?status=’.concat
(encodeURIComponent(document.title)) .concat(‘ ‘) .concat(encodeURIComponent
(location.href))));”><img width=”20″ height=”20″ border=”0″ alt=”把這篇文章貼到twitter”
src=”http://i165.photobucket.com/albums/u73/lunaj0201/other_webpicture/twitter.png” /></a>
<a href=”javascript: void(window.open(‘http://www.plurk.com/?qualifier=shares&status=’
.concat(encodeURIComponent(location.href)) .concat(‘ ‘) .concat(‘(‘) .concat
(encodeURIComponent(document.title)) .concat(‘)’)));”><img width=”20″ height=”20″ border=”0″
alt=”把這篇文章貼到Plurk噗浪”
src=”http://i165.photobucket.com/albums/u73/lunaj0201/other_webpicture/plurk_icon.png
/></a> <script>function fbs_click() {u=location.href;t=document.title;window.open
(\\<WPPreserveSingleQuote />http://www.facebook.com/sharer.php?u=\\<WPPreserveSingleQuote
/>+encodeURIComponent(u)+\\<WPPreserveSingleQuote />&t=\\<WPPreserveSingleQuote
/>+encodeURIComponent(t),\\<WPPreserveSingleQuote />sharer\\<WPPreserveSingleQuote
/>,\\<WPPreserveSingleQuote />toolbar=0,status=0,width=626,height=436
\\<WPPreserveSingleQuote />);return false;}</script><a target=”_blank” onclick=”return
fbs_click()” href=”http://www.facebook.com/share.php?u=<url>”><img border=”0″ alt=”把
這篇文章貼到facebook”
src=”http://i165.photobucket.com/albums/u73/lunaj0201/other_webpicture/facebook.png
/></a></p></div>


在〈語法筆記:twitter, plurk, facebook推文按鈕〉中有 2 則留言

  1. SECRET: 0
    PASS: 74be16979710d4c4e7c6647856088456
    感謝您寫下這篇~對我受益良多~^^[color:FF3366]Color[/color]

發佈回覆給「路那」的留言 取消回覆

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *