プラグインじゃなくて、JavaScriptのライブラリにすることで、どこでも使えるようになるかなと思って。
function putSBM (title_this, url_this) {
// Yahoo!ブックマーク
document.write(' <a href="http://bookmarks.yahoo.co.jp/bookmarklet/showpopup?t=' + encodeURIComponent(title_this) + '&u=' + encodeURIComponent(url_this) + '&opener=bm&ei=UTF-8" target="_blank"><img src="http://i.yimg.jp/images/sicons/ybm16.gif" width="16" height="16" alt="' + title_this + 'をYahoo!ブックマークに登録" border="0" align="bottom" /><img src="http://num.bookmarks.yahoo.co.jp/image/small/' + url_this + '" border="0" alt="' + title_this + 'のYahoo!ブックマーク登録数" align="bottom" /></a>');
// Google Bookmarks
document.write(' <a href="http://www.google.com/bookmarks/mark?op=edit&bkmk=' + encodeURIComponent(url_this) + '&title=' + encodeURIComponent(title_this) + '" target="_blank"><img src="http://www.google.co.jp/favicon.ico" alt="' + title_this + 'をGoogle Bookmarksに追加" width="16" height="16" border="0" align="bottom" /></a>');
// はてブ
document.write(' <a href="http://b.hatena.ne.jp/append?' + url_this + '"><img src="http://b.hatena.ne.jp/images/append.gif" width="16" height="12" border="0" alt="' + title_this + 'をはてなブックマーク に追加" align="bottom" /><img src="http://b.hatena.ne.jp/entry/image/' + url_this + '" border="0" alt="' + title_this + 'のはてブ数" align="bottom" /></a>');
// livedoorクリップ
document.write(' <a href="http://clip.livedoor.com/clip/add?link=' + encodeURIComponent(url_this) + '&title=' + encodeURIComponent(title_this) + '"><img src="http://parts.blog.livedoor.jp/img/cmn/clip_16_12_b.gif" width="16" height="12" alt="' + title_this + 'をlivedoorクリップに追加" border="0" align="bottom" /><img src="http://image.clip.livedoor.com/counter/' + url_this + '" alt="' + title_this + 'をlivedoorクリップに追加" border="0" align="bottom" /></a>');
// del.icio.us
document.write(' <a href="http://del.icio.us/post?url=' + encodeURIComponent(url_this) + '&title=' + encodeURIComponent(title_this) + '"><img src="http://images.del.icio.us/static/img/delicious.gif" width="12" height="12" border="0" alt="' + title_this + 'を del.icio.us に追加" align="bottom" /></a>');
// Pookmark
document.write(' <a href="http://pookmark.jp/post?url=' + encodeURIComponent(url_this) + '&title=' + encodeURIComponent(title_this) + '"><img src="http://pookmark.jp/images/add/add.gif" alt="' + title_this + 'をPookmark に追加" border="0" align="bottom" /></a>');
// FC2
document.write(' <a href="http://bookmark.fc2.com/user/post?url=' + encodeURIComponent(url_this) + '&title=' + encodeURIComponent(title_this) + '" target="_blank"><img src="http://bookmark.fc2.com/img/add-16.gif" alt="' + title_this + 'をFC2 Bookmarkに追加" width="12" height="12" border="0" align="bottom" /></a>');
// buzzurl
document.write(' <a href="http://buzzurl.jp/config/add/confirm?url=' + encodeURIComponent(url_this) + '" target="_blank"><img src="http://buzzurl.jp/static/image/api/icon/add_icon_mini_08.gif" alt="' + title_this + 'をBuzzurlに追加" width="12" height="12" border="0" align="bottom" /><img src="http://api.buzzurl.jp/api/counter/' + url_this + '" border="0" alt="' + title_this + 'のBuzzurl登録数" align="bottom" /></a>');
}
// Yahoo!ブックマーク
document.write(' <a href="http://bookmarks.yahoo.co.jp/bookmarklet/showpopup?t=' + encodeURIComponent(title_this) + '&u=' + encodeURIComponent(url_this) + '&opener=bm&ei=UTF-8" target="_blank"><img src="http://i.yimg.jp/images/sicons/ybm16.gif" width="16" height="16" alt="' + title_this + 'をYahoo!ブックマークに登録" border="0" align="bottom" /><img src="http://num.bookmarks.yahoo.co.jp/image/small/' + url_this + '" border="0" alt="' + title_this + 'のYahoo!ブックマーク登録数" align="bottom" /></a>');
// Google Bookmarks
document.write(' <a href="http://www.google.com/bookmarks/mark?op=edit&bkmk=' + encodeURIComponent(url_this) + '&title=' + encodeURIComponent(title_this) + '" target="_blank"><img src="http://www.google.co.jp/favicon.ico" alt="' + title_this + 'をGoogle Bookmarksに追加" width="16" height="16" border="0" align="bottom" /></a>');
// はてブ
document.write(' <a href="http://b.hatena.ne.jp/append?' + url_this + '"><img src="http://b.hatena.ne.jp/images/append.gif" width="16" height="12" border="0" alt="' + title_this + 'をはてなブックマーク に追加" align="bottom" /><img src="http://b.hatena.ne.jp/entry/image/' + url_this + '" border="0" alt="' + title_this + 'のはてブ数" align="bottom" /></a>');
// livedoorクリップ
document.write(' <a href="http://clip.livedoor.com/clip/add?link=' + encodeURIComponent(url_this) + '&title=' + encodeURIComponent(title_this) + '"><img src="http://parts.blog.livedoor.jp/img/cmn/clip_16_12_b.gif" width="16" height="12" alt="' + title_this + 'をlivedoorクリップに追加" border="0" align="bottom" /><img src="http://image.clip.livedoor.com/counter/' + url_this + '" alt="' + title_this + 'をlivedoorクリップに追加" border="0" align="bottom" /></a>');
// del.icio.us
document.write(' <a href="http://del.icio.us/post?url=' + encodeURIComponent(url_this) + '&title=' + encodeURIComponent(title_this) + '"><img src="http://images.del.icio.us/static/img/delicious.gif" width="12" height="12" border="0" alt="' + title_this + 'を del.icio.us に追加" align="bottom" /></a>');
// Pookmark
document.write(' <a href="http://pookmark.jp/post?url=' + encodeURIComponent(url_this) + '&title=' + encodeURIComponent(title_this) + '"><img src="http://pookmark.jp/images/add/add.gif" alt="' + title_this + 'をPookmark に追加" border="0" align="bottom" /></a>');
// FC2
document.write(' <a href="http://bookmark.fc2.com/user/post?url=' + encodeURIComponent(url_this) + '&title=' + encodeURIComponent(title_this) + '" target="_blank"><img src="http://bookmark.fc2.com/img/add-16.gif" alt="' + title_this + 'をFC2 Bookmarkに追加" width="12" height="12" border="0" align="bottom" /></a>');
// buzzurl
document.write(' <a href="http://buzzurl.jp/config/add/confirm?url=' + encodeURIComponent(url_this) + '" target="_blank"><img src="http://buzzurl.jp/static/image/api/icon/add_icon_mini_08.gif" alt="' + title_this + 'をBuzzurlに追加" width="12" height="12" border="0" align="bottom" /><img src="http://api.buzzurl.jp/api/counter/' + url_this + '" border="0" alt="' + title_this + 'のBuzzurl登録数" align="bottom" /></a>');
}
r_sbm.js などとして保存するなり、すでに読み込んでるライブラリに追加するなりする。
んで、r_sbm.js を読み込んだ上で、出力はHTMLの中で登録画像を出力したい場所に以下のコードを置く。
<script type="text/javascript">
<!--
putSBM('ページのタイトル', 'ページのURL');
//-->
</script>
<!--
putSBM('ページのタイトル', 'ページのURL');
//-->
</script>
例えば、Movable Typeのテンプレートで、エントリー・アーカイブ(個別ページ)向けには以下のように書く。
<script type="text/javascript">
<!--
putSBM('<$MTEntryTitle remove_html="1"$>', '<$MTEntryPermalink$>');
//-->
</script>
<!--
putSBM('<$MTEntryTitle remove_html="1"$>', '<$MTEntryPermalink$>');
//-->
</script>
どうぞ、ご利用ください(´ー`)
