albums for the user var scAlbums = new StringCat(); //scAlbums.push("Albums"); for (var i = 0; i < j.feed.entry.length; i++) { var id_base = j.feed.entry[i].gphoto$name.$t; var album_date = formatDate(j.feed.entry[i].gphoto$timestamp.$t); var thumb = j.feed.entry[i].media$group.media$thumbnail[0].url.replace(new RegExp("/s160-c/", "g"), "/"); scAlbums.push(""); scAlbums.push(""); pwi_show_albumtitles ? scAlbums.push("" + j.feed.entry[i].title.$t + "" + (pwi_show_albumdate ? album_date : "") + ( pwi_show_albumphotocount ? " " + j.feed.entry[i].gphoto$numphotos.$t + " "+ pwi_labels["photos"] : "")) : false; scAlbums.push(""); } scAlbums.push(" "); pwi_storage_albums = scAlbums.toString(); if (pwi_album_only.length > 0) { getAlbum(pwi_album_only, 1); } else { show(false, pwi_storage_albums); }}function album(j) { //returns all photos in a specific album var scPhotos = new StringCat(); //get the number of photos in the album var np = j.feed.openSearch$totalResults.$t; var loc = j.feed.gphoto$location.$t; var ad = j.feed.subtitle.$t; var album_date = formatDate(j.feed.gphoto$timestamp.$t); var item_plural = true; if (np == "1") item_plural = false; var len = j.feed.entry.length; pwi_currAlbumTitle = j.feed.title.$t; scPhotos.push(""); if (!pwi_album_only.length > 0) { scPhotos.push("" + pwi_labels["albums"] + " > " + j.feed.title.$t + ""); }; if (pwi_show_albumdescription) { scPhotos.push("" + j.feed.title.$t + ""); scPhotos.push("" + np + " " + (item_plural ? pwi_labels["photos"] : pwi_labels["photo"]) + (pwi_show_albumdate ? ", " + album_date: "") + (pwi_show_albumlocation && loc ? ", " + loc: "") + ""); scPhotos.push("" + (ad ? ad: "") + ""); if (pwi_show_slideshowlink) scPhotos.push("" + pwi_labels["slideshow"] + ""); } scPhotos.push(""); //create paging navigation if (np > pwi_maxresults) { pageCount = (np / pwi_maxresults); var ppage = pwi_labels["prev"] + " " + pwi_labels["devider"] + " ", npage = pwi_labels["devider"] + " " + pwi_labels["next"]; if (pwi_page > 1) { ppage = "previous | " }; if (pwi_page < pageCount) { npage = "| next" }; var navRow = new StringCat(); navRow.push("" + ppage + pwi_labels["page"] + " "); for (var i = 1; i < pageCount + 1; i++) { if (i == pwi_page) { navRow.push("" + i + " "); } else { navRow.push("" + i + " "); }; }; navRow.push(npage + ""); scPhotos.push(navRow.toString()); } for (var i = 0; i < len; i++) { var img_base = j.feed.entry[i].content.src; var id_base = j.feed.entry[i].gphoto$id.$t; var c = pwi_show_photocaption ? (j.feed.entry[i].summary.$t ? j.feed.entry[i].summary.$t: "") : ""; var dt = pwi_show_photodate ? (j.feed.entry[i].exif$tags.exif$time ? formatDateTime(j.feed.entry[i].exif$tags.exif$time.$t) : j.feed.entry[i].published.$t) : ""; var d = dt + " " + c.replace(new RegExp("'", "g"), "'"); scPhotos.push(""); scPhotos.push(""); scPhotos.push(""); scPhotos.push(""); } scPhotos.push(navRow); pwi_storage_photos = scPhotos.toString(); show(false, pwi_storage_photos);}function getAlbums() { if (pwi_storage_albums) { show(false, pwi_storage_albums); } else { show(true, ''); var url = 'http://picasaweb.google.com/data/feed/api/user/' + pwi_username + '?category=album' + (pwi_maxalbums > 0 ? '&max-results=' + pwi_maxalbums: "") + '&access=public&alt=json'; $.getJSON(url, 'callback=?', albums); }}function getAlbum(albumid, newPage) { if (albumid != pwi_currAlbum || pwi_page != newPage) { pwi_page = newPage; pwi_currAlbum = albumid; pwi_si = ((pwi_page - 1) * pwi_maxresults) + 1; var url = 'http://picasaweb.google.com/data/feed/api/user/' + pwi_username + '/album/' + albumid + '?category=photo&max-results=' + pwi_maxresults + '&start-index=' + pwi_si + '&alt=json'; show(true, ''); $.getJSON(url, 'callback=?', album); } else { show(false, pwi_storage_photos); }}function fromHistory(hash) { if (hash) { var a, p; if (hash.indexOf("/") > 0) { a = hash.split("/")[0]; p = hash.split("/")[1]; getAlbum(a, p); } } else { getAlbums(); }}function show(loading, data) { if (loading)