2008年4月17日 星期四

Blogger add Picasa Web Albums

GOD!!...
Code Style終於搞懂一點,HTML全都還給課本啦!!

Google旗下Blogger/Picasa整合讓部落格愈來愈精彩,
請將CODE裡橘色部分修改你在Picasa的名稱/相簿,
之後在[網頁元素]>[HTML/JavaScript]建立即可。

參考文獻:堯の部落格


<script>
var flashstring='<embed pluginspage="http://www.macromedia.com/go/getflashplayer" width="345" src="http://picasaweb.google.com/s/c/bin/slideshow.swf" height="244" flashvars="host=picasaweb.google.com&captions=1&RGB=0x000000&feed=http%3A%2F%2Fpicasaweb.google.com%2Fdata%2Ffeed%2Fapi%2Fuser%2F[GoogleID]%2Falbumid%2F##ALBUMID##%3Fkind%3Dphoto%26alt%3Drss" type="application/x-shockwave-flash"></embed>';

function writeflash(albumid){
flashstring1=flashstring.replace("##ALBUMID##",albumid);
document.getElementById("picasaweb").innerHTML=flashstring1;
}

function listallalbum(json) {
var firstlink='';
var temp = '<select onchange="writeflash(this.options[this.selectedIndex].value)">';
var sortentry=json.feed.entry;
for (var i=0, post; post = sortentry[i]; i++) {
var title = post.title.$t;

var link = post.link[2].href.replace(/(^.*albumid\/)(.*)(\?.*$)/g,"$2");
if(i==0){
firstlink=link;
}
temp += '<option value="'+link+'">'+title +'</option>';
}
temp+="</select>";
document.writeln(temp);
writeflash(firstlink);
}
</script>

<div id="picasaweb">
<embed pluginspage="http://www.macromedia.com/go/getflashplayer" width="345" src="http://picasaweb.google.com/s/c/bin/slideshow.swf" height="244" flashvars="host=picasaweb.google.com&captions=1&RGB=0x000000&feed=http%3A%2F%2Fpicasaweb.google.com%2Fdata%2Ffeed%2Fapi%2Fuser%2F[GoogleID]%2Falbumid%2F[AlbumsID]%3Fkind%3Dphoto%26alt%3Drss" type="application/x-shockwave-flash"></embed></div>

<script src="http://picasaweb.google.com/data/feed/base/user/[GoogleID]?kind=album&hl=en_US&access=public&alt=json&callback=listallalbum"></script>

1 則留言:

  1. Hello. This post is likeable, and your blog is very interesting, congratulations :-). I will add in my blogroll =). If possible gives a last there on my blog, it is about the Perfume, I hope you enjoy. The address is http://perfumes-brasil.blogspot.com. A hug.

    回覆刪除