summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/picasa-albums')
-rw-r--r--plugins/picasa-albums/1.0.5/admin.php102
-rw-r--r--plugins/picasa-albums/1.0.5/admin/scripts.js120
-rw-r--r--plugins/picasa-albums/1.0.5/admin/style.css73
-rw-r--r--plugins/picasa-albums/1.0.5/fancybox/blank.gifbin0 -> 43 bytes
-rw-r--r--plugins/picasa-albums/1.0.5/fancybox/fancy_close.pngbin0 -> 1517 bytes
-rw-r--r--plugins/picasa-albums/1.0.5/fancybox/fancy_loading.pngbin0 -> 10195 bytes
-rw-r--r--plugins/picasa-albums/1.0.5/fancybox/fancy_nav_left.pngbin0 -> 1446 bytes
-rw-r--r--plugins/picasa-albums/1.0.5/fancybox/fancy_nav_right.pngbin0 -> 1454 bytes
-rw-r--r--plugins/picasa-albums/1.0.5/fancybox/fancy_shadow_e.pngbin0 -> 107 bytes
-rw-r--r--plugins/picasa-albums/1.0.5/fancybox/fancy_shadow_n.pngbin0 -> 106 bytes
-rw-r--r--plugins/picasa-albums/1.0.5/fancybox/fancy_shadow_ne.pngbin0 -> 347 bytes
-rw-r--r--plugins/picasa-albums/1.0.5/fancybox/fancy_shadow_nw.pngbin0 -> 324 bytes
-rw-r--r--plugins/picasa-albums/1.0.5/fancybox/fancy_shadow_s.pngbin0 -> 111 bytes
-rw-r--r--plugins/picasa-albums/1.0.5/fancybox/fancy_shadow_se.pngbin0 -> 352 bytes
-rw-r--r--plugins/picasa-albums/1.0.5/fancybox/fancy_shadow_sw.pngbin0 -> 340 bytes
-rw-r--r--plugins/picasa-albums/1.0.5/fancybox/fancy_shadow_w.pngbin0 -> 103 bytes
-rw-r--r--plugins/picasa-albums/1.0.5/fancybox/fancy_title_left.pngbin0 -> 503 bytes
-rw-r--r--plugins/picasa-albums/1.0.5/fancybox/fancy_title_main.pngbin0 -> 96 bytes
-rw-r--r--plugins/picasa-albums/1.0.5/fancybox/fancy_title_over.pngbin0 -> 70 bytes
-rw-r--r--plugins/picasa-albums/1.0.5/fancybox/fancy_title_right.pngbin0 -> 506 bytes
-rw-r--r--plugins/picasa-albums/1.0.5/fancybox/fancybox-x.pngbin0 -> 203 bytes
-rw-r--r--plugins/picasa-albums/1.0.5/fancybox/fancybox-y.pngbin0 -> 176 bytes
-rw-r--r--plugins/picasa-albums/1.0.5/fancybox/fancybox.pngbin0 -> 15287 bytes
-rw-r--r--plugins/picasa-albums/1.0.5/fancybox/jquery.easing.js72
-rw-r--r--plugins/picasa-albums/1.0.5/fancybox/jquery.fancybox.css363
-rw-r--r--plugins/picasa-albums/1.0.5/fancybox/jquery.fancybox.js44
-rw-r--r--plugins/picasa-albums/1.0.5/fancybox/jquery.mousewheel.js13
-rw-r--r--plugins/picasa-albums/1.0.5/images/image-sunset.pngbin0 -> 499 bytes
-rw-r--r--plugins/picasa-albums/1.0.5/images/loading.gifbin0 -> 723 bytes
-rw-r--r--plugins/picasa-albums/1.0.5/images/lock-image.pngbin0 -> 664 bytes
-rw-r--r--plugins/picasa-albums/1.0.5/images/next-horizontal.pngbin0 -> 3154 bytes
-rw-r--r--plugins/picasa-albums/1.0.5/images/picasa_post_icon.pngbin0 -> 2450 bytes
-rw-r--r--plugins/picasa-albums/1.0.5/images/prev-horizontal.pngbin0 -> 3164 bytes
-rw-r--r--plugins/picasa-albums/1.0.5/images/zoom_layer.pngbin0 -> 678 bytes
-rw-r--r--plugins/picasa-albums/1.0.5/plugin.php809
-rw-r--r--plugins/picasa-albums/1.0.5/readme.txt70
-rw-r--r--plugins/picasa-albums/1.0.5/scb/AdminPage.php460
-rw-r--r--plugins/picasa-albums/1.0.5/scb/BoxesPage.php220
-rw-r--r--plugins/picasa-albums/1.0.5/scb/Cron.php182
-rw-r--r--plugins/picasa-albums/1.0.5/scb/Forms.php422
-rw-r--r--plugins/picasa-albums/1.0.5/scb/Options.php172
-rw-r--r--plugins/picasa-albums/1.0.5/scb/QueryManipulation.php81
-rw-r--r--plugins/picasa-albums/1.0.5/scb/Table.php49
-rw-r--r--plugins/picasa-albums/1.0.5/scb/Util.php159
-rw-r--r--plugins/picasa-albums/1.0.5/scb/Widget.php89
-rw-r--r--plugins/picasa-albums/1.0.5/scb/load.php85
-rw-r--r--plugins/picasa-albums/1.0.5/scripts.js25
-rw-r--r--plugins/picasa-albums/1.0.5/style.css13
-rw-r--r--plugins/picasa-albums/admin.php122
-rw-r--r--plugins/picasa-albums/admin/scripts.js120
-rw-r--r--plugins/picasa-albums/admin/style.css73
-rw-r--r--plugins/picasa-albums/fancybox/blank.gifbin0 -> 43 bytes
-rw-r--r--plugins/picasa-albums/fancybox/fancy_close.pngbin0 -> 1517 bytes
-rw-r--r--plugins/picasa-albums/fancybox/fancy_loading.pngbin0 -> 10195 bytes
-rw-r--r--plugins/picasa-albums/fancybox/fancy_nav_left.pngbin0 -> 1446 bytes
-rw-r--r--plugins/picasa-albums/fancybox/fancy_nav_right.pngbin0 -> 1454 bytes
-rw-r--r--plugins/picasa-albums/fancybox/fancy_shadow_e.pngbin0 -> 107 bytes
-rw-r--r--plugins/picasa-albums/fancybox/fancy_shadow_n.pngbin0 -> 106 bytes
-rw-r--r--plugins/picasa-albums/fancybox/fancy_shadow_ne.pngbin0 -> 347 bytes
-rw-r--r--plugins/picasa-albums/fancybox/fancy_shadow_nw.pngbin0 -> 324 bytes
-rw-r--r--plugins/picasa-albums/fancybox/fancy_shadow_s.pngbin0 -> 111 bytes
-rw-r--r--plugins/picasa-albums/fancybox/fancy_shadow_se.pngbin0 -> 352 bytes
-rw-r--r--plugins/picasa-albums/fancybox/fancy_shadow_sw.pngbin0 -> 340 bytes
-rw-r--r--plugins/picasa-albums/fancybox/fancy_shadow_w.pngbin0 -> 103 bytes
-rw-r--r--plugins/picasa-albums/fancybox/fancy_title_left.pngbin0 -> 503 bytes
-rw-r--r--plugins/picasa-albums/fancybox/fancy_title_main.pngbin0 -> 96 bytes
-rw-r--r--plugins/picasa-albums/fancybox/fancy_title_over.pngbin0 -> 70 bytes
-rw-r--r--plugins/picasa-albums/fancybox/fancy_title_right.pngbin0 -> 506 bytes
-rw-r--r--plugins/picasa-albums/fancybox/fancybox-x.pngbin0 -> 203 bytes
-rw-r--r--plugins/picasa-albums/fancybox/fancybox-y.pngbin0 -> 176 bytes
-rw-r--r--plugins/picasa-albums/fancybox/fancybox.pngbin0 -> 15287 bytes
-rw-r--r--plugins/picasa-albums/fancybox/jquery.easing-1.3.pack.js72
-rw-r--r--plugins/picasa-albums/fancybox/jquery.easing.js72
-rw-r--r--plugins/picasa-albums/fancybox/jquery.fancybox-1.3.4.css359
-rw-r--r--plugins/picasa-albums/fancybox/jquery.fancybox-1.3.4.pack.js46
-rw-r--r--plugins/picasa-albums/fancybox/jquery.fancybox-custom.js1156
-rw-r--r--plugins/picasa-albums/fancybox/jquery.fancybox-custom.pack.js17
-rw-r--r--plugins/picasa-albums/fancybox/jquery.fancybox.css363
-rw-r--r--plugins/picasa-albums/fancybox/jquery.fancybox.js44
-rw-r--r--plugins/picasa-albums/fancybox/jquery.mousewheel-3.0.4.pack.js14
-rw-r--r--plugins/picasa-albums/fancybox/jquery.mousewheel.js13
-rw-r--r--plugins/picasa-albums/images/image-sunset.pngbin0 -> 499 bytes
-rw-r--r--plugins/picasa-albums/images/loading.gifbin0 -> 723 bytes
-rw-r--r--plugins/picasa-albums/images/lock-image.pngbin0 -> 664 bytes
-rw-r--r--plugins/picasa-albums/images/next-horizontal.pngbin0 -> 3154 bytes
-rw-r--r--plugins/picasa-albums/images/picasa_post_icon.pngbin0 -> 2450 bytes
-rw-r--r--plugins/picasa-albums/images/prev-horizontal.pngbin0 -> 3164 bytes
-rw-r--r--plugins/picasa-albums/images/zoom_layer.pngbin0 -> 678 bytes
-rw-r--r--plugins/picasa-albums/plugin.php842
-rw-r--r--plugins/picasa-albums/readme.txt78
-rw-r--r--plugins/picasa-albums/scb/AdminPage.php460
-rw-r--r--plugins/picasa-albums/scb/BoxesPage.php220
-rw-r--r--plugins/picasa-albums/scb/Cron.php182
-rw-r--r--plugins/picasa-albums/scb/Forms.php422
-rw-r--r--plugins/picasa-albums/scb/Options.php172
-rw-r--r--plugins/picasa-albums/scb/QueryManipulation.php81
-rw-r--r--plugins/picasa-albums/scb/Table.php49
-rw-r--r--plugins/picasa-albums/scb/Util.php159
-rw-r--r--plugins/picasa-albums/scb/Widget.php89
-rw-r--r--plugins/picasa-albums/scb/load.php85
-rw-r--r--plugins/picasa-albums/scripts.js25
-rw-r--r--plugins/picasa-albums/style.css13
102 files changed, 8971 insertions, 0 deletions
diff --git a/plugins/picasa-albums/1.0.5/admin.php b/plugins/picasa-albums/1.0.5/admin.php
new file mode 100644
index 00000000..c379a9a4
--- /dev/null
+++ b/plugins/picasa-albums/1.0.5/admin.php
@@ -0,0 +1,102 @@
+<?php
+
+class picasaOptions_Options_Page extends scbAdminPage {
+
+ function setup() {
+ $this->textdomain = 'wp-picasaOptions';
+ $this->args = array(
+ 'page_title' => __('Picasa Albums Option', $this->textdomain),
+ 'menu_title' => __('Picasa Albums', $this->textdomain),
+ 'parent string'=>'edit.php'
+ );
+ }
+
+ function validate($options) {
+ return $options;
+ }
+ function page_content() {
+ $new = (empty($this->options->username)) ? ' ref="new"':' ref="saved"';
+ $rows = array(
+ array(
+ 'title' => __('Picasa User Name', $this->textdomain),
+ 'type' => 'text',
+ 'name' => 'username',
+ 'extra' => 'size="50" '.$new,
+ 'desc' => '<span style="color:red; display:none;">Save options before importing albums!</span><br />Picasa\'s API does not need password to access your public RSS feed.',
+ ),
+ );
+ $out =
+ html('h3', __('Picasa Settings', $this->textdomain))
+ .html('p', __('', $this->textdomain))
+ .$this->table($rows);
+
+ $rows = array(
+ array(
+ 'title' => __('Import Albums', $this->textdomain),
+ 'type' => 'button',
+ 'name' => 'import_albums',
+ 'id'=>'import_albums',
+ 'value'=>'Import',
+ 'extra'=>'class="button"',
+ 'desc' => '<span class="loader hide"><i>Loading</i></span></label><label>',
+ )
+ );
+ $out.=html('h3', __('Import Data', $this->textdomain));
+ $out.=html('p', __('', $this->textdomain));
+
+ $out.=$this->table($rows);
+ $rows = array(
+ array(
+ 'title' => __('Album Thumbnail Height', $this->textdomain),
+ 'type' => 'text',
+ 'name' => 'album_thumbsize',
+ 'extra'=>'class="small-text"',
+ 'desc' => '<span>px. </span>'
+ ),
+ array(
+ 'title' => __('Crop Album Thumbnails', $this->textdomain),
+ 'type' => 'select',
+ 'value'=>array('no'=>'No','yes'=>'Yes'),
+ 'name' => 'album_thumbcrop',
+ 'desc' => '<span style="color:red">Caution: Uncropped images may brake grid layout!</span>'
+ )
+ );
+ $out.=html('h3', __('Album Page Settings', $this->textdomain));
+ $out.=html('p', __('', $this->textdomain));
+ $out.=$this->table($rows);
+ $rows=array(
+ array(
+ 'title' => __('Image Thumbnail Size', $this->textdomain),
+ 'type' => 'text',
+ 'name' => 'image_thumbsize',
+ 'extra'=>'class="small-text"',
+ 'desc' => '<span>px. <br />Recommended sizes: 32, 48, 64, 72, 104, 144, 150, 160</span>'
+ ),
+ array(
+ 'title' => __('Image Max Zoom Size', $this->textdomain),
+ 'type' => 'text',
+ 'name' => 'image_maxsize',
+ 'extra'=>'class="small-text"',
+ 'desc' => '<span>px.<br />
+ The max. size of the image users will see in lightbox.<br />
+ Available sizes: 94, 110, 128, 200, 220, 288, 320, 400, 512, 576, 640, 720, 800, 912, 1024, 1152, 1280, 1440, 1600
+ </span>'
+ ),
+ array(
+ 'title' => __('Crop Thumbnails', $this->textdomain),
+ 'type' => 'select',
+ 'value'=>array('no'=>'No','yes'=>'Yes'),
+ 'name' => 'image_thumbcrop',
+ 'desc' => '<br /><span>It is recommended to use crop. this way images look square and align nicely.</span>'
+ )
+
+ );
+ $out.=html('h3', __('Gallery Page Settings', $this->textdomain));
+ $out.=html('p', __('Define how your gallery posts will look.', $this->textdomain));
+ $out.=$this->table($rows);
+
+ $out.=html('p', __('Do you need more features? Check out <a href="mikhailkozlov.com/picasa_albums_pro" target="blank">Picasa Albums Pro</a>.', $this->textdomain));
+ echo $this->form_wrap($out);
+ }
+}
+
diff --git a/plugins/picasa-albums/1.0.5/admin/scripts.js b/plugins/picasa-albums/1.0.5/admin/scripts.js
new file mode 100644
index 00000000..fa18e2cb
--- /dev/null
+++ b/plugins/picasa-albums/1.0.5/admin/scripts.js
@@ -0,0 +1,120 @@
+var albumPage = false;
+var newName = false;
+var $j =jQuery.noConflict();
+$j(document).ready(function(){
+ /************ option page function **************/
+ // little validation
+ if($j("input#username").attr('ref') == 'new'){
+ newName = true;
+ $j("#import_albums").attr('disabled','disabled');
+ $j(this).next('span').show();
+ }else{
+ newName = false;
+ }
+ $j("input#username").bind('keyup, keydown',function(){
+ $j(this).next('span').show();
+ $j("#import_albums").attr('disabled','disabled');
+ newName = true;
+ });
+ /************ END option page function **************/
+
+ /************ shared function **************/
+ $j("#import_albums").click(function(){
+ if(!newName){
+ var l = $j(this).next();
+ l.show();
+ $j.get('admin-ajax.php?action=picasa_ajax_import',{'user':$j('input#username').val(),'password':$j("#gpassword").val()},function(){
+ l.hide();
+ });
+ }else{
+ alert('Save options before importing albums!');
+ }
+ });
+
+ /************ end shared function **************/
+
+
+ /************ custom post type functions **************/
+ $j("#load_imges_now").bind("click",function(){
+ $j("#import_album_images").click();
+ return false;
+ });
+ // enable fancybox
+ $j("a.fancybox").fancybox();
+ // import button
+ $j("#import_album_images").click(function(){
+ var l = $j(this);
+ var t = $j(this).val();
+ l.val("Loading...");
+ $j.get("admin-ajax.php?action=picasa_ajax_reload_images",{"id":l.attr("data"),"authkey":l.attr("authkey"),"post_ID":$j("#post_ID").val()},function(){
+ l.val(t);
+ window.location.href=window.location.href
+ });
+ });
+ // check if sortable here
+ if($j().sortable) {
+ // find how to add condition here.
+ $j("#picasa-album-images ul.ui-sortable").sortable({
+ containment: 'parent',
+ forcePlaceholderSize: true,
+ distance: 1,
+ tolerance: 'intersect',
+ placeholder: 'ui-state-highlight',
+ opacity: 0.6
+ });
+ }
+ // set album thumbnail
+ $j("a.cover_image").click(function(){
+ var l = $j(this);
+ album.thumbnail.url=l.attr("href").substr(1);
+ album.thumbnail.height=l.attr("ref");
+ album.thumbnail.width=l.attr("ref");
+ $j("#cover_image").attr("height",album.thumbnail.height).attr("width",album.thumbnail.width).attr("src",album.thumbnail.url).fadeOut("fast").fadeIn("fast");
+ $j("#picasa-album-images .ui-sortable li").siblings().removeAttr("style");
+ l.parent().prev('img').parent().css({border:"1px solid #999"});
+ // update text
+ $j("textarea#excerpt").val(JSON.stringify(album));
+ return false;
+ });
+ // show hide images
+ $j('a.hide_image').click(function(){
+ var l = $j(this);
+ var m=0; // martch
+ for(i=0; i<images.length; i++){
+ if(images[i].id == l.attr('id')){
+ m=i;
+ l.toggleClass('visible');
+ if(l.hasClass('visible')){
+ images[i].show="yes";
+ l.parent().prev('img').toggleClass('dimlight');
+ }else{
+ images[i].show="no";
+ l.parent().prev('img').toggleClass('dimlight');
+ }
+ }
+ }
+ $j('span',l).toggle();
+ return false;
+ });
+
+ // save album changes
+ var clickPublish = false;
+ $j("#publish, #save-post").bind("click",function(){
+ var btn = $j(this);
+ if(clickPublish == false && $j("textarea#content").hasClass("albumpage") ){
+ clickPublish = true;
+ var post = "todo=saveAlbum&post_ID="+$j("#post_ID").val()+"&"+$j("#picasa-album-images ul.ui-sortable").sortable("serialize");
+ album.summary = $j("#album_summary").val();
+ $j("textarea#excerpt").val(JSON.stringify(album));
+ for(i=0; i<images.length; i++){
+ post += '&id['+images[i].id+']='+images[i].show;
+ }
+ $j.get('admin-ajax.php?action=picasa_ajax_image_action',post,function(r){
+ // get responce and update textarea
+ $j("textarea#content").val(r);
+ btn.click();
+ },'html');
+ return false;
+ }
+ });
+}); \ No newline at end of file
diff --git a/plugins/picasa-albums/1.0.5/admin/style.css b/plugins/picasa-albums/1.0.5/admin/style.css
new file mode 100644
index 00000000..e2be7e74
--- /dev/null
+++ b/plugins/picasa-albums/1.0.5/admin/style.css
@@ -0,0 +1,73 @@
+#gpass_holder{
+ float:left;
+ margin-right:20px;
+}
+span.loader{ background:url(../images/loading.gif) right no-repeat; padding-right:40px;}
+.hide{
+ display:none;
+}
+#adminmenu #menu-posts-album.menu-icon-post div.wp-menu-image{background:url("../images/picasa_post_icon.png") no-repeat scroll 0px -28px transparent;}
+#adminmenu #menu-posts-album.menu-icon-post:hover div.wp-menu-image{background:url("../images/picasa_post_icon.png") no-repeat scroll 0px 0px transparent;}
+#picasa-album-images div.ui-sortable{
+ display:block;
+ height:100%;
+ list-style:none;
+
+ position:relative;
+}
+#picasa-album-images ul.ui-sortable li{
+ border:1px solid #CCC;
+ cursor:move;
+ display:inline-block;
+ line-height:100%;
+ margin-bottom:10px;
+ margin-right:10px;
+ padding:3px;
+ position:relative;
+}
+.ui-state-highlight {
+ background-color:#ffff80;
+ height: 110px;
+ line-height:100%;
+}
+#picasa-album-images li div{
+ background-color:#F9F9F9;
+ bottom:0;
+ display:none;
+ height:16px;
+ left:0px;
+ opacity:0.95;
+ padding:4px 6px 0px;
+ position:absolute;
+ text-align:center;
+ width:104px;
+}
+#picasa-album-images li a{
+ font-size:11px;
+ margin-right:2px;
+ vertical-align:middle;
+}
+#picasa-album-images li:hover div{
+ display:block;
+}
+/* add browser support */
+#picasa-album-images li img{
+ opacity:1;
+}
+#picasa-album-images li img.dimlight{
+ opacity:0.5;
+}
+
+.icon{
+ background:left no-repeat;
+ padding-left:20px;
+}
+.icon.hide_image{
+ background:url(../images/lock-image.png) left no-repeat scroll;
+}
+.icon.view_image{
+ background:url(../images/zoom_layer.png) left no-repeat scroll;
+}
+.icon.cover_image{
+ background:url(../images/image-sunset.png) left no-repeat scroll;
+}
diff --git a/plugins/picasa-albums/1.0.5/fancybox/blank.gif b/plugins/picasa-albums/1.0.5/fancybox/blank.gif
new file mode 100644
index 00000000..35d42e80
--- /dev/null
+++ b/plugins/picasa-albums/1.0.5/fancybox/blank.gif
Binary files differ
diff --git a/plugins/picasa-albums/1.0.5/fancybox/fancy_close.png b/plugins/picasa-albums/1.0.5/fancybox/fancy_close.png
new file mode 100644
index 00000000..07035307
--- /dev/null
+++ b/plugins/picasa-albums/1.0.5/fancybox/fancy_close.png
Binary files differ
diff --git a/plugins/picasa-albums/1.0.5/fancybox/fancy_loading.png b/plugins/picasa-albums/1.0.5/fancybox/fancy_loading.png
new file mode 100644
index 00000000..25030179
--- /dev/null
+++ b/plugins/picasa-albums/1.0.5/fancybox/fancy_loading.png
Binary files differ
diff --git a/plugins/picasa-albums/1.0.5/fancybox/fancy_nav_left.png b/plugins/picasa-albums/1.0.5/fancybox/fancy_nav_left.png
new file mode 100644
index 00000000..ebaa6a4f
--- /dev/null
+++ b/plugins/picasa-albums/1.0.5/fancybox/fancy_nav_left.png
Binary files differ
diff --git a/plugins/picasa-albums/1.0.5/fancybox/fancy_nav_right.png b/plugins/picasa-albums/1.0.5/fancybox/fancy_nav_right.png
new file mode 100644
index 00000000..873294e9
--- /dev/null
+++ b/plugins/picasa-albums/1.0.5/fancybox/fancy_nav_right.png
Binary files differ
diff --git a/plugins/picasa-albums/1.0.5/fancybox/fancy_shadow_e.png b/plugins/picasa-albums/1.0.5/fancybox/fancy_shadow_e.png
new file mode 100644
index 00000000..2eda0893
--- /dev/null
+++ b/plugins/picasa-albums/1.0.5/fancybox/fancy_shadow_e.png
Binary files differ
diff --git a/plugins/picasa-albums/1.0.5/fancybox/fancy_shadow_n.png b/plugins/picasa-albums/1.0.5/fancybox/fancy_shadow_n.png
new file mode 100644
index 00000000..69aa10e2
--- /dev/null
+++ b/plugins/picasa-albums/1.0.5/fancybox/fancy_shadow_n.png
Binary files differ
diff --git a/plugins/picasa-albums/1.0.5/fancybox/fancy_shadow_ne.png b/plugins/picasa-albums/1.0.5/fancybox/fancy_shadow_ne.png
new file mode 100644
index 00000000..79f6980a
--- /dev/null
+++ b/plugins/picasa-albums/1.0.5/fancybox/fancy_shadow_ne.png
Binary files differ
diff --git a/plugins/picasa-albums/1.0.5/fancybox/fancy_shadow_nw.png b/plugins/picasa-albums/1.0.5/fancybox/fancy_shadow_nw.png
new file mode 100644
index 00000000..7182cd93
--- /dev/null
+++ b/plugins/picasa-albums/1.0.5/fancybox/fancy_shadow_nw.png
Binary files differ
diff --git a/plugins/picasa-albums/1.0.5/fancybox/fancy_shadow_s.png b/plugins/picasa-albums/1.0.5/fancybox/fancy_shadow_s.png
new file mode 100644
index 00000000..d8858bfb
--- /dev/null
+++ b/plugins/picasa-albums/1.0.5/fancybox/fancy_shadow_s.png
Binary files differ
diff --git a/plugins/picasa-albums/1.0.5/fancybox/fancy_shadow_se.png b/plugins/picasa-albums/1.0.5/fancybox/fancy_shadow_se.png
new file mode 100644
index 00000000..541e3ffd
--- /dev/null
+++ b/plugins/picasa-albums/1.0.5/fancybox/fancy_shadow_se.png
Binary files differ
diff --git a/plugins/picasa-albums/1.0.5/fancybox/fancy_shadow_sw.png b/plugins/picasa-albums/1.0.5/fancybox/fancy_shadow_sw.png
new file mode 100644
index 00000000..b451689f
--- /dev/null
+++ b/plugins/picasa-albums/1.0.5/fancybox/fancy_shadow_sw.png
Binary files differ
diff --git a/plugins/picasa-albums/1.0.5/fancybox/fancy_shadow_w.png b/plugins/picasa-albums/1.0.5/fancybox/fancy_shadow_w.png
new file mode 100644
index 00000000..8a4e4a88
--- /dev/null
+++ b/plugins/picasa-albums/1.0.5/fancybox/fancy_shadow_w.png
Binary files differ
diff --git a/plugins/picasa-albums/1.0.5/fancybox/fancy_title_left.png b/plugins/picasa-albums/1.0.5/fancybox/fancy_title_left.png
new file mode 100644
index 00000000..6049223d
--- /dev/null
+++ b/plugins/picasa-albums/1.0.5/fancybox/fancy_title_left.png
Binary files differ
diff --git a/plugins/picasa-albums/1.0.5/fancybox/fancy_title_main.png b/plugins/picasa-albums/1.0.5/fancybox/fancy_title_main.png
new file mode 100644
index 00000000..8044271f
--- /dev/null
+++ b/plugins/picasa-albums/1.0.5/fancybox/fancy_title_main.png
Binary files differ
diff --git a/plugins/picasa-albums/1.0.5/fancybox/fancy_title_over.png b/plugins/picasa-albums/1.0.5/fancybox/fancy_title_over.png
new file mode 100644
index 00000000..d9f458f4
--- /dev/null
+++ b/plugins/picasa-albums/1.0.5/fancybox/fancy_title_over.png
Binary files differ
diff --git a/plugins/picasa-albums/1.0.5/fancybox/fancy_title_right.png b/plugins/picasa-albums/1.0.5/fancybox/fancy_title_right.png
new file mode 100644
index 00000000..e36d9db2
--- /dev/null
+++ b/plugins/picasa-albums/1.0.5/fancybox/fancy_title_right.png
Binary files differ
diff --git a/plugins/picasa-albums/1.0.5/fancybox/fancybox-x.png b/plugins/picasa-albums/1.0.5/fancybox/fancybox-x.png
new file mode 100644
index 00000000..c2130f86
--- /dev/null
+++ b/plugins/picasa-albums/1.0.5/fancybox/fancybox-x.png
Binary files differ
diff --git a/plugins/picasa-albums/1.0.5/fancybox/fancybox-y.png b/plugins/picasa-albums/1.0.5/fancybox/fancybox-y.png
new file mode 100644
index 00000000..7ef399b9
--- /dev/null
+++ b/plugins/picasa-albums/1.0.5/fancybox/fancybox-y.png
Binary files differ
diff --git a/plugins/picasa-albums/1.0.5/fancybox/fancybox.png b/plugins/picasa-albums/1.0.5/fancybox/fancybox.png
new file mode 100644
index 00000000..65e14f68
--- /dev/null
+++ b/plugins/picasa-albums/1.0.5/fancybox/fancybox.png
Binary files differ
diff --git a/plugins/picasa-albums/1.0.5/fancybox/jquery.easing.js b/plugins/picasa-albums/1.0.5/fancybox/jquery.easing.js
new file mode 100644
index 00000000..9370a3b7
--- /dev/null
+++ b/plugins/picasa-albums/1.0.5/fancybox/jquery.easing.js
@@ -0,0 +1,72 @@
+/*
+ * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
+ *
+ * Uses the built in easing capabilities added In jQuery 1.1
+ * to offer multiple easing options
+ *
+ * TERMS OF USE - jQuery Easing
+ *
+ * Open source under the BSD License.
+ *
+ * Copyright © 2008 George McGinley Smith
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this list of
+ * conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice, this list
+ * of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * Neither the name of the author nor the names of contributors may be used to endorse
+ * or promote products derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+*/
+
+// t: current time, b: begInnIng value, c: change In value, d: duration
+eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('h.i[\'1a\']=h.i[\'z\'];h.O(h.i,{y:\'D\',z:9(x,t,b,c,d){6 h.i[h.i.y](x,t,b,c,d)},17:9(x,t,b,c,d){6 c*(t/=d)*t+b},D:9(x,t,b,c,d){6-c*(t/=d)*(t-2)+b},13:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t+b;6-c/2*((--t)*(t-2)-1)+b},X:9(x,t,b,c,d){6 c*(t/=d)*t*t+b},U:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t+1)+b},R:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t+b;6 c/2*((t-=2)*t*t+2)+b},N:9(x,t,b,c,d){6 c*(t/=d)*t*t*t+b},M:9(x,t,b,c,d){6-c*((t=t/d-1)*t*t*t-1)+b},L:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t+b;6-c/2*((t-=2)*t*t*t-2)+b},K:9(x,t,b,c,d){6 c*(t/=d)*t*t*t*t+b},J:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t*t*t+1)+b},I:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t*t+b;6 c/2*((t-=2)*t*t*t*t+2)+b},G:9(x,t,b,c,d){6-c*8.C(t/d*(8.g/2))+c+b},15:9(x,t,b,c,d){6 c*8.n(t/d*(8.g/2))+b},12:9(x,t,b,c,d){6-c/2*(8.C(8.g*t/d)-1)+b},Z:9(x,t,b,c,d){6(t==0)?b:c*8.j(2,10*(t/d-1))+b},Y:9(x,t,b,c,d){6(t==d)?b+c:c*(-8.j(2,-10*t/d)+1)+b},W:9(x,t,b,c,d){e(t==0)6 b;e(t==d)6 b+c;e((t/=d/2)<1)6 c/2*8.j(2,10*(t-1))+b;6 c/2*(-8.j(2,-10*--t)+2)+b},V:9(x,t,b,c,d){6-c*(8.o(1-(t/=d)*t)-1)+b},S:9(x,t,b,c,d){6 c*8.o(1-(t=t/d-1)*t)+b},Q:9(x,t,b,c,d){e((t/=d/2)<1)6-c/2*(8.o(1-t*t)-1)+b;6 c/2*(8.o(1-(t-=2)*t)+1)+b},P:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6-(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b},H:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6 a*8.j(2,-10*t)*8.n((t*d-s)*(2*8.g)/p)+c+b},T:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d/2)==2)6 b+c;e(!p)p=d*(.3*1.5);e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);e(t<1)6-.5*(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b;6 a*8.j(2,-10*(t-=1))*8.n((t*d-s)*(2*8.g)/p)*.5+c+b},F:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*(t/=d)*t*((s+1)*t-s)+b},E:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},16:9(x,t,b,c,d,s){e(s==u)s=1.l;e((t/=d/2)<1)6 c/2*(t*t*(((s*=(1.B))+1)*t-s))+b;6 c/2*((t-=2)*t*(((s*=(1.B))+1)*t+s)+2)+b},A:9(x,t,b,c,d){6 c-h.i.v(x,d-t,0,c,d)+b},v:9(x,t,b,c,d){e((t/=d)<(1/2.k)){6 c*(7.q*t*t)+b}m e(t<(2/2.k)){6 c*(7.q*(t-=(1.5/2.k))*t+.k)+b}m e(t<(2.5/2.k)){6 c*(7.q*(t-=(2.14/2.k))*t+.11)+b}m{6 c*(7.q*(t-=(2.18/2.k))*t+.19)+b}},1b:9(x,t,b,c,d){e(t<d/2)6 h.i.A(x,t*2,0,c,d)*.5+b;6 h.i.v(x,t*2-d,0,c,d)*.5+c*.5+b}});',62,74,'||||||return||Math|function|||||if|var|PI|jQuery|easing|pow|75|70158|else|sin|sqrt||5625|asin|||undefined|easeOutBounce|abs||def|swing|easeInBounce|525|cos|easeOutQuad|easeOutBack|easeInBack|easeInSine|easeOutElastic|easeInOutQuint|easeOutQuint|easeInQuint|easeInOutQuart|easeOutQuart|easeInQuart|extend|easeInElastic|easeInOutCirc|easeInOutCubic|easeOutCirc|easeInOutElastic|easeOutCubic|easeInCirc|easeInOutExpo|easeInCubic|easeOutExpo|easeInExpo||9375|easeInOutSine|easeInOutQuad|25|easeOutSine|easeInOutBack|easeInQuad|625|984375|jswing|easeInOutBounce'.split('|'),0,{}))
+
+/*
+ *
+ * TERMS OF USE - EASING EQUATIONS
+ *
+ * Open source under the BSD License.
+ *
+ * Copyright © 2001 Robert Penner
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this list of
+ * conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice, this list
+ * of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * Neither the name of the author nor the names of contributors may be used to endorse
+ * or promote products derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
diff --git a/plugins/picasa-albums/1.0.5/fancybox/jquery.fancybox.css b/plugins/picasa-albums/1.0.5/fancybox/jquery.fancybox.css
new file mode 100644
index 00000000..28bbb132
--- /dev/null
+++ b/plugins/picasa-albums/1.0.5/fancybox/jquery.fancybox.css
@@ -0,0 +1,363 @@
+/*
+ * FancyBox - jQuery Plugin
+ * Simple and fancy lightbox alternative
+ *
+ * Examples and documentation at: http://fancybox.net
+ *
+ * Copyright (c) 2008 - 2010 Janis Skarnelis
+ *
+ * Version: 1.3.1 (05/03/2010)
+ * Requires: jQuery v1.3+
+ *
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+ */
+
+#fancybox-loading {
+ position: fixed;
+ top: 50%;
+ left: 50%;
+ height: 40px;
+ width: 40px;
+ margin-top: -20px;
+ margin-left: -20px;
+ cursor: pointer;
+ overflow: hidden;
+ z-index: 1104;
+ display: none;
+}
+
+* html #fancybox-loading { /* IE6 */
+ position: absolute;
+ margin-top: 0;
+}
+
+#fancybox-loading div {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 40px;
+ height: 480px;
+ background-image: url('fancybox.png');
+}
+
+#fancybox-overlay {
+ position: fixed;
+ top: 0;
+ left: 0;
+ bottom: 0;
+ right: 0;
+ background: #000;
+ z-index: 1100;
+ display: none;
+}
+
+* html #fancybox-overlay { /* IE6 */
+ position: absolute;
+ width: 100%;
+}
+
+#fancybox-tmp {
+ padding: 0;
+ margin: 0;
+ border: 0;
+ overflow: auto;
+ display: none;
+}
+
+#fancybox-wrap {
+ position: absolute;
+ top: 0;
+ left: 0;
+ margin: 0;
+ padding: 20px;
+ z-index: 1101;
+ display: none;
+}
+
+#fancybox-outer {
+ position: relative;
+ width: 100%;
+ height: 100%;
+ background: #FFF;
+}
+
+#fancybox-inner {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 1px;
+ height: 1px;
+ padding: 0;
+ margin: 0;
+ outline: none;
+ overflow: hidden;
+}
+
+#fancybox-hide-sel-frame {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ background: transparent;
+}
+
+#fancybox-close {
+ position: absolute;
+ top: -15px;
+ right: -15px;
+ width: 30px;
+ height: 30px;
+ background-image: url('fancybox.png');
+ background-position: -40px 0px;
+ cursor: pointer;
+ z-index: 1103;
+ display: none;
+}
+
+#fancybox_error {
+ color: #444;
+ font: normal 12px/20px Arial;
+ padding: 7px;
+ margin: 0;
+}
+
+#fancybox-content {
+ height: auto;
+ width: auto;
+ padding: 0;
+ margin: 0;
+}
+
+#fancybox-img {
+ width: 100%;
+ height: 100%;
+ padding: 0;
+ margin: 0;
+ border: none;
+ outline: none;
+ line-height: 0;
+ vertical-align: top;
+ -ms-interpolation-mode: bicubic;
+}
+
+#fancybox-frame {
+ position: relative;
+ width: 100%;
+ height: 100%;
+ border: none;
+ display: block;
+}
+
+#fancybox-title {
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ font-family: Arial;
+ font-size: 12px;
+ z-index: 1102;
+}
+
+.fancybox-title-inside {
+ padding: 10px 0;
+ text-align: center;
+ color: #333;
+}
+
+.fancybox-title-outside {
+ padding-top: 5px;
+ color: #FFF;
+ text-align: center;
+ font-weight: bold;
+}
+
+.fancybox-title-over {
+ color: #FFF;
+ text-align: left;
+}
+
+#fancybox-title-over {
+ padding: 10px;
+ background-image: url('fancy_title_over.png');
+ display: block;
+}
+
+#fancybox-title-wrap {
+ display: inline-block;
+}
+
+#fancybox-title-wrap span {
+ height: 32px;
+ float: left;
+}
+
+#fancybox-title-left {
+ padding-left: 15px;
+ background-image: url('fancybox.png');
+ background-position: -40px -90px;
+ background-repeat: no-repeat;
+}
+
+#fancybox-title-main {
+ font-weight: bold;
+ line-height: 29px;
+ background-image: url('fancybox-x.png');
+ background-position: 0px -40px;
+ color: #FFF;
+}
+
+#fancybox-title-right {
+ padding-left: 15px;
+ background-image: url('fancybox.png');
+ background-position: -55px -90px;
+ background-repeat: no-repeat;
+}
+
+#fancybox-left, #fancybox-right {
+ position: absolute;
+ bottom: 0px;
+ height: 100%;
+ width: 35%;
+ cursor: pointer;
+ outline: none;
+ background-image: url('blank.gif');
+ z-index: 1102;
+ display: none;
+}
+
+#fancybox-left {
+ left: 0px;
+}
+
+#fancybox-right {
+ right: 0px;
+}
+
+#fancybox-left-ico, #fancybox-right-ico {
+ position: absolute;
+ top: 50%;
+ left: -9999px;
+ width: 30px;
+ height: 30px;
+ margin-top: -15px;
+ cursor: pointer;
+ z-index: 1102;
+ display: block;
+}
+
+#fancybox-left-ico {
+ background-image: url('fancybox.png');
+ background-position: -40px -30px;
+}
+
+#fancybox-right-ico {
+ background-image: url('fancybox.png');
+ background-position: -40px -60px;
+}
+
+#fancybox-left:hover, #fancybox-right:hover {
+ visibility: visible; /* IE6 */
+}
+
+#fancybox-left:hover span {
+ left: 20px;
+}
+
+#fancybox-right:hover span {
+ left: auto;
+ right: 20px;
+}
+
+.fancy-bg {
+ position: absolute;
+ padding: 0;
+ margin: 0;
+ border: 0;
+ width: 20px;
+ height: 20px;
+ z-index: 1001;
+}
+
+#fancy-bg-n {
+ top: -20px;
+ left: 0;
+ width: 100%;
+ background-image: url('fancybox-x.png');
+}
+
+#fancy-bg-ne {
+ top: -20px;
+ right: -20px;
+ background-image: url('fancybox.png');
+ background-position: -40px -162px;
+}
+
+#fancy-bg-e {
+ top: 0;
+ right: -20px;
+ height: 100%;
+ background-image: url('fancybox-y.png');
+ background-position: -20px 0px;
+}
+
+#fancy-bg-se {
+ bottom: -20px;
+ right: -20px;
+ background-image: url('fancybox.png');
+ background-position: -40px -182px;
+}
+
+#fancy-bg-s {
+ bottom: -20px;
+ left: 0;
+ width: 100%;
+ background-image: url('fancybox-x.png');
+ background-position: 0px -20px;
+}
+
+#fancy-bg-sw {
+ bottom: -20px;
+ left: -20px;
+ background-image: url('fancybox.png');
+ background-position: -40px -142px;
+}
+
+#fancy-bg-w {
+ top: 0;
+ left: -20px;
+ height: 100%;
+ background-image: url('fancybox-y.png');
+}
+
+#fancy-bg-nw {
+ top: -20px;
+ left: -20px;
+ background-image: url('fancybox.png');
+ background-position: -40px -122px;
+}
+
+/* IE */
+
+#fancybox-loading.fancybox-ie div { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_loading.png', sizingMethod='scale'); }
+.fancybox-ie #fancybox-close { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_close.png', sizingMethod='scale'); }
+
+.fancybox-ie #fancybox-title-over { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_over.png', sizingMethod='scale'); zoom: 1; }
+.fancybox-ie #fancybox-title-left { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_left.png', sizingMethod='scale'); }
+.fancybox-ie #fancybox-title-main { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_main.png', sizingMethod='scale'); }
+.fancybox-ie #fancybox-title-right { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_right.png', sizingMethod='scale'); }
+
+.fancybox-ie #fancybox-left-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_left.png', sizingMethod='scale'); }
+.fancybox-ie #fancybox-right-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_right.png', sizingMethod='scale'); }
+
+.fancybox-ie .fancy-bg { background: transparent !important; }
+
+.fancybox-ie #fancy-bg-n { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_n.png', sizingMethod='scale'); }
+.fancybox-ie #fancy-bg-ne { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_ne.png', sizingMethod='scale'); }
+.fancybox-ie #fancy-bg-e { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_e.png', sizingMethod='scale'); }
+.fancybox-ie #fancy-bg-se { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_se.png', sizingMethod='scale'); }
+.fancybox-ie #fancy-bg-s { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_s.png', sizingMethod='scale'); }
+.fancybox-ie #fancy-bg-sw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_sw.png', sizingMethod='scale'); }
+.fancybox-ie #fancy-bg-w { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_w.png', sizingMethod='scale'); }
+.fancybox-ie #fancy-bg-nw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_nw.png', sizingMethod='scale'); }
diff --git a/plugins/picasa-albums/1.0.5/fancybox/jquery.fancybox.js b/plugins/picasa-albums/1.0.5/fancybox/jquery.fancybox.js
new file mode 100644
index 00000000..c36219b6
--- /dev/null
+++ b/plugins/picasa-albums/1.0.5/fancybox/jquery.fancybox.js
@@ -0,0 +1,44 @@
+/*
+ * FancyBox - jQuery Plugin
+ * Simple and fancy lightbox alternative
+ *
+ * Examples and documentation at: http://fancybox.net
+ *
+ * Copyright (c) 2008 - 2010 Janis Skarnelis
+ *
+ * Version: 1.3.1 (05/03/2010)
+ * Requires: jQuery v1.3+
+ *
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+ */
+
+(function(b){var m,u,x,g,D,i,z,A,B,p=0,e={},q=[],n=0,c={},j=[],E=null,s=new Image,G=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,S=/[^\.]\.(swf)\s*$/i,H,I=1,k,l,h=false,y=b.extend(b("<div/>")[0],{prop:0}),v=0,O=!b.support.opacity&&!window.XMLHttpRequest,J=function(){u.hide();s.onerror=s.onload=null;E&&E.abort();m.empty()},P=function(){b.fancybox('<p id="fancybox_error">The requested content cannot be loaded.<br />Please try again later.</p>',{scrolling:"no",padding:20,transitionIn:"none",transitionOut:"none"})},
+K=function(){return[b(window).width(),b(window).height(),b(document).scrollLeft(),b(document).scrollTop()]},T=function(){var a=K(),d={},f=c.margin,o=c.autoScale,t=(20+f)*2,w=(20+f)*2,r=c.padding*2;if(c.width.toString().indexOf("%")>-1){d.width=a[0]*parseFloat(c.width)/100-40;o=false}else d.width=c.width+r;if(c.height.toString().indexOf("%")>-1){d.height=a[1]*parseFloat(c.height)/100-40;o=false}else d.height=c.height+r;if(o&&(d.width>a[0]-t||d.height>a[1]-w))if(e.type=="image"||e.type=="swf"){t+=r;
+w+=r;o=Math.min(Math.min(a[0]-t,c.width)/c.width,Math.min(a[1]-w,c.height)/c.height);d.width=Math.round(o*(d.width-r))+r;d.height=Math.round(o*(d.height-r))+r}else{d.width=Math.min(d.width,a[0]-t);d.height=Math.min(d.height,a[1]-w)}d.top=a[3]+(a[1]-(d.height+40))*0.5;d.left=a[2]+(a[0]-(d.width+40))*0.5;if(c.autoScale===false){d.top=Math.max(a[3]+f,d.top);d.left=Math.max(a[2]+f,d.left)}return d},U=function(a){if(a&&a.length)switch(c.titlePosition){case "inside":return a;case "over":return'<span id="fancybox-title-over">'+
+a+"</span>";default:return'<span id="fancybox-title-wrap"><span id="fancybox-title-left"></span><span id="fancybox-title-main">'+a+'</span><span id="fancybox-title-right"></span></span>'}return false},V=function(){var a=c.title,d=l.width-c.padding*2,f="fancybox-title-"+c.titlePosition;b("#fancybox-title").remove();v=0;if(c.titleShow!==false){a=b.isFunction(c.titleFormat)?c.titleFormat(a,j,n,c):U(a);if(!(!a||a==="")){b('<div id="fancybox-title" class="'+f+'" />').css({width:d,paddingLeft:c.padding,
+paddingRight:c.padding}).html(a).appendTo("body");switch(c.titlePosition){case "inside":v=b("#fancybox-title").outerHeight(true)-c.padding;l.height+=v;break;case "over":b("#fancybox-title").css("bottom",c.padding);break;default:b("#fancybox-title").css("bottom",b("#fancybox-title").outerHeight(true)*-1);break}b("#fancybox-title").appendTo(D).hide()}}},W=function(){b(document).unbind("keydown.fb").bind("keydown.fb",function(a){if(a.keyCode==27&&c.enableEscapeButton){a.preventDefault();b.fancybox.close()}else if(a.keyCode==
+37){a.preventDefault();b.fancybox.prev()}else if(a.keyCode==39){a.preventDefault();b.fancybox.next()}});if(b.fn.mousewheel){g.unbind("mousewheel.fb");j.length>1&&g.bind("mousewheel.fb",function(a,d){a.preventDefault();h||d===0||(d>0?b.fancybox.prev():b.fancybox.next())})}if(c.showNavArrows){if(c.cyclic&&j.length>1||n!==0)A.show();if(c.cyclic&&j.length>1||n!=j.length-1)B.show()}},X=function(){var a,d;if(j.length-1>n){a=j[n+1].href;if(typeof a!=="undefined"&&a.match(G)){d=new Image;d.src=a}}if(n>0){a=
+j[n-1].href;if(typeof a!=="undefined"&&a.match(G)){d=new Image;d.src=a}}},L=function(){i.css("overflow",c.scrolling=="auto"?c.type=="image"||c.type=="iframe"||c.type=="swf"?"hidden":"auto":c.scrolling=="yes"?"auto":"visible");if(!b.support.opacity){i.get(0).style.removeAttribute("filter");g.get(0).style.removeAttribute("filter")}b("#fancybox-title").show();c.hideOnContentClick&&i.one("click",b.fancybox.close);c.hideOnOverlayClick&&x.one("click",b.fancybox.close);c.showCloseButton&&z.show();W();b(window).bind("resize.fb",
+b.fancybox.center);c.centerOnScroll?b(window).bind("scroll.fb",b.fancybox.center):b(window).unbind("scroll.fb");b.isFunction(c.onComplete)&&c.onComplete(j,n,c);h=false;X()},M=function(a){var d=Math.round(k.width+(l.width-k.width)*a),f=Math.round(k.height+(l.height-k.height)*a),o=Math.round(k.top+(l.top-k.top)*a),t=Math.round(k.left+(l.left-k.left)*a);g.css({width:d+"px",height:f+"px",top:o+"px",left:t+"px"});d=Math.max(d-c.padding*2,0);f=Math.max(f-(c.padding*2+v*a),0);i.css({width:d+"px",height:f+
+"px"});if(typeof l.opacity!=="undefined")g.css("opacity",a<0.5?0.5:a)},Y=function(a){var d=a.offset();d.top+=parseFloat(a.css("paddingTop"))||0;d.left+=parseFloat(a.css("paddingLeft"))||0;d.top+=parseFloat(a.css("border-top-width"))||0;d.left+=parseFloat(a.css("border-left-width"))||0;d.width=a.width();d.height=a.height();return d},Q=function(){var a=e.orig?b(e.orig):false,d={};if(a&&a.length){a=Y(a);d={width:a.width+c.padding*2,height:a.height+c.padding*2,top:a.top-c.padding-20,left:a.left-c.padding-
+20}}else{a=K();d={width:1,height:1,top:a[3]+a[1]*0.5,left:a[2]+a[0]*0.5}}return d},N=function(){u.hide();if(g.is(":visible")&&b.isFunction(c.onCleanup))if(c.onCleanup(j,n,c)===false){b.event.trigger("fancybox-cancel");h=false;return}j=q;n=p;c=e;i.get(0).scrollTop=0;i.get(0).scrollLeft=0;if(c.overlayShow){O&&b("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"});
+x.css({"background-color":c.overlayColor,opacity:c.overlayOpacity}).unbind().show()}l=T();V();if(g.is(":visible")){b(z.add(A).add(B)).hide();var a=g.position(),d;k={top:a.top,left:a.left,width:g.width(),height:g.height()};d=k.width==l.width&&k.height==l.height;i.fadeOut(c.changeFade,function(){var f=function(){i.html(m.contents()).fadeIn(c.changeFade,L)};b.event.trigger("fancybox-change");i.empty().css("overflow","hidden");if(d){i.css({top:c.padding,left:c.padding,width:Math.max(l.width-c.padding*
+2,1),height:Math.max(l.height-c.padding*2-v,1)});f()}else{i.css({top:c.padding,left:c.padding,width:Math.max(k.width-c.padding*2,1),height:Math.max(k.height-c.padding*2,1)});y.prop=0;b(y).animate({prop:1},{duration:c.changeSpeed,easing:c.easingChange,step:M,complete:f})}})}else{g.css("opacity",1);if(c.transitionIn=="elastic"){k=Q();i.css({top:c.padding,left:c.padding,width:Math.max(k.width-c.padding*2,1),height:Math.max(k.height-c.padding*2,1)}).html(m.contents());g.css(k).show();if(c.opacity)l.opacity=
+0;y.prop=0;b(y).animate({prop:1},{duration:c.speedIn,easing:c.easingIn,step:M,complete:L})}else{i.css({top:c.padding,left:c.padding,width:Math.max(l.width-c.padding*2,1),height:Math.max(l.height-c.padding*2-v,1)}).html(m.contents());g.css(l).fadeIn(c.transitionIn=="none"?0:c.speedIn,L)}}},F=function(){m.width(e.width);m.height(e.height);if(e.width=="auto")e.width=m.width();if(e.height=="auto")e.height=m.height();N()},Z=function(){h=true;e.width=s.width;e.height=s.height;b("<img />").attr({id:"fancybox-img",
+src:s.src,alt:e.title}).appendTo(m);N()},C=function(){J();var a=q[p],d,f,o,t,w;e=b.extend({},b.fn.fancybox.defaults,typeof b(a).data("fancybox")=="undefined"?e:b(a).data("fancybox"));o=a.title||b(a).title||e.title||"";if(a.nodeName&&!e.orig)e.orig=b(a).children("img:first").length?b(a).children("img:first"):b(a);if(o===""&&e.orig)o=e.orig.attr("alt");d=a.nodeName&&/^(?:javascript|#)/i.test(a.href)?e.href||null:e.href||a.href||null;if(e.type){f=e.type;if(!d)d=e.content}else if(e.content)f="html";else if(d)if(d.match(G))f=
+"image";else if(d.match(S))f="swf";else if(b(a).hasClass("iframe"))f="iframe";else if(d.match(/#/)){a=d.substr(d.indexOf("#"));f=b(a).length>0?"inline":"ajax"}else f="ajax";else f="inline";e.type=f;e.href=d;e.title=o;if(e.autoDimensions&&e.type!=="iframe"&&e.type!=="swf"){e.width="auto";e.height="auto"}if(e.modal){e.overlayShow=true;e.hideOnOverlayClick=false;e.hideOnContentClick=false;e.enableEscapeButton=false;e.showCloseButton=false}if(b.isFunction(e.onStart))if(e.onStart(q,p,e)===false){h=false;
+return}m.css("padding",20+e.padding+e.margin);b(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){b(this).replaceWith(i.children())});switch(f){case "html":m.html(e.content);F();break;case "inline":b('<div class="fancybox-inline-tmp" />').hide().insertBefore(b(a)).bind("fancybox-cleanup",function(){b(this).replaceWith(i.children())}).bind("fancybox-cancel",function(){b(this).replaceWith(m.children())});b(a).appendTo(m);F();break;case "image":h=false;b.fancybox.showActivity();
+s=new Image;s.onerror=function(){P()};s.onload=function(){s.onerror=null;s.onload=null;Z()};s.src=d;break;case "swf":t='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+e.width+'" height="'+e.height+'"><param name="movie" value="'+d+'"></param>';w="";b.each(e.swf,function(r,R){t+='<param name="'+r+'" value="'+R+'"></param>';w+=" "+r+'="'+R+'"'});t+='<embed src="'+d+'" type="application/x-shockwave-flash" width="'+e.width+'" height="'+e.height+'"'+w+"></embed></object>";m.html(t);
+F();break;case "ajax":a=d.split("#",2);f=e.ajax.data||{};if(a.length>1){d=a[0];if(typeof f=="string")f+="&selector="+a[1];else f.selector=a[1]}h=false;b.fancybox.showActivity();E=b.ajax(b.extend(e.ajax,{url:d,data:f,error:P,success:function(r){if(E.status==200){m.html(r);F()}}}));break;case "iframe":b('<iframe id="fancybox-frame" name="fancybox-frame'+(new Date).getTime()+'" frameborder="0" hspace="0" scrolling="'+e.scrolling+'" src="'+e.href+'"></iframe>').appendTo(m);N();break}},$=function(){if(u.is(":visible")){b("div",
+u).css("top",I*-40+"px");I=(I+1)%12}else clearInterval(H)},aa=function(){if(!b("#fancybox-wrap").length){b("body").append(m=b('<div id="fancybox-tmp"></div>'),u=b('<div id="fancybox-loading"><div></div></div>'),x=b('<div id="fancybox-overlay"></div>'),g=b('<div id="fancybox-wrap"></div>'));if(!b.support.opacity){g.addClass("fancybox-ie");u.addClass("fancybox-ie")}D=b('<div id="fancybox-outer"></div>').append('<div class="fancy-bg" id="fancy-bg-n"></div><div class="fancy-bg" id="fancy-bg-ne"></div><div class="fancy-bg" id="fancy-bg-e"></div><div class="fancy-bg" id="fancy-bg-se"></div><div class="fancy-bg" id="fancy-bg-s"></div><div class="fancy-bg" id="fancy-bg-sw"></div><div class="fancy-bg" id="fancy-bg-w"></div><div class="fancy-bg" id="fancy-bg-nw"></div>').appendTo(g);
+D.append(i=b('<div id="fancybox-inner"></div>'),z=b('<a id="fancybox-close"></a>'),A=b('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),B=b('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));z.click(b.fancybox.close);u.click(b.fancybox.cancel);A.click(function(a){a.preventDefault();b.fancybox.prev()});B.click(function(a){a.preventDefault();b.fancybox.next()});if(O){x.get(0).style.setExpression("height",
+"document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px'");u.get(0).style.setExpression("top","(-20 + (document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )) + 'px'");D.prepend('<iframe id="fancybox-hide-sel-frame" src="javascript:\'\';" scrolling="no" frameborder="0" ></iframe>')}}};
+b.fn.fancybox=function(a){b(this).data("fancybox",b.extend({},a,b.metadata?b(this).metadata():{})).unbind("click.fb").bind("click.fb",function(d){d.preventDefault();if(!h){h=true;b(this).blur();q=[];p=0;d=b(this).attr("rel")||"";if(!d||d==""||d==="nofollow")q.push(this);else{q=b("a[rel="+d+"], area[rel="+d+"]");p=q.index(this)}C();return false}});return this};b.fancybox=function(a,d){if(!h){h=true;d=typeof d!=="undefined"?d:{};q=[];p=d.index||0;if(b.isArray(a)){for(var f=0,o=a.length;f<o;f++)if(typeof a[f]==
+"object")b(a[f]).data("fancybox",b.extend({},d,a[f]));else a[f]=b({}).data("fancybox",b.extend({content:a[f]},d));q=jQuery.merge(q,a)}else{if(typeof a=="object")b(a).data("fancybox",b.extend({},d,a));else a=b({}).data("fancybox",b.extend({content:a},d));q.push(a)}if(p>q.length||p<0)p=0;C()}};b.fancybox.showActivity=function(){clearInterval(H);u.show();H=setInterval($,66)};b.fancybox.hideActivity=function(){u.hide()};b.fancybox.next=function(){return b.fancybox.pos(n+1)};b.fancybox.prev=function(){return b.fancybox.pos(n-
+1)};b.fancybox.pos=function(a){if(!h){a=parseInt(a,10);if(a>-1&&j.length>a){p=a;C()}if(c.cyclic&&j.length>1&&a<0){p=j.length-1;C()}if(c.cyclic&&j.length>1&&a>=j.length){p=0;C()}}};b.fancybox.cancel=function(){if(!h){h=true;b.event.trigger("fancybox-cancel");J();e&&b.isFunction(e.onCancel)&&e.onCancel(q,p,e);h=false}};b.fancybox.close=function(){function a(){x.fadeOut("fast");g.hide();b.event.trigger("fancybox-cleanup");i.empty();b.isFunction(c.onClosed)&&c.onClosed(j,n,c);j=e=[];n=p=0;c=e={};h=false}
+if(!(h||g.is(":hidden"))){h=true;if(c&&b.isFunction(c.onCleanup))if(c.onCleanup(j,n,c)===false){h=false;return}J();b(z.add(A).add(B)).hide();b("#fancybox-title").remove();g.add(i).add(x).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");i.css("overflow","hidden");if(c.transitionOut=="elastic"){k=Q();var d=g.position();l={top:d.top,left:d.left,width:g.width(),height:g.height()};if(c.opacity)l.opacity=1;y.prop=1;b(y).animate({prop:0},{duration:c.speedOut,easing:c.easingOut,
+step:M,complete:a})}else g.fadeOut(c.transitionOut=="none"?0:c.speedOut,a)}};b.fancybox.resize=function(){var a,d;if(!(h||g.is(":hidden"))){h=true;a=i.wrapInner("<div style='overflow:auto'></div>").children();d=a.height();g.css({height:d+c.padding*2+v});i.css({height:d});a.replaceWith(a.children());b.fancybox.center()}};b.fancybox.center=function(){h=true;var a=K(),d=c.margin,f={};f.top=a[3]+(a[1]-(g.height()-v+40))*0.5;f.left=a[2]+(a[0]-(g.width()+40))*0.5;f.top=Math.max(a[3]+d,f.top);f.left=Math.max(a[2]+
+d,f.left);g.css(f);h=false};b.fn.fancybox.defaults={padding:10,margin:20,opacity:false,modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.3,overlayColor:"#666",titleShow:true,titlePosition:"outside",titleFormat:null,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",
+easingIn:"swing",easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,onStart:null,onCancel:null,onComplete:null,onCleanup:null,onClosed:null};b(document).ready(function(){aa()})})(jQuery); \ No newline at end of file
diff --git a/plugins/picasa-albums/1.0.5/fancybox/jquery.mousewheel.js b/plugins/picasa-albums/1.0.5/fancybox/jquery.mousewheel.js
new file mode 100644
index 00000000..69d28707
--- /dev/null
+++ b/plugins/picasa-albums/1.0.5/fancybox/jquery.mousewheel.js
@@ -0,0 +1,13 @@
+/*! Copyright (c) 2009 Brandon Aaron (http://brandonaaron.net)
+ * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
+ * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
+ * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
+ * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
+ *
+ * Version: 3.0.2
+ *
+ * Requires: 1.2.2+
+ */
+
+(function(b){function d(a){var f=[].slice.call(arguments,1),e=0;a=b.event.fix(a||window.event);a.type="mousewheel";if(a.wheelDelta)e=a.wheelDelta/120;if(a.detail)e=-a.detail/3;f.unshift(a,e);return b.event.handle.apply(this,f)}var c=["DOMMouseScroll","mousewheel"];b.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=c.length;a;)this.addEventListener(c[--a],d,false);else this.onmousewheel=d},teardown:function(){if(this.removeEventListener)for(var a=c.length;a;)this.removeEventListener(c[--a],
+d,false);else this.onmousewheel=null}};b.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery); \ No newline at end of file
diff --git a/plugins/picasa-albums/1.0.5/images/image-sunset.png b/plugins/picasa-albums/1.0.5/images/image-sunset.png
new file mode 100644
index 00000000..612ffe3a
--- /dev/null
+++ b/plugins/picasa-albums/1.0.5/images/image-sunset.png
Binary files differ
diff --git a/plugins/picasa-albums/1.0.5/images/loading.gif b/plugins/picasa-albums/1.0.5/images/loading.gif
new file mode 100644
index 00000000..6bdc3b5e
--- /dev/null
+++ b/plugins/picasa-albums/1.0.5/images/loading.gif
Binary files differ
diff --git a/plugins/picasa-albums/1.0.5/images/lock-image.png b/plugins/picasa-albums/1.0.5/images/lock-image.png
new file mode 100644
index 00000000..b7032066
--- /dev/null
+++ b/plugins/picasa-albums/1.0.5/images/lock-image.png
Binary files differ
diff --git a/plugins/picasa-albums/1.0.5/images/next-horizontal.png b/plugins/picasa-albums/1.0.5/images/next-horizontal.png
new file mode 100644
index 00000000..36c6c847
--- /dev/null
+++ b/plugins/picasa-albums/1.0.5/images/next-horizontal.png
Binary files differ
diff --git a/plugins/picasa-albums/1.0.5/images/picasa_post_icon.png b/plugins/picasa-albums/1.0.5/images/picasa_post_icon.png
new file mode 100644
index 00000000..ab82d7c6
--- /dev/null
+++ b/plugins/picasa-albums/1.0.5/images/picasa_post_icon.png
Binary files differ
diff --git a/plugins/picasa-albums/1.0.5/images/prev-horizontal.png b/plugins/picasa-albums/1.0.5/images/prev-horizontal.png
new file mode 100644
index 00000000..d2359ce3
--- /dev/null
+++ b/plugins/picasa-albums/1.0.5/images/prev-horizontal.png
Binary files differ
diff --git a/plugins/picasa-albums/1.0.5/images/zoom_layer.png b/plugins/picasa-albums/1.0.5/images/zoom_layer.png
new file mode 100644
index 00000000..e36616dd
--- /dev/null
+++ b/plugins/picasa-albums/1.0.5/images/zoom_layer.png
Binary files differ
diff --git a/plugins/picasa-albums/1.0.5/plugin.php b/plugins/picasa-albums/1.0.5/plugin.php
new file mode 100644
index 00000000..72dcbe23
--- /dev/null
+++ b/plugins/picasa-albums/1.0.5/plugin.php
@@ -0,0 +1,809 @@
+<?php
+
+/*
+Plugin Name: Picasa Albums
+Plugin URI: http://mikhailkozlov.com/picasa-albums-for-wordpress/
+Description: Creates custom post type and displays picasa albums
+Version: 1.0.5
+Author: Mikhail Kozlov
+Author URI: http://mikhailkozlov.com
+License: GPLv3
+*/
+date_default_timezone_set('America/Los_Angeles');
+
+$picasaOption;
+$path = str_replace('\\','/',dirname(__FILE__)); // windows scramble
+require $path .'/scb/load.php';
+
+// init picasa class
+scb_init(array('wpPicasa','init'));
+
+class wpPicasa{
+ static $post_type='album';
+ static $options=array(
+ 'v'=>'1.0',
+ 'key'=>'picasaOptions_options',
+ 'username' => '',
+ 'album_thumbsize'=>160,
+ 'album_thumbcrop'=>'yes',
+ 'albums_display'=>'rows',
+ 'image_thumbsize'=>128, // 94, 110, 128, 200, 220, 288, 320, 400, 512, 576, 640, 720, 800, 912, 1024, 1152, 1280, 1440, 1600
+ 'image_thumbcrop'=>'yes', // true/false
+ 'image_maxsize'=>800, // lint to original
+ 'image_class'=>'picasa_image',
+ 'use_lightbox'=>true,
+ 'embed_image_thumbsize'=>128,
+ 'embed_image_maxsize'=>800
+
+ );
+ function init($options=array()) {
+ global $picasaOptions;
+ $options=self::$options;
+ $options = new scbOptions($options['key'], __FILE__,self::$options);
+ if ( is_admin() ) {
+ require_once dirname(__FILE__) . '/admin.php';
+ new picasaOptions_Options_Page(__FILE__, $options);
+ add_action( 'wp_ajax_picasa_ajax_import',array('wpPicasa','picasa_ajax_import') );
+ add_action( 'wp_ajax_picasa_ajax_reload_images',array('wpPicasa','picasa_ajax_reload_images') );
+ add_action( 'wp_ajax_picasa_ajax_image_action',array('wpPicasa','picasa_ajax_image_action') );
+ add_action('admin_menu', array('wpPicasa','add_custom_boxes'));
+ }
+ self::load_picasa_javascript();
+
+ }
+ function _activate(){
+ // set default option
+ add_option('picasaOptions_options', serialize (self::$options),'','yes');
+ }
+ function load_picasa_javascript(){
+ $path = basename(dirname(__FILE__));
+ if ( is_admin() ) {
+ wp_enqueue_script('json', '/wp-admin/load-scripts.php?c=1&load=json2', array('jquery'), '2', true);
+ wp_enqueue_script('picasa_albums_admin', plugins_url($path). '/admin/scripts.js', array('jquery'), '1.0', true);
+ wp_enqueue_style('picasa_albums_admin_css',plugins_url($path).'/admin/style.css');
+ wp_enqueue_style('fancybox_css',plugins_url($path).'/fancybox/jquery.fancybox.css');
+ wp_enqueue_script('fancybox', plugins_url($path) . '/fancybox/jquery.fancybox.js', array('jquery'), '1.3.1', true);
+
+ }else{
+ wp_enqueue_style('picasa_albums_css',plugins_url($path).'/style.css');
+ wp_enqueue_style('fancybox_css',plugins_url($path).'/fancybox/jquery.fancybox.css');
+ wp_enqueue_script('fancybox', plugins_url($path) . '/fancybox/jquery.fancybox.js', array('jquery'), '1.3.1', true);
+
+ wp_enqueue_script('picasa_albums', plugins_url($path) . '/scripts.js', array('jquery'), '1.1', true);
+ }
+ }
+
+ /**
+ * register custom post type
+ * @return unknown_type
+ */
+ function create_postType() {
+ $labels = array(
+ 'name' => _x('Albums', 'post type general name'),
+ 'singular_name' => _x('Album', 'post type singular name'),
+ 'add_new' => _x('Import Album', 'Album'),
+ 'add_new_item' => __('Import Album'),
+ 'edit_item' => __('Edit Album'),
+ 'new_item' => __('New Album'),
+ 'view_item' => __('View Album'),
+ 'search_items' => __('Search Albums'),
+ 'not_found' => __('No Albums found'),
+ 'not_found_in_trash' => __('No Albums found in Trash'),
+ 'parent_item_colon' => ''
+ );
+ $supports = array('title','author','comments');
+ $args = array(
+ 'rewrite' =>array('slug'=>'album'),
+ 'labels' => $labels,
+ 'public' => true,
+ 'show_ui' => true,
+ 'query_var' => true,
+ 'capability_type' => 'page',
+ 'hierarchical' => false,
+ 'publicly_queryable' => true,
+ 'menu_position'=>20,
+ 'supports' => $supports
+ );
+ register_post_type( 'album',$args);
+ register_taxonomy_for_object_type('album', 'album');
+
+ add_filter('the_content',array('wpPicasa','picasa_album_filter'));
+ // v 1.0.5
+ // some themes call the_exerpt();
+ add_filter('the_excerpt',array('wpPicasa','picasa_album_filter'));
+
+ }
+ function add_custom_boxes(){
+ if(isset($_GET['action'])){
+ add_meta_box( 'picasa-album','Album Details',array('wpPicasa','picasa_admin_album_view'),self::$post_type, 'normal', 'high');
+ add_meta_box( 'picasa-album-images','Album Images',array('wpPicasa','picasa_admin_album_images'),self::$post_type, 'normal', 'high');
+ add_meta_box( 'picasa-album-side','Maintenance Functions',array('wpPicasa','picasa_admin_album_import'),self::$post_type, 'side', 'low');
+ remove_meta_box( 'slugdiv' , self::$post_type , 'normal' );
+ }else{
+ remove_meta_box( 'commentstatusdiv' , self::$post_type , 'normal' );
+ remove_meta_box( 'authordiv' , self::$post_type , 'normal' );
+ remove_meta_box( 'submitdiv' , self::$post_type , 'side' );
+ remove_meta_box( 'slugdiv' , self::$post_type , 'normal' );
+
+
+ add_meta_box( 'picasa-album','Import',array('wpPicasa','picasa_admin_import_album_view'),self::$post_type, 'normal', 'high');
+ add_meta_box( 'picasa-album-side-promo','Picasa Album Pro',array('wpPicasa','picasa_admin_import_album_side'),self::$post_type, 'side', 'high');
+ }
+ }
+
+ function picasa_admin_album_import(){
+ global $post;
+ self::decode_content($post->post_excerpt);
+ echo '<div class="submitbox">
+ <p>Will reload all data and erase any changes the you made!</p>
+ ';
+ echo scbForms::input(array(
+ 'type' => 'button',
+ 'name' => 'import_album_images',
+ 'id' => 'import_album_images',
+ 'extra'=>'class="button" data="'.$post->post_excerpt['id'].'" authkey="'.$post->post_excerpt['authkey'].'"',
+ 'value' => 'Reload Images'
+ ));
+ /**
+ * need to add
+ echo scbForms::input(array(
+ 'type' => 'button',
+ 'name' => 'import_album',
+ 'id' => 'import_album',
+ 'extra'=>'class="button" style="float:right" ',
+ 'value' => 'Reload Details'
+ ));
+ */
+ echo '</div>';
+ }
+
+ /**
+ *
+ * @return unknown_type
+ */
+ function picasa_admin_import_album_view(){
+ global $post;
+ $options = get_option(self::$options['key']);
+ echo '<script type="text/javascript">';
+ echo 'jQuery("#titlediv").hide();';
+ echo '</script>';
+ echo '
+ <p>Please note: all new albums will be imported and marked as draft. All existing albums will remain untouched.</p>
+ <input type="text" id="username" size="50" value="'.$options['username'].'" name="username">
+ <input type="button" id="import_albums" class="button" value="Import" name="import_albums" /><span class="loader hide"><i>Loading... Do not reload this page!</i></span>
+ <p>
+ <a href="edit.php?post_type='.self::$post_type.'">View Albums</a>
+ </p>
+
+
+ ';
+ }
+ function picasa_admin_import_album_side(){
+ echo '
+ <p>Do you need more features?<br /> Check out <a target="blank" href="http://mikhailkozlov.com/picasa_albums_pro/">Picasa Albums Pro</a>.</p>
+ ';
+ }
+ /**
+ * box html
+ * @return unknown_type
+ */
+ function picasa_admin_album_view(){
+ global $post;
+ self::decode_content($post->post_excerpt);
+ if(is_array($post->post_excerpt)){
+ echo '<script>';
+ echo 'var album = '.json_encode($post->post_excerpt).';';
+ echo '</script>';
+
+ echo '<textarea id="excerpt" name="excerpt" style="display:none">'.json_encode($post->post_excerpt).'</textarea>';
+ echo '
+ <div class="inside">
+ <img id="cover_image" src="'.self::parseThumb($post->post_excerpt['thumbnail']['url']).'" alt="album cover" ';
+ echo (isset($options['album_thumbcrop']) && $options['album_thumbcrop'] == 'yes' && isset($post->post_excerpt['thumbnail'])) ? ' width="'.$post->post_excerpt['thumbnail']['height'].' height="'.$post->post_excerpt['thumbnail']['height'].'"':'';
+ echo 'style="float:left; margin-right:5px;"/>
+
+ <ul class="inside">
+ <li>Published: <strong>'.date('D F, jS Y',$post->post_excerpt['published']).'</strong></li>
+ <li>Last updated: <strong>'.date('D F, jS Y, H:i',$post->post_excerpt['updated']).'</strong></li>
+ <li>Original Title: <strong>'.utf8_decode($post->post_excerpt['title']).'</strong></li>
+ <li>Links: <a href="'.$post->post_excerpt['links']['text/html'].'" >Album on Picasa</a> | <a href="'.$post->post_excerpt['links']['application/atom+xml'].'" >Picasa RSS</a></li>
+ </il>
+ <div class="clear"></div>
+ <br />
+ <div>
+ <p><strong>Album Description:</strong></p>
+ <textarea class="attachmentlinks" id="album_summary" tabindex="6" name="album[summary]" cols="40" rows="1">'.$post->post_excerpt['summary'].'</textarea>
+ <p>You can provide your custom album description here.</p>
+ </div>
+ </div>
+ ';
+ }else{
+ echo 'Error! Album data is corrupted! Try to delete this album and <a href="options-general.php?page=picasa-albums">reload</a> it from Picasa again.';
+ }
+ }
+ /**
+ * displays edit page
+ * @return unknown_type
+ */
+ function picasa_admin_album_images(){
+ global $post;
+ $options = get_option(self::$options['key']);
+ self::decode_content($post->post_content);
+ echo '<script>';
+ echo 'var images = '.json_encode($post->post_content).';';
+ echo '</script>';
+ echo '<textarea id="content" name="content" style="display:none" class="albumpage">'.json_encode($post->post_content).'</textarea>';
+ echo '<div class="inside">';
+ if(count($post->post_content) > 0){
+ echo '<ul class="ui-sortable">';
+ foreach($post->post_content as $i=>$image){
+ echo '<li title="'.$image['summary'].'" id="order_'.$i.'"';
+ echo '><img width="110" height="110" src="'.$image['fullpath'].'s110-c/'.$image['file'].'" alt="'.$image['summary'].'" class="';
+ echo ($image['show'] == 'yes') ? '':'dimlight';
+ echo '"/>';
+ echo'<div>';
+ echo '<a href="#'.$image['fullpath'].'s'.$options['album_thumbsize'].'-c/'.$image['file'].'" id="'.$image['id'].'" title="Set as album cover" class="icon cover_image" ref="'.$options['album_thumbsize'].'"></a>';
+ echo '<a href="#hide" id="'.$image['id'].'" title="Show/Hide image from public gallery" class="icon hide_image ';
+ echo ($image['show'] == 'yes') ? 'visible" >':'" >'; //echo ($image['show'] == 'yes') ? 'visible" ><span>hide</span><span style="display:none">show</span>':'" ><span style="display:none">hide</span><span>show</span>';
+ echo '</a>';
+ echo '<a href="'.$image['fullpath'].'s800/'.$image['file'].'" class="icon view_image fancybox" rel="album" title="';
+ echo (!empty($image['summary'])) ? $image['summary']:$image['file'];
+ echo '" >zoom</a>';
+ echo'</div>';
+ echo '</li>';
+ }
+ echo '</ul>';
+ }else{
+ echo 'No images yet! <a href="#load_imges_now" id="load_imges_now">Get them now!</a> ';
+ print_r($post->post_content);
+ }
+ echo '
+ <div class="clear"></div>
+ </div>
+ <div class="clear"></div>';
+ }
+
+ /**
+ * AJAX import
+ * @return unknown_type
+ */
+ function picasa_ajax_import() {
+ global $wpdb;
+ $options = get_option(self::$options['key']);
+ set_time_limit(300);
+ echo 'doing ajax...';
+ // time to curl
+ $options['username'] = (isset($_GET['user'])) ? trim($_GET['user']):$options['username'];
+ $xml= new wpPicasaApi($options['username'],array('thumbsize'=>$options['album_thumbsize']));
+ $xml->getAlbums();
+ $xml->parseAlbumXml(true);
+ $q = 'SELECT ID, post_mime_type FROM '.$wpdb->posts.' WHERE post_type = \''.self::$post_type.'\' ';
+ foreach($wpdb->get_results($q, ARRAY_A) as $i=>$row){
+ $albums[$row['post_mime_type']] =$row['ID'];
+ }
+ foreach($xml->getData() as $aData){
+ if(isset($albums) && is_array($albums) && array_key_exists($aData['id'],$albums)){
+ // update existing album. images will not be updated
+ // v 1.0.5
+ // self::insertAlbums($aData,$albums[$aData['id']]);
+ // we used to update here, but people did not want this.
+ }else{
+ //new album. images will BE imported
+ $post_id = self::insertAlbums($aData,0);
+ if(intval($post_id) > 0){
+ // time to get images
+ $x= new wpPicasaApi($options['username']);
+ echo 'new album '.$aData['id'].' auth'.$aData['authkey'].' post id:'.$post_id.'<br />';
+ $x->getImages($aData['id'],$aData['authkey']);
+ $x->parseImageXml(true);
+ self::insertImagesToAlbum($x->getData(),$post_id);
+ }
+ }
+ }
+ exit;
+ }
+ /**
+ * loads images from api
+ * @return bool
+ */
+ function picasa_ajax_reload_images() {
+ global $wpdb;
+ if(isset($_GET['post_ID']) && isset($_GET['id'])){
+ $options = get_option(self::$options['key']);
+ // time to curl
+ $xml= new wpPicasaApi($options['username']);
+ $xml->getImages($_REQUEST['id'],$_REQUEST['authkey']);
+ $xml->parseImageXml(true);
+ self::insertImagesToAlbum($xml->getData(),$_GET['post_ID']);
+ echo '{"r":1,"m":"done!"}';
+ }else{
+ echo '{"r":0,"m":"please provide post and album id"}';
+ }
+ exit;
+ }
+ function picasa_ajax_image_action(){
+ global $wpdb;
+ switch ($_GET['todo']){
+ case 'saveAlbum':
+ if(isset($_REQUEST['post_ID']) && intval($_REQUEST['post_ID']) >0){
+ $aOrder = $_REQUEST['order'];
+ $aImages = false;
+ $q="SELECT post_excerpt, post_content FROM ".$wpdb->posts." WHERE ID=".intval($_REQUEST['post_ID']);
+ $row = $wpdb->get_row($q);
+ if(isset($row->post_content)){
+ self::decode_content($row->post_content);
+ $aImages = $row->post_content;
+ }
+ if($aImages!== false){
+ $aImages = self::sortArrayByArray($aImages,$aOrder,$_REQUEST['id']);
+ }
+ echo json_encode($aImages);
+ }else{
+ echo '{"r":0,"m":"please provide post and album id"}';
+ }
+ break;
+ case 'reloadDetails':
+
+ break;
+ }
+ exit;
+ }
+
+ // apply sort and show not show
+ function sortArrayByArray($array,$order,$ids){
+ $ordered = array();
+ foreach($order as $key=>$value) {
+ if(array_key_exists($value,$array)) {
+ if(array_key_exists($array[$value]['id'],$ids)){
+ $array[$value]['show'] = $ids[$array[$value]['id']];
+ }
+ $ordered[$key] = $array[$value];
+ unset($array[$value]);
+ }
+ }
+ return $ordered + $array;
+ }
+ function insertAlbums($data,$id=0){
+ global $current_user;
+ get_currentuserinfo();
+ $post = array(
+ 'post_status' => 'draft',
+ 'post_type' => 'album',
+ 'post_title' => $data['title'],
+ 'post_name' => $data['name'],
+ 'post_mime_type'=>$data['id'],
+ 'post_date_gmt' => date('Y-m-d H:i:s',$data['published']),
+ 'post_modified_gmt' => date('Y-m-d H:i:s',$data['updated']),
+ 'post_author' => $current_user->ID,
+ 'post_excerpt' => json_encode($data)
+ );
+ if(intval($id) > 0){
+ $post['ID'] = $id;
+ wp_update_post($post);
+ return $id;
+ }
+ $date = new DateTime(date('Y-m-d H:i:s',$data['published']),new DateTimeZone('Europe/London'));
+ $date->setTimezone(new DateTimeZone(date('e')));
+ $post['post_date'] = $date->format('Y-m-d H:i:s');
+ $date = new DateTime(date('Y-m-d H:i:s',$data['updated']),new DateTimeZone('Europe/London'));
+ $date->setTimezone(new DateTimeZone(date('e')));
+ $post['post_modified'] = $date->format('Y-m-d H:i:s');
+ $id=wp_insert_post($post);
+ return $id;
+ }
+ function insertImagesToAlbum($data,$id=0){
+ global $current_user;
+ get_currentuserinfo();
+ $post = array(
+ 'post_content' => json_encode($data)
+ );
+ if(intval($id) > 0){
+ $post['ID'] = $id;
+ $id=wp_update_post($post);
+ }
+ return $id;
+ }
+ // Adding a new rule
+ function wp_insertPicasaRules($rules){
+ $newrules = array();
+ $newrules['(album)/(\d*)$'] = 'index.php?post_type=$matches[1]&post_name=$matches[2]';
+ // issie #2 fix
+ $newrules['(album)/page/?([0-9]{1,})/?$'] = 'index.php?post_type=$matches[1]&paged=$matches[2]';
+ $newrules['(album)$'] = 'index.php?post_type=$matches[1]';
+ return $newrules + $rules;
+ }
+
+ // Adding the id var so that WP recognizes it
+ function wp_insertPicasaQueryVars($vars){
+ array_push($vars, 'post_name');
+ return $vars;
+ }
+ /**
+ *
+ *
+ *
+ * @param $content
+ * @return html
+ */
+ function picasa_album_filter($content){
+ global $post;
+ $options=self::$options;
+ $options = array_merge($options,get_option($options['key']));
+ if(get_post_type() == self::$post_type){
+ if(is_single()){
+ self::decode_content($post->post_content);
+ $res = '';
+ if(!empty($post->post_content) && is_array($post->post_content)){
+ foreach($post->post_content as $i=>$aImage){
+ if($aImage['show'] == 'yes'){
+ $res .= '
+ <div style="width: '.($options['image_thumbsize']+10).'px;" class="wp-caption alignleft '.$options['image_class'].'">
+ <a href="'.$aImage['fullpath'].'s'.$options['image_maxsize'].'/'.$aImage['file'].'" rel="'.$post->post_name.' nofollow" class="fancybox" title="';
+ $res.=(!empty($aImage['summary'])) ? $aImage['summary']:$aImage['file'];
+ $res.='">
+ <img src="'.$aImage['fullpath'].'s'.intval($options['image_thumbsize']);
+ $res.=($options['image_thumbcrop'] == 'yes') ? '-c':'';
+ $res.='/'.$aImage['file'].'"';
+ $res .= ($options['image_thumbcrop'] == 'yes' && isset($aImage['thumbnail']) ) ? ' width="'.$aImage['thumbnail']['height'].'" height="'.$aImage['thumbnail']['height'].'" ':' ';
+ $res.=' class="size-medium" alt="" />
+ </a>
+ <p class="wp-caption-text" style="display:none">';
+ $res.=(!empty($aImage['summary'])) ? $aImage['summary']:$aImage['file'];
+ $res.='</p>
+ </div>
+ ';
+ }
+ }
+ }else{
+ $res = 'Error. Please comeback soon.';
+ }
+ return $res;
+ }else{
+ self::decode_content(&$post->post_excerpt);
+ $res = '
+ <div>
+ <div style="" class="wp-caption alignleft">
+ <a href="'.get_permalink().'">
+ <img class="size-medium" title="'.$post->post_excerpt['title'].'" src="'.self::parseThumb($post->post_excerpt['thumbnail']['url']).'" alt=""';
+ $res .= ($options['album_thumbcrop'] == 'yes') ? ' width="'.$post->post_excerpt['thumbnail']['height'].' height="'.$post->post_excerpt['thumbnail']['height'].'" ':' ';
+ // <img height="'.$post->post_excerpt['thumbnail']['height'].'" width="'.$post->post_excerpt['thumbnail']['width'].'" class="size-medium" title="'.$post->post_excerpt['title'].'" alt="" src="'.$post->post_excerpt['thumbnail']['url'].'" />
+ $res .= ' /></a>
+ <p class="wp-caption-text" style="display:none">'.$post->post_excerpt['title'].'</p>
+ </div>
+ '.$post->post_excerpt['summary'].'
+ <div style="clear:both"></div>
+ </div>
+ ';
+ return $res;
+ }
+ }else{
+ return $content;
+ }
+ }
+
+ function decode_content(&$c){
+ if(!is_array($c)){
+ $c = json_decode(htmlspecialchars_decode(stripcslashes($c)),true);
+ }
+ }
+ function parseThumb($path){
+ $options=self::$options;
+ $options = array_merge($options,get_option($options['key']));
+ $path = explode('/',$path);
+ $size= (count($path)-2);
+ $path[$size] ='s'.$options['album_thumbsize'];
+ $path[$size] .= ($options['album_thumbcrop'] == 'yes')? '-c':'';
+ return implode('/',$path);
+ }
+ /**
+ * deactivation hook
+ */
+ function picasa_albums_cleanup(){
+ global $wpdb;
+ // remove posts
+ $q='DELETE FROM '.$wpdb->posts.' WHERE post_type=\''.self::$post_type.'\'';
+ $wpdb->query($q);
+ // remove settings
+ delete_option(self::$options['key']);
+ }
+}
+//register_activation_hook( __FILE__, array('wpPicasa','_activate') );
+
+//add_action('init', array('wpPicasa','init'));
+
+
+class wpPicasaApi{
+ private $xml;
+ private $data;
+ private $user;
+
+ private $params=array(
+ 'thumbsize'=>160
+ );
+
+ function __construct($user,$params=array()){
+ $this->user = $user;
+ $this->_setParams($params);
+ }
+ function __get($key){
+ return (!isset($this->$key)) ? $this->$key:null;
+ }
+ function getData(){
+ return $this->data;
+ }
+
+
+
+ /** UTILS **/
+ // set addtional params
+ private function _setParams($params=array()){
+ if(is_array($params)){
+ foreach($this->params as $k=>$v){
+ if(array_key_exists($k,$params)){
+ $this->params[$k]=$params[$k];
+ }
+ }
+ }
+ }
+
+ private function _postTo($url, $data=array(), $header=array()) {
+
+ //check that the url is provided
+ if (!isset($url)) {
+ return false;
+ }
+
+ //send the data by curl
+ $ch = curl_init();
+ curl_setopt($ch, CURLOPT_URL, $url);
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
+ if (count($data)>0) {
+ //POST METHOD
+ curl_setopt($ch, CURLOPT_POST, TRUE);
+ curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
+ } else {
+ $header[] = array("application/x-www-form-urlencoded");
+ curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
+ }
+
+ $response = curl_exec($ch);
+ $info = curl_getinfo($ch);
+ curl_close($ch);
+
+ //print_r($info);
+ //print $response;
+ if($info['http_code'] == 200) {
+ return $response;
+ } elseif ($info['http_code'] == 400) {
+ throw new Exception('Bad request - '.$response);
+ } elseif ($info['http_code'] == 401) {
+ throw new Exception('Permission Denied - '.$response);
+ } else {
+ return false;
+ }
+ }
+ private function _getXml($url, $header=array()) {
+ //check that the url is provided
+ if (!isset($url)) {
+ return false;
+ }
+ //send the data by curl
+ $ch = curl_init();
+ curl_setopt($ch, CURLOPT_URL, $url);
+ curl_setopt($ch, CURLOPT_HEADER, 0);
+ curl_setopt($ch, CURLOPT_POST,0); // do not use POST to get xml feeds. GET only!!!
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+ curl_setopt($ch, CURLOPT_HTTPHEADER, $header); //array('Content-type: application/atom+xml','Content-Length: 2000')
+ curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
+ curl_setopt($ch, CURLOPT_VERBOSE, 1);
+ $response = curl_exec($ch);
+ if(intval(curl_errno($ch)) == 0){
+ $this->xml = $response;
+ }else{
+ $this->xml=null;
+ $this->error = curl_error($ch);
+ }
+ $info = curl_getinfo($ch);
+ curl_close($ch);
+
+ //print_r($info);
+ //print $response;
+ if($info['http_code'] == 200) {
+ return true;
+ } elseif ($info['http_code'] == 400) {
+ throw new Exception('Bad request - '.$response .' URL: '.$url);
+ return false;
+ } elseif ($info['http_code'] == 401) {
+ throw new Exception('Permission Denied - '.$response);
+ return false;
+ } else {
+ return false;
+ }
+ return false;
+ }
+
+
+
+ /****** Public getters ********/
+ function getAlbums(){
+ $header = array(
+ "MIME-Version: 1.0",
+ "Content-type: text/html",
+ "Content-transfer-encoding: text"
+ );
+ $url='http://picasaweb.google.com/data/feed/api/user/'.$this->user.'?kind=album&thumbsize='.$this->params['thumbsize'].'c';
+ $url.='&access=public';
+ return $this->_getXml($url,$header);
+ }
+ function getImages($aid,$authkey=null){
+ $header = array(
+ "MIME-Version: 1.0",
+ "Content-type: text/html",
+ "Content-transfer-encoding: text"
+ );
+ //http://picasaweb.google.com/data/feed/api/user/userID/albumid/albumID
+ $url='http://picasaweb.google.com/data/feed/api/user/'.$this->user.'/albumid/'.$aid.'?kind=photo';
+ // may be we need to pass key here
+ $ch = curl_init($url);
+ return $this->_getXml($url,$header);
+ }
+
+
+ /****** parse XML ********/
+ function parseAlbumXml($killxml=false){
+ $xml = new SimpleXMLElement($this->xml);
+ $xml->registerXPathNamespace('media', 'http://search.yahoo.com/mrss/'); // define namespace media
+ $xml->registerXPathNamespace('gphoto', 'http://schemas.google.com/photos/2007'); // define namespace media
+ $xml->registerXPathNamespace('georss', 'http://www.georss.org/georss'); // define namespace media
+ $xml->registerXPathNamespace('gml', 'http://www.opengis.net/gml'); // define namespace media
+
+ #print_r($xml);
+ if(count($xml->entry) > 0){
+ foreach($xml->entry as $i=>$oAlbum){
+ $aAlbum = array(
+ 'author'=>array(
+ 'name'=>(string)$oAlbum->author->name, // Mikhail Kozlov
+ 'uri'=>(string)$oAlbum->author->uri //http://picasaweb.google.com/kozlov.m.a
+ ), // will keep this on record in case we decide to go with more than one album
+ 'id'=> (Array)$oAlbum->xpath('./gphoto:id'), //5516889074505060529
+ 'name'=>'',//20100902RussiaOddThings
+ 'authkey'=>'',
+ 'published'=>strtotime($oAlbum->published), // strtotime(2010-09-11T04:58:08.000Z);
+ 'updated'=>strtotime($oAlbum->updated),// // strtotime(2010-09-11T04:58:08.000Z);
+ 'title' => (string)$oAlbum->title,//2010-09-02 - Russia - Odd Things
+ 'thumbnail' => (Array)$oAlbum->xpath('./media:group/media:thumbnail'), //
+ 'latlong' => '', //
+ 'summary' =>addslashes((string) $oAlbum->summary), //Some things in Russia make you wonder
+ 'rights' => (string)$oAlbum->rights, //public
+ 'links' => array(
+ 'text/html'=>'', //http://picasaweb.google.com/kozlov.m.a/20100902RussiaOddThings
+ 'application/atom+xml'=>'' //http://picasaweb.google.com/data/feed/api/user/kozlov.m.a/albumid/5516889074505060529
+ )
+ );
+ foreach($oAlbum->link as $oLink){
+ $a = (Array)$oLink->attributes();
+ $a = $a['@attributes'];
+ if($a['rel'] == 'alternate' || $a['rel'] == 'self'){
+ $aAlbum['links'][$a['type']] = $a['href'];
+ }
+ }
+ unset($oLink);
+ $aAlbum['thumbnail'] = (Array)$aAlbum['thumbnail'][0];
+ $aAlbum['thumbnail'] = $aAlbum['thumbnail']['@attributes'];
+ $aAlbum['latlong'] = ( $oAlbum->xpath('./georss:where') !== false && $oAlbum->xpath('./georss:where/gml:Point') !== false ) ? (Array)$oAlbum->xpath('./georss:where/gml:Point/gml:pos'):array(); //
+ $aAlbum['latlong'] = (isset($aAlbum['latlong'][0])) ? explode(' ',(string)$aAlbum['latlong'][0]):array();
+ $aAlbum['latlong'] = (count($aAlbum['latlong']) == 1) ? false:$aAlbum['latlong'];
+ $aAlbum['id'] = (string)$aAlbum['id'][0];
+ $url = parse_url($aAlbum['links']['text/html']);
+ $tmp = explode('/',$url['path']);
+ $aAlbum['name']=end($tmp);
+ // if we use auth set authkey
+ if(!empty($this->_authCode)){
+ parse_str($url['query'], $url['query']);
+ $aAlbum['authkey']=$url['query']['authkey'];
+ }
+ unset($tmp);
+ $this->data[$aAlbum['name']]=$aAlbum;
+ unset($aAlbum);
+ }
+ unset($oAlbum);
+ }
+ unset($xml);
+ if($killxml){
+ unset($this->xml);
+ }
+ }
+
+ function parseImageXml($killxml=false){
+ $xml = new SimpleXMLElement($this->xml);
+ $xml->registerXPathNamespace('media', 'http://search.yahoo.com/mrss/'); // define namespace media
+ $xml->registerXPathNamespace('gphoto', 'http://schemas.google.com/photos/2007'); // define namespace media
+ $xml->registerXPathNamespace('georss', 'http://www.georss.org/georss'); // define namespace media
+ $xml->registerXPathNamespace('gml', 'http://www.opengis.net/gml'); // define namespace media
+ $xml->registerXPathNamespace('exif', 'http://schemas.google.com/photos/exif/2007'); // define namespace media
+ if(count($xml->entry) > 0){
+ $c=0;
+ foreach($xml->entry as $i=>$oImage){
+ $c++;
+ $aImage = array(
+ 'id'=> (Array)$oImage->xpath('./gphoto:id'), //5516889074505060529
+ 'published'=>strtotime($oImage->published), // strtotime(2010-09-11T04:58:08.000Z);
+ 'updated'=>strtotime($oImage->updated),// // strtotime(2010-09-11T04:58:08.000Z);
+ 'file' =>(string)$oImage->title,//2010-09-02 - Russia - Odd Things
+ 'fullpath' =>$oImage->content,//2010-09-02 - Russia - Odd Things
+ 'width'=>(Array)$oImage->xpath('./gphoto:width'), // width of the original in px
+ 'height'=>(Array)$oImage->xpath('./gphoto:height'), // height of the original in px
+ 'size'=>(Array)$oImage->xpath('./gphoto:size'), // file size of the original in kb
+ 'latlong' => '', //
+ 'thumbnail' => (Array)$oImage->xpath('./media:group/media:thumbnail'), //
+ 'summary' =>addslashes((string) $oImage->summary), //Some things in Russia make you wonder
+ 'rights' => (Array)$oImage->xpath('./gphoto:access'), //public
+ 'pos'=>$c,
+ 'show'=>'yes',
+ 'links' => array(
+ 'text/html'=>'', //http://picasaweb.google.com/kozlov.m.a/20100902RussiaOddThings
+ 'application/atom+xml'=>'' //http://picasaweb.google.com/data/feed/api/user/kozlov.m.a/albumid/5516889074505060529
+ )
+ );
+
+ foreach($oImage->link as $oLink){
+ $a = (Array)$oLink->attributes();
+ $a = $a['@attributes'];
+ if($a['rel'] == 'alternate' || $a['rel'] == 'self'){
+ $aImage['links'][$a['type']] = $a['href'];
+ }
+ }
+ unset($oLink);
+ $aImage['thumbnail'] = (Array)$aImage['thumbnail'][0];
+ $aImage['thumbnail'] = $aImage['thumbnail']['@attributes'];
+ // some trickery to get image path
+ $aImage['fullpath'] = (Array)$aImage['fullpath'];
+ $aImage['fullpath'] =str_replace($aImage['file'],'',$aImage['fullpath']['@attributes']['src']);
+ // flatten id
+ $aImage['id'] = (string)$aImage['id'][0];
+
+ // private albums do not seem to have georss.
+ $ns = $xml->getDocNamespaces();
+ if(array_key_exists('georss',$ns)){
+ // lat long as array
+ $aImage['latlong'] = (Array)$oImage->xpath('./georss:where/gml:Point/gml:pos');
+ $aImage['latlong'] = (isset($aImage['latlong']) && isset($aImage['latlong'][0])) ? explode(' ',(string)$aImage['latlong'][0]):array();
+ $aImage['latlong'] = (count($aImage['latlong']) == 1) ? false:$aImage['latlong'];
+ }
+ // flatten right, size, width, height
+ $aImage['size'] = (string)$aImage['size'][0];
+ $aImage['rights'] = (string)$aImage['rights'][0];
+ $aImage['height'] = (string)$aImage['height'][0];
+ $aImage['width'] = (string)$aImage['width'][0];
+ unset($tmp);
+ $this->data[]=$aImage;
+ unset($aImage);
+ }
+ unset($oImage);
+ }
+ unset($xml);
+ if($killxml){
+ unset($this->xml);
+ }
+ }
+}
+
+// new post type has to added at init. else rewrite does not work
+add_action('init',array('wpPicasa','create_postType'));
+
+add_filter('rewrite_rules_array',array('wpPicasa','wp_insertPicasaRules'));
+add_filter('query_vars',array('wpPicasa','wp_insertPicasaQueryVars'));
+add_filter('init','flushRules');
+
+if(!function_exists('flushRules')){
+ // Remember to flush_rules() when adding rules
+ function flushRules(){
+ global $wp_rewrite;
+ $wp_rewrite->flush_rules();
+ }
+}
+
+register_deactivation_hook( __FILE__, array('wpPicasa','picasa_albums_cleanup'));
+?> \ No newline at end of file
diff --git a/plugins/picasa-albums/1.0.5/readme.txt b/plugins/picasa-albums/1.0.5/readme.txt
new file mode 100644
index 00000000..f2c6e257
--- /dev/null
+++ b/plugins/picasa-albums/1.0.5/readme.txt
@@ -0,0 +1,70 @@
+=== Picasa Albums ===
+Contributors: MikhaikKozlov
+Donate link: http://mikhailkozlov.com/
+Tags: picasaweb, image hosting, picasa, albums, custom post type, CND, fancybox
+Requires at least: 3.0.0
+Tested up to: 3.3
+Stable tag: trunk
+
+Picasa Albums For WordPress helps to easily import, display and manage your public Picasa Web Albums right in your WordPress site.
+
+== Description ==
+
+Picasa Albums For WordPress gives you full control over how you Picasa Albums displayed in your blog by adding custom post type "Albums" to your WP 3.0. Once Picasa Albums imported, you can rearrange images, hide images and/or change album cover image. Users can add specific album description and control which albums to display on the site. Picasa Albums Settings page allows to set thumbnail size, max image size and cropping options for your images.
+
+If you looking to ease the load on your PHP server by serving static content (images) from CDN or simply short on space on your hosting, Picasa Album is great solutions for you. All images are stored on Google's servers and served to users directly. Picasa Albums does not store any images on your server.
+
+Picasa Albums allows you to import images from any number of Picasa accounts, so you can combine all of your family's pictures in one place.
+
+Once installed you control:
+
+ * Which albums to show.
+ * Album's title, url, description, thumbnail and thumbnail size
+ * Which images in the albums to show, images order, thumbnail size and maximum images size
+ * If own multiple Picasa accounts, you can import from all of them
+
+Limitations:
+
+ * WordPress 3 and newer
+ * PHP 5 with CURL enabled (most web hosters have it)
+ * mod_rewrite is required and you must use permalink.
+
+This plugin includes Fancybox and uses it to display enlarged images.
+
+Visit my blog for more great ideas on how you can take advantage of Google's free with Picasa Albums.
+
+Report issues https://github.com/315design/Picasa-Albums-For-WordPress/issues
+
+
+== Installation ==
+1. Register @ http://picasaweb.google.com/ and get your Picasa Web Albums ID (it is free, usually is the same as your Google ID).
+2. Get files from this repo and put them into "picasa-albums" folder (actually any folder will work).
+3. Go to Plugins section of your WordPress and activate plugin "Picasa Albums" plugin.
+4. Head over to "Picasa Albums" page in "Settings" section of the admin menu.
+5. Enter you Picasa Web Albums ID and click import.
+6. Head over to "Albums" section and publish albums that you like.
+7. Make sure that permalinks are enabled.
+8. Add link to Albums category to your main menu. You can use Menus section to add custom link "http://my_website.com/album/" or you can hard code it to your site.
+9. Done.
+
+
+== Licence ==
+
+This plugin is distributed under GPL. You can and you should:
+
+ * use the software for any purpose,
+ * change the software to suit your needs,
+ * share the software with your friends and neighbors, and
+ * share the changes you make (please do).
+
+== Change Log ==
+
+v. 1.0.4
+
+ * /admin/scripts.js - relative path for ajax requests per issue #5 in github. Thanks stephanvierkant.
+ * /plugin.php - simpleXml warning path not found possible fix. Thanks stephanvierkant.
+
+v. 1.0.5
+
+ * removed album update. now albums only imported. all updates are done manually. Closes #7
+ * added the_excerpt() filter for better compatibility with custom themes \ No newline at end of file
diff --git a/plugins/picasa-albums/1.0.5/scb/AdminPage.php b/plugins/picasa-albums/1.0.5/scb/AdminPage.php
new file mode 100644
index 00000000..cfa8bfc9
--- /dev/null
+++ b/plugins/picasa-albums/1.0.5/scb/AdminPage.php
@@ -0,0 +1,460 @@
+<?php
+
+/*
+Creates an admin page
+
+You must set $this->args and define the page_content() method
+*/
+
+abstract class scbAdminPage {
+ /** Page args
+ * $toplevel string If not empty, will create a new top level menu
+ * $icon string Path to an icon for the top level menu
+ * $parent string ( default: options-general.php )
+ * $capability string ( default: 'manage_options' )
+ * $page_title string ( mandatory )
+ * $menu_title string ( default: $page_title )
+ * $page_slug string ( default: sanitized $page_title )
+ * $nonce string ( default: $page_slug )
+ * $action_link string|bool Text of the action link on the Plugins page ( default: 'Settings' )
+ */
+ protected $args;
+
+ // URL to the current plugin directory.
+ // Useful for adding css and js files
+ protected $plugin_url;
+
+ // Created at page init
+ protected $pagehook;
+
+ // scbOptions object holder
+ // Normally, it's used for storing formdata
+ protected $options;
+ protected $option_name;
+
+ // l10n
+ protected $textdomain;
+
+
+// ____________REGISTRATION COMPONENT____________
+
+
+ private static $registered = array();
+
+ static function register( $class, $file, $options = null ) {
+ if ( isset( self::$registered[$class] ) )
+ return false;
+
+ self::$registered[$class] = array( $file, $options );
+
+ add_action( '_admin_menu', array( __CLASS__, '_pages_init' ) );
+
+ return true;
+ }
+
+ static function replace( $old_class, $new_class ) {
+ if ( ! isset( self::$registered[$old_class] ) )
+ return false;
+
+ self::$registered[$new_class] = self::$registered[$old_class];
+ unset( self::$registered[$old_class] );
+
+ return true;
+ }
+
+ static function remove( $class ) {
+ if ( ! isset( self::$registered[$class] ) )
+ return false;
+
+ unset( self::$registered[$class] );
+
+ return true;
+ }
+
+ static function _pages_init() {
+ foreach ( self::$registered as $class => $args )
+ new $class( $args[0], $args[1] );
+ }
+
+
+// ____________MAIN METHODS____________
+
+
+ // Constructor
+ function __construct( $file, $options = NULL ) {
+ if ( is_a( $options, 'scbOptions' ) )
+ $this->options = $options;
+
+ $this->file = $file;
+ $this->plugin_url = plugin_dir_url( $file );
+
+ $this->setup();
+ $this->check_args();
+
+ if ( isset( $this->option_name ) ) {
+ add_action( 'admin_init', array( $this, 'option_init' ) );
+ if ( function_exists( 'settings_errors' ) )
+ add_action( 'admin_notices', 'settings_errors' );
+ }
+
+ add_action( 'admin_menu', array( $this, 'page_init' ) );
+ add_filter( 'contextual_help', array( $this, '_contextual_help' ), 10, 2 );
+
+ if ( $this->args['action_link'] )
+ add_filter( 'plugin_action_links_' . plugin_basename( $file ), array( $this, '_action_link' ) );
+ }
+
+ // This is where all the page args can be set
+ function setup(){}
+
+ // This is where the css and js go
+ // Both wp_enqueue_*() and inline code can be added
+ function page_head(){}
+
+ // This is where the contextual help goes
+ // @return string
+ function page_help(){}
+
+ // A generic page header
+ function page_header() {
+ echo "<div class='wrap'>\n";
+ screen_icon();
+ echo "<h2>" . $this->args['page_title'] . "</h2>\n";
+ }
+
+ // This is where the page content goes
+ abstract function page_content();
+
+ // A generic page footer
+ function page_footer() {
+ echo "</div>\n";
+ }
+
+ // This is where the form data should be validated
+ function validate( $new_data, $old_data ) {
+ return $new_data;
+ }
+
+ // Manually handle option saving ( use Settings API instead )
+ function form_handler() {
+ if ( empty( $_POST['action'] ) )
+ return false;
+
+ check_admin_referer( $this->nonce );
+
+ if ( !isset($this->options) ) {
+ trigger_error('options handler not set', E_USER_WARNING);
+ return false;
+ }
+
+ $new_data = scbUtil::array_extract( $_POST, array_keys( $this->options->get_defaults() ) );
+
+ $new_data = stripslashes_deep( $new_data );
+
+ $new_data = $this->validate( $new_data, $this->options->get() );
+
+ $this->options->set( $new_data );
+
+ $this->admin_msg();
+ }
+
+ // Manually generate a standard admin notice ( use Settings API instead )
+ function admin_msg( $msg = '', $class = "updated" ) {
+ if ( empty( $msg ) )
+ $msg = __( 'Settings <strong>saved</strong>.', $this->textdomain );
+
+ echo "<div class='$class fade'><p>$msg</p></div>\n";
+ }
+
+
+// ____________UTILITIES____________
+
+
+ // Generates a form submit button
+ function submit_button( $value = '', $action = 'action', $class = "button" ) {
+ if ( is_array( $value ) ) {
+ extract( wp_parse_args( $value, array( 'value' => __( 'Save Changes', $this->textdomain ),
+ 'action' => 'action',
+ 'class' => 'button',
+ 'ajax' => true ) ) );
+
+ if ( ! $ajax )
+ $class .= ' no-ajax';
+ }
+ else {
+ if ( empty( $value ) )
+ $value = __( 'Save Changes', $this->textdomain );
+ }
+
+ $input_args = array( 'type' => 'submit',
+ 'names' => $action,
+ 'values' => $value,
+ 'extra' => '',
+ 'desc' => false );
+
+ if ( ! empty( $class ) )
+ $input_args['extra'] = "class='{$class}'";
+
+ $output = "<p class='submit'>\n" . scbForms::input( $input_args ) . "</p>\n";
+
+ return $output;
+ }
+
+ /*
+ Mimics scbForms::form_wrap()
+
+ $this->form_wrap( $content ); // generates a form with a default submit button
+
+ $this->form_wrap( $content, false ); // generates a form with no submit button
+
+ // the second argument is sent to submit_button()
+ $this->form_wrap( $content, array( 'text' => 'Save changes',
+ 'name' => 'action',
+ 'ajax' => true,
+ ) );
+ */
+ function form_wrap( $content, $submit_button = true ) {
+ if ( is_array( $submit_button ) ) {
+ $content .= call_user_func( array( $this, 'submit_button' ), $submit_button );
+ } elseif ( true === $submit_button ) {
+ $content .= $this->submit_button();
+ } elseif ( false !== strpos( $submit_button, '<input' ) ) {
+ $content .= $submit_button;
+ } elseif ( false !== $submit_button ) {
+ $button_args = array_slice( func_get_args(), 1 );
+ $content .= call_user_func_array( array( $this, 'submit_button' ), $button_args );
+ }
+
+ return scbForms::form_wrap( $content, $this->nonce );
+ }
+
+ // See scbForms::form()
+ function form( $rows, $formdata = array() ) {
+ return scbForms::form( $rows, $formdata, $this->nonce );
+ }
+
+ // Generates a table wrapped in a form
+ function form_table( $rows, $formdata = array() ) {
+ $output = '';
+ foreach ( $rows as $row )
+ $output .= $this->table_row( $row, $formdata );
+
+ $output = $this->form_table_wrap( $output );
+
+ return $output;
+ }
+
+ // Wraps the given content in a <form><table>
+ function form_table_wrap( $content ) {
+ $output = $this->table_wrap( $content );
+ $output = $this->form_wrap( $output, $this->nonce );
+
+ return $output;
+ }
+
+ // Generates a form table
+ function table( $rows, $formdata = array() ) {
+ $output = '';
+ foreach ( $rows as $row )
+ $output .= $this->table_row( $row, $formdata );
+
+ $output = $this->table_wrap( $output );
+
+ return $output;
+ }
+
+ // Generates a table row
+ function table_row( $args, $formdata = array() ) {
+ return $this->row_wrap( $args['title'], $this->input( $args, $formdata ) );
+ }
+
+ // Wraps the given content in a <table>
+ function table_wrap( $content ) {
+ return
+ html( 'table class="form-table"', $content );
+ }
+
+ // Wraps the given content in a <tr><td>
+ function row_wrap( $title, $content ) {
+ return
+ html( 'tr',
+ html( 'th scope="row"', $title )
+ .html( 'td', $content ) );
+ }
+
+ function input( $args, $formdata = array() ) {
+ if ( empty( $formdata ) && isset( $this->options ) )
+ $formdata = $this->options->get();
+
+ if ( isset( $args['name_tree'] ) ) {
+ $tree = ( array ) $args['name_tree'];
+ unset( $args['name_tree'] );
+
+ $value = $formdata;
+ $name = $this->option_name;
+ foreach ( $tree as $key ) {
+ $value = $value[$key];
+ $name .= '[' . $key . ']';
+ }
+
+ $args['name'] = $name;
+ unset( $args['names'] );
+
+ unset( $args['values'] );
+
+ $formdata = array( $name => $value );
+ }
+
+ return scbForms::input( $args, $formdata );
+ }
+
+ // Mimic scbForms inheritance
+ function __call( $method, $args ) {
+ return call_user_func_array( array( 'scbForms', $method ), $args );
+ }
+
+ // Wraps a string in a <script> tag
+ function js_wrap( $string ) {
+ return "\n<script type='text/javascript'>\n" . $string . "\n</script>\n";
+ }
+
+ // Wraps a string in a <style> tag
+ function css_wrap( $string ) {
+ return "\n<style type='text/css'>\n" . $string . "\n</style>\n";
+ }
+
+
+// ____________INTERNAL METHODS____________
+
+
+ // Registers a page
+ function page_init() {
+ extract( $this->args );
+
+ if ( ! $toplevel ) {
+ $this->pagehook = add_submenu_page( $parent, $page_title, $menu_title, $capability, $page_slug, array( $this, '_page_content_hook' ) );
+ } else {
+ $func = 'add_' . $toplevel . '_page';
+ $this->pagehook = $func( $page_title, $menu_title, $capability, $page_slug, array( $this, '_page_content_hook' ), $icon_url );
+ }
+
+ if ( ! $this->pagehook )
+ return;
+
+ if ( $ajax_submit ) {
+ $this->ajax_response();
+ add_action( 'admin_footer', array( $this, 'ajax_submit' ), 20 );
+ }
+
+ add_action( 'admin_print_styles-' . $this->pagehook, array( $this, 'page_head' ) );
+ }
+
+ function option_init() {
+ register_setting( $this->option_name, $this->option_name, array( $this, 'validate' ) );
+ }
+
+ private function check_args() {
+ if ( empty( $this->args['page_title'] ) )
+ trigger_error( 'Page title cannot be empty', E_USER_WARNING );
+
+ $this->args = wp_parse_args( $this->args, array(
+ 'toplevel' => '',
+ 'icon' => '',
+ 'parent' => 'options-general.php',
+ 'capability' => 'manage_options',
+ 'menu_title' => $this->args['page_title'],
+ 'page_slug' => '',
+ 'nonce' => '',
+ 'action_link' => __( 'Settings', $this->textdomain ),
+ 'ajax_submit' => false,
+ ) );
+
+ if ( empty( $this->args['page_slug'] ) )
+ $this->args['page_slug'] = sanitize_title_with_dashes( $this->args['menu_title'] );
+
+ if ( empty( $this->args['nonce'] ) )
+ $this->nonce = $this->args['page_slug'];
+ }
+
+ function _contextual_help( $help, $screen ) {
+ if ( is_object( $screen ) )
+ $screen = $screen->id;
+
+ $actual_help = $this->page_help();
+
+ if ( $screen == $this->pagehook && $actual_help )
+ return $actual_help;
+
+ return $help;
+ }
+
+ function ajax_response() {
+ if ( ! isset( $_POST['_ajax_submit'] ) || $_POST['_ajax_submit'] != $this->pagehook )
+ return;
+
+ $this->form_handler();
+ die;
+ }
+
+ function ajax_submit() {
+ global $page_hook;
+
+ if ( $page_hook != $this->pagehook )
+ return;
+?>
+<script type="text/javascript">
+jQuery( document ).ready( function( $ ){
+ var $spinner = $( new Image() ).attr( 'src', '<?php echo admin_url( "images/wpspin_light.gif" ); ?>' );
+
+ $( ':submit' ).click( function( ev ){
+ var $submit = $( this );
+ var $form = $submit.parents( 'form' );
+
+ if ( $submit.hasClass( 'no-ajax' ) || $form.attr( 'method' ).toLowerCase() != 'post' )
+ return true;
+
+ var $this_spinner = $spinner.clone();
+
+ $submit.before( $this_spinner ).hide();
+
+ var data = $form.serializeArray();
+ data.push( {name: $submit.attr( 'name' ), value: $submit.val()} );
+ data.push( {name: '_ajax_submit', value: '<?php echo $this->pagehook; ?>'} );
+
+ $.post( location.href, data, function( response ){
+ var $prev = $( '.wrap > .updated, .wrap > .error' );
+ var $msg = $( response ).hide().insertAfter( $( '.wrap h2' ) );
+ if ( $prev.length > 0 )
+ $prev.fadeOut( 'slow', function(){ $msg.fadeIn( 'slow' ); } );
+ else
+ $msg.fadeIn( 'slow' );
+
+ $this_spinner.hide();
+ $submit.show();
+ } );
+
+ ev.stopPropagation();
+ ev.preventDefault();
+ } );
+} );
+</script>
+<?php
+ }
+
+ function _page_content_hook() {
+ $this->form_handler();
+
+ $this->page_header();
+ $this->page_content();
+ $this->page_footer();
+ }
+
+ function _action_link( $links ) {
+ $url = add_query_arg( 'page', $this->args['page_slug'], admin_url( $this->args['parent'] ) );
+
+ $links[] = html_link( $url, $this->args['action_link'] );
+
+ return $links;
+ }
+}
+
diff --git a/plugins/picasa-albums/1.0.5/scb/BoxesPage.php b/plugins/picasa-albums/1.0.5/scb/BoxesPage.php
new file mode 100644
index 00000000..a86877dd
--- /dev/null
+++ b/plugins/picasa-albums/1.0.5/scb/BoxesPage.php
@@ -0,0 +1,220 @@
+<?php
+
+/*
+Creates an admin page with widgets, similar to the dashboard
+
+For example, if you defined the boxes like this:
+
+$this->boxes = array( array( 'settings', 'Settings box', 'normal' )
+ ... );
+
+You must also define two methods in your class for each box:
+
+function settings_box() - this is where the box content is echoed
+function settings_handler() - this is where the box settings are saved
+...
+*/
+abstract class scbBoxesPage extends scbAdminPage {
+ /*
+ A box definition looks like this:
+ array( $slug, $title, $column );
+
+ Available columns: normal, side, column3, column4
+ */
+ protected $boxes = array();
+
+ function __construct( $file, $options = null ) {
+ parent::__construct( $file, $options );
+
+ // too late
+ scbUtil::add_uninstall_hook( $this->file, array( $this, 'uninstall' ) );
+ }
+
+ function page_init() {
+ if ( !isset( $this->args['columns'] ) )
+ $this->args['columns'] = 2;
+
+ parent::page_init();
+
+ add_action( 'load-' . $this->pagehook, array( $this, 'boxes_init' ) );
+ add_filter( 'screen_layout_columns', array( $this, 'columns' ) );
+ }
+
+ function default_css() {
+?>
+<style type="text/css">
+.postbox-container + .postbox-container {margin-left: 18px}
+.postbox-container {padding-right: 0}
+
+.inside {clear: both; overflow: hidden; padding: 10px 10px 0 10px !important}
+.inside table {margin: 0 !important; padding: 0 !important}
+.inside table td {vertical-align: middle !important}
+.inside table .regular-text {width: 100% !important}
+.inside .form-table th {width: 30%; max-width: 200px; padding: 10px 0 !important}
+.inside .widefat .check-column {padding-bottom: 7px !important}
+.inside p, .inside table {margin: 0 0 10px 0 !important}
+.inside p.submit {float:left !important; padding: 0 !important}
+</style>
+<?php
+ }
+
+ function page_content() {
+ $this->default_css();
+
+ global $screen_layout_columns;
+
+ if ( isset( $screen_layout_columns ) ) {
+ $hide2 = $hide3 = $hide4 = '';
+ switch ( $screen_layout_columns ) {
+ case 4:
+ $width = 'width:24.5%;';
+ break;
+ case 3:
+ $width = 'width:32.67%;';
+ $hide4 = 'display:none;';
+ break;
+ case 2:
+ $width = 'width:49%;';
+ $hide3 = $hide4 = 'display:none;';
+ break;
+ default:
+ $width = 'width:98%;';
+ $hide2 = $hide3 = $hide4 = 'display:none;';
+ }
+ }
+?>
+<div id='<?php echo $this->pagehook ?>-widgets' class='metabox-holder'>
+<?php
+ echo "\t<div class='postbox-container' style='$width'>\n";
+ do_meta_boxes( $this->pagehook, 'normal', '' );
+
+ echo "\t</div><div class='postbox-container' style='{$hide2}$width'>\n";
+ do_meta_boxes( $this->pagehook, 'side', '' );
+
+ echo "\t</div><div class='postbox-container' style='{$hide3}$width'>\n";
+ do_meta_boxes( $this->pagehook, 'column3', '' );
+
+ echo "\t</div><div class='postbox-container' style='{$hide4}$width'>\n";
+ do_meta_boxes( $this->pagehook, 'column4', '' );
+?>
+</div></div>
+<?php
+ }
+
+ function page_footer() {
+ parent::page_footer();
+ $this->_boxes_js_init();
+ }
+
+ function form_handler() {
+ if ( empty( $_POST ) )
+ return;
+
+ check_admin_referer( $this->nonce );
+
+ // Box handler
+ foreach ( $this->boxes as $box ) {
+ $args = isset( $box[4] ) ? $box[4] : array();
+
+ $handler = $box[0] . '_handler';
+
+ if ( method_exists( $this, $handler ) )
+ call_user_func_array( array( $this, $handler ), $args );
+ }
+ }
+
+ function columns( $columns ) {
+ $columns[$this->pagehook] = $this->args['columns'];
+
+ return $columns;
+ }
+
+ function uninstall() {
+ global $wpdb;
+
+ $hook = str_replace( '-', '', $this->pagehook );
+
+ foreach ( array( 'metaboxhidden', 'closedpostboxes', 'wp_metaboxorder', 'screen_layout' ) as $option )
+ $keys[] = "'{$option}_{$hook}'";
+
+ $keys = '( ' . implode( ', ', $keys ) . ' )';
+
+ $wpdb->query( "
+ DELETE FROM {$wpdb->usermeta}
+ WHERE meta_key IN {$keys}
+ " );
+ }
+
+ function boxes_init() {
+ wp_enqueue_script( 'common' );
+ wp_enqueue_script( 'wp-lists' );
+ wp_enqueue_script( 'postbox' );
+
+ $registered = array();
+ foreach( $this->boxes as $box_args ) {
+ @list( $name, $title, $context, $priority, $args ) = $box_args;
+
+ if ( empty( $title ) )
+ $title = ucfirst( $name );
+ if ( empty( $context ) )
+ $context = 'normal';
+ if ( empty( $priority ) )
+ $priority = 'default';
+ if ( empty( $args ) )
+ $args = array();
+
+ if ( isset( $registered[$name] ) ) {
+ if ( empty( $args ) )
+ trigger_error( "Duplicate box name: $name", E_USER_NOTICE );
+
+ $name = $this->_increment( $name );
+ } else {
+ $registered[$name] = true;
+ }
+
+ add_meta_box( $name, $title, array( $this, '_intermediate_callback' ), $this->pagehook, $context, $priority, $args );
+ }
+ }
+
+ // Make it so that $args is actually what's passed to the callback
+ function _intermediate_callback( $_, $box ) {
+ list( $name ) = explode( '-', $box['id'] );
+
+ call_user_func_array( array( $this, $name . '_box' ), $box['args'] );
+ }
+
+ private function _increment( $name ) {
+ $parts = explode( '-', $name );
+ if ( isset( $parts[1] ) )
+ $parts[1]++;
+ else
+ $parts[1] = 2;
+
+ return implode( '-', $parts );
+ }
+
+ // Adds necesary code for JS to work
+ function _boxes_js_init() {
+ echo $this->js_wrap( <<<EOT
+jQuery( document ).ready( function( $ ){
+ // close postboxes that should be closed
+ $( '.if-js-closed' ).removeClass( 'if-js-closed' ).addClass( 'closed' );
+ // postboxes setup
+ postboxes.add_postbox_toggles( '$this->pagehook' );
+} );
+EOT
+ );
+?>
+
+<form style='display: none' method='get' action=''>
+ <p>
+<?php
+ wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
+ wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
+?>
+ </p>
+</form>
+<?php
+ }
+}
+
diff --git a/plugins/picasa-albums/1.0.5/scb/Cron.php b/plugins/picasa-albums/1.0.5/scb/Cron.php
new file mode 100644
index 00000000..711ce7f1
--- /dev/null
+++ b/plugins/picasa-albums/1.0.5/scb/Cron.php
@@ -0,0 +1,182 @@
+<?php
+
+class scbCron {
+ protected $schedule;
+ protected $interval;
+ protected $time;
+
+ protected $hook;
+ protected $callback_args;
+
+ /**
+ * Create a new cron job
+ *
+ * @param string Reference to main plugin file
+ * @param array List of args:
+ string $action OR callback $callback
+ string $schedule OR number $interval
+ array $callback_args ( optional )
+ * @param bool Debug mode
+ */
+ function __construct( $file, $args, $debug = false ) {
+ $this->_set_args( $args );
+
+ scbUtil::add_activation_hook( $file, array( $this, 'reset' ) );
+ register_deactivation_hook( $file, array( $this, 'unschedule' ) );
+
+ add_filter( 'cron_schedules', array( $this, '_add_timing' ) );
+
+ if ( $debug )
+ self::debug();
+ }
+
+ /* Change the interval of the cron job
+ *
+ * @param array List of args:
+ string $schedule OR number $interval
+ timestamp $time ( optional )
+ */
+ function reschedule( $args ) {
+ extract( $args );
+
+ if ( $schedule && $this->schedule != $schedule ) {
+ $this->schedule = $schedule;
+ } elseif ( $interval && $this->interval != $interval ) {
+ $this->schedule = $interval . 'secs';
+ $this->interval = $interval;
+ }
+
+ $this->time = $time;
+
+ $this->reset();
+ }
+
+ /**
+ * Reset the schedule
+ */
+ function reset() {
+ $this->unschedule();
+ $this->schedule();
+ }
+
+ /**
+ * Clear the cron job
+ */
+ function unschedule() {
+# wp_clear_scheduled_hook( $this->hook, $this->callback_args );
+ self::really_clear_scheduled_hook( $this->hook );
+ }
+
+ /**
+ * Execute the job now
+ */
+ function do_now() {
+ do_action( $this->hook );
+ }
+
+ /**
+ * Execute the job with a given delay
+ * @param int Delay in seconds
+ */
+ function do_once( $delay = 0 ) {
+ wp_schedule_single_event( time() + $delay, $this->hook, $this->callback_args );
+ }
+
+ /**
+ * Display current cron jobs
+ */
+ function debug() {
+ add_action( 'admin_footer', array( __CLASS__, '_debug' ) );
+ }
+
+
+//_____INTERNAL METHODS_____
+
+
+ function _add_timing( $schedules ) {
+ if ( isset( $schedules[$this->schedule] ) )
+ return $schedules;
+
+ $schedules[$this->schedule] = array( 'interval' => $this->interval,
+ 'display' => $this->interval . ' seconds' );
+
+ return $schedules;
+ }
+
+ function _debug() {
+ if ( ! current_user_can( 'manage_options' ) )
+ return;
+
+ echo "<pre>";
+ print_r( get_option( 'cron' ) );
+ echo "</pre>";
+ }
+
+ protected function schedule() {
+ if ( ! $this->time )
+ $this->time = time();
+
+ wp_schedule_event( $this->time, $this->schedule, $this->hook, $this->callback_args );
+ }
+
+ protected function _set_args( $args ) {
+ extract( $args );
+
+ // Set hook
+ if ( isset( $action ) ) {
+ $this->hook = $action;
+ } elseif ( isset( $callback ) ) {
+ $this->hook = self::_callback_to_string( $callback );
+
+ add_action( $this->hook, $callback );
+ } elseif ( method_exists( $this, 'callback' ) ) {
+ $this->hook = self::_callback_to_string( $callback );
+
+ add_action( $this->hook, $callback );
+ } else {
+ trigger_error( '$action OR $callback not set', E_USER_WARNING );
+ }
+
+ // Set schedule
+ if ( isset( $interval ) ) {
+ $this->schedule = $interval . 'secs';
+ $this->interval = $interval;
+ } elseif ( isset( $schedule ) ) {
+ $this->schedule = $schedule;
+ } else {
+ trigger_error( '$schedule OR $interval not set', E_USER_WARNING );
+ }
+
+ if ( isset( $callback_args ) )
+ $this->callback_args = ( array ) $callback_args;
+ }
+
+ protected static function really_clear_scheduled_hook( $name ) {
+ $crons = _get_cron_array();
+
+ foreach ( $crons as $timestamp => $hooks ) {
+ foreach ( $hooks as $hook => $args )
+ if ( $hook == $name )
+ unset( $crons[$timestamp][$hook] );
+
+ if ( empty( $hooks ) )
+ unset( $crons[$timestamp] );
+ }
+
+ _set_cron_array( $crons );
+ }
+
+ protected static function _callback_to_string( $callback ) {
+ if ( ! is_array( $callback ) )
+ $str = $callback;
+ elseif ( ! is_string( $callback[0] ) )
+ $str = get_class( $callback[0] ) . '_' . $callback[1];
+ else
+ $str = $callback[0] . '::' . $callback[1];
+
+ $str .= '_hook';
+
+ return $str;
+ }
+}
+
diff --git a/plugins/picasa-albums/1.0.5/scb/Forms.php b/plugins/picasa-albums/1.0.5/scb/Forms.php
new file mode 100644
index 00000000..e6318469
--- /dev/null
+++ b/plugins/picasa-albums/1.0.5/scb/Forms.php
@@ -0,0 +1,422 @@
+<?php
+
+// Documentation: http://scribu.net/wordpress/scb-framework/scb-forms.html
+
+class scbForms {
+
+ const token = '%input%';
+
+ protected static $args;
+ protected static $formdata = array();
+
+ static function input( $args, $formdata = array() ) {
+ $args = self::validate_data( $args );
+
+ $error = false;
+ foreach ( array( 'name', 'value' ) as $key ) {
+ $old = $key . 's';
+
+ if ( isset( $args[$old] ) ) {
+ $args[$key] = $args[$old];
+ unset( $args[$old] );
+ }
+ }
+
+ if ( empty( $args['name'] ) )
+ return trigger_error( 'Empty name', E_USER_WARNING );
+
+ self::$args = $args;
+ self::$formdata = self::validate_data( $formdata );
+
+ if ( 'select' == $args['type'] )
+ return self::_select();
+ else
+ return self::_input();
+ }
+
+
+// ____________UTILITIES____________
+
+
+ // Generates a table wrapped in a form
+ static function form_table( $rows, $formdata = NULL ) {
+ $output = '';
+ foreach ( $rows as $row )
+ $output .= self::table_row( $row, $formdata );
+
+ $output = self::form_table_wrap( $output );
+
+ return $output;
+ }
+
+ // Generates a form
+ static function form( $inputs, $formdata = NULL, $nonce ) {
+ $output = '';
+ foreach ( $inputs as $input )
+ $output .= self::input( $input, $formdata );
+
+ $output = self::form_wrap( $output, $nonce );
+
+ return $output;
+ }
+
+ // Generates a table
+ static function table( $rows, $formdata = NULL ) {
+ $output = '';
+ foreach ( $rows as $row )
+ $output .= self::table_row( $row, $formdata );
+
+ $output = self::table_wrap( $output );
+
+ return $output;
+ }
+
+ // Generates a table row
+ static function table_row( $args, $formdata = NULL ) {
+ return self::row_wrap( $args['title'], self::input( $args, $formdata ) );
+ }
+
+
+// ____________WRAPPERS____________
+
+
+ // Wraps the given content in a <form><table>
+ static function form_table_wrap( $content, $nonce = 'update_options' ) {
+ $output = self::table_wrap( $content );
+ $output = self::form_wrap( $output, $nonce );
+
+ return $output;
+ }
+
+ // Wraps the given content in a <form> tag
+ static function form_wrap( $content, $nonce = 'update_options' ) {
+ $output = "\n<form method='post' action=''>\n";
+ $output .= $content;
+ $output .= wp_nonce_field( $action = $nonce, $name = "_wpnonce", $referer = true , $echo = false );
+ $output .= "\n</form>\n";
+
+ return $output;
+ }
+
+ // Wraps the given content in a <table>
+ static function table_wrap( $content ) {
+ $output = "\n<table class='form-table'>\n" . $content . "\n</table>\n";
+
+ return $output;
+ }
+
+ // Wraps the given content in a <tr><td>
+ static function row_wrap( $title, $content ) {
+ return "\n<tr>\n\t<th scope='row'>" . $title . "</th>\n\t<td>\n\t\t" . $content . "\t</td>\n\n</tr>";
+ }
+
+
+// ____________PRIVATE METHODS____________
+
+
+ // Recursivly transform empty arrays to ''
+ private static function validate_data( $data ) {
+ if ( !is_array( $data ) )
+ return $data;
+
+ if ( empty( $data ) )
+ return '';
+
+ foreach ( $data as $key => &$value )
+ $value = self::validate_data( $value );
+
+ return $data;
+ }
+
+ // From multiple inputs to single inputs
+ private static function _input() {
+ extract( wp_parse_args( self::$args, array(
+ 'name' => NULL,
+ 'value' => NULL,
+ 'desc' => NULL,
+ 'checked' => NULL,
+ ) ) );
+
+ $m_name = is_array( $name );
+ $m_value = is_array( $value );
+ $m_desc = is_array( $desc );
+
+ // Correct name
+ if ( !$m_name && $m_value
+ && 'checkbox' == $type
+ && false === strpos( $name, '[' )
+ )
+ $args['name'] = $name = $name . '[]';
+
+ // Expand names or values
+ if ( !$m_name && !$m_value ) {
+ $a = array( $name => $value );
+ }
+ elseif ( $m_name && !$m_value ) {
+ $a = array_fill_keys( $name, $value );
+ }
+ elseif ( !$m_name && $m_value ) {
+ $a = array_fill_keys( $value, $name );
+ }
+ else {
+ $a = array_combine( $name, $value );
+ }
+
+ // Correct descriptions
+ $_after = '';
+ if ( isset( $desc ) && !$m_desc && false === strpos( $desc, self::token ) ) {
+ if ( $m_value ) {
+ $_after = $desc;
+ $args['desc'] = $desc = $value;
+ }
+ elseif ( $m_name ) {
+ $_after = $desc;
+ $args['desc'] = $desc = $name;
+ }
+ }
+
+ // Determine what goes where
+ if ( !$m_name && $m_value ) {
+ $i1 = 'val';
+ $i2 = 'name';
+ } else {
+ $i1 = 'name';
+ $i2 = 'val';
+ }
+
+ $func = in_array( $type, array( 'checkbox', 'radio' ) ) ? '_checkbox_single' : '_input_single';
+
+ // Set constant args
+ $const_args = self::array_extract( self::$args, array( 'type', 'desc_pos', 'checked' ) );
+ if ( isset( $extra ) ) {
+ if ( !is_array( $extra ) )
+ $extra = self::attr_to_array( $extra );
+ $const_args['extra'] = $extra;
+ }
+
+ $i = 0;
+ foreach ( $a as $name => $val ) {
+ $cur_args = $const_args;
+
+ if ( $$i1 !== NULL )
+ $cur_args['name'] = $$i1;
+
+ if ( $$i2 !== NULL )
+ $cur_args['value'] = $$i2;
+
+ // Set desc
+ if ( is_array( $desc ) )
+ $cur_args['desc'] = $desc[$i];
+ elseif ( isset( $desc ) )
+ $cur_args['desc'] = $desc;
+
+ // Find relevant formdata
+ $match = NULL;
+ if ( $checked === NULL ) {
+ if(isset(self::$formdata) && !empty(self::$formdata)){
+ $match = @self::$formdata[str_replace( '[]', '', $$i1 )];
+ if ( is_array( $match ) ) {
+ $match = $match[$i];
+ }
+ }
+ } else if ( is_array( $checked ) ) {
+ $cur_args['checked'] = isset( $checked[$i] ) && $checked[$i];
+ }
+
+ $output[] = self::$func( $cur_args, $match );
+
+ $i++;
+ }
+
+ return implode( "\n", $output ) . $_after;
+ }
+
+ // Handle args for checkboxes and radio inputs
+ private static function _checkbox_single( $args, $data ) {
+ $args = wp_parse_args( $args, array(
+ 'name' => NULL,
+ 'value' => true,
+ 'desc_pos' => 'after',
+ 'desc' => NULL,
+ 'checked' => NULL,
+ 'extra' => array(),
+ ) );
+
+ foreach ( $args as $key => &$val )
+ $$key = &$val;
+ unset( $val );
+
+ if ( $checked === NULL && $value == $data )
+ $checked = true;
+
+ if ( $checked )
+ $extra['checked'] = 'checked';
+
+ if ( is_null( $desc ) && !is_bool( $value ) )
+ $desc = str_replace( '[]', '', $value );
+
+ return self::_input_gen( $args );
+ }
+
+ // Handle args for text inputs
+ private static function _input_single( $args, $data ) {
+ $args = wp_parse_args( $args, array(
+ 'value' => $data,
+ 'desc_pos' => 'after',
+ 'extra' => array( 'class' => 'regular-text' ),
+ ) );
+
+ foreach ( $args as $key => &$val )
+ $$key = &$val;
+ unset( $val );
+
+ if ( FALSE === strpos( $name, '[' ) )
+ $extra['id'] = $name;
+
+ return self::_input_gen( $args );
+ }
+
+ // Generate html with the final args
+ private static function _input_gen( $args ) {
+ extract( wp_parse_args( $args, array(
+ 'name' => NULL,
+ 'value' => NULL,
+ 'desc' => NULL,
+ 'extra' => array()
+ ) ) );
+
+ $extra = self::array_to_attr( $extra );
+
+ if ( 'textarea' == $type ) {
+ $value = esc_html( $value );
+ $input = "<textarea name='{$name}'{$extra}>{$value}</textarea>\n";
+ }
+ else {
+ $value = esc_attr( $value );
+ $input = "<input name='{$name}' value='{$value}' type='{$type}'{$extra} /> ";
+ }
+
+ return self::add_label( $input, $desc, $desc_pos );
+ }
+
+ private static function _select() {
+ extract( wp_parse_args( self::$args, array(
+ 'name' => '',
+ 'value' => array(),
+ 'text' => '',
+ 'selected' => array( 'foo' ), // hack to make default blank
+ 'extra' => array(),
+ 'numeric' => false, // use numeric array instead of associative
+ 'desc' => '',
+ 'desc_pos' => '',
+ ) ), EXTR_SKIP );
+
+ if ( empty( $value ) )
+ $value = array( '' => '' );
+
+ if ( !is_array( $value ) )
+ return trigger_error( "'value' argument is expected to be an array", E_USER_WARNING );
+
+ if ( !self::is_associative( $value ) && !$numeric )
+ $value = array_combine( $value, $value );
+
+ if ( isset( self::$formdata[$name] ) )
+ $cur_val = self::$formdata[$name];
+ else
+ $cur_val = $selected;
+
+ if ( false === $text ) {
+ $opts = '';
+ } else {
+ $opts = "\t<option value=''" . selected( $cur_val, array( 'foo' ), false ) . ">{$text}</option>\n";
+ }
+
+ foreach ( $value as $key => $value ) {
+ if ( empty( $key ) || empty( $value ) )
+ continue;
+
+ $opts .= "\t<option value='{$key}'" . selected( (string) $key, (string) $cur_val, false) . '>' . $value . "</option>\n";
+ }
+
+ if ( !is_array( $extra ) )
+ $extra = self::attr_to_array( $extra );
+ $extra = self::array_to_attr( $extra );
+
+ $input = "<select name='{$name}'$extra>\n{$opts}</select>";
+
+ return self::add_label( $input, $desc, $desc_pos );
+ }
+
+ private static function add_label( $input, $desc, $desc_pos ) {
+ if ( empty( $desc_pos ) )
+ $desc_pos = 'after';
+
+ $label = '';
+ if ( false === strpos( $desc, self::token ) ) {
+ switch ( $desc_pos ) {
+ case 'before': $label = $desc . ' ' . self::token; break;
+ case 'after': $label = self::token . ' ' . $desc;
+ }
+ } else {
+ $label = $desc;
+ }
+
+ $label = trim( str_replace( self::token, $input, $label ) );
+
+ if ( empty( $desc ) )
+ $output = $input . "\n";
+ else
+ $output = "<label>{$label}</label>\n";
+
+ return $output;
+ }
+
+
+// Utilities
+
+
+ private static function attr_to_array( $html ) {
+ return shortcode_parse_atts( $html );
+ }
+
+ private static function array_to_attr( $attr ) {
+ $out = '';
+ foreach ( $attr as $key => $value )
+ $out .= ' ' . $key . '=' . '"' . esc_attr( $value ) . '"';
+
+ return $out;
+ }
+
+ private static function is_associative( $array ) {
+ if ( !is_array( $array ) || empty( $array ) )
+ return false;
+
+ $keys = array_keys( $array );
+
+ return array_keys( $keys ) !== $keys;
+ }
+
+ private static function array_extract( $array, $keys ) {
+ $r = array();
+ foreach ( $keys as $key )
+ if ( isset( $array[$key] ) )
+ $r[$key] = $array[$key];
+
+ return $r;
+ }
+}
+
+// PHP < 5.2
+if ( !function_exists( 'array_fill_keys' ) ) :
+function array_fill_keys( $keys, $value ) {
+ if ( !is_array( $keys ) )
+ trigger_error( 'First argument is expected to be an array.' . gettype( $keys ) . 'given', E_USER_WARNING );
+
+ $r = array();
+ foreach ( $keys as $key )
+ $r[$key] = $value;
+
+ return $r;
+}
+endif;
+
diff --git a/plugins/picasa-albums/1.0.5/scb/Options.php b/plugins/picasa-albums/1.0.5/scb/Options.php
new file mode 100644
index 00000000..54eb4668
--- /dev/null
+++ b/plugins/picasa-albums/1.0.5/scb/Options.php
@@ -0,0 +1,172 @@
+<?php
+
+// Documentation: http://scribu.net/wordpress/scb-framework/scb-options.html
+
+class scbOptions {
+
+ protected $key; // the option name
+
+ protected $defaults; // the default value( s )
+
+ public $wp_filter_id; // used by WP hooks
+
+ /**
+ * Create a new set of options
+ *
+ * @param string $key Option name
+ * @param string $file Reference to main plugin file
+ * @param array $defaults An associative array of default values ( optional )
+ */
+ public function __construct( $key, $file, $defaults = '' ) {
+ $this->key = $key;
+ $this->defaults = $defaults;
+
+ scbUtil::add_activation_hook( $file, array( $this, '_update_reset' ) );
+
+ scbUtil::add_uninstall_hook( $file, array( $this, 'delete' ) );
+ }
+
+ /**
+ * Get option name
+ */
+ public function get_key() {
+ return $this->key;
+ }
+
+ /**
+ * Get option values for one, many or all fields
+ *
+ * @param string|array $field The field( s ) to get
+ * @return mixed Whatever is in those fields
+ */
+ public function get( $field = '' ) {
+ $data = get_option( $this->key );
+
+ if ( is_array( $this->defaults ) )
+ $data = ( array ) $data;
+
+ return $this->_get( $field, $data );
+ }
+
+ /**
+ * Get default values for one, many or all fields
+ *
+ * @param string|array $field The field( s ) to get
+ * @return mixed Whatever is in those fields
+ */
+ public function get_defaults( $field = '' ) {
+ return $this->_get( $field, $this->defaults );
+ }
+
+ /**
+ * Set all data fields, certain fields or a single field
+ *
+ * @param string|array $field The field to update or an associative array
+ * @param mixed $value The new value ( ignored if $field is array )
+ * @return null
+ */
+ public function set( $field, $value = '' ) {
+ if ( is_array( $field ) )
+ $newdata = $field;
+ else
+ $newdata = array( $field => $value );
+
+ $this->update( array_merge( $this->get(), $newdata ) );
+ }
+
+ /**
+ * Reset option to defaults
+ *
+ * @return null
+ */
+ public function reset() {
+ $this->update( $this->defaults, false );
+ }
+
+ /**
+ * Remove any keys that are not in the defaults array
+ *
+ * @return bool
+ */
+ public function cleanup() {
+ $this->update( $this->_clean( $this->get() ) );
+ }
+
+ /**
+ * Update raw data
+ *
+ * @param mixed $newdata
+ * @param bool $clean wether to remove unrecognized keys or not
+ * @return null
+ */
+ public function update( $newdata, $clean = true ) {
+ if ( $clean )
+ $newdata = $this->_clean( $newdata );
+
+ update_option( $this->key, $newdata );
+ }
+
+ /**
+ * Delete the option
+ *
+ * @return null
+ */
+ public function delete() {
+ delete_option( $this->key );
+ }
+
+
+//_____INTERNAL METHODS_____
+
+
+ // Add new fields with their default values
+ function _update_reset() {
+ if ( is_array( $this->defaults ) )
+ $this->update( array_merge( $this->defaults, $this->get() ) );
+ else
+ add_option( $this->key, $this->defaults );
+ }
+
+ private function _clean( $data ) {
+ if ( !is_array( $data ) || !is_array( $this->defaults ) )
+ return $data;
+
+ $r = array();
+ foreach ( array_keys( $this->defaults ) as $key )
+ $r[$key] = @$data[$key];
+
+ return $r;
+ }
+
+ // Get one, more or all fields from an array
+ private function &_get( $field, $data ) {
+ if ( empty( $field ) )
+ return $data;
+
+ if ( is_string( $field ) )
+ return $data[$field];
+
+ foreach ( $field as $key )
+ if ( isset( $data[$key] ) )
+ $result[] = $data[$key];
+
+ return $result;
+ }
+
+ // Magic method: $options->field
+ function __get( $field ) {
+ return $this->get( $field );
+ }
+
+ // Magic method: $options->field = $value
+ function __set( $field, $value ) {
+ $this->set( $field, $value );
+ }
+
+ // Magic method: isset( $options->field )
+ function __isset( $field ) {
+ $data = $this->get();
+ return isset( $data[$field] );
+ }
+}
+
diff --git a/plugins/picasa-albums/1.0.5/scb/QueryManipulation.php b/plugins/picasa-albums/1.0.5/scb/QueryManipulation.php
new file mode 100644
index 00000000..f6adef19
--- /dev/null
+++ b/plugins/picasa-albums/1.0.5/scb/QueryManipulation.php
@@ -0,0 +1,81 @@
+<?php
+
+class scbQueryManipulation {
+
+ private $bits = array();
+ private $wp_query;
+
+ private static $filters = array(
+ 'posts_where',
+ 'posts_join',
+ 'posts_groupby',
+ 'posts_orderby',
+ 'posts_distinct',
+ 'post_limits',
+ 'posts_fields'
+ );
+
+ public function __construct( $callback, $once = true ) {
+ $this->callback = $callback;
+
+ $this->enable();
+
+ if ( !$once )
+ return;
+
+ add_filter( 'posts_request', array( $this, '_disable' ) );
+ }
+
+ function _disable( $request ) {
+ remove_filter( 'posts_request', array( $this, '_disable' ) );
+
+ $this->disable();
+
+ return $request;
+ }
+
+ public function enable() {
+ foreach ( self::$filters as $filter ) {
+ add_filter( $filter, array( $this, 'collect' ), 999, 2 );
+ add_filter( $filter . '_request' , array( $this, 'update' ), 9 );
+ }
+
+ add_action( 'posts_selection' , array( $this, 'alter' ) );
+ }
+
+ public function disable() {
+ foreach ( self::$filters as $filter ) {
+ remove_filter( $filter, array( $this, 'collect' ), 999, 2 );
+ remove_filter( $filter . '_request' , array( $this, 'update' ), 9 );
+ }
+
+ remove_action( 'posts_selection' , array( $this, 'alter' ) );
+ }
+
+ function collect( $value, $wp_query ) {
+ // remove 'posts_'
+ $key = explode( '_', current_filter() );
+ $key = array_slice( $key, 1 );
+ $key = implode( '_', $key );
+
+ $this->bits[ $key ] = $value;
+
+ $this->wp_query = $wp_query;
+
+ return $value;
+ }
+
+ function alter( $query ) {
+ $this->bits = call_user_func( $this->callback, $this->bits, $this->wp_query );
+ }
+
+ function update( $value ) {
+ // remove 'posts_' and '_request'
+ $key = explode( '_', current_filter() );
+ $key = array_slice( $key, 1, -1 );
+ $key = implode( '_', $key );
+
+ return $this->bits[ $key ];
+ }
+}
+
diff --git a/plugins/picasa-albums/1.0.5/scb/Table.php b/plugins/picasa-albums/1.0.5/scb/Table.php
new file mode 100644
index 00000000..b4529b88
--- /dev/null
+++ b/plugins/picasa-albums/1.0.5/scb/Table.php
@@ -0,0 +1,49 @@
+<?php
+
+// Takes care of creating, updating and deleting database tables
+class scbTable {
+ protected $name;
+ protected $columns;
+ protected $upgrade_method;
+
+ function __construct( $name, $file, $columns, $upgrade_method = 'dbDelta' ) {
+ global $wpdb;
+
+ $this->name = $wpdb->$name = $wpdb->prefix . $name;
+ $this->columns = $columns;
+ $this->upgrade_method = $upgrade_method;
+
+ scbUtil::add_activation_hook( $file, array( $this, 'install' ) );
+ scbUtil::add_uninstall_hook( $file, array( $this, 'uninstall' ) );
+ }
+
+ function install() {
+ global $wpdb;
+
+ $charset_collate = '';
+ if ( $wpdb->has_cap( 'collation' ) ) {
+ if ( ! empty( $wpdb->charset ) )
+ $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset";
+ if ( ! empty( $wpdb->collate ) )
+ $charset_collate .= " COLLATE $wpdb->collate";
+ }
+
+ if ( 'dbDelta' == $this->upgrade_method ) {
+ require_once ABSPATH . 'wp-admin/includes/upgrade.php';
+ dbDelta( "CREATE TABLE $this->name ( $this->columns ) $charset_collate" );
+ return;
+ }
+
+ if ( 'delete_first' == $this->upgrade_method )
+ $wpdb->query( "DROP TABLE IF EXISTS $this->name;" );
+
+ $wpdb->query( "CREATE TABLE IF NOT EXISTS $this->name ( $this->columns ) $charset_collate;" );
+ }
+
+ function uninstall() {
+ global $wpdb;
+
+ $wpdb->query( "DROP TABLE IF EXISTS $this->name" );
+ }
+}
+
diff --git a/plugins/picasa-albums/1.0.5/scb/Util.php b/plugins/picasa-albums/1.0.5/scb/Util.php
new file mode 100644
index 00000000..36086a23
--- /dev/null
+++ b/plugins/picasa-albums/1.0.5/scb/Util.php
@@ -0,0 +1,159 @@
+<?php
+
+class scbUtil {
+
+ // Force script enqueue
+ static function do_scripts( $handles ) {
+ global $wp_scripts;
+
+ if ( ! is_a( $wp_scripts, 'WP_Scripts' ) )
+ $wp_scripts = new WP_Scripts();
+
+ $wp_scripts->do_items( ( array ) $handles );
+ }
+
+ // Force style enqueue
+ static function do_styles( $handles ) {
+ self::do_scripts( 'jquery' );
+
+ global $wp_styles;
+
+ if ( ! is_a( $wp_styles, 'WP_Styles' ) )
+ $wp_styles = new WP_Styles();
+
+ ob_start();
+ $wp_styles->do_items( ( array ) $handles );
+ $content = str_replace( array( '"', "\n" ), array( "'", '' ), ob_get_clean() );
+
+ echo "<script type='text/javascript'>\n";
+ echo "jQuery( document ).ready( function( $ ) {\n";
+ echo "$( 'head' ).prepend( \"$content\" );\n";
+ echo "} );\n";
+ echo "</script>";
+ }
+
+ // Enable delayed activation ( to be used with scb_init() )
+ static function add_activation_hook( $plugin, $callback ) {
+ add_action( 'scb_activation_' . plugin_basename( $plugin ), $callback );
+ }
+
+ // Have more than one uninstall hooks; also prevents an UPDATE query on each page load
+ static function add_uninstall_hook( $plugin, $callback ) {
+ register_uninstall_hook( $plugin, '__return_false' ); // dummy
+
+ add_action( 'uninstall_' . plugin_basename( $plugin ), $callback );
+ }
+
+ // Apply a function to each element of a ( nested ) array recursively
+ static function array_map_recursive( $callback, $array ) {
+ array_walk_recursive( $array, array( __CLASS__, 'array_map_recursive_helper' ), $callback );
+
+ return $array;
+ }
+
+ static function array_map_recursive_helper( &$val, $key, $callback ) {
+ $val = call_user_func( $callback, $val );
+ }
+
+ // Extract certain $keys from $array
+ static function array_extract( $array, $keys ) {
+ $r = array();
+
+ foreach ( $keys as $key )
+ if ( array_key_exists( $key, $array ) )
+ $r[$key] = $array[$key];
+
+ return $r;
+ }
+
+ // Extract a certain value from a list of arrays
+ static function array_pluck( $array, $key ) {
+ $r = array();
+
+ foreach ( $array as $value ) {
+ if ( is_object( $value ) )
+ $value = get_object_vars( $value );
+ if ( array_key_exists( $key, $value ) )
+ $r[] = $value[$key];
+ }
+
+ return $r;
+ }
+
+ // Transform a list of objects into an associative array
+ static function objects_to_assoc( $objects, $key, $value ) {
+ $r = array();
+
+ foreach ( $objects as $obj )
+ $r[$obj->$key] = $obj->$value;
+
+ return $r;
+ }
+
+ // Prepare an array for an IN statement
+ static function array_to_sql( $values ) {
+ foreach ( $values as &$val )
+ $val = "'" . esc_sql( trim( $val ) ) . "'";
+
+ return implode( ',', $values );
+ }
+
+ // Example: split_at( '</', '<a></a>' ) => array( '<a>', '</a>' )
+ static function split_at( $delim, $str ) {
+ $i = strpos( $str, $delim );
+
+ if ( false === $i )
+ return false;
+
+ $start = substr( $str, 0, $i );
+ $finish = substr( $str, $i );
+
+ return array( $start, $finish );
+ }
+}
+
+
+//_____Minimalist HTML framework_____
+
+
+if ( ! function_exists( 'html' ) ):
+function html( $tag, $attributes = array(), $content = '' ) {
+ if ( is_array( $attributes ) ) {
+ $closing = $tag;
+ foreach ( $attributes as $key => $value ) {
+ $tag .= ' ' . $key . '="' . esc_attr( $value ) . '"';
+ }
+ } else {
+ $content = $attributes;
+ list( $closing ) = explode(' ', $tag, 2);
+ }
+
+ return "<{$tag}>{$content}</{$closing}>";
+}
+endif;
+
+// Generate an <a> tag
+if ( ! function_exists( 'html_link' ) ):
+function html_link( $url, $title = '' ) {
+ if ( empty( $title ) )
+ $title = $url;
+
+ return sprintf( "<a href='%s'>%s</a>", esc_url( $url ), $title );
+}
+endif;
+
+
+//_____Compatibility layer_____
+
+// WP < ?
+if ( ! function_exists( 'set_post_field' ) ) :
+function set_post_field( $field, $value, $post_id ) {
+ global $wpdb;
+
+ $post_id = absint( $post_id );
+ $value = sanitize_post_field( $field, $value, $post_id, 'db' );
+
+ return $wpdb->update( $wpdb->posts, array( $field => $value ), array( 'ID' => $post_id ) );
+}
+endif;
+
diff --git a/plugins/picasa-albums/1.0.5/scb/Widget.php b/plugins/picasa-albums/1.0.5/scb/Widget.php
new file mode 100644
index 00000000..93fbb228
--- /dev/null
+++ b/plugins/picasa-albums/1.0.5/scb/Widget.php
@@ -0,0 +1,89 @@
+<?php
+
+// Adds compatibility methods between WP_Widget and scbForms
+
+abstract class scbWidget extends WP_Widget {
+ protected $defaults = array();
+
+ private static $scb_widgets = array();
+
+ static function init( $class, $file = '', $base = '' ) {
+ self::$scb_widgets[] = $class;
+
+ add_action( 'widgets_init', array( __CLASS__, '_scb_register' ) );
+
+ // for auto-uninstall
+ if ( $file && $base && class_exists( 'scbOptions' ) )
+ new scbOptions( "widget_$base", $file );
+ }
+
+ static function _scb_register() {
+ foreach ( self::$scb_widgets as $widget )
+ register_widget( $widget );
+ }
+
+ // A pre-filled method, for convenience
+ function widget( $args, $instance ) {
+ $instance = wp_parse_args( $instance, $this->defaults );
+
+ extract( $args );
+
+ echo $before_widget;
+
+ $title = apply_filters( 'widget_title', isset( $instance['title'] ) ? $instance['title'] : '', $instance, $this->id_base );
+
+ if ( ! empty( $title ) )
+ echo $before_title . $title . $after_title;
+
+ $this->content( $instance );
+
+ echo $after_widget;
+ }
+
+ // This is where the actual widget content goes
+ function content( $instance ) {}
+
+
+//_____HELPER METHODS_____
+
+
+ // See scbForms::input()
+ // Allows extra parameter $args['title']
+ protected function input( $args, $formdata = array() ) {
+ // Add default class
+ if ( !isset( $args['extra'] ) )
+ $args['extra'] = 'class="regular-text"';
+
+ // Add default label position
+ if ( !in_array( $args['type'], array( 'checkbox', 'radio' ) ) && empty( $args['desc_pos'] ) )
+ $args['desc_pos'] = 'before';
+
+ // Then add prefix to names and formdata
+ $new_formdata = array();
+ foreach ( ( array ) $args['name'] as $name )
+ $new_formdata[$this->scb_get_field_name( $name )] = @$formdata[$name];
+ $new_names = array_keys( $new_formdata );
+
+ // Finally, replace the old names
+ if ( 1 == count( $new_names ) )
+ $args['name'] = $new_names[0];
+ else
+ $args['name'] = $new_names;
+
+ return scbForms::input( $args, $new_formdata );
+ }
+
+
+//_____INTERNAL METHODS_____
+
+
+ private function scb_get_field_name( $name ) {
+ if ( $split = scbUtil::split_at( '[', $name ) )
+ list( $basename, $extra ) = $split;
+ else
+ return $this->get_field_name( $name );
+
+ return str_replace( '[]', '', $this->get_field_name( $basename ) ) . $extra;
+ }
+}
+
diff --git a/plugins/picasa-albums/1.0.5/scb/load.php b/plugins/picasa-albums/1.0.5/scb/load.php
new file mode 100644
index 00000000..633c437c
--- /dev/null
+++ b/plugins/picasa-albums/1.0.5/scb/load.php
@@ -0,0 +1,85 @@
+<?php
+
+$GLOBALS['_scb_data'] = array( 25, __FILE__, array(
+ 'scbUtil', 'scbOptions', 'scbForms', 'scbTable',
+ 'scbWidget', 'scbAdminPage', 'scbBoxesPage',
+ 'scbQueryManipulation', 'scbCron',
+) );
+
+if ( !class_exists( 'scbLoad4' ) ) :
+class scbLoad4 {
+
+ private static $candidates;
+ private static $classes;
+ private static $callbacks = array();
+
+ private static $loaded;
+
+ static function init( $callback = '' ) {
+ list( $rev, $file, $classes ) = $GLOBALS['_scb_data'];
+
+ self::$candidates[$file] = $rev;
+ self::$classes[$file] = $classes;
+
+ if ( !empty( $callback ) ) {
+ self::$callbacks[$file] = $callback;
+
+ add_action( 'activate_plugin', array( __CLASS__, 'delayed_activation' ) );
+ }
+
+ // TODO: don't load when activating a plugin ?
+ add_action( 'plugins_loaded', array( __CLASS__, 'load' ), 10, 0 );
+ }
+
+ static function delayed_activation( $plugin ) {
+ $plugin_dir = dirname( $plugin );
+
+ if ( '.' == $plugin_dir )
+ return;
+
+ foreach ( self::$callbacks as $file => $callback )
+ if ( plugin_basename( dirname( dirname( $file ) ) ) == $plugin_dir ) {
+ self::load( false );
+ call_user_func( $callback );
+ do_action( 'scb_activation_' . $plugin );
+ break;
+ }
+ }
+
+ static function load( $do_callbacks = true ) {
+ arsort( self::$candidates );
+
+ $file = key( self::$candidates );
+
+ $path = dirname( $file ) . '/';
+
+ foreach ( self::$classes[$file] as $class_name ) {
+ if ( class_exists( $class_name ) )
+ continue;
+
+ $fpath = $path . substr( $class_name, 3 ) . '.php';
+ if ( file_exists( $fpath ) ) {
+ include $fpath;
+ self::$loaded[] = $fpath;
+ }
+ }
+
+ if ( $do_callbacks )
+ foreach ( self::$callbacks as $callback )
+ call_user_func( $callback );
+ }
+
+ static function get_info() {
+ arsort( self::$candidates );
+
+ return array( self::$loaded, self::$candidates );
+ }
+}
+endif;
+
+if ( !function_exists( 'scb_init' ) ) :
+function scb_init( $callback = '' ) {
+ scbLoad4::init( $callback );
+}
+endif;
+
diff --git a/plugins/picasa-albums/1.0.5/scripts.js b/plugins/picasa-albums/1.0.5/scripts.js
new file mode 100644
index 00000000..3156d2c8
--- /dev/null
+++ b/plugins/picasa-albums/1.0.5/scripts.js
@@ -0,0 +1,25 @@
+var $j =jQuery.noConflict();
+$j(document).ready(function(){
+ $j("a.fancybox").fancybox();
+ $j(".picasa_carousel").jcarousel();
+
+});
+
+
+
+/*!
+ * jCarousel - Riding carousels with jQuery
+ * http://sorgalla.com/jcarousel/
+ *
+ * Copyright (c) 2006 Jan Sorgalla (http://sorgalla.com)
+ * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
+ * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
+ *
+ * Built on top of the jQuery library
+ * http://jquery.com
+ *
+ * Inspired by the "Carousel Component" by Bill Scott
+ * http://billwscott.com/carousel/
+ */
+
+(function(i){var q={vertical:false,rtl:false,start:1,offset:1,size:null,scroll:3,visible:null,animation:"normal",easing:"swing",auto:0,wrap:null,initCallback:null,reloadCallback:null,itemLoadCallback:null,itemFirstInCallback:null,itemFirstOutCallback:null,itemLastInCallback:null,itemLastOutCallback:null,itemVisibleInCallback:null,itemVisibleOutCallback:null,buttonNextHTML:"<div></div>",buttonPrevHTML:"<div></div>",buttonNextEvent:"click",buttonPrevEvent:"click",buttonNextCallback:null,buttonPrevCallback:null, itemFallbackDimension:null},r=false;i(window).bind("load.jcarousel",function(){r=true});i.jcarousel=function(a,c){this.options=i.extend({},q,c||{});this.autoStopped=this.locked=false;this.buttonPrevState=this.buttonNextState=this.buttonPrev=this.buttonNext=this.list=this.clip=this.container=null;if(!c||c.rtl===undefined)this.options.rtl=(i(a).attr("dir")||i("html").attr("dir")||"").toLowerCase()=="rtl";this.wh=!this.options.vertical?"width":"height";this.lt=!this.options.vertical?this.options.rtl? "right":"left":"top";for(var b="",d=a.className.split(" "),f=0;f<d.length;f++)if(d[f].indexOf("jcarousel-skin")!=-1){i(a).removeClass(d[f]);b=d[f];break}if(a.nodeName.toUpperCase()=="UL"||a.nodeName.toUpperCase()=="OL"){this.list=i(a);this.container=this.list.parent();if(this.container.hasClass("jcarousel-clip")){if(!this.container.parent().hasClass("jcarousel-container"))this.container=this.container.wrap("<div></div>");this.container=this.container.parent()}else if(!this.container.hasClass("jcarousel-container"))this.container= this.list.wrap("<div></div>").parent()}else{this.container=i(a);this.list=this.container.find("ul,ol").eq(0)}b!==""&&this.container.parent()[0].className.indexOf("jcarousel-skin")==-1&&this.container.wrap('<div class=" '+b+'"></div>');this.clip=this.list.parent();if(!this.clip.length||!this.clip.hasClass("jcarousel-clip"))this.clip=this.list.wrap("<div></div>").parent();this.buttonNext=i(".jcarousel-next",this.container);if(this.buttonNext.size()===0&&this.options.buttonNextHTML!==null)this.buttonNext= this.clip.after(this.options.buttonNextHTML).next();this.buttonNext.addClass(this.className("jcarousel-next"));this.buttonPrev=i(".jcarousel-prev",this.container);if(this.buttonPrev.size()===0&&this.options.buttonPrevHTML!==null)this.buttonPrev=this.clip.after(this.options.buttonPrevHTML).next();this.buttonPrev.addClass(this.className("jcarousel-prev"));this.clip.addClass(this.className("jcarousel-clip")).css({overflow:"hidden",position:"relative"});this.list.addClass(this.className("jcarousel-list")).css({overflow:"hidden", position:"relative",top:0,margin:0,padding:0}).css(this.options.rtl?"right":"left",0);this.container.addClass(this.className("jcarousel-container")).css({position:"relative"});!this.options.vertical&&this.options.rtl&&this.container.addClass("jcarousel-direction-rtl").attr("dir","rtl");var j=this.options.visible!==null?Math.ceil(this.clipping()/this.options.visible):null;b=this.list.children("li");var e=this;if(b.size()>0){var g=0,k=this.options.offset;b.each(function(){e.format(this,k++);g+=e.dimension(this, j)});this.list.css(this.wh,g+100+"px");if(!c||c.size===undefined)this.options.size=b.size()}this.container.css("display","block");this.buttonNext.css("display","block");this.buttonPrev.css("display","block");this.funcNext=function(){e.next()};this.funcPrev=function(){e.prev()};this.funcResize=function(){e.reload()};this.options.initCallback!==null&&this.options.initCallback(this,"init");if(!r&&i.browser.safari){this.buttons(false,false);i(window).bind("load.jcarousel",function(){e.setup()})}else this.setup()}; var h=i.jcarousel;h.fn=h.prototype={jcarousel:"0.2.7"};h.fn.extend=h.extend=i.extend;h.fn.extend({setup:function(){this.prevLast=this.prevFirst=this.last=this.first=null;this.animating=false;this.tail=this.timer=null;this.inTail=false;if(!this.locked){this.list.css(this.lt,this.pos(this.options.offset)+"px");var a=this.pos(this.options.start,true);this.prevFirst=this.prevLast=null;this.animate(a,false);i(window).unbind("resize.jcarousel",this.funcResize).bind("resize.jcarousel",this.funcResize)}}, reset:function(){this.list.empty();this.list.css(this.lt,"0px");this.list.css(this.wh,"10px");this.options.initCallback!==null&&this.options.initCallback(this,"reset");this.setup()},reload:function(){this.tail!==null&&this.inTail&&this.list.css(this.lt,h.intval(this.list.css(this.lt))+this.tail);this.tail=null;this.inTail=false;this.options.reloadCallback!==null&&this.options.reloadCallback(this);if(this.options.visible!==null){var a=this,c=Math.ceil(this.clipping()/this.options.visible),b=0,d=0; this.list.children("li").each(function(f){b+=a.dimension(this,c);if(f+1<a.first)d=b});this.list.css(this.wh,b+"px");this.list.css(this.lt,-d+"px")}this.scroll(this.first,false)},lock:function(){this.locked=true;this.buttons()},unlock:function(){this.locked=false;this.buttons()},size:function(a){if(a!==undefined){this.options.size=a;this.locked||this.buttons()}return this.options.size},has:function(a,c){if(c===undefined||!c)c=a;if(this.options.size!==null&&c>this.options.size)c=this.options.size;for(var b= a;b<=c;b++){var d=this.get(b);if(!d.length||d.hasClass("jcarousel-item-placeholder"))return false}return true},get:function(a){return i(".jcarousel-item-"+a,this.list)},add:function(a,c){var b=this.get(a),d=0,f=i(c);if(b.length===0){var j,e=h.intval(a);for(b=this.create(a);;){j=this.get(--e);if(e<=0||j.length){e<=0?this.list.prepend(b):j.after(b);break}}}else d=this.dimension(b);if(f.get(0).nodeName.toUpperCase()=="LI"){b.replaceWith(f);b=f}else b.empty().append(c);this.format(b.removeClass(this.className("jcarousel-item-placeholder")), a);f=this.options.visible!==null?Math.ceil(this.clipping()/this.options.visible):null;d=this.dimension(b,f)-d;a>0&&a<this.first&&this.list.css(this.lt,h.intval(this.list.css(this.lt))-d+"px");this.list.css(this.wh,h.intval(this.list.css(this.wh))+d+"px");return b},remove:function(a){var c=this.get(a);if(!(!c.length||a>=this.first&&a<=this.last)){var b=this.dimension(c);a<this.first&&this.list.css(this.lt,h.intval(this.list.css(this.lt))+b+"px");c.remove();this.list.css(this.wh,h.intval(this.list.css(this.wh))- b+"px")}},next:function(){this.tail!==null&&!this.inTail?this.scrollTail(false):this.scroll((this.options.wrap=="both"||this.options.wrap=="last")&&this.options.size!==null&&this.last==this.options.size?1:this.first+this.options.scroll)},prev:function(){this.tail!==null&&this.inTail?this.scrollTail(true):this.scroll((this.options.wrap=="both"||this.options.wrap=="first")&&this.options.size!==null&&this.first==1?this.options.size:this.first-this.options.scroll)},scrollTail:function(a){if(!(this.locked|| this.animating||!this.tail)){this.pauseAuto();var c=h.intval(this.list.css(this.lt));c=!a?c-this.tail:c+this.tail;this.inTail=!a;this.prevFirst=this.first;this.prevLast=this.last;this.animate(c)}},scroll:function(a,c){if(!(this.locked||this.animating)){this.pauseAuto();this.animate(this.pos(a),c)}},pos:function(a,c){var b=h.intval(this.list.css(this.lt));if(this.locked||this.animating)return b;if(this.options.wrap!="circular")a=a<1?1:this.options.size&&a>this.options.size?this.options.size:a;for(var d= this.first>a,f=this.options.wrap!="circular"&&this.first<=1?1:this.first,j=d?this.get(f):this.get(this.last),e=d?f:f-1,g=null,k=0,l=false,m=0;d?--e>=a:++e<a;){g=this.get(e);l=!g.length;if(g.length===0){g=this.create(e).addClass(this.className("jcarousel-item-placeholder"));j[d?"before":"after"](g);if(this.first!==null&&this.options.wrap=="circular"&&this.options.size!==null&&(e<=0||e>this.options.size)){j=this.get(this.index(e));if(j.length)g=this.add(e,j.clone(true))}}j=g;m=this.dimension(g);if(l)k+= m;if(this.first!==null&&(this.options.wrap=="circular"||e>=1&&(this.options.size===null||e<=this.options.size)))b=d?b+m:b-m}f=this.clipping();var p=[],o=0,n=0;j=this.get(a-1);for(e=a;++o;){g=this.get(e);l=!g.length;if(g.length===0){g=this.create(e).addClass(this.className("jcarousel-item-placeholder"));j.length===0?this.list.prepend(g):j[d?"before":"after"](g);if(this.first!==null&&this.options.wrap=="circular"&&this.options.size!==null&&(e<=0||e>this.options.size)){j=this.get(this.index(e));if(j.length)g= this.add(e,j.clone(true))}}j=g;m=this.dimension(g);if(m===0)throw Error("jCarousel: No width/height set for items. This will cause an infinite loop. Aborting...");if(this.options.wrap!="circular"&&this.options.size!==null&&e>this.options.size)p.push(g);else if(l)k+=m;n+=m;if(n>=f)break;e++}for(g=0;g<p.length;g++)p[g].remove();if(k>0){this.list.css(this.wh,this.dimension(this.list)+k+"px");if(d){b-=k;this.list.css(this.lt,h.intval(this.list.css(this.lt))-k+"px")}}k=a+o-1;if(this.options.wrap!="circular"&& this.options.size&&k>this.options.size)k=this.options.size;if(e>k){o=0;e=k;for(n=0;++o;){g=this.get(e--);if(!g.length)break;n+=this.dimension(g);if(n>=f)break}}e=k-o+1;if(this.options.wrap!="circular"&&e<1)e=1;if(this.inTail&&d){b+=this.tail;this.inTail=false}this.tail=null;if(this.options.wrap!="circular"&&k==this.options.size&&k-o+1>=1){d=h.margin(this.get(k),!this.options.vertical?"marginRight":"marginBottom");if(n-d>f)this.tail=n-f-d}if(c&&a===this.options.size&&this.tail){b-=this.tail;this.inTail= true}for(;a-- >e;)b+=this.dimension(this.get(a));this.prevFirst=this.first;this.prevLast=this.last;this.first=e;this.last=k;return b},animate:function(a,c){if(!(this.locked||this.animating)){this.animating=true;var b=this,d=function(){b.animating=false;a===0&&b.list.css(b.lt,0);if(!b.autoStopped&&(b.options.wrap=="circular"||b.options.wrap=="both"||b.options.wrap=="last"||b.options.size===null||b.last<b.options.size||b.last==b.options.size&&b.tail!==null&&!b.inTail))b.startAuto();b.buttons();b.notify("onAfterAnimation"); if(b.options.wrap=="circular"&&b.options.size!==null)for(var f=b.prevFirst;f<=b.prevLast;f++)if(f!==null&&!(f>=b.first&&f<=b.last)&&(f<1||f>b.options.size))b.remove(f)};this.notify("onBeforeAnimation");if(!this.options.animation||c===false){this.list.css(this.lt,a+"px");d()}else this.list.animate(!this.options.vertical?this.options.rtl?{right:a}:{left:a}:{top:a},this.options.animation,this.options.easing,d)}},startAuto:function(a){if(a!==undefined)this.options.auto=a;if(this.options.auto===0)return this.stopAuto(); if(this.timer===null){this.autoStopped=false;var c=this;this.timer=window.setTimeout(function(){c.next()},this.options.auto*1E3)}},stopAuto:function(){this.pauseAuto();this.autoStopped=true},pauseAuto:function(){if(this.timer!==null){window.clearTimeout(this.timer);this.timer=null}},buttons:function(a,c){if(a==null){a=!this.locked&&this.options.size!==0&&(this.options.wrap&&this.options.wrap!="first"||this.options.size===null||this.last<this.options.size);if(!this.locked&&(!this.options.wrap||this.options.wrap== "first")&&this.options.size!==null&&this.last>=this.options.size)a=this.tail!==null&&!this.inTail}if(c==null){c=!this.locked&&this.options.size!==0&&(this.options.wrap&&this.options.wrap!="last"||this.first>1);if(!this.locked&&(!this.options.wrap||this.options.wrap=="last")&&this.options.size!==null&&this.first==1)c=this.tail!==null&&this.inTail}var b=this;if(this.buttonNext.size()>0){this.buttonNext.unbind(this.options.buttonNextEvent+".jcarousel",this.funcNext);a&&this.buttonNext.bind(this.options.buttonNextEvent+ ".jcarousel",this.funcNext);this.buttonNext[a?"removeClass":"addClass"](this.className("jcarousel-next-disabled")).attr("disabled",a?false:true);this.options.buttonNextCallback!==null&&this.buttonNext.data("jcarouselstate")!=a&&this.buttonNext.each(function(){b.options.buttonNextCallback(b,this,a)}).data("jcarouselstate",a)}else this.options.buttonNextCallback!==null&&this.buttonNextState!=a&&this.options.buttonNextCallback(b,null,a);if(this.buttonPrev.size()>0){this.buttonPrev.unbind(this.options.buttonPrevEvent+ ".jcarousel",this.funcPrev);c&&this.buttonPrev.bind(this.options.buttonPrevEvent+".jcarousel",this.funcPrev);this.buttonPrev[c?"removeClass":"addClass"](this.className("jcarousel-prev-disabled")).attr("disabled",c?false:true);this.options.buttonPrevCallback!==null&&this.buttonPrev.data("jcarouselstate")!=c&&this.buttonPrev.each(function(){b.options.buttonPrevCallback(b,this,c)}).data("jcarouselstate",c)}else this.options.buttonPrevCallback!==null&&this.buttonPrevState!=c&&this.options.buttonPrevCallback(b, null,c);this.buttonNextState=a;this.buttonPrevState=c},notify:function(a){var c=this.prevFirst===null?"init":this.prevFirst<this.first?"next":"prev";this.callback("itemLoadCallback",a,c);if(this.prevFirst!==this.first){this.callback("itemFirstInCallback",a,c,this.first);this.callback("itemFirstOutCallback",a,c,this.prevFirst)}if(this.prevLast!==this.last){this.callback("itemLastInCallback",a,c,this.last);this.callback("itemLastOutCallback",a,c,this.prevLast)}this.callback("itemVisibleInCallback", a,c,this.first,this.last,this.prevFirst,this.prevLast);this.callback("itemVisibleOutCallback",a,c,this.prevFirst,this.prevLast,this.first,this.last)},callback:function(a,c,b,d,f,j,e){if(!(this.options[a]==null||typeof this.options[a]!="object"&&c!="onAfterAnimation")){var g=typeof this.options[a]=="object"?this.options[a][c]:this.options[a];if(i.isFunction(g)){var k=this;if(d===undefined)g(k,b,c);else if(f===undefined)this.get(d).each(function(){g(k,this,d,b,c)});else{a=function(m){k.get(m).each(function(){g(k, this,m,b,c)})};for(var l=d;l<=f;l++)l!==null&&!(l>=j&&l<=e)&&a(l)}}}},create:function(a){return this.format("<li></li>",a)},format:function(a,c){a=i(a);for(var b=a.get(0).className.split(" "),d=0;d<b.length;d++)b[d].indexOf("jcarousel-")!=-1&&a.removeClass(b[d]);a.addClass(this.className("jcarousel-item")).addClass(this.className("jcarousel-item-"+c)).css({"float":this.options.rtl?"right":"left","list-style":"none"}).attr("jcarouselindex",c);return a},className:function(a){return a+" "+a+(!this.options.vertical? "-horizontal":"-vertical")},dimension:function(a,c){var b=a.jquery!==undefined?a[0]:a,d=!this.options.vertical?(b.offsetWidth||h.intval(this.options.itemFallbackDimension))+h.margin(b,"marginLeft")+h.margin(b,"marginRight"):(b.offsetHeight||h.intval(this.options.itemFallbackDimension))+h.margin(b,"marginTop")+h.margin(b,"marginBottom");if(c==null||d==c)return d;d=!this.options.vertical?c-h.margin(b,"marginLeft")-h.margin(b,"marginRight"):c-h.margin(b,"marginTop")-h.margin(b,"marginBottom");i(b).css(this.wh, d+"px");return this.dimension(b)},clipping:function(){return!this.options.vertical?this.clip[0].offsetWidth-h.intval(this.clip.css("borderLeftWidth"))-h.intval(this.clip.css("borderRightWidth")):this.clip[0].offsetHeight-h.intval(this.clip.css("borderTopWidth"))-h.intval(this.clip.css("borderBottomWidth"))},index:function(a,c){if(c==null)c=this.options.size;return Math.round(((a-1)/c-Math.floor((a-1)/c))*c)+1}});h.extend({defaults:function(a){return i.extend(q,a||{})},margin:function(a,c){if(!a)return 0; var b=a.jquery!==undefined?a[0]:a;if(c=="marginRight"&&i.browser.safari){var d={display:"block","float":"none",width:"auto"},f,j;i.swap(b,d,function(){f=b.offsetWidth});d.marginRight=0;i.swap(b,d,function(){j=b.offsetWidth});return j-f}return h.intval(i.css(b,c))},intval:function(a){a=parseInt(a,10);return isNaN(a)?0:a}});i.fn.jcarousel=function(a){if(typeof a=="string"){var c=i(this).data("jcarousel"),b=Array.prototype.slice.call(arguments,1);return c[a].apply(c,b)}else return this.each(function(){i(this).data("jcarousel", new h(this,a))})}})(jQuery);
diff --git a/plugins/picasa-albums/1.0.5/style.css b/plugins/picasa-albums/1.0.5/style.css
new file mode 100644
index 00000000..cef670a3
--- /dev/null
+++ b/plugins/picasa-albums/1.0.5/style.css
@@ -0,0 +1,13 @@
+#content .alignleft.picasa_image{
+ margin-right:10px;
+}
+.picasa_album_embed{
+ margin:10px 0;
+}
+#content .type-album .wp-caption {
+ margin:0 10px 10px 0;
+}
+
+
+/* clear fix*/
+.clear {clear: both;display: block;overflow: hidden;visibility: hidden;width: 0;height: 0;}.clearfix:after {clear: both;content:' ';display: block;font-size: 0;line-height: 0;visibility: hidden;width: 0;height: 0;}.clearfix {display: inline-block;}* html .clearfix {height: 1%;}.clearfix {display: block;} \ No newline at end of file
diff --git a/plugins/picasa-albums/admin.php b/plugins/picasa-albums/admin.php
new file mode 100644
index 00000000..ea3335a2
--- /dev/null
+++ b/plugins/picasa-albums/admin.php
@@ -0,0 +1,122 @@
+<?php
+
+class picasaOptions_Options_Page extends scbAdminPage {
+
+ function setup() {
+ $this->textdomain = 'wp-picasaOptions';
+ $this->args = array(
+ 'page_title' => __('Picasa Albums Option', $this->textdomain),
+ 'menu_title' => __('Picasa Albums', $this->textdomain),
+ 'parent string'=>'edit.php'
+ );
+ }
+
+ function validate($options) {
+ return $options;
+ }
+ function page_content() {
+ $new = (empty($this->options->username)) ? ' ref="new"':' ref="saved"';
+ $rows = array(
+ array(
+ 'title' => __('Picasa User Name', $this->textdomain),
+ 'type' => 'text',
+ 'name' => 'username',
+ 'extra' => 'size="50" '.$new,
+ 'desc' => '<span style="color:red; display:none;">Save options before importing albums!</span><br />Picasa\'s API does not need password to access your public RSS feed.',
+ ),
+ );
+ $out =
+ html('h3', __('Picasa Settings', $this->textdomain))
+ .html('p', __('', $this->textdomain))
+ .$this->table($rows);
+
+ $rows = array(
+ array(
+ 'title' => __('Import Albums', $this->textdomain),
+ 'type' => 'button',
+ 'name' => 'import_albums',
+ 'id'=>'import_albums',
+ 'value'=>'Import',
+ 'extra'=>'class="button"',
+ 'desc' => '<span class="loader hide"><i>Loading</i></span></label><label>',
+ )
+ );
+ $out.=html('h3', __('Import Data', $this->textdomain));
+ $out.=html('p', __('', $this->textdomain));
+
+ $out.=$this->table($rows);
+ $rows = array(
+ array(
+ 'title' => __('Album Thumbnail Height', $this->textdomain),
+ 'type' => 'text',
+ 'name' => 'album_thumbsize',
+ 'extra'=>'class="small-text"',
+ 'desc' => '<span>px. </span>'
+ ),
+ array(
+ 'title' => __('Crop Album Thumbnails', $this->textdomain),
+ 'type' => 'select',
+ 'value'=>array('no'=>'No','yes'=>'Yes'),
+ 'name' => 'album_thumbcrop',
+ 'desc' => '<span style="color:red">Caution: Uncropped images may brake grid layout!</span>'
+ )
+ );
+ $out.=html('h3', __('Album Page Settings', $this->textdomain));
+ $out.=html('p', __('', $this->textdomain));
+ $out.=$this->table($rows);
+ $rows=array(
+ array(
+ 'title' => __('Image Thumbnail Size', $this->textdomain),
+ 'type' => 'text',
+ 'name' => 'image_thumbsize',
+ 'extra'=>'class="small-text"',
+ 'desc' => '<span>px. <br />Recommended sizes: 32, 48, 64, 72, 104, 144, 150, 160</span>'
+ ),
+ array(
+ 'title' => __('Image Max Zoom Size', $this->textdomain),
+ 'type' => 'text',
+ 'name' => 'image_maxsize',
+ 'extra'=>'class="small-text"',
+ 'desc' => '<span>px.<br />
+ The max. size of the image users will see in lightbox.<br />
+ Available sizes: 94, 110, 128, 200, 220, 288, 320, 400, 512, 576, 640, 720, 800, 912, 1024, 1152, 1280, 1440, 1600
+ </span>'
+ ),
+ array(
+ 'title' => __('Crop Thumbnails', $this->textdomain),
+ 'type' => 'select',
+ 'value'=>array('no'=>'No','yes'=>'Yes'),
+ 'name' => 'image_thumbcrop',
+ 'desc' => '<br /><span>It is recommended to use crop. this way images look square and align nicely.</span>'
+ )
+
+ );
+ $out.=html('h3', __('Gallery Page Settings', $this->textdomain));
+ $out.=html('p', __('Define how your gallery posts will look.', $this->textdomain));
+ $out.=$this->table($rows);
+
+ // v.1.0.6
+ $out.=html('h3', __('Url Settings', $this->textdomain));
+ if ( get_option('permalink_structure') != '' )
+ {
+ $rows=array(
+ array(
+ 'title' => __('Gallery pretty url', $this->textdomain),
+ 'type' => 'text',
+ 'name' => 'gallery_path',
+ 'extra'=>'class="small-text" ',
+ 'desc' => '<div>Please make sure to update link to albums in blog\'s menus and all other links pointing to picasa albums.</div>'
+ )
+ );
+ $out.=html('Customize blog\'s url structure', __('', $this->textdomain));
+ }else{
+ $out.=html('span', __('If you would like to customize path to your albums <a href="options-permalink.php">permalinks</a> must be enabled!', $this->textdomain));
+ $rows=array();
+ }
+ $out.=$this->table($rows);
+
+ $out.=html('p', __('Do you need more features? Check out <a href="http://mikhailkozlov.com/category/projects/picasa-albums/" target="blank">Picasa Albums Pro</a>.', $this->textdomain));
+ echo $this->form_wrap($out);
+ }
+}
+
diff --git a/plugins/picasa-albums/admin/scripts.js b/plugins/picasa-albums/admin/scripts.js
new file mode 100644
index 00000000..fa18e2cb
--- /dev/null
+++ b/plugins/picasa-albums/admin/scripts.js
@@ -0,0 +1,120 @@
+var albumPage = false;
+var newName = false;
+var $j =jQuery.noConflict();
+$j(document).ready(function(){
+ /************ option page function **************/
+ // little validation
+ if($j("input#username").attr('ref') == 'new'){
+ newName = true;
+ $j("#import_albums").attr('disabled','disabled');
+ $j(this).next('span').show();
+ }else{
+ newName = false;
+ }
+ $j("input#username").bind('keyup, keydown',function(){
+ $j(this).next('span').show();
+ $j("#import_albums").attr('disabled','disabled');
+ newName = true;
+ });
+ /************ END option page function **************/
+
+ /************ shared function **************/
+ $j("#import_albums").click(function(){
+ if(!newName){
+ var l = $j(this).next();
+ l.show();
+ $j.get('admin-ajax.php?action=picasa_ajax_import',{'user':$j('input#username').val(),'password':$j("#gpassword").val()},function(){
+ l.hide();
+ });
+ }else{
+ alert('Save options before importing albums!');
+ }
+ });
+
+ /************ end shared function **************/
+
+
+ /************ custom post type functions **************/
+ $j("#load_imges_now").bind("click",function(){
+ $j("#import_album_images").click();
+ return false;
+ });
+ // enable fancybox
+ $j("a.fancybox").fancybox();
+ // import button
+ $j("#import_album_images").click(function(){
+ var l = $j(this);
+ var t = $j(this).val();
+ l.val("Loading...");
+ $j.get("admin-ajax.php?action=picasa_ajax_reload_images",{"id":l.attr("data"),"authkey":l.attr("authkey"),"post_ID":$j("#post_ID").val()},function(){
+ l.val(t);
+ window.location.href=window.location.href
+ });
+ });
+ // check if sortable here
+ if($j().sortable) {
+ // find how to add condition here.
+ $j("#picasa-album-images ul.ui-sortable").sortable({
+ containment: 'parent',
+ forcePlaceholderSize: true,
+ distance: 1,
+ tolerance: 'intersect',
+ placeholder: 'ui-state-highlight',
+ opacity: 0.6
+ });
+ }
+ // set album thumbnail
+ $j("a.cover_image").click(function(){
+ var l = $j(this);
+ album.thumbnail.url=l.attr("href").substr(1);
+ album.thumbnail.height=l.attr("ref");
+ album.thumbnail.width=l.attr("ref");
+ $j("#cover_image").attr("height",album.thumbnail.height).attr("width",album.thumbnail.width).attr("src",album.thumbnail.url).fadeOut("fast").fadeIn("fast");
+ $j("#picasa-album-images .ui-sortable li").siblings().removeAttr("style");
+ l.parent().prev('img').parent().css({border:"1px solid #999"});
+ // update text
+ $j("textarea#excerpt").val(JSON.stringify(album));
+ return false;
+ });
+ // show hide images
+ $j('a.hide_image').click(function(){
+ var l = $j(this);
+ var m=0; // martch
+ for(i=0; i<images.length; i++){
+ if(images[i].id == l.attr('id')){
+ m=i;
+ l.toggleClass('visible');
+ if(l.hasClass('visible')){
+ images[i].show="yes";
+ l.parent().prev('img').toggleClass('dimlight');
+ }else{
+ images[i].show="no";
+ l.parent().prev('img').toggleClass('dimlight');
+ }
+ }
+ }
+ $j('span',l).toggle();
+ return false;
+ });
+
+ // save album changes
+ var clickPublish = false;
+ $j("#publish, #save-post").bind("click",function(){
+ var btn = $j(this);
+ if(clickPublish == false && $j("textarea#content").hasClass("albumpage") ){
+ clickPublish = true;
+ var post = "todo=saveAlbum&post_ID="+$j("#post_ID").val()+"&"+$j("#picasa-album-images ul.ui-sortable").sortable("serialize");
+ album.summary = $j("#album_summary").val();
+ $j("textarea#excerpt").val(JSON.stringify(album));
+ for(i=0; i<images.length; i++){
+ post += '&id['+images[i].id+']='+images[i].show;
+ }
+ $j.get('admin-ajax.php?action=picasa_ajax_image_action',post,function(r){
+ // get responce and update textarea
+ $j("textarea#content").val(r);
+ btn.click();
+ },'html');
+ return false;
+ }
+ });
+}); \ No newline at end of file
diff --git a/plugins/picasa-albums/admin/style.css b/plugins/picasa-albums/admin/style.css
new file mode 100644
index 00000000..e2be7e74
--- /dev/null
+++ b/plugins/picasa-albums/admin/style.css
@@ -0,0 +1,73 @@
+#gpass_holder{
+ float:left;
+ margin-right:20px;
+}
+span.loader{ background:url(../images/loading.gif) right no-repeat; padding-right:40px;}
+.hide{
+ display:none;
+}
+#adminmenu #menu-posts-album.menu-icon-post div.wp-menu-image{background:url("../images/picasa_post_icon.png") no-repeat scroll 0px -28px transparent;}
+#adminmenu #menu-posts-album.menu-icon-post:hover div.wp-menu-image{background:url("../images/picasa_post_icon.png") no-repeat scroll 0px 0px transparent;}
+#picasa-album-images div.ui-sortable{
+ display:block;
+ height:100%;
+ list-style:none;
+
+ position:relative;
+}
+#picasa-album-images ul.ui-sortable li{
+ border:1px solid #CCC;
+ cursor:move;
+ display:inline-block;
+ line-height:100%;
+ margin-bottom:10px;
+ margin-right:10px;
+ padding:3px;
+ position:relative;
+}
+.ui-state-highlight {
+ background-color:#ffff80;
+ height: 110px;
+ line-height:100%;
+}
+#picasa-album-images li div{
+ background-color:#F9F9F9;
+ bottom:0;
+ display:none;
+ height:16px;
+ left:0px;
+ opacity:0.95;
+ padding:4px 6px 0px;
+ position:absolute;
+ text-align:center;
+ width:104px;
+}
+#picasa-album-images li a{
+ font-size:11px;
+ margin-right:2px;
+ vertical-align:middle;
+}
+#picasa-album-images li:hover div{
+ display:block;
+}
+/* add browser support */
+#picasa-album-images li img{
+ opacity:1;
+}
+#picasa-album-images li img.dimlight{
+ opacity:0.5;
+}
+
+.icon{
+ background:left no-repeat;
+ padding-left:20px;
+}
+.icon.hide_image{
+ background:url(../images/lock-image.png) left no-repeat scroll;
+}
+.icon.view_image{
+ background:url(../images/zoom_layer.png) left no-repeat scroll;
+}
+.icon.cover_image{
+ background:url(../images/image-sunset.png) left no-repeat scroll;
+}
diff --git a/plugins/picasa-albums/fancybox/blank.gif b/plugins/picasa-albums/fancybox/blank.gif
new file mode 100644
index 00000000..35d42e80
--- /dev/null
+++ b/plugins/picasa-albums/fancybox/blank.gif
Binary files differ
diff --git a/plugins/picasa-albums/fancybox/fancy_close.png b/plugins/picasa-albums/fancybox/fancy_close.png
new file mode 100644
index 00000000..07035307
--- /dev/null
+++ b/plugins/picasa-albums/fancybox/fancy_close.png
Binary files differ
diff --git a/plugins/picasa-albums/fancybox/fancy_loading.png b/plugins/picasa-albums/fancybox/fancy_loading.png
new file mode 100644
index 00000000..25030179
--- /dev/null
+++ b/plugins/picasa-albums/fancybox/fancy_loading.png
Binary files differ
diff --git a/plugins/picasa-albums/fancybox/fancy_nav_left.png b/plugins/picasa-albums/fancybox/fancy_nav_left.png
new file mode 100644
index 00000000..ebaa6a4f
--- /dev/null
+++ b/plugins/picasa-albums/fancybox/fancy_nav_left.png
Binary files differ
diff --git a/plugins/picasa-albums/fancybox/fancy_nav_right.png b/plugins/picasa-albums/fancybox/fancy_nav_right.png
new file mode 100644
index 00000000..873294e9
--- /dev/null
+++ b/plugins/picasa-albums/fancybox/fancy_nav_right.png
Binary files differ
diff --git a/plugins/picasa-albums/fancybox/fancy_shadow_e.png b/plugins/picasa-albums/fancybox/fancy_shadow_e.png
new file mode 100644
index 00000000..2eda0893
--- /dev/null
+++ b/plugins/picasa-albums/fancybox/fancy_shadow_e.png
Binary files differ
diff --git a/plugins/picasa-albums/fancybox/fancy_shadow_n.png b/plugins/picasa-albums/fancybox/fancy_shadow_n.png
new file mode 100644
index 00000000..69aa10e2
--- /dev/null
+++ b/plugins/picasa-albums/fancybox/fancy_shadow_n.png
Binary files differ
diff --git a/plugins/picasa-albums/fancybox/fancy_shadow_ne.png b/plugins/picasa-albums/fancybox/fancy_shadow_ne.png
new file mode 100644
index 00000000..79f6980a
--- /dev/null
+++ b/plugins/picasa-albums/fancybox/fancy_shadow_ne.png
Binary files differ
diff --git a/plugins/picasa-albums/fancybox/fancy_shadow_nw.png b/plugins/picasa-albums/fancybox/fancy_shadow_nw.png
new file mode 100644
index 00000000..7182cd93
--- /dev/null
+++ b/plugins/picasa-albums/fancybox/fancy_shadow_nw.png
Binary files differ
diff --git a/plugins/picasa-albums/fancybox/fancy_shadow_s.png b/plugins/picasa-albums/fancybox/fancy_shadow_s.png
new file mode 100644
index 00000000..d8858bfb
--- /dev/null
+++ b/plugins/picasa-albums/fancybox/fancy_shadow_s.png
Binary files differ
diff --git a/plugins/picasa-albums/fancybox/fancy_shadow_se.png b/plugins/picasa-albums/fancybox/fancy_shadow_se.png
new file mode 100644
index 00000000..541e3ffd
--- /dev/null
+++ b/plugins/picasa-albums/fancybox/fancy_shadow_se.png
Binary files differ
diff --git a/plugins/picasa-albums/fancybox/fancy_shadow_sw.png b/plugins/picasa-albums/fancybox/fancy_shadow_sw.png
new file mode 100644
index 00000000..b451689f
--- /dev/null
+++ b/plugins/picasa-albums/fancybox/fancy_shadow_sw.png
Binary files differ
diff --git a/plugins/picasa-albums/fancybox/fancy_shadow_w.png b/plugins/picasa-albums/fancybox/fancy_shadow_w.png
new file mode 100644
index 00000000..8a4e4a88
--- /dev/null
+++ b/plugins/picasa-albums/fancybox/fancy_shadow_w.png
Binary files differ
diff --git a/plugins/picasa-albums/fancybox/fancy_title_left.png b/plugins/picasa-albums/fancybox/fancy_title_left.png
new file mode 100644
index 00000000..6049223d
--- /dev/null
+++ b/plugins/picasa-albums/fancybox/fancy_title_left.png
Binary files differ
diff --git a/plugins/picasa-albums/fancybox/fancy_title_main.png b/plugins/picasa-albums/fancybox/fancy_title_main.png
new file mode 100644
index 00000000..8044271f
--- /dev/null
+++ b/plugins/picasa-albums/fancybox/fancy_title_main.png
Binary files differ
diff --git a/plugins/picasa-albums/fancybox/fancy_title_over.png b/plugins/picasa-albums/fancybox/fancy_title_over.png
new file mode 100644
index 00000000..d9f458f4
--- /dev/null
+++ b/plugins/picasa-albums/fancybox/fancy_title_over.png
Binary files differ
diff --git a/plugins/picasa-albums/fancybox/fancy_title_right.png b/plugins/picasa-albums/fancybox/fancy_title_right.png
new file mode 100644
index 00000000..e36d9db2
--- /dev/null
+++ b/plugins/picasa-albums/fancybox/fancy_title_right.png
Binary files differ
diff --git a/plugins/picasa-albums/fancybox/fancybox-x.png b/plugins/picasa-albums/fancybox/fancybox-x.png
new file mode 100644
index 00000000..c2130f86
--- /dev/null
+++ b/plugins/picasa-albums/fancybox/fancybox-x.png
Binary files differ
diff --git a/plugins/picasa-albums/fancybox/fancybox-y.png b/plugins/picasa-albums/fancybox/fancybox-y.png
new file mode 100644
index 00000000..7ef399b9
--- /dev/null
+++ b/plugins/picasa-albums/fancybox/fancybox-y.png
Binary files differ
diff --git a/plugins/picasa-albums/fancybox/fancybox.png b/plugins/picasa-albums/fancybox/fancybox.png
new file mode 100644
index 00000000..65e14f68
--- /dev/null
+++ b/plugins/picasa-albums/fancybox/fancybox.png
Binary files differ
diff --git a/plugins/picasa-albums/fancybox/jquery.easing-1.3.pack.js b/plugins/picasa-albums/fancybox/jquery.easing-1.3.pack.js
new file mode 100644
index 00000000..9028179e
--- /dev/null
+++ b/plugins/picasa-albums/fancybox/jquery.easing-1.3.pack.js
@@ -0,0 +1,72 @@
+/*
+ * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
+ *
+ * Uses the built in easing capabilities added In jQuery 1.1
+ * to offer multiple easing options
+ *
+ * TERMS OF USE - jQuery Easing
+ *
+ * Open source under the BSD License.
+ *
+ * Copyright © 2008 George McGinley Smith
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this list of
+ * conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice, this list
+ * of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * Neither the name of the author nor the names of contributors may be used to endorse
+ * or promote products derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+*/
+
+// t: current time, b: begInnIng value, c: change In value, d: duration
+eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('h.i[\'1a\']=h.i[\'z\'];h.O(h.i,{y:\'D\',z:9(x,t,b,c,d){6 h.i[h.i.y](x,t,b,c,d)},17:9(x,t,b,c,d){6 c*(t/=d)*t+b},D:9(x,t,b,c,d){6-c*(t/=d)*(t-2)+b},13:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t+b;6-c/2*((--t)*(t-2)-1)+b},X:9(x,t,b,c,d){6 c*(t/=d)*t*t+b},U:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t+1)+b},R:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t+b;6 c/2*((t-=2)*t*t+2)+b},N:9(x,t,b,c,d){6 c*(t/=d)*t*t*t+b},M:9(x,t,b,c,d){6-c*((t=t/d-1)*t*t*t-1)+b},L:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t+b;6-c/2*((t-=2)*t*t*t-2)+b},K:9(x,t,b,c,d){6 c*(t/=d)*t*t*t*t+b},J:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t*t*t+1)+b},I:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t*t+b;6 c/2*((t-=2)*t*t*t*t+2)+b},G:9(x,t,b,c,d){6-c*8.C(t/d*(8.g/2))+c+b},15:9(x,t,b,c,d){6 c*8.n(t/d*(8.g/2))+b},12:9(x,t,b,c,d){6-c/2*(8.C(8.g*t/d)-1)+b},Z:9(x,t,b,c,d){6(t==0)?b:c*8.j(2,10*(t/d-1))+b},Y:9(x,t,b,c,d){6(t==d)?b+c:c*(-8.j(2,-10*t/d)+1)+b},W:9(x,t,b,c,d){e(t==0)6 b;e(t==d)6 b+c;e((t/=d/2)<1)6 c/2*8.j(2,10*(t-1))+b;6 c/2*(-8.j(2,-10*--t)+2)+b},V:9(x,t,b,c,d){6-c*(8.o(1-(t/=d)*t)-1)+b},S:9(x,t,b,c,d){6 c*8.o(1-(t=t/d-1)*t)+b},Q:9(x,t,b,c,d){e((t/=d/2)<1)6-c/2*(8.o(1-t*t)-1)+b;6 c/2*(8.o(1-(t-=2)*t)+1)+b},P:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6-(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b},H:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6 a*8.j(2,-10*t)*8.n((t*d-s)*(2*8.g)/p)+c+b},T:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d/2)==2)6 b+c;e(!p)p=d*(.3*1.5);e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);e(t<1)6-.5*(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b;6 a*8.j(2,-10*(t-=1))*8.n((t*d-s)*(2*8.g)/p)*.5+c+b},F:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*(t/=d)*t*((s+1)*t-s)+b},E:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},16:9(x,t,b,c,d,s){e(s==u)s=1.l;e((t/=d/2)<1)6 c/2*(t*t*(((s*=(1.B))+1)*t-s))+b;6 c/2*((t-=2)*t*(((s*=(1.B))+1)*t+s)+2)+b},A:9(x,t,b,c,d){6 c-h.i.v(x,d-t,0,c,d)+b},v:9(x,t,b,c,d){e((t/=d)<(1/2.k)){6 c*(7.q*t*t)+b}m e(t<(2/2.k)){6 c*(7.q*(t-=(1.5/2.k))*t+.k)+b}m e(t<(2.5/2.k)){6 c*(7.q*(t-=(2.14/2.k))*t+.11)+b}m{6 c*(7.q*(t-=(2.18/2.k))*t+.19)+b}},1b:9(x,t,b,c,d){e(t<d/2)6 h.i.A(x,t*2,0,c,d)*.5+b;6 h.i.v(x,t*2-d,0,c,d)*.5+c*.5+b}});',62,74,'||||||return||Math|function|||||if|var|PI|jQuery|easing|pow|75|70158|else|sin|sqrt||5625|asin|||undefined|easeOutBounce|abs||def|swing|easeInBounce|525|cos|easeOutQuad|easeOutBack|easeInBack|easeInSine|easeOutElastic|easeInOutQuint|easeOutQuint|easeInQuint|easeInOutQuart|easeOutQuart|easeInQuart|extend|easeInElastic|easeInOutCirc|easeInOutCubic|easeOutCirc|easeInOutElastic|easeOutCubic|easeInCirc|easeInOutExpo|easeInCubic|easeOutExpo|easeInExpo||9375|easeInOutSine|easeInOutQuad|25|easeOutSine|easeInOutBack|easeInQuad|625|984375|jswing|easeInOutBounce'.split('|'),0,{}))
+
+/*
+ *
+ * TERMS OF USE - EASING EQUATIONS
+ *
+ * Open source under the BSD License.
+ *
+ * Copyright © 2001 Robert Penner
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this list of
+ * conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice, this list
+ * of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * Neither the name of the author nor the names of contributors may be used to endorse
+ * or promote products derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
diff --git a/plugins/picasa-albums/fancybox/jquery.easing.js b/plugins/picasa-albums/fancybox/jquery.easing.js
new file mode 100644
index 00000000..9370a3b7
--- /dev/null
+++ b/plugins/picasa-albums/fancybox/jquery.easing.js
@@ -0,0 +1,72 @@
+/*
+ * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
+ *
+ * Uses the built in easing capabilities added In jQuery 1.1
+ * to offer multiple easing options
+ *
+ * TERMS OF USE - jQuery Easing
+ *
+ * Open source under the BSD License.
+ *
+ * Copyright © 2008 George McGinley Smith
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this list of
+ * conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice, this list
+ * of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * Neither the name of the author nor the names of contributors may be used to endorse
+ * or promote products derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+*/
+
+// t: current time, b: begInnIng value, c: change In value, d: duration
+eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('h.i[\'1a\']=h.i[\'z\'];h.O(h.i,{y:\'D\',z:9(x,t,b,c,d){6 h.i[h.i.y](x,t,b,c,d)},17:9(x,t,b,c,d){6 c*(t/=d)*t+b},D:9(x,t,b,c,d){6-c*(t/=d)*(t-2)+b},13:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t+b;6-c/2*((--t)*(t-2)-1)+b},X:9(x,t,b,c,d){6 c*(t/=d)*t*t+b},U:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t+1)+b},R:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t+b;6 c/2*((t-=2)*t*t+2)+b},N:9(x,t,b,c,d){6 c*(t/=d)*t*t*t+b},M:9(x,t,b,c,d){6-c*((t=t/d-1)*t*t*t-1)+b},L:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t+b;6-c/2*((t-=2)*t*t*t-2)+b},K:9(x,t,b,c,d){6 c*(t/=d)*t*t*t*t+b},J:9(x,t,b,c,d){6 c*((t=t/d-1)*t*t*t*t+1)+b},I:9(x,t,b,c,d){e((t/=d/2)<1)6 c/2*t*t*t*t*t+b;6 c/2*((t-=2)*t*t*t*t+2)+b},G:9(x,t,b,c,d){6-c*8.C(t/d*(8.g/2))+c+b},15:9(x,t,b,c,d){6 c*8.n(t/d*(8.g/2))+b},12:9(x,t,b,c,d){6-c/2*(8.C(8.g*t/d)-1)+b},Z:9(x,t,b,c,d){6(t==0)?b:c*8.j(2,10*(t/d-1))+b},Y:9(x,t,b,c,d){6(t==d)?b+c:c*(-8.j(2,-10*t/d)+1)+b},W:9(x,t,b,c,d){e(t==0)6 b;e(t==d)6 b+c;e((t/=d/2)<1)6 c/2*8.j(2,10*(t-1))+b;6 c/2*(-8.j(2,-10*--t)+2)+b},V:9(x,t,b,c,d){6-c*(8.o(1-(t/=d)*t)-1)+b},S:9(x,t,b,c,d){6 c*8.o(1-(t=t/d-1)*t)+b},Q:9(x,t,b,c,d){e((t/=d/2)<1)6-c/2*(8.o(1-t*t)-1)+b;6 c/2*(8.o(1-(t-=2)*t)+1)+b},P:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6-(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b},H:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d)==1)6 b+c;e(!p)p=d*.3;e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);6 a*8.j(2,-10*t)*8.n((t*d-s)*(2*8.g)/p)+c+b},T:9(x,t,b,c,d){f s=1.l;f p=0;f a=c;e(t==0)6 b;e((t/=d/2)==2)6 b+c;e(!p)p=d*(.3*1.5);e(a<8.w(c)){a=c;f s=p/4}m f s=p/(2*8.g)*8.r(c/a);e(t<1)6-.5*(a*8.j(2,10*(t-=1))*8.n((t*d-s)*(2*8.g)/p))+b;6 a*8.j(2,-10*(t-=1))*8.n((t*d-s)*(2*8.g)/p)*.5+c+b},F:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*(t/=d)*t*((s+1)*t-s)+b},E:9(x,t,b,c,d,s){e(s==u)s=1.l;6 c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},16:9(x,t,b,c,d,s){e(s==u)s=1.l;e((t/=d/2)<1)6 c/2*(t*t*(((s*=(1.B))+1)*t-s))+b;6 c/2*((t-=2)*t*(((s*=(1.B))+1)*t+s)+2)+b},A:9(x,t,b,c,d){6 c-h.i.v(x,d-t,0,c,d)+b},v:9(x,t,b,c,d){e((t/=d)<(1/2.k)){6 c*(7.q*t*t)+b}m e(t<(2/2.k)){6 c*(7.q*(t-=(1.5/2.k))*t+.k)+b}m e(t<(2.5/2.k)){6 c*(7.q*(t-=(2.14/2.k))*t+.11)+b}m{6 c*(7.q*(t-=(2.18/2.k))*t+.19)+b}},1b:9(x,t,b,c,d){e(t<d/2)6 h.i.A(x,t*2,0,c,d)*.5+b;6 h.i.v(x,t*2-d,0,c,d)*.5+c*.5+b}});',62,74,'||||||return||Math|function|||||if|var|PI|jQuery|easing|pow|75|70158|else|sin|sqrt||5625|asin|||undefined|easeOutBounce|abs||def|swing|easeInBounce|525|cos|easeOutQuad|easeOutBack|easeInBack|easeInSine|easeOutElastic|easeInOutQuint|easeOutQuint|easeInQuint|easeInOutQuart|easeOutQuart|easeInQuart|extend|easeInElastic|easeInOutCirc|easeInOutCubic|easeOutCirc|easeInOutElastic|easeOutCubic|easeInCirc|easeInOutExpo|easeInCubic|easeOutExpo|easeInExpo||9375|easeInOutSine|easeInOutQuad|25|easeOutSine|easeInOutBack|easeInQuad|625|984375|jswing|easeInOutBounce'.split('|'),0,{}))
+
+/*
+ *
+ * TERMS OF USE - EASING EQUATIONS
+ *
+ * Open source under the BSD License.
+ *
+ * Copyright © 2001 Robert Penner
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice, this list of
+ * conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice, this list
+ * of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * Neither the name of the author nor the names of contributors may be used to endorse
+ * or promote products derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
diff --git a/plugins/picasa-albums/fancybox/jquery.fancybox-1.3.4.css b/plugins/picasa-albums/fancybox/jquery.fancybox-1.3.4.css
new file mode 100644
index 00000000..6f53d8f4
--- /dev/null
+++ b/plugins/picasa-albums/fancybox/jquery.fancybox-1.3.4.css
@@ -0,0 +1,359 @@
+/*
+ * FancyBox - jQuery Plugin
+ * Simple and fancy lightbox alternative
+ *
+ * Examples and documentation at: http://fancybox.net
+ *
+ * Copyright (c) 2008 - 2010 Janis Skarnelis
+ * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
+ *
+ * Version: 1.3.4 (11/11/2010)
+ * Requires: jQuery v1.3+
+ *
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+ */
+
+#fancybox-loading {
+ position: fixed;
+ top: 50%;
+ left: 50%;
+ width: 40px;
+ height: 40px;
+ margin-top: -20px;
+ margin-left: -20px;
+ cursor: pointer;
+ overflow: hidden;
+ z-index: 1104;
+ display: none;
+}
+
+#fancybox-loading div {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 40px;
+ height: 480px;
+ background-image: url('fancybox.png');
+}
+
+#fancybox-overlay {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ z-index: 1100;
+ display: none;
+}
+
+#fancybox-tmp {
+ padding: 0;
+ margin: 0;
+ border: 0;
+ overflow: auto;
+ display: none;
+}
+
+#fancybox-wrap {
+ position: absolute;
+ top: 0;
+ left: 0;
+ padding: 20px;
+ z-index: 1101;
+ outline: none;
+ display: none;
+}
+
+#fancybox-outer {
+ position: relative;
+ width: 100%;
+ height: 100%;
+ background: #fff;
+}
+
+#fancybox-content {
+ width: 0;
+ height: 0;
+ padding: 0;
+ outline: none;
+ position: relative;
+ overflow: hidden;
+ z-index: 1102;
+ border: 0px solid #fff;
+}
+
+#fancybox-hide-sel-frame {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ background: transparent;
+ z-index: 1101;
+}
+
+#fancybox-close {
+ position: absolute;
+ top: -15px;
+ right: -15px;
+ width: 30px;
+ height: 30px;
+ background: transparent url('fancybox.png') -40px 0px;
+ cursor: pointer;
+ z-index: 1103;
+ display: none;
+}
+
+#fancybox-error {
+ color: #444;
+ font: normal 12px/20px Arial;
+ padding: 14px;
+ margin: 0;
+}
+
+#fancybox-img {
+ width: 100%;
+ height: 100%;
+ padding: 0;
+ margin: 0;
+ border: none;
+ outline: none;
+ line-height: 0;
+ vertical-align: top;
+}
+
+#fancybox-frame {
+ width: 100%;
+ height: 100%;
+ border: none;
+ display: block;
+}
+
+#fancybox-left, #fancybox-right {
+ position: absolute;
+ bottom: 0px;
+ height: 100%;
+ width: 35%;
+ cursor: pointer;
+ outline: none;
+ background: transparent url('blank.gif');
+ z-index: 1102;
+ display: none;
+}
+
+#fancybox-left {
+ left: 0px;
+}
+
+#fancybox-right {
+ right: 0px;
+}
+
+#fancybox-left-ico, #fancybox-right-ico {
+ position: absolute;
+ top: 50%;
+ left: -9999px;
+ width: 30px;
+ height: 30px;
+ margin-top: -15px;
+ cursor: pointer;
+ z-index: 1102;
+ display: block;
+}
+
+#fancybox-left-ico {
+ background-image: url('fancybox.png');
+ background-position: -40px -30px;
+}
+
+#fancybox-right-ico {
+ background-image: url('fancybox.png');
+ background-position: -40px -60px;
+}
+
+#fancybox-left:hover, #fancybox-right:hover {
+ visibility: visible; /* IE6 */
+}
+
+#fancybox-left:hover span {
+ left: 20px;
+}
+
+#fancybox-right:hover span {
+ left: auto;
+ right: 20px;
+}
+
+.fancybox-bg {
+ position: absolute;
+ padding: 0;
+ margin: 0;
+ border: 0;
+ width: 20px;
+ height: 20px;
+ z-index: 1001;
+}
+
+#fancybox-bg-n {
+ top: -20px;
+ left: 0;
+ width: 100%;
+ background-image: url('fancybox-x.png');
+}
+
+#fancybox-bg-ne {
+ top: -20px;
+ right: -20px;
+ background-image: url('fancybox.png');
+ background-position: -40px -162px;
+}
+
+#fancybox-bg-e {
+ top: 0;
+ right: -20px;
+ height: 100%;
+ background-image: url('fancybox-y.png');
+ background-position: -20px 0px;
+}
+
+#fancybox-bg-se {
+ bottom: -20px;
+ right: -20px;
+ background-image: url('fancybox.png');
+ background-position: -40px -182px;
+}
+
+#fancybox-bg-s {
+ bottom: -20px;
+ left: 0;
+ width: 100%;
+ background-image: url('fancybox-x.png');
+ background-position: 0px -20px;
+}
+
+#fancybox-bg-sw {
+ bottom: -20px;
+ left: -20px;
+ background-image: url('fancybox.png');
+ background-position: -40px -142px;
+}
+
+#fancybox-bg-w {
+ top: 0;
+ left: -20px;
+ height: 100%;
+ background-image: url('fancybox-y.png');
+}
+
+#fancybox-bg-nw {
+ top: -20px;
+ left: -20px;
+ background-image: url('fancybox.png');
+ background-position: -40px -122px;
+}
+
+#fancybox-title {
+ font-family: Helvetica;
+ font-size: 12px;
+ z-index: 1102;
+}
+
+.fancybox-title-inside {
+ padding-bottom: 10px;
+ text-align: center;
+ color: #333;
+ background: #fff;
+ position: relative;
+}
+
+.fancybox-title-outside {
+ padding-top: 10px;
+ color: #fff;
+}
+
+.fancybox-title-over {
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ color: #FFF;
+ text-align: left;
+}
+
+#fancybox-title-over {
+ padding: 10px;
+ background-image: url('fancy_title_over.png');
+ display: block;
+}
+
+.fancybox-title-float {
+ position: absolute;
+ left: 0;
+ bottom: -20px;
+ height: 32px;
+}
+
+#fancybox-title-float-wrap {
+ border: none;
+ border-collapse: collapse;
+ width: auto;
+}
+
+#fancybox-title-float-wrap td {
+ border: none;
+ white-space: nowrap;
+}
+
+#fancybox-title-float-left {
+ padding: 0 0 0 15px;
+ background: url('fancybox.png') -40px -90px no-repeat;
+}
+
+#fancybox-title-float-main {
+ color: #FFF;
+ line-height: 29px;
+ font-weight: bold;
+ padding: 0 0 3px 0;
+ background: url('fancybox-x.png') 0px -40px;
+}
+
+#fancybox-title-float-right {
+ padding: 0 0 0 15px;
+ background: url('fancybox.png') -55px -90px no-repeat;
+}
+
+/* IE6 */
+
+.fancybox-ie6 #fancybox-close { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_close.png', sizingMethod='scale'); }
+
+.fancybox-ie6 #fancybox-left-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_left.png', sizingMethod='scale'); }
+.fancybox-ie6 #fancybox-right-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_right.png', sizingMethod='scale'); }
+
+.fancybox-ie6 #fancybox-title-over { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_over.png', sizingMethod='scale'); zoom: 1; }
+.fancybox-ie6 #fancybox-title-float-left { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_left.png', sizingMethod='scale'); }
+.fancybox-ie6 #fancybox-title-float-main { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_main.png', sizingMethod='scale'); }
+.fancybox-ie6 #fancybox-title-float-right { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_right.png', sizingMethod='scale'); }
+
+.fancybox-ie6 #fancybox-bg-w, .fancybox-ie6 #fancybox-bg-e, .fancybox-ie6 #fancybox-left, .fancybox-ie6 #fancybox-right, #fancybox-hide-sel-frame {
+ height: expression(this.parentNode.clientHeight + "px");
+}
+
+#fancybox-loading.fancybox-ie6 {
+ position: absolute; margin-top: 0;
+ top: expression( (-20 + (document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )) + 'px');
+}
+
+#fancybox-loading.fancybox-ie6 div { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_loading.png', sizingMethod='scale'); }
+
+/* IE6, IE7, IE8 */
+
+.fancybox-ie .fancybox-bg { background: transparent !important; }
+
+.fancybox-ie #fancybox-bg-n { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_n.png', sizingMethod='scale'); }
+.fancybox-ie #fancybox-bg-ne { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_ne.png', sizingMethod='scale'); }
+.fancybox-ie #fancybox-bg-e { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_e.png', sizingMethod='scale'); }
+.fancybox-ie #fancybox-bg-se { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_se.png', sizingMethod='scale'); }
+.fancybox-ie #fancybox-bg-s { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_s.png', sizingMethod='scale'); }
+.fancybox-ie #fancybox-bg-sw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_sw.png', sizingMethod='scale'); }
+.fancybox-ie #fancybox-bg-w { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_w.png', sizingMethod='scale'); }
+.fancybox-ie #fancybox-bg-nw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_nw.png', sizingMethod='scale'); } \ No newline at end of file
diff --git a/plugins/picasa-albums/fancybox/jquery.fancybox-1.3.4.pack.js b/plugins/picasa-albums/fancybox/jquery.fancybox-1.3.4.pack.js
new file mode 100644
index 00000000..1373ed08
--- /dev/null
+++ b/plugins/picasa-albums/fancybox/jquery.fancybox-1.3.4.pack.js
@@ -0,0 +1,46 @@
+/*
+ * FancyBox - jQuery Plugin
+ * Simple and fancy lightbox alternative
+ *
+ * Examples and documentation at: http://fancybox.net
+ *
+ * Copyright (c) 2008 - 2010 Janis Skarnelis
+ * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
+ *
+ * Version: 1.3.4 (11/11/2010)
+ * Requires: jQuery v1.3+
+ *
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+ */
+
+;(function(b){var m,t,u,f,D,j,E,n,z,A,q=0,e={},o=[],p=0,d={},l=[],G=null,v=new Image,J=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,W=/[^\.]\.(swf)\s*$/i,K,L=1,y=0,s="",r,i,h=false,B=b.extend(b("<div/>")[0],{prop:0}),M=b.browser.msie&&b.browser.version<7&&!window.XMLHttpRequest,N=function(){t.hide();v.onerror=v.onload=null;G&&G.abort();m.empty()},O=function(){if(false===e.onError(o,q,e)){t.hide();h=false}else{e.titleShow=false;e.width="auto";e.height="auto";m.html('<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>');
+F()}},I=function(){var a=o[q],c,g,k,C,P,w;N();e=b.extend({},b.fn.fancybox.defaults,typeof b(a).data("fancybox")=="undefined"?e:b(a).data("fancybox"));w=e.onStart(o,q,e);if(w===false)h=false;else{if(typeof w=="object")e=b.extend(e,w);k=e.title||(a.nodeName?b(a).attr("title"):a.title)||"";if(a.nodeName&&!e.orig)e.orig=b(a).children("img:first").length?b(a).children("img:first"):b(a);if(k===""&&e.orig&&e.titleFromAlt)k=e.orig.attr("alt");c=e.href||(a.nodeName?b(a).attr("href"):a.href)||null;if(/^(?:javascript)/i.test(c)||
+c=="#")c=null;if(e.type){g=e.type;if(!c)c=e.content}else if(e.content)g="html";else if(c)g=c.match(J)?"image":c.match(W)?"swf":b(a).hasClass("iframe")?"iframe":c.indexOf("#")===0?"inline":"ajax";if(g){if(g=="inline"){a=c.substr(c.indexOf("#"));g=b(a).length>0?"inline":"ajax"}e.type=g;e.href=c;e.title=k;if(e.autoDimensions)if(e.type=="html"||e.type=="inline"||e.type=="ajax"){e.width="auto";e.height="auto"}else e.autoDimensions=false;if(e.modal){e.overlayShow=true;e.hideOnOverlayClick=false;e.hideOnContentClick=
+false;e.enableEscapeButton=false;e.showCloseButton=false}e.padding=parseInt(e.padding,10);e.margin=parseInt(e.margin,10);m.css("padding",e.padding+e.margin);b(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){b(this).replaceWith(j.children())});switch(g){case "html":m.html(e.content);F();break;case "inline":if(b(a).parent().is("#fancybox-content")===true){h=false;break}b('<div class="fancybox-inline-tmp" />').hide().insertBefore(b(a)).bind("fancybox-cleanup",function(){b(this).replaceWith(j.children())}).bind("fancybox-cancel",
+function(){b(this).replaceWith(m.children())});b(a).appendTo(m);F();break;case "image":h=false;b.fancybox.showActivity();v=new Image;v.onerror=function(){O()};v.onload=function(){h=true;v.onerror=v.onload=null;e.width=v.width;e.height=v.height;b("<img />").attr({id:"fancybox-img",src:v.src,alt:e.title}).appendTo(m);Q()};v.src=c;break;case "swf":e.scrolling="no";C='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+e.width+'" height="'+e.height+'"><param name="movie" value="'+c+
+'"></param>';P="";b.each(e.swf,function(x,H){C+='<param name="'+x+'" value="'+H+'"></param>';P+=" "+x+'="'+H+'"'});C+='<embed src="'+c+'" type="application/x-shockwave-flash" width="'+e.width+'" height="'+e.height+'"'+P+"></embed></object>";m.html(C);F();break;case "ajax":h=false;b.fancybox.showActivity();e.ajax.win=e.ajax.success;G=b.ajax(b.extend({},e.ajax,{url:c,data:e.ajax.data||{},error:function(x){x.status>0&&O()},success:function(x,H,R){if((typeof R=="object"?R:G).status==200){if(typeof e.ajax.win==
+"function"){w=e.ajax.win(c,x,H,R);if(w===false){t.hide();return}else if(typeof w=="string"||typeof w=="object")x=w}m.html(x);F()}}}));break;case "iframe":Q()}}else O()}},F=function(){var a=e.width,c=e.height;a=a.toString().indexOf("%")>-1?parseInt((b(window).width()-e.margin*2)*parseFloat(a)/100,10)+"px":a=="auto"?"auto":a+"px";c=c.toString().indexOf("%")>-1?parseInt((b(window).height()-e.margin*2)*parseFloat(c)/100,10)+"px":c=="auto"?"auto":c+"px";m.wrapInner('<div style="width:'+a+";height:"+c+
+";overflow: "+(e.scrolling=="auto"?"auto":e.scrolling=="yes"?"scroll":"hidden")+';position:relative;"></div>');e.width=m.width();e.height=m.height();Q()},Q=function(){var a,c;t.hide();if(f.is(":visible")&&false===d.onCleanup(l,p,d)){b.event.trigger("fancybox-cancel");h=false}else{h=true;b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");f.is(":visible")&&d.titlePosition!=="outside"&&f.css("height",f.height());l=o;p=q;d=e;if(d.overlayShow){u.css({"background-color":d.overlayColor,
+opacity:d.overlayOpacity,cursor:d.hideOnOverlayClick?"pointer":"auto",height:b(document).height()});if(!u.is(":visible")){M&&b("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"});u.show()}}else u.hide();i=X();s=d.title||"";y=0;n.empty().removeAttr("style").removeClass();if(d.titleShow!==false){if(b.isFunction(d.titleFormat))a=d.titleFormat(s,l,p,d);else a=s&&s.length?
+d.titlePosition=="float"?'<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">'+s+'</td><td id="fancybox-title-float-right"></td></tr></table>':'<div id="fancybox-title-'+d.titlePosition+'">'+s+"</div>":false;s=a;if(!(!s||s==="")){n.addClass("fancybox-title-"+d.titlePosition).html(s).appendTo("body").show();switch(d.titlePosition){case "inside":n.css({width:i.width-d.padding*2,marginLeft:d.padding,marginRight:d.padding});
+y=n.outerHeight(true);n.appendTo(D);i.height+=y;break;case "over":n.css({marginLeft:d.padding,width:i.width-d.padding*2,bottom:d.padding}).appendTo(D);break;case "float":n.css("left",parseInt((n.width()-i.width-40)/2,10)*-1).appendTo(f);break;default:n.css({width:i.width-d.padding*2,paddingLeft:d.padding,paddingRight:d.padding}).appendTo(f)}}}n.hide();if(f.is(":visible")){b(E.add(z).add(A)).hide();a=f.position();r={top:a.top,left:a.left,width:f.width(),height:f.height()};c=r.width==i.width&&r.height==
+i.height;j.fadeTo(d.changeFade,0.3,function(){var g=function(){j.html(m.contents()).fadeTo(d.changeFade,1,S)};b.event.trigger("fancybox-change");j.empty().removeAttr("filter").css({"border-width":d.padding,width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2});if(c)g();else{B.prop=0;b(B).animate({prop:1},{duration:d.changeSpeed,easing:d.easingChange,step:T,complete:g})}})}else{f.removeAttr("style");j.css("border-width",d.padding);if(d.transitionIn=="elastic"){r=V();j.html(m.contents());
+f.show();if(d.opacity)i.opacity=0;B.prop=0;b(B).animate({prop:1},{duration:d.speedIn,easing:d.easingIn,step:T,complete:S})}else{d.titlePosition=="inside"&&y>0&&n.show();j.css({width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2}).html(m.contents());f.css(i).fadeIn(d.transitionIn=="none"?0:d.speedIn,S)}}}},Y=function(){if(d.enableEscapeButton||d.enableKeyboardNav)b(document).bind("keydown.fb",function(a){if(a.keyCode==27&&d.enableEscapeButton){a.preventDefault();b.fancybox.close()}else if((a.keyCode==
+37||a.keyCode==39)&&d.enableKeyboardNav&&a.target.tagName!=="INPUT"&&a.target.tagName!=="TEXTAREA"&&a.target.tagName!=="SELECT"){a.preventDefault();b.fancybox[a.keyCode==37?"prev":"next"]()}});if(d.showNavArrows){if(d.cyclic&&l.length>1||p!==0)z.show();if(d.cyclic&&l.length>1||p!=l.length-1)A.show()}else{z.hide();A.hide()}},S=function(){if(!b.support.opacity){j.get(0).style.removeAttribute("filter");f.get(0).style.removeAttribute("filter")}e.autoDimensions&&j.css("height","auto");f.css("height","auto");
+s&&s.length&&n.show();d.showCloseButton&&E.show();Y();d.hideOnContentClick&&j.bind("click",b.fancybox.close);d.hideOnOverlayClick&&u.bind("click",b.fancybox.close);b(window).bind("resize.fb",b.fancybox.resize);d.centerOnScroll&&b(window).bind("scroll.fb",b.fancybox.center);if(d.type=="iframe")b('<iframe id="fancybox-frame" name="fancybox-frame'+(new Date).getTime()+'" frameborder="0" hspace="0" '+(b.browser.msie?'allowtransparency="true""':"")+' scrolling="'+e.scrolling+'" src="'+d.href+'"></iframe>').appendTo(j);
+f.show();h=false;b.fancybox.center();d.onComplete(l,p,d);var a,c;if(l.length-1>p){a=l[p+1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}if(p>0){a=l[p-1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}},T=function(a){var c={width:parseInt(r.width+(i.width-r.width)*a,10),height:parseInt(r.height+(i.height-r.height)*a,10),top:parseInt(r.top+(i.top-r.top)*a,10),left:parseInt(r.left+(i.left-r.left)*a,10)};if(typeof i.opacity!=="undefined")c.opacity=a<0.5?0.5:a;f.css(c);
+j.css({width:c.width-d.padding*2,height:c.height-y*a-d.padding*2})},U=function(){return[b(window).width()-d.margin*2,b(window).height()-d.margin*2,b(document).scrollLeft()+d.margin,b(document).scrollTop()+d.margin]},X=function(){var a=U(),c={},g=d.autoScale,k=d.padding*2;c.width=d.width.toString().indexOf("%")>-1?parseInt(a[0]*parseFloat(d.width)/100,10):d.width+k;c.height=d.height.toString().indexOf("%")>-1?parseInt(a[1]*parseFloat(d.height)/100,10):d.height+k;if(g&&(c.width>a[0]||c.height>a[1]))if(e.type==
+"image"||e.type=="swf"){g=d.width/d.height;if(c.width>a[0]){c.width=a[0];c.height=parseInt((c.width-k)/g+k,10)}if(c.height>a[1]){c.height=a[1];c.width=parseInt((c.height-k)*g+k,10)}}else{c.width=Math.min(c.width,a[0]);c.height=Math.min(c.height,a[1])}c.top=parseInt(Math.max(a[3]-20,a[3]+(a[1]-c.height-40)*0.5),10);c.left=parseInt(Math.max(a[2]-20,a[2]+(a[0]-c.width-40)*0.5),10);return c},V=function(){var a=e.orig?b(e.orig):false,c={};if(a&&a.length){c=a.offset();c.top+=parseInt(a.css("paddingTop"),
+10)||0;c.left+=parseInt(a.css("paddingLeft"),10)||0;c.top+=parseInt(a.css("border-top-width"),10)||0;c.left+=parseInt(a.css("border-left-width"),10)||0;c.width=a.width();c.height=a.height();c={width:c.width+d.padding*2,height:c.height+d.padding*2,top:c.top-d.padding-20,left:c.left-d.padding-20}}else{a=U();c={width:d.padding*2,height:d.padding*2,top:parseInt(a[3]+a[1]*0.5,10),left:parseInt(a[2]+a[0]*0.5,10)}}return c},Z=function(){if(t.is(":visible")){b("div",t).css("top",L*-40+"px");L=(L+1)%12}else clearInterval(K)};
+b.fn.fancybox=function(a){if(!b(this).length)return this;b(this).data("fancybox",b.extend({},a,b.metadata?b(this).metadata():{})).unbind("click.fb").bind("click.fb",function(c){c.preventDefault();if(!h){h=true;b(this).blur();o=[];q=0;c=b(this).attr("rel")||"";if(!c||c==""||c==="nofollow")o.push(this);else{o=b("a[rel="+c+"], area[rel="+c+"]");q=o.index(this)}I()}});return this};b.fancybox=function(a,c){var g;if(!h){h=true;g=typeof c!=="undefined"?c:{};o=[];q=parseInt(g.index,10)||0;if(b.isArray(a)){for(var k=
+0,C=a.length;k<C;k++)if(typeof a[k]=="object")b(a[k]).data("fancybox",b.extend({},g,a[k]));else a[k]=b({}).data("fancybox",b.extend({content:a[k]},g));o=jQuery.merge(o,a)}else{if(typeof a=="object")b(a).data("fancybox",b.extend({},g,a));else a=b({}).data("fancybox",b.extend({content:a},g));o.push(a)}if(q>o.length||q<0)q=0;I()}};b.fancybox.showActivity=function(){clearInterval(K);t.show();K=setInterval(Z,66)};b.fancybox.hideActivity=function(){t.hide()};b.fancybox.next=function(){return b.fancybox.pos(p+
+1)};b.fancybox.prev=function(){return b.fancybox.pos(p-1)};b.fancybox.pos=function(a){if(!h){a=parseInt(a);o=l;if(a>-1&&a<l.length){q=a;I()}else if(d.cyclic&&l.length>1){q=a>=l.length?0:l.length-1;I()}}};b.fancybox.cancel=function(){if(!h){h=true;b.event.trigger("fancybox-cancel");N();e.onCancel(o,q,e);h=false}};b.fancybox.close=function(){function a(){u.fadeOut("fast");n.empty().hide();f.hide();b.event.trigger("fancybox-cleanup");j.empty();d.onClosed(l,p,d);l=e=[];p=q=0;d=e={};h=false}if(!(h||f.is(":hidden"))){h=
+true;if(d&&false===d.onCleanup(l,p,d))h=false;else{N();b(E.add(z).add(A)).hide();b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");j.find("iframe").attr("src",M&&/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank");d.titlePosition!=="inside"&&n.empty();f.stop();if(d.transitionOut=="elastic"){r=V();var c=f.position();i={top:c.top,left:c.left,width:f.width(),height:f.height()};if(d.opacity)i.opacity=1;n.empty().hide();B.prop=1;
+b(B).animate({prop:0},{duration:d.speedOut,easing:d.easingOut,step:T,complete:a})}else f.fadeOut(d.transitionOut=="none"?0:d.speedOut,a)}}};b.fancybox.resize=function(){u.is(":visible")&&u.css("height",b(document).height());b.fancybox.center(true)};b.fancybox.center=function(a){var c,g;if(!h){g=a===true?1:0;c=U();!g&&(f.width()>c[0]||f.height()>c[1])||f.stop().animate({top:parseInt(Math.max(c[3]-20,c[3]+(c[1]-j.height()-40)*0.5-d.padding)),left:parseInt(Math.max(c[2]-20,c[2]+(c[0]-j.width()-40)*0.5-
+d.padding))},typeof a=="number"?a:200)}};b.fancybox.init=function(){if(!b("#fancybox-wrap").length){b("body").append(m=b('<div id="fancybox-tmp"></div>'),t=b('<div id="fancybox-loading"><div></div></div>'),u=b('<div id="fancybox-overlay"></div>'),f=b('<div id="fancybox-wrap"></div>'));D=b('<div id="fancybox-outer"></div>').append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>').appendTo(f);
+D.append(j=b('<div id="fancybox-content"></div>'),E=b('<a id="fancybox-close"></a>'),n=b('<div id="fancybox-title"></div>'),z=b('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),A=b('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));E.click(b.fancybox.close);t.click(b.fancybox.cancel);z.click(function(a){a.preventDefault();b.fancybox.prev()});A.click(function(a){a.preventDefault();b.fancybox.next()});
+b.fn.mousewheel&&f.bind("mousewheel.fb",function(a,c){if(h)a.preventDefault();else if(b(a.target).get(0).clientHeight==0||b(a.target).get(0).scrollHeight===b(a.target).get(0).clientHeight){a.preventDefault();b.fancybox[c>0?"prev":"next"]()}});b.support.opacity||f.addClass("fancybox-ie");if(M){t.addClass("fancybox-ie6");f.addClass("fancybox-ie6");b('<iframe id="fancybox-hide-sel-frame" src="'+(/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank")+'" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(D)}}};
+b.fn.fancybox.defaults={padding:10,margin:40,opacity:false,modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.7,overlayColor:"#777",titleShow:true,titlePosition:"float",titleFormat:null,titleFromAlt:false,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing",
+easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,enableKeyboardNav:true,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}};b(document).ready(function(){b.fancybox.init()})})(jQuery); \ No newline at end of file
diff --git a/plugins/picasa-albums/fancybox/jquery.fancybox-custom.js b/plugins/picasa-albums/fancybox/jquery.fancybox-custom.js
new file mode 100644
index 00000000..e326c08e
--- /dev/null
+++ b/plugins/picasa-albums/fancybox/jquery.fancybox-custom.js
@@ -0,0 +1,1156 @@
+/*
+ * FancyBox - jQuery Plugin
+ * Simple and fancy lightbox alternative
+ *
+ * Examples and documentation at: http://fancybox.net
+ *
+ * Copyright (c) 2008 - 2010 Janis Skarnelis
+ * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
+ *
+ * Version: 1.3.4 (11/11/2010)
+ * Requires: jQuery v1.3+
+ *
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+ */
+
+;(function($) {
+ var tmp, loading, overlay, wrap, outer, content, close, title, nav_left, nav_right,
+
+ selectedIndex = 0, selectedOpts = {}, selectedArray = [], currentIndex = 0, currentOpts = {}, currentArray = [],
+
+ ajaxLoader = null, imgPreloader = new Image(), imgRegExp = /\.(jpg|gif|png|bmp|jpeg)(.*)?$/i, swfRegExp = /[^\.]\.(swf)\s*$/i,
+
+ loadingTimer, loadingFrame = 1,
+
+ titleHeight = 0, titleStr = '', start_pos, final_pos, busy = false, fx = $.extend($('<div/>')[0], { prop: 0 }),
+
+ isIE6 = $.browser.msie && $.browser.version < 7 && !window.XMLHttpRequest,
+
+ /*
+ * Private methods
+ */
+
+ _abort = function() {
+ loading.hide();
+
+ imgPreloader.onerror = imgPreloader.onload = null;
+
+ if (ajaxLoader) {
+ ajaxLoader.abort();
+ }
+
+ tmp.empty();
+ },
+
+ _error = function() {
+ if (false === selectedOpts.onError(selectedArray, selectedIndex, selectedOpts)) {
+ loading.hide();
+ busy = false;
+ return;
+ }
+
+ selectedOpts.titleShow = false;
+
+ selectedOpts.width = 'auto';
+ selectedOpts.height = 'auto';
+
+ tmp.html( '<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>' );
+
+ _process_inline();
+ },
+
+ _start = function() {
+
+ var obj = selectedArray[ selectedIndex ],
+ href,
+ type,
+ title,
+ str,
+ emb,
+ ret;
+
+ _abort();
+
+ selectedOpts = $.extend({}, $.fn.fancybox.defaults, (typeof $(obj).data('fancybox') == 'undefined' ? selectedOpts : $(obj).data('fancybox')));
+
+ ret = selectedOpts.onStart(selectedArray, selectedIndex, selectedOpts);
+
+ if (ret === false) {
+ busy = false;
+ return;
+ } else if (typeof ret == 'object') {
+ selectedOpts = $.extend(selectedOpts, ret);
+ }
+
+ title = selectedOpts.title || (obj.nodeName ? $(obj).attr('title') : obj.title) || '';
+
+ if (obj.nodeName && !selectedOpts.orig) {
+ selectedOpts.orig = $(obj).children("img:first").length ? $(obj).children("img:first") : $(obj);
+ }
+
+ if (title === '' && selectedOpts.orig && selectedOpts.titleFromAlt) {
+ title = selectedOpts.orig.attr('alt');
+ }
+
+ href = selectedOpts.href || (obj.nodeName ? $(obj).attr('href') : obj.href) || null;
+
+ if ((/^(?:javascript)/i).test(href) || href == '#') {
+ href = null;
+ }
+
+ if (selectedOpts.type) {
+ type = selectedOpts.type;
+
+ if (!href) {
+ href = selectedOpts.content;
+ }
+
+ } else if (selectedOpts.content) {
+ type = 'html';
+
+ } else if (href) {
+ if (href.match(imgRegExp)) {
+ type = 'image';
+
+ } else if (href.match(swfRegExp)) {
+ type = 'swf';
+
+ } else if ($(obj).hasClass("iframe")) {
+ type = 'iframe';
+
+ } else if (href.indexOf("#") === 0) {
+ type = 'inline';
+
+ } else {
+ type = 'ajax';
+ }
+ }
+
+ if (!type) {
+ _error();
+ return;
+ }
+
+ if (type == 'inline') {
+ obj = href.substr(href.indexOf("#"));
+ type = $(obj).length > 0 ? 'inline' : 'ajax';
+ }
+
+ selectedOpts.type = type;
+ selectedOpts.href = href;
+ selectedOpts.title = title;
+
+ if (selectedOpts.autoDimensions) {
+ if (selectedOpts.type == 'html' || selectedOpts.type == 'inline' || selectedOpts.type == 'ajax') {
+ selectedOpts.width = 'auto';
+ selectedOpts.height = 'auto';
+ } else {
+ selectedOpts.autoDimensions = false;
+ }
+ }
+
+ if (selectedOpts.modal) {
+ selectedOpts.overlayShow = true;
+ selectedOpts.hideOnOverlayClick = false;
+ selectedOpts.hideOnContentClick = false;
+ selectedOpts.enableEscapeButton = false;
+ selectedOpts.showCloseButton = false;
+ }
+
+ selectedOpts.padding = parseInt(selectedOpts.padding, 10);
+ selectedOpts.margin = parseInt(selectedOpts.margin, 10);
+
+ tmp.css('padding', (selectedOpts.padding + selectedOpts.margin));
+
+ $('.fancybox-inline-tmp').unbind('fancybox-cancel').bind('fancybox-change', function() {
+ $(this).replaceWith(content.children());
+ });
+
+ switch (type) {
+ case 'html' :
+ tmp.html( selectedOpts.content );
+ _process_inline();
+ break;
+
+ case 'inline' :
+ if ( $(obj).parent().is('#fancybox-content') === true) {
+ busy = false;
+ return;
+ }
+
+ $('<div class="fancybox-inline-tmp" />')
+ .hide()
+ .insertBefore( $(obj) )
+ .bind('fancybox-cleanup', function() {
+ $(this).replaceWith(content.children());
+ }).bind('fancybox-cancel', function() {
+ $(this).replaceWith(tmp.children());
+ });
+
+ $(obj).appendTo(tmp);
+
+ _process_inline();
+ break;
+
+ case 'image':
+ busy = false;
+
+ $.fancybox.showActivity();
+
+ imgPreloader = new Image();
+
+ imgPreloader.onerror = function() {
+ _error();
+ };
+
+ imgPreloader.onload = function() {
+ busy = true;
+
+ imgPreloader.onerror = imgPreloader.onload = null;
+
+ _process_image();
+ };
+
+ imgPreloader.src = href;
+ break;
+
+ case 'swf':
+ selectedOpts.scrolling = 'no';
+
+ str = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + selectedOpts.width + '" height="' + selectedOpts.height + '"><param name="movie" value="' + href + '"></param>';
+ emb = '';
+
+ $.each(selectedOpts.swf, function(name, val) {
+ str += '<param name="' + name + '" value="' + val + '"></param>';
+ emb += ' ' + name + '="' + val + '"';
+ });
+
+ str += '<embed src="' + href + '" type="application/x-shockwave-flash" width="' + selectedOpts.width + '" height="' + selectedOpts.height + '"' + emb + '></embed></object>';
+
+ tmp.html(str);
+
+ _process_inline();
+ break;
+
+ case 'ajax':
+ busy = false;
+
+ $.fancybox.showActivity();
+
+ selectedOpts.ajax.win = selectedOpts.ajax.success;
+
+ ajaxLoader = $.ajax($.extend({}, selectedOpts.ajax, {
+ url : href,
+ data : selectedOpts.ajax.data || {},
+ error : function(XMLHttpRequest, textStatus, errorThrown) {
+ if ( XMLHttpRequest.status > 0 ) {
+ _error();
+ }
+ },
+ success : function(data, textStatus, XMLHttpRequest) {
+ var o = typeof XMLHttpRequest == 'object' ? XMLHttpRequest : ajaxLoader;
+ if (o.status == 200) {
+ if ( typeof selectedOpts.ajax.win == 'function' ) {
+ ret = selectedOpts.ajax.win(href, data, textStatus, XMLHttpRequest);
+
+ if (ret === false) {
+ loading.hide();
+ return;
+ } else if (typeof ret == 'string' || typeof ret == 'object') {
+ data = ret;
+ }
+ }
+
+ tmp.html( data );
+ _process_inline();
+ }
+ }
+ }));
+
+ break;
+
+ case 'iframe':
+ _show();
+ break;
+ }
+ },
+
+ _process_inline = function() {
+ var
+ w = selectedOpts.width,
+ h = selectedOpts.height;
+
+ if (w.toString().indexOf('%') > -1) {
+ w = parseInt( ($(window).width() - (selectedOpts.margin * 2)) * parseFloat(w) / 100, 10) + 'px';
+
+ } else {
+ w = w == 'auto' ? 'auto' : w + 'px';
+ }
+
+ if (h.toString().indexOf('%') > -1) {
+ h = parseInt( ($(window).height() - (selectedOpts.margin * 2)) * parseFloat(h) / 100, 10) + 'px';
+
+ } else {
+ h = h == 'auto' ? 'auto' : h + 'px';
+ }
+
+ tmp.wrapInner('<div style="width:' + w + ';height:' + h + ';overflow: ' + (selectedOpts.scrolling == 'auto' ? 'auto' : (selectedOpts.scrolling == 'yes' ? 'scroll' : 'hidden')) + ';position:relative;"></div>');
+
+ selectedOpts.width = tmp.width();
+ selectedOpts.height = tmp.height();
+
+ _show();
+ },
+
+ _process_image = function() {
+ selectedOpts.width = imgPreloader.width;
+ selectedOpts.height = imgPreloader.height;
+
+ $("<img />").attr({
+ 'id' : 'fancybox-img',
+ 'src' : imgPreloader.src,
+ 'alt' : selectedOpts.title
+ }).appendTo( tmp );
+
+ _show();
+ },
+
+ _show = function() {
+ var pos, equal;
+
+ loading.hide();
+
+ if (wrap.is(":visible") && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) {
+ $.event.trigger('fancybox-cancel');
+
+ busy = false;
+ return;
+ }
+
+ busy = true;
+
+ $(content.add( overlay )).unbind();
+
+ $(window).unbind("resize.fb scroll.fb");
+ $(document).unbind('keydown.fb');
+
+ if (wrap.is(":visible") && currentOpts.titlePosition !== 'outside') {
+ wrap.css('height', wrap.height());
+ }
+
+ currentArray = selectedArray;
+ currentIndex = selectedIndex;
+ currentOpts = selectedOpts;
+
+ if (currentOpts.overlayShow) {
+ overlay.css({
+ 'background-color' : currentOpts.overlayColor,
+ 'opacity' : currentOpts.overlayOpacity,
+ 'cursor' : currentOpts.hideOnOverlayClick ? 'pointer' : 'auto',
+ 'height' : $(document).height()
+ });
+
+ if (!overlay.is(':visible')) {
+ if (isIE6) {
+ $('select:not(#fancybox-tmp select)').filter(function() {
+ return this.style.visibility !== 'hidden';
+ }).css({'visibility' : 'hidden'}).one('fancybox-cleanup', function() {
+ this.style.visibility = 'inherit';
+ });
+ }
+
+ overlay.show();
+ }
+ } else {
+ overlay.hide();
+ }
+
+ final_pos = _get_zoom_to();
+
+ _process_title();
+
+ if (wrap.is(":visible")) {
+ $( close.add( nav_left ).add( nav_right ) ).hide();
+
+ pos = wrap.position(),
+
+ start_pos = {
+ top : pos.top,
+ left : pos.left,
+ width : wrap.width(),
+ height : wrap.height()
+ };
+
+ equal = (start_pos.width == final_pos.width && start_pos.height == final_pos.height);
+
+ content.fadeTo(currentOpts.changeFade, 0.3, function() {
+ var finish_resizing = function() {
+ content.html( tmp.contents() ).fadeTo(currentOpts.changeFade, 1, _finish);
+ };
+
+ $.event.trigger('fancybox-change');
+
+ content
+ .empty()
+ .removeAttr('filter')
+ .css({
+ 'border-width' : currentOpts.padding,
+ 'width' : final_pos.width - currentOpts.padding * 2,
+ 'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2
+ });
+
+ if (equal) {
+ finish_resizing();
+
+ } else {
+ fx.prop = 0;
+
+ $(fx).animate({prop: 1}, {
+ duration : currentOpts.changeSpeed,
+ easing : currentOpts.easingChange,
+ step : _draw,
+ complete : finish_resizing
+ });
+ }
+ });
+
+ return;
+ }
+
+ wrap.removeAttr("style");
+
+ content.css('border-width', currentOpts.padding);
+
+ if (currentOpts.transitionIn == 'elastic') {
+ start_pos = _get_zoom_from();
+
+ content.html( tmp.contents() );
+
+ wrap.show();
+
+ if (currentOpts.opacity) {
+ final_pos.opacity = 0;
+ }
+
+ fx.prop = 0;
+
+ $(fx).animate({prop: 1}, {
+ duration : currentOpts.speedIn,
+ easing : currentOpts.easingIn,
+ step : _draw,
+ complete : _finish
+ });
+
+ return;
+ }
+
+ if (currentOpts.titlePosition == 'inside' && titleHeight > 0) {
+ title.show();
+ }
+
+ content
+ .css({
+ 'width' : final_pos.width - currentOpts.padding * 2,
+ 'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2
+ })
+ .html( tmp.contents() );
+
+ wrap
+ .css(final_pos)
+ .fadeIn( currentOpts.transitionIn == 'none' ? 0 : currentOpts.speedIn, _finish );
+ },
+
+ _format_title = function(title) {
+ if (title && title.length) {
+ if (currentOpts.titlePosition == 'float') {
+ return '<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">' + title + '</td><td id="fancybox-title-float-right"></td></tr></table>';
+ }
+
+ return '<div id="fancybox-title-' + currentOpts.titlePosition + '">' + title + '</div>';
+ }
+
+ return false;
+ },
+
+ _process_title = function() {
+ titleStr = currentOpts.title || '';
+ titleHeight = 0;
+
+ title
+ .empty()
+ .removeAttr('style')
+ .removeClass();
+
+ if (currentOpts.titleShow === false) {
+ title.hide();
+ return;
+ }
+
+ titleStr = $.isFunction(currentOpts.titleFormat) ? currentOpts.titleFormat(titleStr, currentArray, currentIndex, currentOpts) : _format_title(titleStr);
+
+ if (!titleStr || titleStr === '') {
+ title.hide();
+ return;
+ }
+
+ title
+ .addClass('fancybox-title-' + currentOpts.titlePosition)
+ .html( titleStr )
+ .appendTo( 'body' )
+ .show();
+
+ switch (currentOpts.titlePosition) {
+ case 'inside':
+ title
+ .css({
+ 'width' : final_pos.width - (currentOpts.padding * 2),
+ 'marginLeft' : currentOpts.padding,
+ 'marginRight' : currentOpts.padding
+ });
+
+ titleHeight = title.outerHeight(true);
+
+ title.appendTo( outer );
+
+ final_pos.height += titleHeight;
+ break;
+
+ case 'over':
+ title
+ .css({
+ 'marginLeft' : currentOpts.padding,
+ 'width' : final_pos.width - (currentOpts.padding * 2),
+ 'bottom' : currentOpts.padding
+ })
+ .appendTo( outer );
+ break;
+
+ case 'float':
+ title
+ .css('left', parseInt((title.width() - final_pos.width - 40)/ 2, 10) * -1)
+ .appendTo( wrap );
+ break;
+
+ default:
+ title
+ .css({
+ 'width' : final_pos.width - (currentOpts.padding * 2),
+ 'paddingLeft' : currentOpts.padding,
+ 'paddingRight' : currentOpts.padding
+ })
+ .appendTo( wrap );
+ break;
+ }
+
+ title.hide();
+ },
+
+ _set_navigation = function() {
+ if (currentOpts.enableEscapeButton || currentOpts.enableKeyboardNav) {
+ $(document).bind('keydown.fb', function(e) {
+ if (e.keyCode == 27 && currentOpts.enableEscapeButton) {
+ e.preventDefault();
+ $.fancybox.close();
+
+ } else if ((e.keyCode == 37 || e.keyCode == 39) && currentOpts.enableKeyboardNav && e.target.tagName !== 'INPUT' && e.target.tagName !== 'TEXTAREA' && e.target.tagName !== 'SELECT') {
+ e.preventDefault();
+ $.fancybox[ e.keyCode == 37 ? 'prev' : 'next']();
+ }
+ });
+ }
+
+ if (!currentOpts.showNavArrows) {
+ nav_left.hide();
+ nav_right.hide();
+ return;
+ }
+
+ if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex !== 0) {
+ nav_left.show();
+ }
+
+ if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex != (currentArray.length -1)) {
+ nav_right.show();
+ }
+ },
+
+ _finish = function () {
+ if (!$.support.opacity) {
+ content.get(0).style.removeAttribute('filter');
+ wrap.get(0).style.removeAttribute('filter');
+ }
+
+ if (selectedOpts.autoDimensions) {
+ content.css('height', 'auto');
+ }
+
+ wrap.css('height', 'auto');
+
+ if (titleStr && titleStr.length) {
+ title.show();
+ }
+
+ if (currentOpts.showCloseButton) {
+ close.show();
+ }
+
+ _set_navigation();
+
+ if (currentOpts.hideOnContentClick) {
+ content.bind('click', $.fancybox.close);
+ }
+
+ if (currentOpts.hideOnOverlayClick) {
+ overlay.bind('click', $.fancybox.close);
+ }
+
+ $(window).bind("resize.fb", $.fancybox.resize);
+
+ if (currentOpts.centerOnScroll) {
+ $(window).bind("scroll.fb", $.fancybox.center);
+ }
+
+ if (currentOpts.type == 'iframe') {
+ $('<iframe id="fancybox-frame" name="fancybox-frame' + new Date().getTime() + '" frameborder="0" hspace="0" ' + ($.browser.msie ? 'allowtransparency="true""' : '') + ' scrolling="' + selectedOpts.scrolling + '" src="' + currentOpts.href + '"></iframe>').appendTo(content);
+ }
+
+ wrap.show();
+
+ busy = false;
+
+ $.fancybox.center();
+
+ currentOpts.onComplete(currentArray, currentIndex, currentOpts);
+
+ _preload_images();
+ },
+
+ _preload_images = function() {
+ var href,
+ objNext;
+
+ if ((currentArray.length -1) > currentIndex) {
+ href = currentArray[ currentIndex + 1 ].href;
+
+ if (typeof href !== 'undefined' && href.match(imgRegExp)) {
+ objNext = new Image();
+ objNext.src = href;
+ }
+ }
+
+ if (currentIndex > 0) {
+ href = currentArray[ currentIndex - 1 ].href;
+
+ if (typeof href !== 'undefined' && href.match(imgRegExp)) {
+ objNext = new Image();
+ objNext.src = href;
+ }
+ }
+ },
+
+ _draw = function(pos) {
+ var dim = {
+ width : parseInt(start_pos.width + (final_pos.width - start_pos.width) * pos, 10),
+ height : parseInt(start_pos.height + (final_pos.height - start_pos.height) * pos, 10),
+
+ top : parseInt(start_pos.top + (final_pos.top - start_pos.top) * pos, 10),
+ left : parseInt(start_pos.left + (final_pos.left - start_pos.left) * pos, 10)
+ };
+
+ if (typeof final_pos.opacity !== 'undefined') {
+ dim.opacity = pos < 0.5 ? 0.5 : pos;
+ }
+
+ wrap.css(dim);
+
+ content.css({
+ 'width' : dim.width - currentOpts.padding * 2,
+ 'height' : dim.height - (titleHeight * pos) - currentOpts.padding * 2
+ });
+ },
+
+ _get_viewport = function() {
+ return [
+ $(window).width() - (currentOpts.margin * 2),
+ $(window).height() - (currentOpts.margin * 2),
+ $(document).scrollLeft() + currentOpts.margin,
+ $(document).scrollTop() + currentOpts.margin
+ ];
+ },
+
+ _get_zoom_to = function () {
+ var view = _get_viewport(),
+ to = {},
+ resize = currentOpts.autoScale,
+ double_padding = currentOpts.padding * 2,
+ ratio;
+
+ if (currentOpts.width.toString().indexOf('%') > -1) {
+ to.width = parseInt((view[0] * parseFloat(currentOpts.width)) / 100, 10);
+ } else {
+ to.width = currentOpts.width + double_padding;
+ }
+
+ if (currentOpts.height.toString().indexOf('%') > -1) {
+ to.height = parseInt((view[1] * parseFloat(currentOpts.height)) / 100, 10);
+ } else {
+ to.height = currentOpts.height + double_padding;
+ }
+
+ if (resize && (to.width > view[0] || to.height > view[1])) {
+ if (selectedOpts.type == 'image' || selectedOpts.type == 'swf') {
+ ratio = (currentOpts.width ) / (currentOpts.height );
+
+ if ((to.width ) > view[0]) {
+ to.width = view[0];
+ to.height = parseInt(((to.width - double_padding) / ratio) + double_padding, 10);
+ }
+
+ if ((to.height) > view[1]) {
+ to.height = view[1];
+ to.width = parseInt(((to.height - double_padding) * ratio) + double_padding, 10);
+ }
+
+ } else {
+ to.width = Math.min(to.width, view[0]);
+ to.height = Math.min(to.height, view[1]);
+ }
+ }
+
+ to.top = parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - to.height - 40) * 0.5)), 10);
+ to.left = parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - to.width - 40) * 0.5)), 10);
+
+ return to;
+ },
+
+ _get_obj_pos = function(obj) {
+ var pos = obj.offset();
+
+ pos.top += parseInt( obj.css('paddingTop'), 10 ) || 0;
+ pos.left += parseInt( obj.css('paddingLeft'), 10 ) || 0;
+
+ pos.top += parseInt( obj.css('border-top-width'), 10 ) || 0;
+ pos.left += parseInt( obj.css('border-left-width'), 10 ) || 0;
+
+ pos.width = obj.width();
+ pos.height = obj.height();
+
+ return pos;
+ },
+
+ _get_zoom_from = function() {
+ var orig = selectedOpts.orig ? $(selectedOpts.orig) : false,
+ from = {},
+ pos,
+ view;
+
+ if (orig && orig.length) {
+ pos = _get_obj_pos(orig);
+
+ from = {
+ width : pos.width + (currentOpts.padding * 2),
+ height : pos.height + (currentOpts.padding * 2),
+ top : pos.top - currentOpts.padding - 20,
+ left : pos.left - currentOpts.padding - 20
+ };
+
+ } else {
+ view = _get_viewport();
+
+ from = {
+ width : currentOpts.padding * 2,
+ height : currentOpts.padding * 2,
+ top : parseInt(view[3] + view[1] * 0.5, 10),
+ left : parseInt(view[2] + view[0] * 0.5, 10)
+ };
+ }
+
+ return from;
+ },
+
+ _animate_loading = function() {
+ if (!loading.is(':visible')){
+ clearInterval(loadingTimer);
+ return;
+ }
+
+ $('div', loading).css('top', (loadingFrame * -40) + 'px');
+
+ loadingFrame = (loadingFrame + 1) % 12;
+ };
+
+ /*
+ * Public methods
+ */
+
+ $.fn.fancybox = function(options) {
+ if (!$(this).length) {
+ return this;
+ }
+
+ $(this)
+ .data('fancybox', $.extend({}, options, ($.metadata ? $(this).metadata() : {})))
+ .unbind('click.fb')
+ .bind('click.fb', function(e) {
+ e.preventDefault();
+
+ if (busy) {
+ return;
+ }
+
+ busy = true;
+
+ $(this).blur();
+
+ selectedArray = [];
+ selectedIndex = 0;
+
+ var rel = $(this).attr('rel') || '';
+ rel = $(this).data('rel') || rel;
+ if (!rel || rel == '' || rel === 'nofollow') {
+ selectedArray.push(this);
+ } else {
+ selectedArray = $("a[rel=" + rel + "], area[rel=" + rel + "],a[data-rel=" + rel + "], area[data-rel=" + rel + "]");
+ selectedIndex = selectedArray.index( this );
+ }
+
+ _start();
+
+ return;
+ });
+
+ return this;
+ };
+
+ $.fancybox = function(obj) {
+ var opts;
+
+ if (busy) {
+ return;
+ }
+
+ busy = true;
+ opts = typeof arguments[1] !== 'undefined' ? arguments[1] : {};
+
+ selectedArray = [];
+ selectedIndex = parseInt(opts.index, 10) || 0;
+
+ if ($.isArray(obj)) {
+ for (var i = 0, j = obj.length; i < j; i++) {
+ if (typeof obj[i] == 'object') {
+ $(obj[i]).data('fancybox', $.extend({}, opts, obj[i]));
+ } else {
+ obj[i] = $({}).data('fancybox', $.extend({content : obj[i]}, opts));
+ }
+ }
+
+ selectedArray = jQuery.merge(selectedArray, obj);
+
+ } else {
+ if (typeof obj == 'object') {
+ $(obj).data('fancybox', $.extend({}, opts, obj));
+ } else {
+ obj = $({}).data('fancybox', $.extend({content : obj}, opts));
+ }
+
+ selectedArray.push(obj);
+ }
+
+ if (selectedIndex > selectedArray.length || selectedIndex < 0) {
+ selectedIndex = 0;
+ }
+
+ _start();
+ };
+
+ $.fancybox.showActivity = function() {
+ clearInterval(loadingTimer);
+
+ loading.show();
+ loadingTimer = setInterval(_animate_loading, 66);
+ };
+
+ $.fancybox.hideActivity = function() {
+ loading.hide();
+ };
+
+ $.fancybox.next = function() {
+ return $.fancybox.pos( currentIndex + 1);
+ };
+
+ $.fancybox.prev = function() {
+ return $.fancybox.pos( currentIndex - 1);
+ };
+
+ $.fancybox.pos = function(pos) {
+ if (busy) {
+ return;
+ }
+
+ pos = parseInt(pos);
+
+ selectedArray = currentArray;
+
+ if (pos > -1 && pos < currentArray.length) {
+ selectedIndex = pos;
+ _start();
+
+ } else if (currentOpts.cyclic && currentArray.length > 1) {
+ selectedIndex = pos >= currentArray.length ? 0 : currentArray.length - 1;
+ _start();
+ }
+
+ return;
+ };
+
+ $.fancybox.cancel = function() {
+ if (busy) {
+ return;
+ }
+
+ busy = true;
+
+ $.event.trigger('fancybox-cancel');
+
+ _abort();
+
+ selectedOpts.onCancel(selectedArray, selectedIndex, selectedOpts);
+
+ busy = false;
+ };
+
+ // Note: within an iframe use - parent.$.fancybox.close();
+ $.fancybox.close = function() {
+ if (busy || wrap.is(':hidden')) {
+ return;
+ }
+
+ busy = true;
+
+ if (currentOpts && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) {
+ busy = false;
+ return;
+ }
+
+ _abort();
+
+ $(close.add( nav_left ).add( nav_right )).hide();
+
+ $(content.add( overlay )).unbind();
+
+ $(window).unbind("resize.fb scroll.fb");
+ $(document).unbind('keydown.fb');
+
+ content.find('iframe').attr('src', isIE6 && /^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank');
+
+ if (currentOpts.titlePosition !== 'inside') {
+ title.empty();
+ }
+
+ wrap.stop();
+
+ function _cleanup() {
+ overlay.fadeOut('fast');
+
+ title.empty().hide();
+ wrap.hide();
+
+ $.event.trigger('fancybox-cleanup');
+
+ content.empty();
+
+ currentOpts.onClosed(currentArray, currentIndex, currentOpts);
+
+ currentArray = selectedOpts = [];
+ currentIndex = selectedIndex = 0;
+ currentOpts = selectedOpts = {};
+
+ busy = false;
+ }
+
+ if (currentOpts.transitionOut == 'elastic') {
+ start_pos = _get_zoom_from();
+
+ var pos = wrap.position();
+
+ final_pos = {
+ top : pos.top ,
+ left : pos.left,
+ width : wrap.width(),
+ height : wrap.height()
+ };
+
+ if (currentOpts.opacity) {
+ final_pos.opacity = 1;
+ }
+
+ title.empty().hide();
+
+ fx.prop = 1;
+
+ $(fx).animate({ prop: 0 }, {
+ duration : currentOpts.speedOut,
+ easing : currentOpts.easingOut,
+ step : _draw,
+ complete : _cleanup
+ });
+
+ } else {
+ wrap.fadeOut( currentOpts.transitionOut == 'none' ? 0 : currentOpts.speedOut, _cleanup);
+ }
+ };
+
+ $.fancybox.resize = function() {
+ if (overlay.is(':visible')) {
+ overlay.css('height', $(document).height());
+ }
+
+ $.fancybox.center(true);
+ };
+
+ $.fancybox.center = function() {
+ var view, align;
+
+ if (busy) {
+ return;
+ }
+
+ align = arguments[0] === true ? 1 : 0;
+ view = _get_viewport();
+
+ if (!align && (wrap.width() > view[0] || wrap.height() > view[1])) {
+ return;
+ }
+
+ wrap
+ .stop()
+ .animate({
+ 'top' : parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - content.height() - 40) * 0.5) - currentOpts.padding)),
+ 'left' : parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - content.width() - 40) * 0.5) - currentOpts.padding))
+ }, typeof arguments[0] == 'number' ? arguments[0] : 200);
+ };
+
+ $.fancybox.init = function() {
+ if ($("#fancybox-wrap").length) {
+ return;
+ }
+
+ $('body').append(
+ tmp = $('<div id="fancybox-tmp"></div>'),
+ loading = $('<div id="fancybox-loading"><div></div></div>'),
+ overlay = $('<div id="fancybox-overlay"></div>'),
+ wrap = $('<div id="fancybox-wrap"></div>')
+ );
+
+ outer = $('<div id="fancybox-outer"></div>')
+ .append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>')
+ .appendTo( wrap );
+
+ outer.append(
+ content = $('<div id="fancybox-content"></div>'),
+ close = $('<a id="fancybox-close"></a>'),
+ title = $('<div id="fancybox-title"></div>'),
+
+ nav_left = $('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),
+ nav_right = $('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>')
+ );
+
+ close.click($.fancybox.close);
+ loading.click($.fancybox.cancel);
+
+ nav_left.click(function(e) {
+ e.preventDefault();
+ $.fancybox.prev();
+ });
+
+ nav_right.click(function(e) {
+ e.preventDefault();
+ $.fancybox.next();
+ });
+
+ if ($.fn.mousewheel) {
+ wrap.bind('mousewheel.fb', function(e, delta) {
+ if (busy) {
+ e.preventDefault();
+
+ } else if ($(e.target).get(0).clientHeight == 0 || $(e.target).get(0).scrollHeight === $(e.target).get(0).clientHeight) {
+ e.preventDefault();
+ $.fancybox[ delta > 0 ? 'prev' : 'next']();
+ }
+ });
+ }
+
+ if (!$.support.opacity) {
+ wrap.addClass('fancybox-ie');
+ }
+
+ if (isIE6) {
+ loading.addClass('fancybox-ie6');
+ wrap.addClass('fancybox-ie6');
+
+ $('<iframe id="fancybox-hide-sel-frame" src="' + (/^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank' ) + '" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(outer);
+ }
+ };
+
+ $.fn.fancybox.defaults = {
+ padding : 10,
+ margin : 40,
+ opacity : false,
+ modal : false,
+ cyclic : false,
+ scrolling : 'auto', // 'auto', 'yes' or 'no'
+
+ width : 560,
+ height : 340,
+
+ autoScale : true,
+ autoDimensions : true,
+ centerOnScroll : false,
+
+ ajax : {},
+ swf : { wmode: 'transparent' },
+
+ hideOnOverlayClick : true,
+ hideOnContentClick : false,
+
+ overlayShow : true,
+ overlayOpacity : 0.7,
+ overlayColor : '#777',
+
+ titleShow : true,
+ titlePosition : 'float', // 'float', 'outside', 'inside' or 'over'
+ titleFormat : null,
+ titleFromAlt : false,
+
+ transitionIn : 'fade', // 'elastic', 'fade' or 'none'
+ transitionOut : 'fade', // 'elastic', 'fade' or 'none'
+
+ speedIn : 300,
+ speedOut : 300,
+
+ changeSpeed : 300,
+ changeFade : 'fast',
+
+ easingIn : 'swing',
+ easingOut : 'swing',
+
+ showCloseButton : true,
+ showNavArrows : true,
+ enableEscapeButton : true,
+ enableKeyboardNav : true,
+
+ onStart : function(){},
+ onCancel : function(){},
+ onComplete : function(){},
+ onCleanup : function(){},
+ onClosed : function(){},
+ onError : function(){}
+ };
+
+ $(document).ready(function() {
+ $.fancybox.init();
+ });
+
+})(jQuery); \ No newline at end of file
diff --git a/plugins/picasa-albums/fancybox/jquery.fancybox-custom.pack.js b/plugins/picasa-albums/fancybox/jquery.fancybox-custom.pack.js
new file mode 100644
index 00000000..889f474a
--- /dev/null
+++ b/plugins/picasa-albums/fancybox/jquery.fancybox-custom.pack.js
@@ -0,0 +1,17 @@
+/*
+ * FancyBox - jQuery Plugin
+ * Simple and fancy lightbox alternative
+ *
+ * Examples and documentation at: http://fancybox.net
+ *
+ * Copyright (c) 2008 - 2010 Janis Skarnelis
+ * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
+ *
+ * Version: 1.3.4 (11/11/2010)
+ * Requires: jQuery v1.3+
+ *
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+ */
+eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}(';(d($){S H,Y,Z,q,1H,y,13,f,1F,1C,W=0,9={},O=[],P=0,4={},K=[],29=1M,14=22 2b(),2j=/\\.(58|57|59|5a|5c)(.*)?$/i,3z=/[^\\.]\\.(1O)\\s*$/i,2t,2u=1,1n=0,1e=\'\',X,F,D=t,1B=$.1i($(\'<k/>\')[0],{1A:0}),2D=$.34.3L&&$.34.5b<7&&!17.1D,2p=d(){Y.L();14.3h=14.3r=1M;6(29){29.56()}H.1x()},2o=d(){6(t===9.3F(O,W,9)){Y.L();D=t;r}9.30=t;9.b=\'T\';9.c=\'T\';H.18(\'<p z="8-4b">55 50 y 4Z 4Y 51.<52 />54 53 5d 5e.</p>\');1K()},1Y=d(){S g=O[W],m,E,f,23,2z,1h;2p();9=$.1i({},$.2F.8.4t,(11 $(g).Q(\'8\')==\'21\'?9:$(g).Q(\'8\')));1h=9.3X(O,W,9);6(1h===t){D=t;r}A 6(11 1h==\'1v\'){9=$.1i(9,1h)}f=9.f||(g.3s?$(g).1S(\'f\'):g.f)||\'\';6(g.3s&&!9.1d){9.1d=$(g).1X("2c:3C").M?$(g).1X("2c:3C"):$(g)}6(f===\'\'&&9.1d&&9.3J){f=9.1d.1S(\'3Y\')}m=9.m||(g.3s?$(g).1S(\'m\'):g.m)||1M;6((/^(?:2a)/i).2N(m)||m==\'#\'){m=1M}6(9.E){E=9.E;6(!m){m=9.y}}A 6(9.y){E=\'18\'}A 6(m){6(m.2k(2j)){E=\'32\'}A 6(m.2k(3z)){E=\'1O\'}A 6($(g).5o("1l")){E=\'1l\'}A 6(m.1P("#")===0){E=\'1I\'}A{E=\'15\'}}6(!E){2o();r}6(E==\'1I\'){g=m.5q(m.1P("#"));E=$(g).M>0?\'1I\':\'15\'}9.E=E;9.m=m;9.f=f;6(9.1N){6(9.E==\'18\'||9.E==\'1I\'||9.E==\'15\'){9.b=\'T\';9.c=\'T\'}A{9.1N=t}}6(9.4w){9.31=I;9.2M=t;9.33=t;9.2K=t;9.2S=t}9.v=B(9.v,10);9.1g=B(9.1g,10);H.G(\'v\',(9.v+9.1g));$(\'.8-1I-H\').1q(\'8-1L\').1c(\'8-3R\',d(){$(V).3i(y.1X())});43(E){1m\'18\':H.18(9.y);1K();1a;1m\'1I\':6($(g).5r().1o(\'#8-y\')===I){D=t;r}$(\'<k 19="8-1I-H" />\').L().5t($(g)).1c(\'8-2T\',d(){$(V).3i(y.1X())}).1c(\'8-1L\',d(){$(V).3i(H.1X())});$(g).1k(H);1K();1a;1m\'32\':D=t;$.8.2X();14=22 2b();14.3h=d(){2o()};14.3r=d(){D=I;14.3h=14.3r=1M;3V()};14.1j=m;1a;1m\'1O\':9.1G=\'4r\';23=\'<1v 5m="5h:5g-5f-4X-5i-5j" b="\'+9.b+\'" c="\'+9.c+\'"><2x 1U="5l" 3K="\'+m+\'"></2x>\';2z=\'\';$.5k(9.1O,d(1U,3l){23+=\'<2x 1U="\'+1U+\'" 3K="\'+3l+\'"></2x>\';2z+=\' \'+1U+\'="\'+3l+\'"\'});23+=\'<3A 1j="\'+m+\'" E="4K/x-4M-4J" b="\'+9.b+\'" c="\'+9.c+\'"\'+2z+\'></3A></1v>\';H.18(23);1K();1a;1m\'15\':D=t;$.8.2X();9.15.3j=9.15.41;29=$.15($.1i({},9.15,{4W:m,Q:9.15.Q||{},4b:d(1D,3w,4O){6(1D.3S>0){2o()}},41:d(Q,3w,1D){S o=11 1D==\'1v\'?1D:29;6(o.3S==3y){6(11 9.15.3j==\'d\'){1h=9.15.3j(m,Q,3w,1D);6(1h===t){Y.L();r}A 6(11 1h==\'4P\'||11 1h==\'1v\'){Q=1h}}H.18(Q);1K()}}}));1a;1m\'1l\':2f();1a}},1K=d(){S w=9.b,h=9.c;6(w.2B().1P(\'%\')>-1){w=B(($(17).b()-(9.1g*2))*2w(w)/2v,10)+\'1Z\'}A{w=w==\'T\'?\'T\':w+\'1Z\'}6(h.2B().1P(\'%\')>-1){h=B(($(17).c()-(9.1g*2))*2w(h)/2v,10)+\'1Z\'}A{h=h==\'T\'?\'T\':h+\'1Z\'}H.4S(\'<k 1t="b:\'+w+\';c:\'+h+\';4T: \'+(9.1G==\'T\'?\'T\':(9.1G==\'4V\'?\'2C\':\'2n\'))+\';38:4U;"></k>\');9.b=H.b();9.c=H.c();2f()},3V=d(){9.b=14.b;9.c=14.c;$("<2c />").1S({\'z\':\'8-2c\',\'1j\':14.1j,\'3Y\':9.f}).1k(H);2f()},2f=d(){S l,2O;Y.L();6(q.1o(":1R")&&t===4.3g(K,P,4)){$.2q.2s(\'8-1L\');D=t;r}D=I;$(y.1T(Z)).1q();$(17).1q("1u.16 2C.16");$(1r).1q(\'2W.16\');6(q.1o(":1R")&&4.1p!==\'62\'){q.G(\'c\',q.c())}K=O;P=W;4=9;6(4.31){Z.G({\'63-64\':4.3N,\'1b\':4.3H,\'5v\':4.2M?\'65\':\'T\',\'c\':$(1r).c()});6(!Z.1o(\':1R\')){6(2D){$(\'3P:61(#8-H 3P)\').2e(d(){r V.1t.2R!==\'2n\'}).G({\'2R\':\'2n\'}).60(\'8-2T\',d(){V.1t.2R=\'5X\'})}Z.1f()}}A{Z.L()}F=3I();47();6(q.1o(":1R")){$(13.1T(1F).1T(1C)).L();l=q.38(),X={N:l.N,J:l.J,b:q.b(),c:q.c()};2O=(X.b==F.b&&X.c==F.c);y.3Q(4.36,0.3,d(){S 2P=d(){y.18(H.2Q()).3Q(4.36,1,2h)};$.2q.2s(\'8-3R\');y.1x().3e(\'2e\').G({\'26-b\':4.v,\'b\':F.b-4.v*2,\'c\':9.1N?\'T\':F.c-1n-4.v*2});6(2O){2P()}A{1B.1A=0;$(1B).2d({1A:1},{3v:4.3B,3u:4.67,3t:2r,3q:2P})}});r}q.3e("1t");y.G(\'26-b\',4.v);6(4.2Z==\'4z\'){X=2V();y.18(H.2Q());q.1f();6(4.1b){F.1b=0}1B.1A=0;$(1B).2d({1A:1},{3v:4.3c,3u:4.42,3t:2r,3q:2h});r}6(4.1p==\'2U\'&&1n>0){f.1f()}y.G({\'b\':F.b-4.v*2,\'c\':9.1N?\'T\':F.c-1n-4.v*2}).18(H.2Q());q.G(F).68(4.2Z==\'4d\'?0:4.3c,2h)},46=d(f){6(f&&f.M){6(4.1p==\'1w\'){r\'<4a z="8-f-1w-q" 6f="0" 6g="0"><49><1V z="8-f-1w-J"></1V><1V z="8-f-1w-6c">\'+f+\'</1V><1V z="8-f-1w-3p"></1V></49></4a>\'}r\'<k z="8-f-\'+4.1p+\'">\'+f+\'</k>\'}r t},47=d(){1e=4.f||\'\';1n=0;f.1x().3e(\'1t\').6h();6(4.30===t){f.L();r}1e=$.6e(4.2Y)?4.2Y(1e,K,P,4):46(1e);6(!1e||1e===\'\'){f.L();r}f.2I(\'8-f-\'+4.1p).18(1e).1k(\'4g\').1f();43(4.1p){1m\'2U\':f.G({\'b\':F.b-(4.v*2),\'44\':4.v,\'5D\':4.v});1n=f.5E(I);f.1k(1H);F.c+=1n;1a;1m\'5F\':f.G({\'44\':4.v,\'b\':F.b-(4.v*2),\'5B\':4.v}).1k(1H);1a;1m\'1w\':f.G(\'J\',B((f.b()-F.b-40)/2,10)*-1).1k(q);1a;5x:f.G({\'b\':F.b-(4.v*2),\'4F\':4.v,\'5w\':4.v}).1k(q);1a}f.L()},3D=d(){6(4.2K||4.3o){$(1r).1c(\'2W.16\',d(e){6(e.2g==27&&4.2K){e.1y();$.8.13()}A 6((e.2g==37||e.2g==39)&&4.3o&&e.1J.3a!==\'5A\'&&e.1J.3a!==\'5H\'&&e.1J.3a!==\'5P\'){e.1y();$.8[e.2g==37?\'2L\':\'2J\']()}})}6(!4.3W){1F.L();1C.L();r}6((4.2H&&K.M>1)||P!==0){1F.1f()}6((4.2H&&K.M>1)||P!=(K.M-1)){1C.1f()}},2h=d(){6(!$.4B.1b){y.1W(0).1t.3E(\'2e\');q.1W(0).1t.3E(\'2e\')}6(9.1N){y.G(\'c\',\'T\')}q.G(\'c\',\'T\');6(1e&&1e.M){f.1f()}6(4.2S){13.1f()}3D();6(4.33){y.1c(\'1s\',$.8.13)}6(4.2M){Z.1c(\'1s\',$.8.13)}$(17).1c("1u.16",$.8.1u);6(4.4x){$(17).1c("2C.16",$.8.2A)}6(4.E==\'1l\'){$(\'<1l z="8-3f" 1U="8-3f\'+22 5M().5J()+\'" 4n="0" 5N="0" \'+($.34.3L?\'5S="I""\':\'\')+\' 1G="\'+9.1G+\'" 1j="\'+4.m+\'"></1l>\').1k(y)}q.1f();D=t;$.8.2A();4.3O(K,P,4);3M()},3M=d(){S m,25;6((K.M-1)>P){m=K[P+1].m;6(11 m!==\'21\'&&m.2k(2j)){25=22 2b();25.1j=m}}6(P>0){m=K[P-1].m;6(11 m!==\'21\'&&m.2k(2j)){25=22 2b();25.1j=m}}},2r=d(l){S 24={b:B(X.b+(F.b-X.b)*l,10),c:B(X.c+(F.c-X.c)*l,10),N:B(X.N+(F.N-X.N)*l,10),J:B(X.J+(F.J-X.J)*l,10)};6(11 F.1b!==\'21\'){24.1b=l<0.5?0.5:l}q.G(24);y.G({\'b\':24.b-4.v*2,\'c\':24.c-(1n*l)-4.v*2})},2l=d(){r[$(17).b()-(4.1g*2),$(17).c()-(4.1g*2),$(1r).5U()+4.1g,$(1r).5T()+4.1g]},3I=d(){S u=2l(),C={},1u=4.4C,1z=4.v*2,2m;6(4.b.2B().1P(\'%\')>-1){C.b=B((u[0]*2w(4.b))/2v,10)}A{C.b=4.b+1z}6(4.c.2B().1P(\'%\')>-1){C.c=B((u[1]*2w(4.c))/2v,10)}A{C.c=4.c+1z}6(1u&&(C.b>u[0]||C.c>u[1])){6(9.E==\'32\'||9.E==\'1O\'){2m=(4.b)/(4.c);6((C.b)>u[0]){C.b=u[0];C.c=B(((C.b-1z)/2m)+1z,10)}6((C.c)>u[1]){C.c=u[1];C.b=B(((C.c-1z)*2m)+1z,10)}}A{C.b=1Q.3T(C.b,u[0]);C.c=1Q.3T(C.c,u[1])}}C.N=B(1Q.2i(u[3]-20,u[3]+((u[1]-C.c-40)*0.5)),10);C.J=B(1Q.2i(u[2]-20,u[2]+((u[0]-C.b-40)*0.5)),10);r C},4H=d(g){S l=g.5Z();l.N+=B(g.G(\'6d\'),10)||0;l.J+=B(g.G(\'4F\'),10)||0;l.N+=B(g.G(\'26-N-b\'),10)||0;l.J+=B(g.G(\'26-J-b\'),10)||0;l.b=g.b();l.c=g.c();r l},2V=d(){S 1d=9.1d?$(9.1d):t,2y={},l,u;6(1d&&1d.M){l=4H(1d);2y={b:l.b+(4.v*2),c:l.c+(4.v*2),N:l.N-4.v-20,J:l.J-4.v-20}}A{u=2l();2y={b:4.v*2,c:4.v*2,N:B(u[3]+u[1]*0.5,10),J:B(u[2]+u[0]*0.5,10)}}r 2y},4s=d(){6(!Y.1o(\':1R\')){4o(2t);r}$(\'k\',Y).G(\'N\',(2u*-40)+\'1Z\');2u=(2u+1)%12};$.2F.8=d(4G){6(!$(V).M){r V}$(V).Q(\'8\',$.1i({},4G,($.4E?$(V).4E():{}))).1q(\'1s.16\').1c(\'1s.16\',d(e){e.1y();6(D){r}D=I;$(V).5Q();O=[];W=0;S R=$(V).1S(\'R\')||\'\';R=$(V).Q(\'R\')||R;6(!R||R==\'\'||R===\'5R\'){O.4p(V)}A{O=$("a[R="+R+"], 4j[R="+R+"],a[Q-R="+R+"], 4j[Q-R="+R+"]");W=O.4e(V)}1Y();r});r V};$.8=d(g){S 1E;6(D){r}D=I;1E=11 28[1]!==\'21\'?28[1]:{};O=[];W=B(1E.4e,10)||0;6($.5L(g)){5K(S i=0,j=g.M;i<j;i++){6(11 g[i]==\'1v\'){$(g[i]).Q(\'8\',$.1i({},1E,g[i]))}A{g[i]=$({}).Q(\'8\',$.1i({y:g[i]},1E))}}O=4D.5O(O,g)}A{6(11 g==\'1v\'){$(g).Q(\'8\',$.1i({},1E,g))}A{g=$({}).Q(\'8\',$.1i({y:g},1E))}O.4p(g)}6(W>O.M||W<0){W=0}1Y()};$.8.2X=d(){4o(2t);Y.1f();2t=6b(4s,66)};$.8.69=d(){Y.L()};$.8.2J=d(){r $.8.l(P+1)};$.8.2L=d(){r $.8.l(P-1)};$.8.l=d(l){6(D){r}l=B(l);O=K;6(l>-1&&l<K.M){W=l;1Y()}A 6(4.2H&&K.M>1){W=l>=K.M?0:K.M-1;1Y()}r};$.8.1L=d(){6(D){r}D=I;$.2q.2s(\'8-1L\');2p();9.3Z(O,W,9);D=t};$.8.13=d(){6(D||q.1o(\':2n\')){r}D=I;6(4&&t===4.3g(K,P,4)){D=t;r}2p();$(13.1T(1F).1T(1C)).L();$(y.1T(Z)).1q();$(17).1q("1u.16 2C.16");$(1r).1q(\'2W.16\');y.5V(\'1l\').1S(\'1j\',2D&&/^4A/i.2N(17.4I.m||\'\')?\'2a:4i(t)\':\'4k:4l\');6(4.1p!==\'2U\'){f.1x()}q.4u();d 3k(){Z.4h(\'45\');f.1x().L();q.L();$.2q.2s(\'8-2T\');y.1x();4.3x(K,P,4);K=9=[];P=W=0;4=9={};D=t}6(4.35==\'4z\'){X=2V();S l=q.38();F={N:l.N,J:l.J,b:q.b(),c:q.c()};6(4.1b){F.1b=1}f.1x().L();1B.1A=1;$(1B).2d({1A:0},{3v:4.3d,3u:4.48,3t:2r,3q:3k})}A{q.4h(4.35==\'4d\'?0:4.3d,3k)}};$.8.1u=d(){6(Z.1o(\':1R\')){Z.G(\'c\',$(1r).c())}$.8.2A(I)};$.8.2A=d(){S u,3m;6(D){r}3m=28[0]===I?1:0;u=2l();6(!3m&&(q.b()>u[0]||q.c()>u[1])){r}q.4u().2d({\'N\':B(1Q.2i(u[3]-20,u[3]+((u[1]-y.c()-40)*0.5)-4.v)),\'J\':B(1Q.2i(u[2]-20,u[2]+((u[0]-y.b()-40)*0.5)-4.v))},11 28[0]==\'5p\'?28[0]:3y)};$.8.3G=d(){6($("#8-q").M){r}$(\'4g\').3n(H=$(\'<k z="8-H"></k>\'),Y=$(\'<k z="8-Y"><k></k></k>\'),Z=$(\'<k z="8-Z"></k>\'),q=$(\'<k z="8-q"></k>\'));1H=$(\'<k z="8-1H"></k>\').3n(\'<k 19="8-U" z="8-U-n"></k><k 19="8-U" z="8-U-5s"></k><k 19="8-U" z="8-U-e"></k><k 19="8-U" z="8-U-5u"></k><k 19="8-U" z="8-U-s"></k><k 19="8-U" z="8-U-4R"></k><k 19="8-U" z="8-U-w"></k><k 19="8-U" z="8-U-4N"></k>\').1k(q);1H.3n(y=$(\'<k z="8-y"></k>\'),13=$(\'<a z="8-13"></a>\'),f=$(\'<k z="8-f"></k>\'),1F=$(\'<a m="2a:;" z="8-J"><2E 19="4m-2G" z="8-J-2G"></2E></a>\'),1C=$(\'<a m="2a:;" z="8-3p"><2E 19="4m-2G" z="8-3p-2G"></2E></a>\'));13.1s($.8.13);Y.1s($.8.1L);1F.1s(d(e){e.1y();$.8.2L()});1C.1s(d(e){e.1y();$.8.2J()});6($.2F.4f){q.1c(\'4f.16\',d(e,4y){6(D){e.1y()}A 6($(e.1J).1W(0).4v==0||$(e.1J).1W(0).4Q===$(e.1J).1W(0).4v){e.1y();$.8[4y>0?\'2L\':\'2J\']()}})}6(!$.4B.1b){q.2I(\'8-4L\')}6(2D){Y.2I(\'8-4q\');q.2I(\'8-4q\');$(\'<1l z="8-L-5y-3f" 1j="\'+(/^4A/i.2N(17.4I.m||\'\')?\'2a:4i(t)\':\'4k:4l\')+\'" 1G="4r" 26="0" 4n="0" 5G="-1"></1l>\').5I(1H)}};$.2F.8.4t={v:10,1g:40,1b:t,4w:t,2H:t,1G:\'T\',b:5C,c:6a,4C:I,1N:I,4x:t,15:{},1O:{5W:\'5Y\'},2M:I,33:t,31:I,3H:0.7,3N:\'#5z\',30:I,1p:\'1w\',2Y:1M,3J:t,2Z:\'4c\',35:\'4c\',3c:3b,3d:3b,3B:3b,36:\'45\',42:\'3U\',48:\'3U\',2S:I,3W:I,2K:I,3o:I,3X:d(){},3Z:d(){},3O:d(){},3g:d(){},3x:d(){},3F:d(){}};$(1r).5n(d(){$.8.3G()})})(4D);',62,390,'||||currentOpts||if||fancybox|selectedOpts||width|height|function||title|obj||||div|pos|href||||wrap|return||false|view|padding|||content|id|else|parseInt|to|busy|type|final_pos|css|tmp|true|left|currentArray|hide|length|top|selectedArray|currentIndex|data|rel|var|auto|bg|this|selectedIndex|start_pos|loading|overlay||typeof||close|imgPreloader|ajax|fb|window|html|class|break|opacity|bind|orig|titleStr|show|margin|ret|extend|src|appendTo|iframe|case|titleHeight|is|titlePosition|unbind|document|click|style|resize|object|float|empty|preventDefault|double_padding|prop|fx|nav_right|XMLHttpRequest|opts|nav_left|scrolling|outer|inline|target|_process_inline|cancel|null|autoDimensions|swf|indexOf|Math|visible|attr|add|name|td|get|children|_start|px||undefined|new|str|dim|objNext|border||arguments|ajaxLoader|javascript|Image|img|animate|filter|_show|keyCode|_finish|max|imgRegExp|match|_get_viewport|ratio|hidden|_error|_abort|event|_draw|trigger|loadingTimer|loadingFrame|100|parseFloat|param|from|emb|center|toString|scroll|isIE6|span|fn|ico|cyclic|addClass|next|enableEscapeButton|prev|hideOnOverlayClick|test|equal|finish_resizing|contents|visibility|showCloseButton|cleanup|inside|_get_zoom_from|keydown|showActivity|titleFormat|transitionIn|titleShow|overlayShow|image|hideOnContentClick|browser|transitionOut|changeFade||position||tagName|300|speedIn|speedOut|removeAttr|frame|onCleanup|onerror|replaceWith|win|_cleanup|val|align|append|enableKeyboardNav|right|complete|onload|nodeName|step|easing|duration|textStatus|onClosed|200|swfRegExp|embed|changeSpeed|first|_set_navigation|removeAttribute|onError|init|overlayOpacity|_get_zoom_to|titleFromAlt|value|msie|_preload_images|overlayColor|onComplete|select|fadeTo|change|status|min|swing|_process_image|showNavArrows|onStart|alt|onCancel||success|easingIn|switch|marginLeft|fast|_format_title|_process_title|easingOut|tr|table|error|fade|none|index|mousewheel|body|fadeOut|void|area|about|blank|fancy|frameborder|clearInterval|push|ie6|no|_animate_loading|defaults|stop|clientHeight|modal|centerOnScroll|delta|elastic|https|support|autoScale|jQuery|metadata|paddingLeft|options|_get_obj_pos|location|flash|application|ie|shockwave|nw|errorThrown|string|scrollHeight|sw|wrapInner|overflow|relative|yes|url|11cf|be|cannot|requested|loaded|br|try|Please|The|abort|gif|jpg|png|bmp|version|jpeg|again|later|AE6D|D27CDB6E|clsid|96B8|444553540000|each|movie|classid|ready|hasClass|number|substr|parent|ne|insertBefore|se|cursor|paddingRight|default|sel|777|INPUT|bottom|560|marginRight|outerHeight|over|tabindex|TEXTAREA|prependTo|getTime|for|isArray|Date|hspace|merge|SELECT|blur|nofollow|allowtransparency|scrollTop|scrollLeft|find|wmode|inherit|transparent|offset|one|not|outside|background|color|pointer||easingChange|fadeIn|hideActivity|340|setInterval|main|paddingTop|isFunction|cellpadding|cellspacing|removeClass'.split('|'),0,{})) \ No newline at end of file
diff --git a/plugins/picasa-albums/fancybox/jquery.fancybox.css b/plugins/picasa-albums/fancybox/jquery.fancybox.css
new file mode 100644
index 00000000..28bbb132
--- /dev/null
+++ b/plugins/picasa-albums/fancybox/jquery.fancybox.css
@@ -0,0 +1,363 @@
+/*
+ * FancyBox - jQuery Plugin
+ * Simple and fancy lightbox alternative
+ *
+ * Examples and documentation at: http://fancybox.net
+ *
+ * Copyright (c) 2008 - 2010 Janis Skarnelis
+ *
+ * Version: 1.3.1 (05/03/2010)
+ * Requires: jQuery v1.3+
+ *
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+ */
+
+#fancybox-loading {
+ position: fixed;
+ top: 50%;
+ left: 50%;
+ height: 40px;
+ width: 40px;
+ margin-top: -20px;
+ margin-left: -20px;
+ cursor: pointer;
+ overflow: hidden;
+ z-index: 1104;
+ display: none;
+}
+
+* html #fancybox-loading { /* IE6 */
+ position: absolute;
+ margin-top: 0;
+}
+
+#fancybox-loading div {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 40px;
+ height: 480px;
+ background-image: url('fancybox.png');
+}
+
+#fancybox-overlay {
+ position: fixed;
+ top: 0;
+ left: 0;
+ bottom: 0;
+ right: 0;
+ background: #000;
+ z-index: 1100;
+ display: none;
+}
+
+* html #fancybox-overlay { /* IE6 */
+ position: absolute;
+ width: 100%;
+}
+
+#fancybox-tmp {
+ padding: 0;
+ margin: 0;
+ border: 0;
+ overflow: auto;
+ display: none;
+}
+
+#fancybox-wrap {
+ position: absolute;
+ top: 0;
+ left: 0;
+ margin: 0;
+ padding: 20px;
+ z-index: 1101;
+ display: none;
+}
+
+#fancybox-outer {
+ position: relative;
+ width: 100%;
+ height: 100%;
+ background: #FFF;
+}
+
+#fancybox-inner {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 1px;
+ height: 1px;
+ padding: 0;
+ margin: 0;
+ outline: none;
+ overflow: hidden;
+}
+
+#fancybox-hide-sel-frame {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ background: transparent;
+}
+
+#fancybox-close {
+ position: absolute;
+ top: -15px;
+ right: -15px;
+ width: 30px;
+ height: 30px;
+ background-image: url('fancybox.png');
+ background-position: -40px 0px;
+ cursor: pointer;
+ z-index: 1103;
+ display: none;
+}
+
+#fancybox_error {
+ color: #444;
+ font: normal 12px/20px Arial;
+ padding: 7px;
+ margin: 0;
+}
+
+#fancybox-content {
+ height: auto;
+ width: auto;
+ padding: 0;
+ margin: 0;
+}
+
+#fancybox-img {
+ width: 100%;
+ height: 100%;
+ padding: 0;
+ margin: 0;
+ border: none;
+ outline: none;
+ line-height: 0;
+ vertical-align: top;
+ -ms-interpolation-mode: bicubic;
+}
+
+#fancybox-frame {
+ position: relative;
+ width: 100%;
+ height: 100%;
+ border: none;
+ display: block;
+}
+
+#fancybox-title {
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ font-family: Arial;
+ font-size: 12px;
+ z-index: 1102;
+}
+
+.fancybox-title-inside {
+ padding: 10px 0;
+ text-align: center;
+ color: #333;
+}
+
+.fancybox-title-outside {
+ padding-top: 5px;
+ color: #FFF;
+ text-align: center;
+ font-weight: bold;
+}
+
+.fancybox-title-over {
+ color: #FFF;
+ text-align: left;
+}
+
+#fancybox-title-over {
+ padding: 10px;
+ background-image: url('fancy_title_over.png');
+ display: block;
+}
+
+#fancybox-title-wrap {
+ display: inline-block;
+}
+
+#fancybox-title-wrap span {
+ height: 32px;
+ float: left;
+}
+
+#fancybox-title-left {
+ padding-left: 15px;
+ background-image: url('fancybox.png');
+ background-position: -40px -90px;
+ background-repeat: no-repeat;
+}
+
+#fancybox-title-main {
+ font-weight: bold;
+ line-height: 29px;
+ background-image: url('fancybox-x.png');
+ background-position: 0px -40px;
+ color: #FFF;
+}
+
+#fancybox-title-right {
+ padding-left: 15px;
+ background-image: url('fancybox.png');
+ background-position: -55px -90px;
+ background-repeat: no-repeat;
+}
+
+#fancybox-left, #fancybox-right {
+ position: absolute;
+ bottom: 0px;
+ height: 100%;
+ width: 35%;
+ cursor: pointer;
+ outline: none;
+ background-image: url('blank.gif');
+ z-index: 1102;
+ display: none;
+}
+
+#fancybox-left {
+ left: 0px;
+}
+
+#fancybox-right {
+ right: 0px;
+}
+
+#fancybox-left-ico, #fancybox-right-ico {
+ position: absolute;
+ top: 50%;
+ left: -9999px;
+ width: 30px;
+ height: 30px;
+ margin-top: -15px;
+ cursor: pointer;
+ z-index: 1102;
+ display: block;
+}
+
+#fancybox-left-ico {
+ background-image: url('fancybox.png');
+ background-position: -40px -30px;
+}
+
+#fancybox-right-ico {
+ background-image: url('fancybox.png');
+ background-position: -40px -60px;
+}
+
+#fancybox-left:hover, #fancybox-right:hover {
+ visibility: visible; /* IE6 */
+}
+
+#fancybox-left:hover span {
+ left: 20px;
+}
+
+#fancybox-right:hover span {
+ left: auto;
+ right: 20px;
+}
+
+.fancy-bg {
+ position: absolute;
+ padding: 0;
+ margin: 0;
+ border: 0;
+ width: 20px;
+ height: 20px;
+ z-index: 1001;
+}
+
+#fancy-bg-n {
+ top: -20px;
+ left: 0;
+ width: 100%;
+ background-image: url('fancybox-x.png');
+}
+
+#fancy-bg-ne {
+ top: -20px;
+ right: -20px;
+ background-image: url('fancybox.png');
+ background-position: -40px -162px;
+}
+
+#fancy-bg-e {
+ top: 0;
+ right: -20px;
+ height: 100%;
+ background-image: url('fancybox-y.png');
+ background-position: -20px 0px;
+}
+
+#fancy-bg-se {
+ bottom: -20px;
+ right: -20px;
+ background-image: url('fancybox.png');
+ background-position: -40px -182px;
+}
+
+#fancy-bg-s {
+ bottom: -20px;
+ left: 0;
+ width: 100%;
+ background-image: url('fancybox-x.png');
+ background-position: 0px -20px;
+}
+
+#fancy-bg-sw {
+ bottom: -20px;
+ left: -20px;
+ background-image: url('fancybox.png');
+ background-position: -40px -142px;
+}
+
+#fancy-bg-w {
+ top: 0;
+ left: -20px;
+ height: 100%;
+ background-image: url('fancybox-y.png');
+}
+
+#fancy-bg-nw {
+ top: -20px;
+ left: -20px;
+ background-image: url('fancybox.png');
+ background-position: -40px -122px;
+}
+
+/* IE */
+
+#fancybox-loading.fancybox-ie div { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_loading.png', sizingMethod='scale'); }
+.fancybox-ie #fancybox-close { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_close.png', sizingMethod='scale'); }
+
+.fancybox-ie #fancybox-title-over { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_over.png', sizingMethod='scale'); zoom: 1; }
+.fancybox-ie #fancybox-title-left { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_left.png', sizingMethod='scale'); }
+.fancybox-ie #fancybox-title-main { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_main.png', sizingMethod='scale'); }
+.fancybox-ie #fancybox-title-right { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_right.png', sizingMethod='scale'); }
+
+.fancybox-ie #fancybox-left-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_left.png', sizingMethod='scale'); }
+.fancybox-ie #fancybox-right-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_right.png', sizingMethod='scale'); }
+
+.fancybox-ie .fancy-bg { background: transparent !important; }
+
+.fancybox-ie #fancy-bg-n { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_n.png', sizingMethod='scale'); }
+.fancybox-ie #fancy-bg-ne { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_ne.png', sizingMethod='scale'); }
+.fancybox-ie #fancy-bg-e { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_e.png', sizingMethod='scale'); }
+.fancybox-ie #fancy-bg-se { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_se.png', sizingMethod='scale'); }
+.fancybox-ie #fancy-bg-s { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_s.png', sizingMethod='scale'); }
+.fancybox-ie #fancy-bg-sw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_sw.png', sizingMethod='scale'); }
+.fancybox-ie #fancy-bg-w { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_w.png', sizingMethod='scale'); }
+.fancybox-ie #fancy-bg-nw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_nw.png', sizingMethod='scale'); }
diff --git a/plugins/picasa-albums/fancybox/jquery.fancybox.js b/plugins/picasa-albums/fancybox/jquery.fancybox.js
new file mode 100644
index 00000000..c36219b6
--- /dev/null
+++ b/plugins/picasa-albums/fancybox/jquery.fancybox.js
@@ -0,0 +1,44 @@
+/*
+ * FancyBox - jQuery Plugin
+ * Simple and fancy lightbox alternative
+ *
+ * Examples and documentation at: http://fancybox.net
+ *
+ * Copyright (c) 2008 - 2010 Janis Skarnelis
+ *
+ * Version: 1.3.1 (05/03/2010)
+ * Requires: jQuery v1.3+
+ *
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+ */
+
+(function(b){var m,u,x,g,D,i,z,A,B,p=0,e={},q=[],n=0,c={},j=[],E=null,s=new Image,G=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,S=/[^\.]\.(swf)\s*$/i,H,I=1,k,l,h=false,y=b.extend(b("<div/>")[0],{prop:0}),v=0,O=!b.support.opacity&&!window.XMLHttpRequest,J=function(){u.hide();s.onerror=s.onload=null;E&&E.abort();m.empty()},P=function(){b.fancybox('<p id="fancybox_error">The requested content cannot be loaded.<br />Please try again later.</p>',{scrolling:"no",padding:20,transitionIn:"none",transitionOut:"none"})},
+K=function(){return[b(window).width(),b(window).height(),b(document).scrollLeft(),b(document).scrollTop()]},T=function(){var a=K(),d={},f=c.margin,o=c.autoScale,t=(20+f)*2,w=(20+f)*2,r=c.padding*2;if(c.width.toString().indexOf("%")>-1){d.width=a[0]*parseFloat(c.width)/100-40;o=false}else d.width=c.width+r;if(c.height.toString().indexOf("%")>-1){d.height=a[1]*parseFloat(c.height)/100-40;o=false}else d.height=c.height+r;if(o&&(d.width>a[0]-t||d.height>a[1]-w))if(e.type=="image"||e.type=="swf"){t+=r;
+w+=r;o=Math.min(Math.min(a[0]-t,c.width)/c.width,Math.min(a[1]-w,c.height)/c.height);d.width=Math.round(o*(d.width-r))+r;d.height=Math.round(o*(d.height-r))+r}else{d.width=Math.min(d.width,a[0]-t);d.height=Math.min(d.height,a[1]-w)}d.top=a[3]+(a[1]-(d.height+40))*0.5;d.left=a[2]+(a[0]-(d.width+40))*0.5;if(c.autoScale===false){d.top=Math.max(a[3]+f,d.top);d.left=Math.max(a[2]+f,d.left)}return d},U=function(a){if(a&&a.length)switch(c.titlePosition){case "inside":return a;case "over":return'<span id="fancybox-title-over">'+
+a+"</span>";default:return'<span id="fancybox-title-wrap"><span id="fancybox-title-left"></span><span id="fancybox-title-main">'+a+'</span><span id="fancybox-title-right"></span></span>'}return false},V=function(){var a=c.title,d=l.width-c.padding*2,f="fancybox-title-"+c.titlePosition;b("#fancybox-title").remove();v=0;if(c.titleShow!==false){a=b.isFunction(c.titleFormat)?c.titleFormat(a,j,n,c):U(a);if(!(!a||a==="")){b('<div id="fancybox-title" class="'+f+'" />').css({width:d,paddingLeft:c.padding,
+paddingRight:c.padding}).html(a).appendTo("body");switch(c.titlePosition){case "inside":v=b("#fancybox-title").outerHeight(true)-c.padding;l.height+=v;break;case "over":b("#fancybox-title").css("bottom",c.padding);break;default:b("#fancybox-title").css("bottom",b("#fancybox-title").outerHeight(true)*-1);break}b("#fancybox-title").appendTo(D).hide()}}},W=function(){b(document).unbind("keydown.fb").bind("keydown.fb",function(a){if(a.keyCode==27&&c.enableEscapeButton){a.preventDefault();b.fancybox.close()}else if(a.keyCode==
+37){a.preventDefault();b.fancybox.prev()}else if(a.keyCode==39){a.preventDefault();b.fancybox.next()}});if(b.fn.mousewheel){g.unbind("mousewheel.fb");j.length>1&&g.bind("mousewheel.fb",function(a,d){a.preventDefault();h||d===0||(d>0?b.fancybox.prev():b.fancybox.next())})}if(c.showNavArrows){if(c.cyclic&&j.length>1||n!==0)A.show();if(c.cyclic&&j.length>1||n!=j.length-1)B.show()}},X=function(){var a,d;if(j.length-1>n){a=j[n+1].href;if(typeof a!=="undefined"&&a.match(G)){d=new Image;d.src=a}}if(n>0){a=
+j[n-1].href;if(typeof a!=="undefined"&&a.match(G)){d=new Image;d.src=a}}},L=function(){i.css("overflow",c.scrolling=="auto"?c.type=="image"||c.type=="iframe"||c.type=="swf"?"hidden":"auto":c.scrolling=="yes"?"auto":"visible");if(!b.support.opacity){i.get(0).style.removeAttribute("filter");g.get(0).style.removeAttribute("filter")}b("#fancybox-title").show();c.hideOnContentClick&&i.one("click",b.fancybox.close);c.hideOnOverlayClick&&x.one("click",b.fancybox.close);c.showCloseButton&&z.show();W();b(window).bind("resize.fb",
+b.fancybox.center);c.centerOnScroll?b(window).bind("scroll.fb",b.fancybox.center):b(window).unbind("scroll.fb");b.isFunction(c.onComplete)&&c.onComplete(j,n,c);h=false;X()},M=function(a){var d=Math.round(k.width+(l.width-k.width)*a),f=Math.round(k.height+(l.height-k.height)*a),o=Math.round(k.top+(l.top-k.top)*a),t=Math.round(k.left+(l.left-k.left)*a);g.css({width:d+"px",height:f+"px",top:o+"px",left:t+"px"});d=Math.max(d-c.padding*2,0);f=Math.max(f-(c.padding*2+v*a),0);i.css({width:d+"px",height:f+
+"px"});if(typeof l.opacity!=="undefined")g.css("opacity",a<0.5?0.5:a)},Y=function(a){var d=a.offset();d.top+=parseFloat(a.css("paddingTop"))||0;d.left+=parseFloat(a.css("paddingLeft"))||0;d.top+=parseFloat(a.css("border-top-width"))||0;d.left+=parseFloat(a.css("border-left-width"))||0;d.width=a.width();d.height=a.height();return d},Q=function(){var a=e.orig?b(e.orig):false,d={};if(a&&a.length){a=Y(a);d={width:a.width+c.padding*2,height:a.height+c.padding*2,top:a.top-c.padding-20,left:a.left-c.padding-
+20}}else{a=K();d={width:1,height:1,top:a[3]+a[1]*0.5,left:a[2]+a[0]*0.5}}return d},N=function(){u.hide();if(g.is(":visible")&&b.isFunction(c.onCleanup))if(c.onCleanup(j,n,c)===false){b.event.trigger("fancybox-cancel");h=false;return}j=q;n=p;c=e;i.get(0).scrollTop=0;i.get(0).scrollLeft=0;if(c.overlayShow){O&&b("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"});
+x.css({"background-color":c.overlayColor,opacity:c.overlayOpacity}).unbind().show()}l=T();V();if(g.is(":visible")){b(z.add(A).add(B)).hide();var a=g.position(),d;k={top:a.top,left:a.left,width:g.width(),height:g.height()};d=k.width==l.width&&k.height==l.height;i.fadeOut(c.changeFade,function(){var f=function(){i.html(m.contents()).fadeIn(c.changeFade,L)};b.event.trigger("fancybox-change");i.empty().css("overflow","hidden");if(d){i.css({top:c.padding,left:c.padding,width:Math.max(l.width-c.padding*
+2,1),height:Math.max(l.height-c.padding*2-v,1)});f()}else{i.css({top:c.padding,left:c.padding,width:Math.max(k.width-c.padding*2,1),height:Math.max(k.height-c.padding*2,1)});y.prop=0;b(y).animate({prop:1},{duration:c.changeSpeed,easing:c.easingChange,step:M,complete:f})}})}else{g.css("opacity",1);if(c.transitionIn=="elastic"){k=Q();i.css({top:c.padding,left:c.padding,width:Math.max(k.width-c.padding*2,1),height:Math.max(k.height-c.padding*2,1)}).html(m.contents());g.css(k).show();if(c.opacity)l.opacity=
+0;y.prop=0;b(y).animate({prop:1},{duration:c.speedIn,easing:c.easingIn,step:M,complete:L})}else{i.css({top:c.padding,left:c.padding,width:Math.max(l.width-c.padding*2,1),height:Math.max(l.height-c.padding*2-v,1)}).html(m.contents());g.css(l).fadeIn(c.transitionIn=="none"?0:c.speedIn,L)}}},F=function(){m.width(e.width);m.height(e.height);if(e.width=="auto")e.width=m.width();if(e.height=="auto")e.height=m.height();N()},Z=function(){h=true;e.width=s.width;e.height=s.height;b("<img />").attr({id:"fancybox-img",
+src:s.src,alt:e.title}).appendTo(m);N()},C=function(){J();var a=q[p],d,f,o,t,w;e=b.extend({},b.fn.fancybox.defaults,typeof b(a).data("fancybox")=="undefined"?e:b(a).data("fancybox"));o=a.title||b(a).title||e.title||"";if(a.nodeName&&!e.orig)e.orig=b(a).children("img:first").length?b(a).children("img:first"):b(a);if(o===""&&e.orig)o=e.orig.attr("alt");d=a.nodeName&&/^(?:javascript|#)/i.test(a.href)?e.href||null:e.href||a.href||null;if(e.type){f=e.type;if(!d)d=e.content}else if(e.content)f="html";else if(d)if(d.match(G))f=
+"image";else if(d.match(S))f="swf";else if(b(a).hasClass("iframe"))f="iframe";else if(d.match(/#/)){a=d.substr(d.indexOf("#"));f=b(a).length>0?"inline":"ajax"}else f="ajax";else f="inline";e.type=f;e.href=d;e.title=o;if(e.autoDimensions&&e.type!=="iframe"&&e.type!=="swf"){e.width="auto";e.height="auto"}if(e.modal){e.overlayShow=true;e.hideOnOverlayClick=false;e.hideOnContentClick=false;e.enableEscapeButton=false;e.showCloseButton=false}if(b.isFunction(e.onStart))if(e.onStart(q,p,e)===false){h=false;
+return}m.css("padding",20+e.padding+e.margin);b(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){b(this).replaceWith(i.children())});switch(f){case "html":m.html(e.content);F();break;case "inline":b('<div class="fancybox-inline-tmp" />').hide().insertBefore(b(a)).bind("fancybox-cleanup",function(){b(this).replaceWith(i.children())}).bind("fancybox-cancel",function(){b(this).replaceWith(m.children())});b(a).appendTo(m);F();break;case "image":h=false;b.fancybox.showActivity();
+s=new Image;s.onerror=function(){P()};s.onload=function(){s.onerror=null;s.onload=null;Z()};s.src=d;break;case "swf":t='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+e.width+'" height="'+e.height+'"><param name="movie" value="'+d+'"></param>';w="";b.each(e.swf,function(r,R){t+='<param name="'+r+'" value="'+R+'"></param>';w+=" "+r+'="'+R+'"'});t+='<embed src="'+d+'" type="application/x-shockwave-flash" width="'+e.width+'" height="'+e.height+'"'+w+"></embed></object>";m.html(t);
+F();break;case "ajax":a=d.split("#",2);f=e.ajax.data||{};if(a.length>1){d=a[0];if(typeof f=="string")f+="&selector="+a[1];else f.selector=a[1]}h=false;b.fancybox.showActivity();E=b.ajax(b.extend(e.ajax,{url:d,data:f,error:P,success:function(r){if(E.status==200){m.html(r);F()}}}));break;case "iframe":b('<iframe id="fancybox-frame" name="fancybox-frame'+(new Date).getTime()+'" frameborder="0" hspace="0" scrolling="'+e.scrolling+'" src="'+e.href+'"></iframe>').appendTo(m);N();break}},$=function(){if(u.is(":visible")){b("div",
+u).css("top",I*-40+"px");I=(I+1)%12}else clearInterval(H)},aa=function(){if(!b("#fancybox-wrap").length){b("body").append(m=b('<div id="fancybox-tmp"></div>'),u=b('<div id="fancybox-loading"><div></div></div>'),x=b('<div id="fancybox-overlay"></div>'),g=b('<div id="fancybox-wrap"></div>'));if(!b.support.opacity){g.addClass("fancybox-ie");u.addClass("fancybox-ie")}D=b('<div id="fancybox-outer"></div>').append('<div class="fancy-bg" id="fancy-bg-n"></div><div class="fancy-bg" id="fancy-bg-ne"></div><div class="fancy-bg" id="fancy-bg-e"></div><div class="fancy-bg" id="fancy-bg-se"></div><div class="fancy-bg" id="fancy-bg-s"></div><div class="fancy-bg" id="fancy-bg-sw"></div><div class="fancy-bg" id="fancy-bg-w"></div><div class="fancy-bg" id="fancy-bg-nw"></div>').appendTo(g);
+D.append(i=b('<div id="fancybox-inner"></div>'),z=b('<a id="fancybox-close"></a>'),A=b('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),B=b('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>'));z.click(b.fancybox.close);u.click(b.fancybox.cancel);A.click(function(a){a.preventDefault();b.fancybox.prev()});B.click(function(a){a.preventDefault();b.fancybox.next()});if(O){x.get(0).style.setExpression("height",
+"document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px'");u.get(0).style.setExpression("top","(-20 + (document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )) + 'px'");D.prepend('<iframe id="fancybox-hide-sel-frame" src="javascript:\'\';" scrolling="no" frameborder="0" ></iframe>')}}};
+b.fn.fancybox=function(a){b(this).data("fancybox",b.extend({},a,b.metadata?b(this).metadata():{})).unbind("click.fb").bind("click.fb",function(d){d.preventDefault();if(!h){h=true;b(this).blur();q=[];p=0;d=b(this).attr("rel")||"";if(!d||d==""||d==="nofollow")q.push(this);else{q=b("a[rel="+d+"], area[rel="+d+"]");p=q.index(this)}C();return false}});return this};b.fancybox=function(a,d){if(!h){h=true;d=typeof d!=="undefined"?d:{};q=[];p=d.index||0;if(b.isArray(a)){for(var f=0,o=a.length;f<o;f++)if(typeof a[f]==
+"object")b(a[f]).data("fancybox",b.extend({},d,a[f]));else a[f]=b({}).data("fancybox",b.extend({content:a[f]},d));q=jQuery.merge(q,a)}else{if(typeof a=="object")b(a).data("fancybox",b.extend({},d,a));else a=b({}).data("fancybox",b.extend({content:a},d));q.push(a)}if(p>q.length||p<0)p=0;C()}};b.fancybox.showActivity=function(){clearInterval(H);u.show();H=setInterval($,66)};b.fancybox.hideActivity=function(){u.hide()};b.fancybox.next=function(){return b.fancybox.pos(n+1)};b.fancybox.prev=function(){return b.fancybox.pos(n-
+1)};b.fancybox.pos=function(a){if(!h){a=parseInt(a,10);if(a>-1&&j.length>a){p=a;C()}if(c.cyclic&&j.length>1&&a<0){p=j.length-1;C()}if(c.cyclic&&j.length>1&&a>=j.length){p=0;C()}}};b.fancybox.cancel=function(){if(!h){h=true;b.event.trigger("fancybox-cancel");J();e&&b.isFunction(e.onCancel)&&e.onCancel(q,p,e);h=false}};b.fancybox.close=function(){function a(){x.fadeOut("fast");g.hide();b.event.trigger("fancybox-cleanup");i.empty();b.isFunction(c.onClosed)&&c.onClosed(j,n,c);j=e=[];n=p=0;c=e={};h=false}
+if(!(h||g.is(":hidden"))){h=true;if(c&&b.isFunction(c.onCleanup))if(c.onCleanup(j,n,c)===false){h=false;return}J();b(z.add(A).add(B)).hide();b("#fancybox-title").remove();g.add(i).add(x).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");i.css("overflow","hidden");if(c.transitionOut=="elastic"){k=Q();var d=g.position();l={top:d.top,left:d.left,width:g.width(),height:g.height()};if(c.opacity)l.opacity=1;y.prop=1;b(y).animate({prop:0},{duration:c.speedOut,easing:c.easingOut,
+step:M,complete:a})}else g.fadeOut(c.transitionOut=="none"?0:c.speedOut,a)}};b.fancybox.resize=function(){var a,d;if(!(h||g.is(":hidden"))){h=true;a=i.wrapInner("<div style='overflow:auto'></div>").children();d=a.height();g.css({height:d+c.padding*2+v});i.css({height:d});a.replaceWith(a.children());b.fancybox.center()}};b.fancybox.center=function(){h=true;var a=K(),d=c.margin,f={};f.top=a[3]+(a[1]-(g.height()-v+40))*0.5;f.left=a[2]+(a[0]-(g.width()+40))*0.5;f.top=Math.max(a[3]+d,f.top);f.left=Math.max(a[2]+
+d,f.left);g.css(f);h=false};b.fn.fancybox.defaults={padding:10,margin:20,opacity:false,modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.3,overlayColor:"#666",titleShow:true,titlePosition:"outside",titleFormat:null,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",
+easingIn:"swing",easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,onStart:null,onCancel:null,onComplete:null,onCleanup:null,onClosed:null};b(document).ready(function(){aa()})})(jQuery); \ No newline at end of file
diff --git a/plugins/picasa-albums/fancybox/jquery.mousewheel-3.0.4.pack.js b/plugins/picasa-albums/fancybox/jquery.mousewheel-3.0.4.pack.js
new file mode 100644
index 00000000..cb66588e
--- /dev/null
+++ b/plugins/picasa-albums/fancybox/jquery.mousewheel-3.0.4.pack.js
@@ -0,0 +1,14 @@
+/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net)
+* Licensed under the MIT License (LICENSE.txt).
+*
+* Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
+* Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
+* Thanks to: Seamus Leahy for adding deltaX and deltaY
+*
+* Version: 3.0.4
+*
+* Requires: 1.2.2+
+*/
+
+(function(d){function g(a){var b=a||window.event,i=[].slice.call(arguments,1),c=0,h=0,e=0;a=d.event.fix(b);a.type="mousewheel";if(a.wheelDelta)c=a.wheelDelta/120;if(a.detail)c=-a.detail/3;e=c;if(b.axis!==undefined&&b.axis===b.HORIZONTAL_AXIS){e=0;h=-1*c}if(b.wheelDeltaY!==undefined)e=b.wheelDeltaY/120;if(b.wheelDeltaX!==undefined)h=-1*b.wheelDeltaX/120;i.unshift(a,c,h,e);return d.event.handle.apply(this,i)}var f=["DOMMouseScroll","mousewheel"];d.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=
+f.length;a;)this.addEventListener(f[--a],g,false);else this.onmousewheel=g},teardown:function(){if(this.removeEventListener)for(var a=f.length;a;)this.removeEventListener(f[--a],g,false);else this.onmousewheel=null}};d.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery); \ No newline at end of file
diff --git a/plugins/picasa-albums/fancybox/jquery.mousewheel.js b/plugins/picasa-albums/fancybox/jquery.mousewheel.js
new file mode 100644
index 00000000..69d28707
--- /dev/null
+++ b/plugins/picasa-albums/fancybox/jquery.mousewheel.js
@@ -0,0 +1,13 @@
+/*! Copyright (c) 2009 Brandon Aaron (http://brandonaaron.net)
+ * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
+ * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
+ * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
+ * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
+ *
+ * Version: 3.0.2
+ *
+ * Requires: 1.2.2+
+ */
+
+(function(b){function d(a){var f=[].slice.call(arguments,1),e=0;a=b.event.fix(a||window.event);a.type="mousewheel";if(a.wheelDelta)e=a.wheelDelta/120;if(a.detail)e=-a.detail/3;f.unshift(a,e);return b.event.handle.apply(this,f)}var c=["DOMMouseScroll","mousewheel"];b.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=c.length;a;)this.addEventListener(c[--a],d,false);else this.onmousewheel=d},teardown:function(){if(this.removeEventListener)for(var a=c.length;a;)this.removeEventListener(c[--a],
+d,false);else this.onmousewheel=null}};b.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery); \ No newline at end of file
diff --git a/plugins/picasa-albums/images/image-sunset.png b/plugins/picasa-albums/images/image-sunset.png
new file mode 100644
index 00000000..612ffe3a
--- /dev/null
+++ b/plugins/picasa-albums/images/image-sunset.png
Binary files differ
diff --git a/plugins/picasa-albums/images/loading.gif b/plugins/picasa-albums/images/loading.gif
new file mode 100644
index 00000000..6bdc3b5e
--- /dev/null
+++ b/plugins/picasa-albums/images/loading.gif
Binary files differ
diff --git a/plugins/picasa-albums/images/lock-image.png b/plugins/picasa-albums/images/lock-image.png
new file mode 100644
index 00000000..b7032066
--- /dev/null
+++ b/plugins/picasa-albums/images/lock-image.png
Binary files differ
diff --git a/plugins/picasa-albums/images/next-horizontal.png b/plugins/picasa-albums/images/next-horizontal.png
new file mode 100644
index 00000000..36c6c847
--- /dev/null
+++ b/plugins/picasa-albums/images/next-horizontal.png
Binary files differ
diff --git a/plugins/picasa-albums/images/picasa_post_icon.png b/plugins/picasa-albums/images/picasa_post_icon.png
new file mode 100644
index 00000000..ab82d7c6
--- /dev/null
+++ b/plugins/picasa-albums/images/picasa_post_icon.png
Binary files differ
diff --git a/plugins/picasa-albums/images/prev-horizontal.png b/plugins/picasa-albums/images/prev-horizontal.png
new file mode 100644
index 00000000..d2359ce3
--- /dev/null
+++ b/plugins/picasa-albums/images/prev-horizontal.png
Binary files differ
diff --git a/plugins/picasa-albums/images/zoom_layer.png b/plugins/picasa-albums/images/zoom_layer.png
new file mode 100644
index 00000000..e36616dd
--- /dev/null
+++ b/plugins/picasa-albums/images/zoom_layer.png
Binary files differ
diff --git a/plugins/picasa-albums/plugin.php b/plugins/picasa-albums/plugin.php
new file mode 100644
index 00000000..3ae8f8fe
--- /dev/null
+++ b/plugins/picasa-albums/plugin.php
@@ -0,0 +1,842 @@
+<?php
+
+/*
+Plugin Name: Picasa Albums
+Plugin URI: http://mikhailkozlov.com/picasa-albums-for-wordpress/
+Description: Creates custom post type and displays picasa albums
+Version: 1.0.6
+Author: Mikhail Kozlov
+Author URI: http://mikhailkozlov.com
+License: GPLv2 (or later)
+*/
+date_default_timezone_set('America/Los_Angeles');
+
+$picasaOption;
+$path = str_replace('\\','/',dirname(__FILE__)); // windows scramble
+require $path .'/scb/load.php';
+
+// init picasa class
+scb_init(array('wpPicasa','init'));
+
+class wpPicasa{
+ static $post_type='album';
+ static $options=array(
+ 'v'=>'1.0.6',
+ 'key'=>'picasaOptions_options',
+ 'username' => '',
+ 'album_thumbsize'=>160,
+ 'album_thumbcrop'=>'yes',
+ 'albums_display'=>'rows',
+ 'image_thumbsize'=>128, // 94, 110, 128, 200, 220, 288, 320, 400, 512, 576, 640, 720, 800, 912, 1024, 1152, 1280, 1440, 1600
+ 'image_thumbcrop'=>'yes', // true/false
+ 'image_maxsize'=>800, // lint to original
+ 'image_class'=>'picasa_image',
+ 'use_lightbox'=>true,
+ 'embed_image_thumbsize'=>128,
+ 'embed_image_maxsize'=>800,
+ 'gallery_path' => 'album',
+
+ );
+ function init($options=array()) {
+ global $picasaOptions;
+ $options=self::$options;
+ $options = new scbOptions($options['key'], __FILE__,self::$options);
+ if ( is_admin() ) {
+ require_once dirname(__FILE__) . '/admin.php';
+ new picasaOptions_Options_Page(__FILE__, $options);
+ add_action( 'wp_ajax_picasa_ajax_import',array('wpPicasa','picasa_ajax_import') );
+ add_action( 'wp_ajax_picasa_ajax_reload_images',array('wpPicasa','picasa_ajax_reload_images') );
+ add_action( 'wp_ajax_picasa_ajax_image_action',array('wpPicasa','picasa_ajax_image_action') );
+ add_action('admin_menu', array('wpPicasa','add_custom_boxes'));
+ }
+ self::load_picasa_javascript();
+
+ }
+ function _activate(){
+ // set default option
+ add_option('picasaOptions_options', serialize (self::$options),'','yes');
+ }
+ function load_picasa_javascript(){
+ $path = basename(dirname(__FILE__));
+ if ( is_admin() ) {
+ wp_enqueue_script('json', '/wp-admin/load-scripts.php?c=1&load=json2', array(), '', true);
+ wp_enqueue_script('picasa_albums_admin', plugins_url($path). '/admin/scripts.js', array(), '', true);
+ wp_enqueue_style('picasa_albums_admin_css',plugins_url($path).'/admin/style.css');
+ wp_enqueue_style('fancybox_css',plugins_url($path).'/fancybox/jquery.fancybox-1.3.4.css');
+ wp_enqueue_script('fancybox', plugins_url($path) . '/fancybox/jquery.fancybox-custom.js', array(), '', true);
+ }else{
+ wp_enqueue_script('jquery');
+ wp_enqueue_style('picasa_albums_css',plugins_url($path).'/style.css');
+ wp_enqueue_style('fancybox_css',plugins_url($path).'/fancybox/jquery.fancybox-1.3.4.css');
+ wp_enqueue_script('fancybox', plugins_url($path) . '/fancybox/jquery.fancybox-custom.js', array(), '', true);
+ wp_enqueue_script('picasa_albums', plugins_url($path) . '/scripts.js', array(), '', true);
+ }
+ }
+
+ /**
+ * register custom post type
+ * @return unknown_type
+ */
+ function create_postType() {
+ $labels = array(
+ 'name' => _x('Albums', 'post type general name'),
+ 'singular_name' => _x('Album', 'post type singular name'),
+ 'add_new' => _x('Import Album', 'Album'),
+ 'add_new_item' => __('Import Album'),
+ 'edit_item' => __('Edit Album'),
+ 'new_item' => __('New Album'),
+ 'view_item' => __('View Album'),
+ 'search_items' => __('Search Albums'),
+ 'not_found' => __('No Albums found'),
+ 'not_found_in_trash' => __('No Albums found in Trash'),
+ 'parent_item_colon' => ''
+ );
+ $supports = array('title','author','comments');
+ $args = array(
+ 'rewrite' =>array('slug'=>self::$post_type),
+ 'labels' => $labels,
+ 'public' => true,
+ 'show_ui' => true,
+ 'query_var' => true,
+ 'capability_type' => 'page',
+ 'hierarchical' => false,
+ 'publicly_queryable' => true,
+ 'menu_position'=>20,
+ 'supports' => $supports
+ );
+ // v.1.0.6 - rewrite if we have too
+ $options = get_option(self::$options['key']);
+ if(is_array($options) && array_key_exists('gallery_path', $options))
+ {
+ $args['rewrite'] = array('slug'=>$options['gallery_path']);
+ }
+
+ register_post_type( 'album',$args);
+ register_taxonomy_for_object_type('album', 'album');
+
+ add_filter('the_content',array('wpPicasa','picasa_album_filter'));
+ // v 1.0.5
+ // some themes call the_exerpt();
+ add_filter('the_excerpt',array('wpPicasa','picasa_album_filter'));
+
+ }
+ function add_custom_boxes(){
+ if(isset($_GET['action'])){
+ add_meta_box( 'picasa-album','Album Details',array('wpPicasa','picasa_admin_album_view'),self::$post_type, 'normal', 'high');
+ add_meta_box( 'picasa-album-images','Album Images',array('wpPicasa','picasa_admin_album_images'),self::$post_type, 'normal', 'high');
+ add_meta_box( 'picasa-album-side','Maintenance Functions',array('wpPicasa','picasa_admin_album_import'),self::$post_type, 'side', 'low');
+ remove_meta_box( 'slugdiv' , self::$post_type , 'normal' );
+ }else{
+ remove_meta_box( 'commentstatusdiv' , self::$post_type , 'normal' );
+ remove_meta_box( 'authordiv' , self::$post_type , 'normal' );
+ remove_meta_box( 'submitdiv' , self::$post_type , 'side' );
+ remove_meta_box( 'slugdiv' , self::$post_type , 'normal' );
+
+
+ add_meta_box( 'picasa-album','Import',array('wpPicasa','picasa_admin_import_album_view'),self::$post_type, 'normal', 'high');
+ add_meta_box( 'picasa-album-side-promo','Picasa Album Pro',array('wpPicasa','picasa_admin_import_album_side'),self::$post_type, 'side', 'high');
+ }
+ }
+
+ function picasa_admin_album_import(){
+ global $post;
+ self::decode_content($post->post_excerpt);
+ echo '<div class="submitbox">
+ <p>Will reload all data and erase any changes the you made!</p>
+ ';
+ echo scbForms::input(array(
+ 'type' => 'button',
+ 'name' => 'import_album_images',
+ 'id' => 'import_album_images',
+ 'extra'=>'class="button" data="'.$post->post_excerpt['id'].'" authkey="'.$post->post_excerpt['authkey'].'"',
+ 'value' => 'Reload Images'
+ ));
+ /**
+ * need to add
+ echo scbForms::input(array(
+ 'type' => 'button',
+ 'name' => 'import_album',
+ 'id' => 'import_album',
+ 'extra'=>'class="button" style="float:right" ',
+ 'value' => 'Reload Details'
+ ));
+ */
+ echo '</div>';
+ }
+
+ /**
+ *
+ * @return unknown_type
+ */
+ function picasa_admin_import_album_view(){
+ global $post;
+ $options = get_option(self::$options['key']);
+ echo '<script type="text/javascript">';
+ echo 'jQuery("#titlediv").hide();';
+ echo '</script>';
+ echo '
+ <p>Please note: all new albums will be imported and marked as draft. All existing albums will remain untouched.</p>
+ <input type="text" id="username" size="50" value="'.$options['username'].'" name="username">
+ <input type="button" id="import_albums" class="button" value="Import" name="import_albums" /><span class="loader hide"><i>Loading... Do not reload this page!</i></span>
+ <p>
+ <a href="edit.php?post_type='.self::$post_type.'">View Albums</a>
+ </p>
+
+
+ ';
+ }
+ function picasa_admin_import_album_side(){
+ echo '
+ <p>Do you need more features?<br /> Check out <a target="blank" href="http://mikhailkozlov.com/picasa_albums_pro/">Picasa Albums Pro</a>.</p>
+ ';
+ }
+ /**
+ * box html
+ * @return unknown_type
+ */
+ function picasa_admin_album_view(){
+ global $post;
+ self::decode_content($post->post_excerpt);
+ if(is_array($post->post_excerpt)){
+ echo '<script>';
+ echo 'var album = '.json_encode($post->post_excerpt).';';
+ echo '</script>';
+
+ echo '<textarea id="excerpt" name="excerpt" style="display:none">'.json_encode($post->post_excerpt).'</textarea>';
+ echo '
+ <div class="inside">
+ <img id="cover_image" src="'.self::parseThumb($post->post_excerpt['thumbnail']['url']).'" alt="album cover" ';
+ echo (isset($options['album_thumbcrop']) && $options['album_thumbcrop'] == 'yes' && isset($post->post_excerpt['thumbnail'])) ? ' width="'.$post->post_excerpt['thumbnail']['height'].' height="'.$post->post_excerpt['thumbnail']['height'].'"':'';
+ echo 'style="float:left; margin-right:5px;"/>
+
+ <ul class="inside">
+ <li>Published: <strong>'.date('D F, jS Y',$post->post_excerpt['published']).'</strong></li>
+ <li>Last updated: <strong>'.date('D F, jS Y, H:i',$post->post_excerpt['updated']).'</strong></li>
+ <li>Original Title: <strong>'.utf8_decode($post->post_excerpt['title']).'</strong></li>
+ <li>Links: <a href="'.$post->post_excerpt['links']['text/html'].'" >Album on Picasa</a> | <a href="'.$post->post_excerpt['links']['application/atom+xml'].'" >Picasa RSS</a></li>
+ </il>
+ <div class="clear"></div>
+ <br />
+ <div>
+ <p><strong>Album Description:</strong></p>
+ <textarea class="attachmentlinks" id="album_summary" tabindex="6" name="album[summary]" cols="40" rows="1">'.$post->post_excerpt['summary'].'</textarea>
+ <p>You can provide your custom album description here.</p>
+ </div>
+ </div>
+ ';
+ }else{
+ echo 'Error! Album data is corrupted! Try to delete this album and <a href="options-general.php?page=picasa-albums">reload</a> it from Picasa again.';
+ }
+ }
+ /**
+ * displays edit page
+ * @return unknown_type
+ */
+ function picasa_admin_album_images(){
+ global $post;
+ $options = get_option(self::$options['key']);
+ self::decode_content($post->post_content);
+ echo '<script>';
+ echo 'var images = '.json_encode($post->post_content).';';
+ echo '</script>';
+ echo '<textarea id="content" name="content" style="display:none" class="albumpage">'.json_encode($post->post_content).'</textarea>';
+ echo '<div class="inside">';
+ if(count($post->post_content) > 0){
+ echo '<ul class="ui-sortable">';
+ foreach($post->post_content as $i=>$image){
+ echo '<li title="'.$image['summary'].'" id="order_'.$i.'"';
+ echo '><img width="110" height="110" src="'.$image['fullpath'].'s110-c/'.$image['file'].'" alt="'.$image['summary'].'" class="';
+ echo ($image['show'] == 'yes') ? '':'dimlight';
+ echo '"/>';
+ echo'<div>';
+ echo '<a href="#'.$image['fullpath'].'s'.$options['album_thumbsize'].'-c/'.$image['file'].'" id="'.$image['id'].'" title="Set as album cover" class="icon cover_image" ref="'.$options['album_thumbsize'].'"></a>';
+ echo '<a href="#hide" id="'.$image['id'].'" title="Show/Hide image from public gallery" class="icon hide_image ';
+ echo ($image['show'] == 'yes') ? 'visible" >':'" >'; //echo ($image['show'] == 'yes') ? 'visible" ><span>hide</span><span style="display:none">show</span>':'" ><span style="display:none">hide</span><span>show</span>';
+ echo '</a>';
+ echo '<a href="'.$image['fullpath'].'s800/'.$image['file'].'" class="icon view_image fancybox" rel="album" title="';
+ echo (!empty($image['summary'])) ? $image['summary']:$image['file'];
+ echo '" >zoom</a>';
+ echo'</div>';
+ echo '</li>';
+ }
+ echo '</ul>';
+ }else{
+ echo 'No images yet! <a href="#load_imges_now" id="load_imges_now">Get them now!</a> ';
+ print_r($post->post_content);
+ }
+ echo '
+ <div class="clear"></div>
+ </div>
+ <div class="clear"></div>';
+ }
+
+ /**
+ * AJAX import
+ * @return unknown_type
+ */
+ function picasa_ajax_import() {
+ global $wpdb;
+ $options = get_option(self::$options['key']);
+ set_time_limit(300);
+ echo 'doing ajax...';
+ // time to curl
+ $options['username'] = (isset($_GET['user'])) ? trim($_GET['user']):$options['username'];
+ $xml= new wpPicasaApi($options['username'],array('thumbsize'=>$options['album_thumbsize']));
+ $xml->getAlbums();
+ $xml->parseAlbumXml(true);
+ $q = 'SELECT ID, post_mime_type FROM '.$wpdb->posts.' WHERE post_type = \''.self::$post_type.'\' ';
+ foreach($wpdb->get_results($q, ARRAY_A) as $i=>$row){
+ $albums[$row['post_mime_type']] =$row['ID'];
+ }
+ foreach($xml->getData() as $aData){
+ if(isset($albums) && is_array($albums) && array_key_exists($aData['id'],$albums)){
+ // update existing album. images will not be updated
+ // v 1.0.5
+ // self::insertAlbums($aData,$albums[$aData['id']]);
+ // we used to update here, but people did not want this.
+ }else{
+ //new album. images will BE imported
+ $post_id = self::insertAlbums($aData,0);
+ if(intval($post_id) > 0){
+ // time to get images
+ $x= new wpPicasaApi($options['username']);
+ echo 'new album '.$aData['id'].' auth'.$aData['authkey'].' post id:'.$post_id.'<br />';
+ $x->getImages($aData['id'],$aData['authkey']);
+ $x->parseImageXml(true);
+ self::insertImagesToAlbum($x->getData(),$post_id);
+ }
+ }
+ }
+ exit;
+ }
+ /**
+ * loads images from api
+ * @return bool
+ */
+ function picasa_ajax_reload_images() {
+ global $wpdb;
+ if(isset($_GET['post_ID']) && isset($_GET['id'])){
+ $options = get_option(self::$options['key']);
+ // time to curl
+ $xml= new wpPicasaApi($options['username']);
+ $xml->getImages($_REQUEST['id'],$_REQUEST['authkey']);
+ $xml->parseImageXml(true);
+ self::insertImagesToAlbum($xml->getData(),$_GET['post_ID']);
+ echo '{"r":1,"m":"done!"}';
+ }else{
+ echo '{"r":0,"m":"please provide post and album id"}';
+ }
+ exit;
+ }
+ function picasa_ajax_image_action(){
+ global $wpdb;
+ switch ($_GET['todo']){
+ case 'saveAlbum':
+ if(isset($_REQUEST['post_ID']) && intval($_REQUEST['post_ID']) >0){
+ $aOrder = $_REQUEST['order'];
+ $aImages = false;
+ $q="SELECT post_excerpt, post_content FROM ".$wpdb->posts." WHERE ID=".intval($_REQUEST['post_ID']);
+ $row = $wpdb->get_row($q);
+ if(isset($row->post_content)){
+ self::decode_content($row->post_content);
+ $aImages = $row->post_content;
+ }
+ if($aImages!== false){
+ $aImages = self::sortArrayByArray($aImages,$aOrder,$_REQUEST['id']);
+ }
+ echo json_encode($aImages);
+ }else{
+ echo '{"r":0,"m":"please provide post and album id"}';
+ }
+ break;
+ case 'reloadDetails':
+
+ break;
+ }
+ exit;
+ }
+
+ // apply sort and show not show
+ function sortArrayByArray($array,$order,$ids){
+ $ordered = array();
+ foreach($order as $key=>$value) {
+ if(array_key_exists($value,$array)) {
+ if(array_key_exists($array[$value]['id'],$ids)){
+ $array[$value]['show'] = $ids[$array[$value]['id']];
+ }
+ $ordered[$key] = $array[$value];
+ unset($array[$value]);
+ }
+ }
+ return $ordered + $array;
+ }
+ function insertAlbums($data,$id=0){
+ global $current_user;
+ get_currentuserinfo();
+ $post = array(
+ 'post_status' => 'draft',
+ 'post_type' => 'album',
+ 'post_title' => $data['title'],
+ 'post_name' => $data['name'],
+ 'post_mime_type'=>$data['id'],
+ 'post_date_gmt' => date('Y-m-d H:i:s',$data['published']),
+ 'post_modified_gmt' => date('Y-m-d H:i:s',$data['updated']),
+ 'post_author' => $current_user->ID,
+ 'post_excerpt' => json_encode($data)
+ );
+ if(intval($id) > 0){
+ $post['ID'] = $id;
+ wp_update_post($post);
+ return $id;
+ }
+ $date = new DateTime(date('Y-m-d H:i:s',$data['published']),new DateTimeZone('Europe/London'));
+ $date->setTimezone(new DateTimeZone(date('e')));
+ $post['post_date'] = $date->format('Y-m-d H:i:s');
+ $date = new DateTime(date('Y-m-d H:i:s',$data['updated']),new DateTimeZone('Europe/London'));
+ $date->setTimezone(new DateTimeZone(date('e')));
+ $post['post_modified'] = $date->format('Y-m-d H:i:s');
+ $id=wp_insert_post($post);
+ return $id;
+ }
+ function insertImagesToAlbum($data,$id=0){
+ global $current_user;
+ get_currentuserinfo();
+ $post = array(
+ 'post_content' => json_encode($data)
+ );
+ if(intval($id) > 0){
+ $post['ID'] = $id;
+ $id=wp_update_post($post);
+ }
+ return $id;
+ }
+ // Adding a new rule
+ function wp_insertPicasaRules($rules){
+ $newrules = array();
+ // v.1.0.6 - rewrite if we have too
+ $options = get_option(self::$options['key']);
+ if(is_array($options) && array_key_exists('gallery_path', $options))
+ {
+ $path = $options['gallery_path'];
+ $newrules['('.$path.')/(\d*)$'] = 'index.php?post_type='.self::$post_type.'&post_name=$matches[2]';
+ // issie #2 fix
+ $newrules['('.$path.')/page/?([0-9]{1,})/?$'] = 'index.php?post_type='.self::$post_type.'&paged=$matches[2]';
+ $newrules['('.$path.')$'] = 'index.php?post_type='.self::$post_type;
+ }else{
+ $newrules['(album)/(\d*)$'] = 'index.php?post_type=$matches[1]&post_name=$matches[2]';
+ // issie #2 fix
+ $newrules['(album)/page/?([0-9]{1,})/?$'] = 'index.php?post_type=$matches[1]&paged=$matches[2]';
+ $newrules['(album)$'] = 'index.php?post_type=$matches[1]';
+ }
+ return $newrules + $rules;
+ }
+
+ // Adding the id var so that WP recognizes it
+ function wp_insertPicasaQueryVars($vars){
+ array_push($vars, 'post_name');
+ return $vars;
+ }
+ /**
+ *
+ *
+ *
+ * @param $content
+ * @return html
+ */
+ function picasa_album_filter($content){
+ global $post;
+ $options=self::$options;
+ $options = array_merge($options,get_option($options['key']));
+ if(get_post_type() == self::$post_type){
+ if(is_single()){
+ self::decode_content($post->post_content);
+ // v.1.0.6 - addign hooks to overwrite default style
+ if( function_exists( wp_picasa_single_view_filter) ){
+ $res = wp_picasa_single_view_filter($post,$options);
+ }
+ else
+ {
+ $res = '';
+ if(!empty($post->post_content) && is_array($post->post_content)){
+ foreach($post->post_content as $i=>$aImage){
+ if($aImage['show'] == 'yes'){
+ $res .= '
+ <div style="width: '.($options['image_thumbsize']+10).'px;" class="wp-caption alignleft '.$options['image_class'].'">
+ <a href="'.$aImage['fullpath'].'s'.$options['image_maxsize'].'/'.$aImage['file'].'" data-rel="'.$post->post_name.'" rel="nofollow" class="fancybox" title="';
+ $res.=(!empty($aImage['summary'])) ? $aImage['summary']:$aImage['file'];
+ $res.='">
+ <img src="'.$aImage['fullpath'].'s'.intval($options['image_thumbsize']);
+ $res.=($options['image_thumbcrop'] == 'yes') ? '-c':'';
+ $res.='/'.$aImage['file'].'"';
+ $res .= ($options['image_thumbcrop'] == 'yes' && isset($aImage['thumbnail']) ) ? ' width="'.$aImage['image_thumbsize'].'" height="'.$aImage['image_thumbsize'].'" ':' ';
+ $res.=' class="size-medium" alt="" />
+ </a>
+ <p class="wp-caption-text" style="display:none">';
+ $res.=(!empty($aImage['summary'])) ? $aImage['summary']:$aImage['file'];
+ $res.='</p>
+ </div>
+ ';
+ }
+ }
+ }else{
+ $res = 'Error. Please comeback soon.';
+ }
+ }
+ return $res;
+ }else{
+ self::decode_content(&$post->post_excerpt);
+ // v.1.0.6 - addign hooks to overwrite default style
+ if( function_exists( wp_picasa_list_view_filter) ){
+ $res = wp_picasa_list_view_filter($post,$options);
+ }
+ else
+ {
+
+ $res = '
+ <div>
+ <div style="" class="wp-caption alignleft">
+ <a href="'.get_permalink().'">
+ <img class="size-medium" title="'.$post->post_excerpt['title'].'" src="'.self::parseThumb($post->post_excerpt['thumbnail']['url']).'" alt=""';
+ $res .= ($options['album_thumbcrop'] == 'yes') ? ' width="'.$post->post_excerpt['thumbnail']['height'].' height="'.$post->post_excerpt['thumbnail']['height'].'" ':' ';
+ // <img height="'.$post->post_excerpt['thumbnail']['height'].'" width="'.$post->post_excerpt['thumbnail']['width'].'" class="size-medium" title="'.$post->post_excerpt['title'].'" alt="" src="'.$post->post_excerpt['thumbnail']['url'].'" />
+ $res .= ' /></a>
+ <p class="wp-caption-text" style="display:none">'.$post->post_excerpt['title'].'</p>
+ </div>
+ '.$post->post_excerpt['summary'].'
+ <div style="clear:both"></div>
+ </div>
+ ';
+ }
+ return $res;
+ }
+ }else{
+ return $content;
+ }
+ }
+
+ function decode_content(&$c){
+ if(!is_array($c)){
+ $c = json_decode(htmlspecialchars_decode(stripcslashes($c)),true);
+ }
+ }
+ function parseThumb($path){
+ $options=self::$options;
+ $options = array_merge($options,get_option($options['key']));
+ $path = explode('/',$path);
+ $size= (count($path)-2);
+ $path[$size] ='s'.$options['album_thumbsize'];
+ $path[$size] .= ($options['album_thumbcrop'] == 'yes')? '-c':'';
+ return implode('/',$path);
+ }
+ /**
+ * deactivation hook
+ */
+ function picasa_albums_cleanup(){
+ global $wpdb;
+ // remove posts
+ $q='DELETE FROM '.$wpdb->posts.' WHERE post_type=\''.self::$post_type.'\'';
+ $wpdb->query($q);
+ // remove settings
+ delete_option(self::$options['key']);
+ }
+}
+//register_activation_hook( __FILE__, array('wpPicasa','_activate') );
+
+//add_action('init', array('wpPicasa','init'));
+
+
+class wpPicasaApi{
+ private $xml;
+ private $data;
+ private $user;
+
+ private $params=array(
+ 'thumbsize'=>160
+ );
+
+ function __construct($user,$params=array()){
+ $this->user = $user;
+ $this->_setParams($params);
+ }
+ function __get($key){
+ return (!isset($this->$key)) ? $this->$key:null;
+ }
+ function getData(){
+ return $this->data;
+ }
+
+
+
+ /** UTILS **/
+ // set addtional params
+ private function _setParams($params=array()){
+ if(is_array($params)){
+ foreach($this->params as $k=>$v){
+ if(array_key_exists($k,$params)){
+ $this->params[$k]=$params[$k];
+ }
+ }
+ }
+ }
+
+ private function _postTo($url, $data=array(), $header=array()) {
+
+ //check that the url is provided
+ if (!isset($url)) {
+ return false;
+ }
+
+ //send the data by curl
+ $ch = curl_init();
+ curl_setopt($ch, CURLOPT_URL, $url);
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
+ if (count($data)>0) {
+ //POST METHOD
+ curl_setopt($ch, CURLOPT_POST, TRUE);
+ curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
+ } else {
+ $header[] = array("application/x-www-form-urlencoded");
+ curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
+ }
+
+ $response = curl_exec($ch);
+ $info = curl_getinfo($ch);
+ curl_close($ch);
+
+ //print_r($info);
+ //print $response;
+ if($info['http_code'] == 200) {
+ return $response;
+ } elseif ($info['http_code'] == 400) {
+ throw new Exception('Bad request - '.$response);
+ } elseif ($info['http_code'] == 401) {
+ throw new Exception('Permission Denied - '.$response);
+ } else {
+ return false;
+ }
+ }
+ private function _getXml($url, $header=array()) {
+ //check that the url is provided
+ if (!isset($url)) {
+ return false;
+ }
+ //send the data by curl
+ $ch = curl_init();
+ curl_setopt($ch, CURLOPT_URL, $url);
+ curl_setopt($ch, CURLOPT_HEADER, 0);
+ curl_setopt($ch, CURLOPT_POST,0); // do not use POST to get xml feeds. GET only!!!
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+ curl_setopt($ch, CURLOPT_HTTPHEADER, $header); //array('Content-type: application/atom+xml','Content-Length: 2000')
+ curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
+ curl_setopt($ch, CURLOPT_VERBOSE, 1);
+ $response = curl_exec($ch);
+ if(intval(curl_errno($ch)) == 0){
+ $this->xml = $response;
+ }else{
+ $this->xml=null;
+ $this->error = curl_error($ch);
+ }
+ $info = curl_getinfo($ch);
+ curl_close($ch);
+
+ //print_r($info);
+ //print $response;
+ if($info['http_code'] == 200) {
+ return true;
+ } elseif ($info['http_code'] == 400) {
+ throw new Exception('Bad request - '.$response .' URL: '.$url);
+ return false;
+ } elseif ($info['http_code'] == 401) {
+ throw new Exception('Permission Denied - '.$response);
+ return false;
+ } else {
+ return false;
+ }
+ return false;
+ }
+
+
+
+ /****** Public getters ********/
+ function getAlbums(){
+ $header = array(
+ "MIME-Version: 1.0",
+ "Content-type: text/html",
+ "Content-transfer-encoding: text"
+ );
+ $url='http://picasaweb.google.com/data/feed/api/user/'.$this->user.'?kind=album&thumbsize='.$this->params['thumbsize'].'c';
+ $url.='&access=public';
+ return $this->_getXml($url,$header);
+ }
+ function getImages($aid,$authkey=null){
+ $header = array(
+ "MIME-Version: 1.0",
+ "Content-type: text/html",
+ "Content-transfer-encoding: text"
+ );
+ //http://picasaweb.google.com/data/feed/api/user/userID/albumid/albumID
+ $url='http://picasaweb.google.com/data/feed/api/user/'.$this->user.'/albumid/'.$aid.'?kind=photo';
+ // may be we need to pass key here
+ $ch = curl_init($url);
+ return $this->_getXml($url,$header);
+ }
+
+
+ /****** parse XML ********/
+ function parseAlbumXml($killxml=false){
+ $xml = new SimpleXMLElement($this->xml);
+ $xml->registerXPathNamespace('media', 'http://search.yahoo.com/mrss/'); // define namespace media
+ $xml->registerXPathNamespace('gphoto', 'http://schemas.google.com/photos/2007'); // define namespace media
+ $xml->registerXPathNamespace('georss', 'http://www.georss.org/georss'); // define namespace media
+ $xml->registerXPathNamespace('gml', 'http://www.opengis.net/gml'); // define namespace media
+
+ #print_r($xml);
+ if(count($xml->entry) > 0){
+ foreach($xml->entry as $i=>$oAlbum){
+ $aAlbum = array(
+ 'author'=>array(
+ 'name'=>(string)$oAlbum->author->name, // Mikhail Kozlov
+ 'uri'=>(string)$oAlbum->author->uri //http://picasaweb.google.com/kozlov.m.a
+ ), // will keep this on record in case we decide to go with more than one album
+ 'id'=> (Array)$oAlbum->xpath('./gphoto:id'), //5516889074505060529
+ 'name'=>'',//20100902RussiaOddThings
+ 'authkey'=>'',
+ 'published'=>strtotime($oAlbum->published), // strtotime(2010-09-11T04:58:08.000Z);
+ 'updated'=>strtotime($oAlbum->updated),// // strtotime(2010-09-11T04:58:08.000Z);
+ 'title' => (string)$oAlbum->title,//2010-09-02 - Russia - Odd Things
+ 'thumbnail' => (Array)$oAlbum->xpath('./media:group/media:thumbnail'), //
+ 'latlong' => '', //
+ 'summary' =>addslashes((string) $oAlbum->summary), //Some things in Russia make you wonder
+ 'rights' => (string)$oAlbum->rights, //public
+ 'links' => array(
+ 'text/html'=>'', //http://picasaweb.google.com/kozlov.m.a/20100902RussiaOddThings
+ 'application/atom+xml'=>'' //http://picasaweb.google.com/data/feed/api/user/kozlov.m.a/albumid/5516889074505060529
+ )
+ );
+ foreach($oAlbum->link as $oLink){
+ $a = (Array)$oLink->attributes();
+ $a = $a['@attributes'];
+ if($a['rel'] == 'alternate' || $a['rel'] == 'self'){
+ $aAlbum['links'][$a['type']] = $a['href'];
+ }
+ }
+ unset($oLink);
+ $aAlbum['thumbnail'] = (Array)$aAlbum['thumbnail'][0];
+ $aAlbum['thumbnail'] = $aAlbum['thumbnail']['@attributes'];
+ $aAlbum['latlong'] = ( $oAlbum->xpath('./georss:where') !== false && $oAlbum->xpath('./georss:where/gml:Point') !== false ) ? (Array)$oAlbum->xpath('./georss:where/gml:Point/gml:pos'):array(); //
+ $aAlbum['latlong'] = (isset($aAlbum['latlong'][0])) ? explode(' ',(string)$aAlbum['latlong'][0]):array();
+ $aAlbum['latlong'] = (count($aAlbum['latlong']) == 1) ? false:$aAlbum['latlong'];
+ $aAlbum['id'] = (string)$aAlbum['id'][0];
+ $url = parse_url($aAlbum['links']['text/html']);
+ $tmp = explode('/',$url['path']);
+ $aAlbum['name']=end($tmp);
+ // if we use auth set authkey
+ if(!empty($this->_authCode)){
+ parse_str($url['query'], $url['query']);
+ $aAlbum['authkey']=$url['query']['authkey'];
+ }
+ unset($tmp);
+ $this->data[$aAlbum['name']]=$aAlbum;
+ unset($aAlbum);
+ }
+ unset($oAlbum);
+ }
+ unset($xml);
+ if($killxml){
+ unset($this->xml);
+ }
+ }
+
+ function parseImageXml($killxml=false){
+ $xml = new SimpleXMLElement($this->xml);
+ $xml->registerXPathNamespace('media', 'http://search.yahoo.com/mrss/'); // define namespace media
+ $xml->registerXPathNamespace('gphoto', 'http://schemas.google.com/photos/2007'); // define namespace media
+ $xml->registerXPathNamespace('georss', 'http://www.georss.org/georss'); // define namespace media
+ $xml->registerXPathNamespace('gml', 'http://www.opengis.net/gml'); // define namespace media
+ $xml->registerXPathNamespace('exif', 'http://schemas.google.com/photos/exif/2007'); // define namespace media
+ if(count($xml->entry) > 0){
+ $c=0;
+ foreach($xml->entry as $i=>$oImage){
+ $c++;
+ $aImage = array(
+ 'id'=> (Array)$oImage->xpath('./gphoto:id'), //5516889074505060529
+ 'published'=>strtotime($oImage->published), // strtotime(2010-09-11T04:58:08.000Z);
+ 'updated'=>strtotime($oImage->updated),// // strtotime(2010-09-11T04:58:08.000Z);
+ 'file' =>(string)$oImage->title,//2010-09-02 - Russia - Odd Things
+ 'fullpath' =>$oImage->content,//2010-09-02 - Russia - Odd Things
+ 'width'=>(Array)$oImage->xpath('./gphoto:width'), // width of the original in px
+ 'height'=>(Array)$oImage->xpath('./gphoto:height'), // height of the original in px
+ 'size'=>(Array)$oImage->xpath('./gphoto:size'), // file size of the original in kb
+ 'latlong' => '', //
+ 'thumbnail' => (Array)$oImage->xpath('./media:group/media:thumbnail'), //
+ 'summary' =>addslashes((string) $oImage->summary), //Some things in Russia make you wonder
+ 'rights' => (Array)$oImage->xpath('./gphoto:access'), //public
+ 'pos'=>$c,
+ 'show'=>'yes',
+ 'links' => array(
+ 'text/html'=>'', //http://picasaweb.google.com/kozlov.m.a/20100902RussiaOddThings
+ 'application/atom+xml'=>'' //http://picasaweb.google.com/data/feed/api/user/kozlov.m.a/albumid/5516889074505060529
+ )
+ );
+
+ foreach($oImage->link as $oLink){
+ $a = (Array)$oLink->attributes();
+ $a = $a['@attributes'];
+ if($a['rel'] == 'alternate' || $a['rel'] == 'self'){
+ $aImage['links'][$a['type']] = $a['href'];
+ }
+ }
+ unset($oLink);
+ $aImage['thumbnail'] = (Array)$aImage['thumbnail'][0];
+ $aImage['thumbnail'] = $aImage['thumbnail']['@attributes'];
+ // some trickery to get image path
+ $aImage['fullpath'] = (Array)$aImage['fullpath'];
+ $aImage['fullpath'] =str_replace($aImage['file'],'',$aImage['fullpath']['@attributes']['src']);
+ // flatten id
+ $aImage['id'] = (string)$aImage['id'][0];
+
+ // private albums do not seem to have georss.
+ $ns = $xml->getDocNamespaces();
+ if(array_key_exists('georss',$ns)){
+ // lat long as array
+ $aImage['latlong'] = (Array)$oImage->xpath('./georss:where/gml:Point/gml:pos');
+ $aImage['latlong'] = (isset($aImage['latlong']) && isset($aImage['latlong'][0])) ? explode(' ',(string)$aImage['latlong'][0]):array();
+ $aImage['latlong'] = (count($aImage['latlong']) == 1) ? false:$aImage['latlong'];
+ }
+ // flatten right, size, width, height
+ $aImage['size'] = (string)$aImage['size'][0];
+ $aImage['rights'] = (string)$aImage['rights'][0];
+ $aImage['height'] = (string)$aImage['height'][0];
+ $aImage['width'] = (string)$aImage['width'][0];
+ unset($tmp);
+ $this->data[]=$aImage;
+ unset($aImage);
+ }
+ unset($oImage);
+ }
+ unset($xml);
+ if($killxml){
+ unset($this->xml);
+ }
+ }
+}
+
+// new post type has to added at init. else rewrite does not work
+add_action('init',array('wpPicasa','create_postType'));
+
+add_filter('rewrite_rules_array',array('wpPicasa','wp_insertPicasaRules'));
+add_filter('query_vars',array('wpPicasa','wp_insertPicasaQueryVars'));
+add_filter('init','flushRules');
+
+if(!function_exists('flushRules')){
+ // Remember to flush_rules() when adding rules
+ function flushRules(){
+ global $wp_rewrite;
+ $wp_rewrite->flush_rules();
+ }
+}
+
+register_deactivation_hook( __FILE__, array('wpPicasa','picasa_albums_cleanup'));
+?> \ No newline at end of file
diff --git a/plugins/picasa-albums/readme.txt b/plugins/picasa-albums/readme.txt
new file mode 100644
index 00000000..4dc68e48
--- /dev/null
+++ b/plugins/picasa-albums/readme.txt
@@ -0,0 +1,78 @@
+=== Picasa Albums ===
+Contributors: MikhaikKozlov
+Donate link: http://mikhailkozlov.com/
+Tags: picasaweb, image hosting, picasa, albums, custom post type, CND, fancybox
+Requires at least: 3.0.0
+Tested up to: 3.2.1
+Stable tag: trunk
+
+Picasa Albums For WordPress helps to easily import, display and manage your public Picasa Web Albums right in your WordPress site.
+
+== Description ==
+
+Picasa Albums For WordPress gives you full control over how you Picasa Albums displayed in your blog by adding custom post type "Albums" to your WP 3.0. Once Picasa Albums imported, you can rearrange images, hide images and/or change album cover image. Users can add specific album description and control which albums to display on the site. Picasa Albums Settings page allows to set thumbnail size, max image size and cropping options for your images.
+
+If you looking to ease the load on your PHP server by serving static content (images) from CDN or simply short on space on your hosting, Picasa Album is great solutions for you. All images are stored on Google's servers and served to users directly. Picasa Albums does not store any images on your server.
+
+Picasa Albums allows you to import images from any number of Picasa accounts, so you can combine all of your family's pictures in one place.
+
+Once installed you control:
+
+ * Which albums to show.
+ * Album's title, url, description, thumbnail and thumbnail size
+ * Which images in the albums to show, images order, thumbnail size and maximum images size
+ * If own multiple Picasa accounts, you can import from all of them
+
+Limitations:
+
+ * WordPress 3 and newer
+ * PHP 5 with CURL enabled (most web hosters have it)
+ * mod_rewrite is required and you must use permalink.
+
+This plugin includes Fancybox and uses it to display enlarged images.
+
+Visit my blog for more great ideas on how you can take advantage of Google's free with Picasa Albums.
+
+Report issues https://github.com/315design/Picasa-Albums-For-WordPress/issues
+
+
+== Installation ==
+1. Register @ http://picasaweb.google.com/ and get your Picasa Web Albums ID (it is free, usually is the same as your Google ID).
+2. Get files from this repo and put them into "picasa-albums" folder (actually any folder will work).
+3. Go to Plugins section of your WordPress and activate plugin "Picasa Albums" plugin.
+4. Head over to "Picasa Albums" page in "Settings" section of the admin menu.
+5. Enter you Picasa Web Albums ID and click import.
+6. Head over to "Albums" section and publish albums that you like.
+7. Make sure that permalinks are enabled.
+8. Add link to Albums category to your main menu. You can use Menus section to add custom link "http://my_website.com/album/" or you can hard code it to your site.
+9. Done.
+
+
+== Licence ==
+
+This plugin is distributed under GPLv2 (or later). You can and you should:
+
+ * use the software for any purpose,
+ * change the software to suit your needs,
+ * share the software with your friends and neighbors, and
+ * share the changes you make (please do).
+
+== Change Log ==
+
+v. 1.0.4
+
+ * /admin/scripts.js - relative path for ajax requests per issue #5 in github. Thanks stephanvierkant.
+ * /plugin.php - simpleXml warning path not found possible fix. Thanks stephanvierkant.
+
+v. 1.0.5
+
+ * removed album update. now albums only imported. all updates are done manually. Closes #7
+ * added the_excerpt() filter for better compatibility with custom themes
+
+v. 1.0.6
+ * GPLv2 (or later) license
+ * Updated Fancybox to the latest code. Added jQuery to the list of libs required during init
+ * Updated image thumbnails to work as expected
+ * Custom url for picasa albums
+ * New hooks to overwrite defualt layout without changing plagin
+ \ No newline at end of file
diff --git a/plugins/picasa-albums/scb/AdminPage.php b/plugins/picasa-albums/scb/AdminPage.php
new file mode 100644
index 00000000..cfa8bfc9
--- /dev/null
+++ b/plugins/picasa-albums/scb/AdminPage.php
@@ -0,0 +1,460 @@
+<?php
+
+/*
+Creates an admin page
+
+You must set $this->args and define the page_content() method
+*/
+
+abstract class scbAdminPage {
+ /** Page args
+ * $toplevel string If not empty, will create a new top level menu
+ * $icon string Path to an icon for the top level menu
+ * $parent string ( default: options-general.php )
+ * $capability string ( default: 'manage_options' )
+ * $page_title string ( mandatory )
+ * $menu_title string ( default: $page_title )
+ * $page_slug string ( default: sanitized $page_title )
+ * $nonce string ( default: $page_slug )
+ * $action_link string|bool Text of the action link on the Plugins page ( default: 'Settings' )
+ */
+ protected $args;
+
+ // URL to the current plugin directory.
+ // Useful for adding css and js files
+ protected $plugin_url;
+
+ // Created at page init
+ protected $pagehook;
+
+ // scbOptions object holder
+ // Normally, it's used for storing formdata
+ protected $options;
+ protected $option_name;
+
+ // l10n
+ protected $textdomain;
+
+
+// ____________REGISTRATION COMPONENT____________
+
+
+ private static $registered = array();
+
+ static function register( $class, $file, $options = null ) {
+ if ( isset( self::$registered[$class] ) )
+ return false;
+
+ self::$registered[$class] = array( $file, $options );
+
+ add_action( '_admin_menu', array( __CLASS__, '_pages_init' ) );
+
+ return true;
+ }
+
+ static function replace( $old_class, $new_class ) {
+ if ( ! isset( self::$registered[$old_class] ) )
+ return false;
+
+ self::$registered[$new_class] = self::$registered[$old_class];
+ unset( self::$registered[$old_class] );
+
+ return true;
+ }
+
+ static function remove( $class ) {
+ if ( ! isset( self::$registered[$class] ) )
+ return false;
+
+ unset( self::$registered[$class] );
+
+ return true;
+ }
+
+ static function _pages_init() {
+ foreach ( self::$registered as $class => $args )
+ new $class( $args[0], $args[1] );
+ }
+
+
+// ____________MAIN METHODS____________
+
+
+ // Constructor
+ function __construct( $file, $options = NULL ) {
+ if ( is_a( $options, 'scbOptions' ) )
+ $this->options = $options;
+
+ $this->file = $file;
+ $this->plugin_url = plugin_dir_url( $file );
+
+ $this->setup();
+ $this->check_args();
+
+ if ( isset( $this->option_name ) ) {
+ add_action( 'admin_init', array( $this, 'option_init' ) );
+ if ( function_exists( 'settings_errors' ) )
+ add_action( 'admin_notices', 'settings_errors' );
+ }
+
+ add_action( 'admin_menu', array( $this, 'page_init' ) );
+ add_filter( 'contextual_help', array( $this, '_contextual_help' ), 10, 2 );
+
+ if ( $this->args['action_link'] )
+ add_filter( 'plugin_action_links_' . plugin_basename( $file ), array( $this, '_action_link' ) );
+ }
+
+ // This is where all the page args can be set
+ function setup(){}
+
+ // This is where the css and js go
+ // Both wp_enqueue_*() and inline code can be added
+ function page_head(){}
+
+ // This is where the contextual help goes
+ // @return string
+ function page_help(){}
+
+ // A generic page header
+ function page_header() {
+ echo "<div class='wrap'>\n";
+ screen_icon();
+ echo "<h2>" . $this->args['page_title'] . "</h2>\n";
+ }
+
+ // This is where the page content goes
+ abstract function page_content();
+
+ // A generic page footer
+ function page_footer() {
+ echo "</div>\n";
+ }
+
+ // This is where the form data should be validated
+ function validate( $new_data, $old_data ) {
+ return $new_data;
+ }
+
+ // Manually handle option saving ( use Settings API instead )
+ function form_handler() {
+ if ( empty( $_POST['action'] ) )
+ return false;
+
+ check_admin_referer( $this->nonce );
+
+ if ( !isset($this->options) ) {
+ trigger_error('options handler not set', E_USER_WARNING);
+ return false;
+ }
+
+ $new_data = scbUtil::array_extract( $_POST, array_keys( $this->options->get_defaults() ) );
+
+ $new_data = stripslashes_deep( $new_data );
+
+ $new_data = $this->validate( $new_data, $this->options->get() );
+
+ $this->options->set( $new_data );
+
+ $this->admin_msg();
+ }
+
+ // Manually generate a standard admin notice ( use Settings API instead )
+ function admin_msg( $msg = '', $class = "updated" ) {
+ if ( empty( $msg ) )
+ $msg = __( 'Settings <strong>saved</strong>.', $this->textdomain );
+
+ echo "<div class='$class fade'><p>$msg</p></div>\n";
+ }
+
+
+// ____________UTILITIES____________
+
+
+ // Generates a form submit button
+ function submit_button( $value = '', $action = 'action', $class = "button" ) {
+ if ( is_array( $value ) ) {
+ extract( wp_parse_args( $value, array( 'value' => __( 'Save Changes', $this->textdomain ),
+ 'action' => 'action',
+ 'class' => 'button',
+ 'ajax' => true ) ) );
+
+ if ( ! $ajax )
+ $class .= ' no-ajax';
+ }
+ else {
+ if ( empty( $value ) )
+ $value = __( 'Save Changes', $this->textdomain );
+ }
+
+ $input_args = array( 'type' => 'submit',
+ 'names' => $action,
+ 'values' => $value,
+ 'extra' => '',
+ 'desc' => false );
+
+ if ( ! empty( $class ) )
+ $input_args['extra'] = "class='{$class}'";
+
+ $output = "<p class='submit'>\n" . scbForms::input( $input_args ) . "</p>\n";
+
+ return $output;
+ }
+
+ /*
+ Mimics scbForms::form_wrap()
+
+ $this->form_wrap( $content ); // generates a form with a default submit button
+
+ $this->form_wrap( $content, false ); // generates a form with no submit button
+
+ // the second argument is sent to submit_button()
+ $this->form_wrap( $content, array( 'text' => 'Save changes',
+ 'name' => 'action',
+ 'ajax' => true,
+ ) );
+ */
+ function form_wrap( $content, $submit_button = true ) {
+ if ( is_array( $submit_button ) ) {
+ $content .= call_user_func( array( $this, 'submit_button' ), $submit_button );
+ } elseif ( true === $submit_button ) {
+ $content .= $this->submit_button();
+ } elseif ( false !== strpos( $submit_button, '<input' ) ) {
+ $content .= $submit_button;
+ } elseif ( false !== $submit_button ) {
+ $button_args = array_slice( func_get_args(), 1 );
+ $content .= call_user_func_array( array( $this, 'submit_button' ), $button_args );
+ }
+
+ return scbForms::form_wrap( $content, $this->nonce );
+ }
+
+ // See scbForms::form()
+ function form( $rows, $formdata = array() ) {
+ return scbForms::form( $rows, $formdata, $this->nonce );
+ }
+
+ // Generates a table wrapped in a form
+ function form_table( $rows, $formdata = array() ) {
+ $output = '';
+ foreach ( $rows as $row )
+ $output .= $this->table_row( $row, $formdata );
+
+ $output = $this->form_table_wrap( $output );
+
+ return $output;
+ }
+
+ // Wraps the given content in a <form><table>
+ function form_table_wrap( $content ) {
+ $output = $this->table_wrap( $content );
+ $output = $this->form_wrap( $output, $this->nonce );
+
+ return $output;
+ }
+
+ // Generates a form table
+ function table( $rows, $formdata = array() ) {
+ $output = '';
+ foreach ( $rows as $row )
+ $output .= $this->table_row( $row, $formdata );
+
+ $output = $this->table_wrap( $output );
+
+ return $output;
+ }
+
+ // Generates a table row
+ function table_row( $args, $formdata = array() ) {
+ return $this->row_wrap( $args['title'], $this->input( $args, $formdata ) );
+ }
+
+ // Wraps the given content in a <table>
+ function table_wrap( $content ) {
+ return
+ html( 'table class="form-table"', $content );
+ }
+
+ // Wraps the given content in a <tr><td>
+ function row_wrap( $title, $content ) {
+ return
+ html( 'tr',
+ html( 'th scope="row"', $title )
+ .html( 'td', $content ) );
+ }
+
+ function input( $args, $formdata = array() ) {
+ if ( empty( $formdata ) && isset( $this->options ) )
+ $formdata = $this->options->get();
+
+ if ( isset( $args['name_tree'] ) ) {
+ $tree = ( array ) $args['name_tree'];
+ unset( $args['name_tree'] );
+
+ $value = $formdata;
+ $name = $this->option_name;
+ foreach ( $tree as $key ) {
+ $value = $value[$key];
+ $name .= '[' . $key . ']';
+ }
+
+ $args['name'] = $name;
+ unset( $args['names'] );
+
+ unset( $args['values'] );
+
+ $formdata = array( $name => $value );
+ }
+
+ return scbForms::input( $args, $formdata );
+ }
+
+ // Mimic scbForms inheritance
+ function __call( $method, $args ) {
+ return call_user_func_array( array( 'scbForms', $method ), $args );
+ }
+
+ // Wraps a string in a <script> tag
+ function js_wrap( $string ) {
+ return "\n<script type='text/javascript'>\n" . $string . "\n</script>\n";
+ }
+
+ // Wraps a string in a <style> tag
+ function css_wrap( $string ) {
+ return "\n<style type='text/css'>\n" . $string . "\n</style>\n";
+ }
+
+
+// ____________INTERNAL METHODS____________
+
+
+ // Registers a page
+ function page_init() {
+ extract( $this->args );
+
+ if ( ! $toplevel ) {
+ $this->pagehook = add_submenu_page( $parent, $page_title, $menu_title, $capability, $page_slug, array( $this, '_page_content_hook' ) );
+ } else {
+ $func = 'add_' . $toplevel . '_page';
+ $this->pagehook = $func( $page_title, $menu_title, $capability, $page_slug, array( $this, '_page_content_hook' ), $icon_url );
+ }
+
+ if ( ! $this->pagehook )
+ return;
+
+ if ( $ajax_submit ) {
+ $this->ajax_response();
+ add_action( 'admin_footer', array( $this, 'ajax_submit' ), 20 );
+ }
+
+ add_action( 'admin_print_styles-' . $this->pagehook, array( $this, 'page_head' ) );
+ }
+
+ function option_init() {
+ register_setting( $this->option_name, $this->option_name, array( $this, 'validate' ) );
+ }
+
+ private function check_args() {
+ if ( empty( $this->args['page_title'] ) )
+ trigger_error( 'Page title cannot be empty', E_USER_WARNING );
+
+ $this->args = wp_parse_args( $this->args, array(
+ 'toplevel' => '',
+ 'icon' => '',
+ 'parent' => 'options-general.php',
+ 'capability' => 'manage_options',
+ 'menu_title' => $this->args['page_title'],
+ 'page_slug' => '',
+ 'nonce' => '',
+ 'action_link' => __( 'Settings', $this->textdomain ),
+ 'ajax_submit' => false,
+ ) );
+
+ if ( empty( $this->args['page_slug'] ) )
+ $this->args['page_slug'] = sanitize_title_with_dashes( $this->args['menu_title'] );
+
+ if ( empty( $this->args['nonce'] ) )
+ $this->nonce = $this->args['page_slug'];
+ }
+
+ function _contextual_help( $help, $screen ) {
+ if ( is_object( $screen ) )
+ $screen = $screen->id;
+
+ $actual_help = $this->page_help();
+
+ if ( $screen == $this->pagehook && $actual_help )
+ return $actual_help;
+
+ return $help;
+ }
+
+ function ajax_response() {
+ if ( ! isset( $_POST['_ajax_submit'] ) || $_POST['_ajax_submit'] != $this->pagehook )
+ return;
+
+ $this->form_handler();
+ die;
+ }
+
+ function ajax_submit() {
+ global $page_hook;
+
+ if ( $page_hook != $this->pagehook )
+ return;
+?>
+<script type="text/javascript">
+jQuery( document ).ready( function( $ ){
+ var $spinner = $( new Image() ).attr( 'src', '<?php echo admin_url( "images/wpspin_light.gif" ); ?>' );
+
+ $( ':submit' ).click( function( ev ){
+ var $submit = $( this );
+ var $form = $submit.parents( 'form' );
+
+ if ( $submit.hasClass( 'no-ajax' ) || $form.attr( 'method' ).toLowerCase() != 'post' )
+ return true;
+
+ var $this_spinner = $spinner.clone();
+
+ $submit.before( $this_spinner ).hide();
+
+ var data = $form.serializeArray();
+ data.push( {name: $submit.attr( 'name' ), value: $submit.val()} );
+ data.push( {name: '_ajax_submit', value: '<?php echo $this->pagehook; ?>'} );
+
+ $.post( location.href, data, function( response ){
+ var $prev = $( '.wrap > .updated, .wrap > .error' );
+ var $msg = $( response ).hide().insertAfter( $( '.wrap h2' ) );
+ if ( $prev.length > 0 )
+ $prev.fadeOut( 'slow', function(){ $msg.fadeIn( 'slow' ); } );
+ else
+ $msg.fadeIn( 'slow' );
+
+ $this_spinner.hide();
+ $submit.show();
+ } );
+
+ ev.stopPropagation();
+ ev.preventDefault();
+ } );
+} );
+</script>
+<?php
+ }
+
+ function _page_content_hook() {
+ $this->form_handler();
+
+ $this->page_header();
+ $this->page_content();
+ $this->page_footer();
+ }
+
+ function _action_link( $links ) {
+ $url = add_query_arg( 'page', $this->args['page_slug'], admin_url( $this->args['parent'] ) );
+
+ $links[] = html_link( $url, $this->args['action_link'] );
+
+ return $links;
+ }
+}
+
diff --git a/plugins/picasa-albums/scb/BoxesPage.php b/plugins/picasa-albums/scb/BoxesPage.php
new file mode 100644
index 00000000..a86877dd
--- /dev/null
+++ b/plugins/picasa-albums/scb/BoxesPage.php
@@ -0,0 +1,220 @@
+<?php
+
+/*
+Creates an admin page with widgets, similar to the dashboard
+
+For example, if you defined the boxes like this:
+
+$this->boxes = array( array( 'settings', 'Settings box', 'normal' )
+ ... );
+
+You must also define two methods in your class for each box:
+
+function settings_box() - this is where the box content is echoed
+function settings_handler() - this is where the box settings are saved
+...
+*/
+abstract class scbBoxesPage extends scbAdminPage {
+ /*
+ A box definition looks like this:
+ array( $slug, $title, $column );
+
+ Available columns: normal, side, column3, column4
+ */
+ protected $boxes = array();
+
+ function __construct( $file, $options = null ) {
+ parent::__construct( $file, $options );
+
+ // too late
+ scbUtil::add_uninstall_hook( $this->file, array( $this, 'uninstall' ) );
+ }
+
+ function page_init() {
+ if ( !isset( $this->args['columns'] ) )
+ $this->args['columns'] = 2;
+
+ parent::page_init();
+
+ add_action( 'load-' . $this->pagehook, array( $this, 'boxes_init' ) );
+ add_filter( 'screen_layout_columns', array( $this, 'columns' ) );
+ }
+
+ function default_css() {
+?>
+<style type="text/css">
+.postbox-container + .postbox-container {margin-left: 18px}
+.postbox-container {padding-right: 0}
+
+.inside {clear: both; overflow: hidden; padding: 10px 10px 0 10px !important}
+.inside table {margin: 0 !important; padding: 0 !important}
+.inside table td {vertical-align: middle !important}
+.inside table .regular-text {width: 100% !important}
+.inside .form-table th {width: 30%; max-width: 200px; padding: 10px 0 !important}
+.inside .widefat .check-column {padding-bottom: 7px !important}
+.inside p, .inside table {margin: 0 0 10px 0 !important}
+.inside p.submit {float:left !important; padding: 0 !important}
+</style>
+<?php
+ }
+
+ function page_content() {
+ $this->default_css();
+
+ global $screen_layout_columns;
+
+ if ( isset( $screen_layout_columns ) ) {
+ $hide2 = $hide3 = $hide4 = '';
+ switch ( $screen_layout_columns ) {
+ case 4:
+ $width = 'width:24.5%;';
+ break;
+ case 3:
+ $width = 'width:32.67%;';
+ $hide4 = 'display:none;';
+ break;
+ case 2:
+ $width = 'width:49%;';
+ $hide3 = $hide4 = 'display:none;';
+ break;
+ default:
+ $width = 'width:98%;';
+ $hide2 = $hide3 = $hide4 = 'display:none;';
+ }
+ }
+?>
+<div id='<?php echo $this->pagehook ?>-widgets' class='metabox-holder'>
+<?php
+ echo "\t<div class='postbox-container' style='$width'>\n";
+ do_meta_boxes( $this->pagehook, 'normal', '' );
+
+ echo "\t</div><div class='postbox-container' style='{$hide2}$width'>\n";
+ do_meta_boxes( $this->pagehook, 'side', '' );
+
+ echo "\t</div><div class='postbox-container' style='{$hide3}$width'>\n";
+ do_meta_boxes( $this->pagehook, 'column3', '' );
+
+ echo "\t</div><div class='postbox-container' style='{$hide4}$width'>\n";
+ do_meta_boxes( $this->pagehook, 'column4', '' );
+?>
+</div></div>
+<?php
+ }
+
+ function page_footer() {
+ parent::page_footer();
+ $this->_boxes_js_init();
+ }
+
+ function form_handler() {
+ if ( empty( $_POST ) )
+ return;
+
+ check_admin_referer( $this->nonce );
+
+ // Box handler
+ foreach ( $this->boxes as $box ) {
+ $args = isset( $box[4] ) ? $box[4] : array();
+
+ $handler = $box[0] . '_handler';
+
+ if ( method_exists( $this, $handler ) )
+ call_user_func_array( array( $this, $handler ), $args );
+ }
+ }
+
+ function columns( $columns ) {
+ $columns[$this->pagehook] = $this->args['columns'];
+
+ return $columns;
+ }
+
+ function uninstall() {
+ global $wpdb;
+
+ $hook = str_replace( '-', '', $this->pagehook );
+
+ foreach ( array( 'metaboxhidden', 'closedpostboxes', 'wp_metaboxorder', 'screen_layout' ) as $option )
+ $keys[] = "'{$option}_{$hook}'";
+
+ $keys = '( ' . implode( ', ', $keys ) . ' )';
+
+ $wpdb->query( "
+ DELETE FROM {$wpdb->usermeta}
+ WHERE meta_key IN {$keys}
+ " );
+ }
+
+ function boxes_init() {
+ wp_enqueue_script( 'common' );
+ wp_enqueue_script( 'wp-lists' );
+ wp_enqueue_script( 'postbox' );
+
+ $registered = array();
+ foreach( $this->boxes as $box_args ) {
+ @list( $name, $title, $context, $priority, $args ) = $box_args;
+
+ if ( empty( $title ) )
+ $title = ucfirst( $name );
+ if ( empty( $context ) )
+ $context = 'normal';
+ if ( empty( $priority ) )
+ $priority = 'default';
+ if ( empty( $args ) )
+ $args = array();
+
+ if ( isset( $registered[$name] ) ) {
+ if ( empty( $args ) )
+ trigger_error( "Duplicate box name: $name", E_USER_NOTICE );
+
+ $name = $this->_increment( $name );
+ } else {
+ $registered[$name] = true;
+ }
+
+ add_meta_box( $name, $title, array( $this, '_intermediate_callback' ), $this->pagehook, $context, $priority, $args );
+ }
+ }
+
+ // Make it so that $args is actually what's passed to the callback
+ function _intermediate_callback( $_, $box ) {
+ list( $name ) = explode( '-', $box['id'] );
+
+ call_user_func_array( array( $this, $name . '_box' ), $box['args'] );
+ }
+
+ private function _increment( $name ) {
+ $parts = explode( '-', $name );
+ if ( isset( $parts[1] ) )
+ $parts[1]++;
+ else
+ $parts[1] = 2;
+
+ return implode( '-', $parts );
+ }
+
+ // Adds necesary code for JS to work
+ function _boxes_js_init() {
+ echo $this->js_wrap( <<<EOT
+jQuery( document ).ready( function( $ ){
+ // close postboxes that should be closed
+ $( '.if-js-closed' ).removeClass( 'if-js-closed' ).addClass( 'closed' );
+ // postboxes setup
+ postboxes.add_postbox_toggles( '$this->pagehook' );
+} );
+EOT
+ );
+?>
+
+<form style='display: none' method='get' action=''>
+ <p>
+<?php
+ wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
+ wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
+?>
+ </p>
+</form>
+<?php
+ }
+}
+
diff --git a/plugins/picasa-albums/scb/Cron.php b/plugins/picasa-albums/scb/Cron.php
new file mode 100644
index 00000000..711ce7f1
--- /dev/null
+++ b/plugins/picasa-albums/scb/Cron.php
@@ -0,0 +1,182 @@
+<?php
+
+class scbCron {
+ protected $schedule;
+ protected $interval;
+ protected $time;
+
+ protected $hook;
+ protected $callback_args;
+
+ /**
+ * Create a new cron job
+ *
+ * @param string Reference to main plugin file
+ * @param array List of args:
+ string $action OR callback $callback
+ string $schedule OR number $interval
+ array $callback_args ( optional )
+ * @param bool Debug mode
+ */
+ function __construct( $file, $args, $debug = false ) {
+ $this->_set_args( $args );
+
+ scbUtil::add_activation_hook( $file, array( $this, 'reset' ) );
+ register_deactivation_hook( $file, array( $this, 'unschedule' ) );
+
+ add_filter( 'cron_schedules', array( $this, '_add_timing' ) );
+
+ if ( $debug )
+ self::debug();
+ }
+
+ /* Change the interval of the cron job
+ *
+ * @param array List of args:
+ string $schedule OR number $interval
+ timestamp $time ( optional )
+ */
+ function reschedule( $args ) {
+ extract( $args );
+
+ if ( $schedule && $this->schedule != $schedule ) {
+ $this->schedule = $schedule;
+ } elseif ( $interval && $this->interval != $interval ) {
+ $this->schedule = $interval . 'secs';
+ $this->interval = $interval;
+ }
+
+ $this->time = $time;
+
+ $this->reset();
+ }
+
+ /**
+ * Reset the schedule
+ */
+ function reset() {
+ $this->unschedule();
+ $this->schedule();
+ }
+
+ /**
+ * Clear the cron job
+ */
+ function unschedule() {
+# wp_clear_scheduled_hook( $this->hook, $this->callback_args );
+ self::really_clear_scheduled_hook( $this->hook );
+ }
+
+ /**
+ * Execute the job now
+ */
+ function do_now() {
+ do_action( $this->hook );
+ }
+
+ /**
+ * Execute the job with a given delay
+ * @param int Delay in seconds
+ */
+ function do_once( $delay = 0 ) {
+ wp_schedule_single_event( time() + $delay, $this->hook, $this->callback_args );
+ }
+
+ /**
+ * Display current cron jobs
+ */
+ function debug() {
+ add_action( 'admin_footer', array( __CLASS__, '_debug' ) );
+ }
+
+
+//_____INTERNAL METHODS_____
+
+
+ function _add_timing( $schedules ) {
+ if ( isset( $schedules[$this->schedule] ) )
+ return $schedules;
+
+ $schedules[$this->schedule] = array( 'interval' => $this->interval,
+ 'display' => $this->interval . ' seconds' );
+
+ return $schedules;
+ }
+
+ function _debug() {
+ if ( ! current_user_can( 'manage_options' ) )
+ return;
+
+ echo "<pre>";
+ print_r( get_option( 'cron' ) );
+ echo "</pre>";
+ }
+
+ protected function schedule() {
+ if ( ! $this->time )
+ $this->time = time();
+
+ wp_schedule_event( $this->time, $this->schedule, $this->hook, $this->callback_args );
+ }
+
+ protected function _set_args( $args ) {
+ extract( $args );
+
+ // Set hook
+ if ( isset( $action ) ) {
+ $this->hook = $action;
+ } elseif ( isset( $callback ) ) {
+ $this->hook = self::_callback_to_string( $callback );
+
+ add_action( $this->hook, $callback );
+ } elseif ( method_exists( $this, 'callback' ) ) {
+ $this->hook = self::_callback_to_string( $callback );
+
+ add_action( $this->hook, $callback );
+ } else {
+ trigger_error( '$action OR $callback not set', E_USER_WARNING );
+ }
+
+ // Set schedule
+ if ( isset( $interval ) ) {
+ $this->schedule = $interval . 'secs';
+ $this->interval = $interval;
+ } elseif ( isset( $schedule ) ) {
+ $this->schedule = $schedule;
+ } else {
+ trigger_error( '$schedule OR $interval not set', E_USER_WARNING );
+ }
+
+ if ( isset( $callback_args ) )
+ $this->callback_args = ( array ) $callback_args;
+ }
+
+ protected static function really_clear_scheduled_hook( $name ) {
+ $crons = _get_cron_array();
+
+ foreach ( $crons as $timestamp => $hooks ) {
+ foreach ( $hooks as $hook => $args )
+ if ( $hook == $name )
+ unset( $crons[$timestamp][$hook] );
+
+ if ( empty( $hooks ) )
+ unset( $crons[$timestamp] );
+ }
+
+ _set_cron_array( $crons );
+ }
+
+ protected static function _callback_to_string( $callback ) {
+ if ( ! is_array( $callback ) )
+ $str = $callback;
+ elseif ( ! is_string( $callback[0] ) )
+ $str = get_class( $callback[0] ) . '_' . $callback[1];
+ else
+ $str = $callback[0] . '::' . $callback[1];
+
+ $str .= '_hook';
+
+ return $str;
+ }
+}
+
diff --git a/plugins/picasa-albums/scb/Forms.php b/plugins/picasa-albums/scb/Forms.php
new file mode 100644
index 00000000..e6318469
--- /dev/null
+++ b/plugins/picasa-albums/scb/Forms.php
@@ -0,0 +1,422 @@
+<?php
+
+// Documentation: http://scribu.net/wordpress/scb-framework/scb-forms.html
+
+class scbForms {
+
+ const token = '%input%';
+
+ protected static $args;
+ protected static $formdata = array();
+
+ static function input( $args, $formdata = array() ) {
+ $args = self::validate_data( $args );
+
+ $error = false;
+ foreach ( array( 'name', 'value' ) as $key ) {
+ $old = $key . 's';
+
+ if ( isset( $args[$old] ) ) {
+ $args[$key] = $args[$old];
+ unset( $args[$old] );
+ }
+ }
+
+ if ( empty( $args['name'] ) )
+ return trigger_error( 'Empty name', E_USER_WARNING );
+
+ self::$args = $args;
+ self::$formdata = self::validate_data( $formdata );
+
+ if ( 'select' == $args['type'] )
+ return self::_select();
+ else
+ return self::_input();
+ }
+
+
+// ____________UTILITIES____________
+
+
+ // Generates a table wrapped in a form
+ static function form_table( $rows, $formdata = NULL ) {
+ $output = '';
+ foreach ( $rows as $row )
+ $output .= self::table_row( $row, $formdata );
+
+ $output = self::form_table_wrap( $output );
+
+ return $output;
+ }
+
+ // Generates a form
+ static function form( $inputs, $formdata = NULL, $nonce ) {
+ $output = '';
+ foreach ( $inputs as $input )
+ $output .= self::input( $input, $formdata );
+
+ $output = self::form_wrap( $output, $nonce );
+
+ return $output;
+ }
+
+ // Generates a table
+ static function table( $rows, $formdata = NULL ) {
+ $output = '';
+ foreach ( $rows as $row )
+ $output .= self::table_row( $row, $formdata );
+
+ $output = self::table_wrap( $output );
+
+ return $output;
+ }
+
+ // Generates a table row
+ static function table_row( $args, $formdata = NULL ) {
+ return self::row_wrap( $args['title'], self::input( $args, $formdata ) );
+ }
+
+
+// ____________WRAPPERS____________
+
+
+ // Wraps the given content in a <form><table>
+ static function form_table_wrap( $content, $nonce = 'update_options' ) {
+ $output = self::table_wrap( $content );
+ $output = self::form_wrap( $output, $nonce );
+
+ return $output;
+ }
+
+ // Wraps the given content in a <form> tag
+ static function form_wrap( $content, $nonce = 'update_options' ) {
+ $output = "\n<form method='post' action=''>\n";
+ $output .= $content;
+ $output .= wp_nonce_field( $action = $nonce, $name = "_wpnonce", $referer = true , $echo = false );
+ $output .= "\n</form>\n";
+
+ return $output;
+ }
+
+ // Wraps the given content in a <table>
+ static function table_wrap( $content ) {
+ $output = "\n<table class='form-table'>\n" . $content . "\n</table>\n";
+
+ return $output;
+ }
+
+ // Wraps the given content in a <tr><td>
+ static function row_wrap( $title, $content ) {
+ return "\n<tr>\n\t<th scope='row'>" . $title . "</th>\n\t<td>\n\t\t" . $content . "\t</td>\n\n</tr>";
+ }
+
+
+// ____________PRIVATE METHODS____________
+
+
+ // Recursivly transform empty arrays to ''
+ private static function validate_data( $data ) {
+ if ( !is_array( $data ) )
+ return $data;
+
+ if ( empty( $data ) )
+ return '';
+
+ foreach ( $data as $key => &$value )
+ $value = self::validate_data( $value );
+
+ return $data;
+ }
+
+ // From multiple inputs to single inputs
+ private static function _input() {
+ extract( wp_parse_args( self::$args, array(
+ 'name' => NULL,
+ 'value' => NULL,
+ 'desc' => NULL,
+ 'checked' => NULL,
+ ) ) );
+
+ $m_name = is_array( $name );
+ $m_value = is_array( $value );
+ $m_desc = is_array( $desc );
+
+ // Correct name
+ if ( !$m_name && $m_value
+ && 'checkbox' == $type
+ && false === strpos( $name, '[' )
+ )
+ $args['name'] = $name = $name . '[]';
+
+ // Expand names or values
+ if ( !$m_name && !$m_value ) {
+ $a = array( $name => $value );
+ }
+ elseif ( $m_name && !$m_value ) {
+ $a = array_fill_keys( $name, $value );
+ }
+ elseif ( !$m_name && $m_value ) {
+ $a = array_fill_keys( $value, $name );
+ }
+ else {
+ $a = array_combine( $name, $value );
+ }
+
+ // Correct descriptions
+ $_after = '';
+ if ( isset( $desc ) && !$m_desc && false === strpos( $desc, self::token ) ) {
+ if ( $m_value ) {
+ $_after = $desc;
+ $args['desc'] = $desc = $value;
+ }
+ elseif ( $m_name ) {
+ $_after = $desc;
+ $args['desc'] = $desc = $name;
+ }
+ }
+
+ // Determine what goes where
+ if ( !$m_name && $m_value ) {
+ $i1 = 'val';
+ $i2 = 'name';
+ } else {
+ $i1 = 'name';
+ $i2 = 'val';
+ }
+
+ $func = in_array( $type, array( 'checkbox', 'radio' ) ) ? '_checkbox_single' : '_input_single';
+
+ // Set constant args
+ $const_args = self::array_extract( self::$args, array( 'type', 'desc_pos', 'checked' ) );
+ if ( isset( $extra ) ) {
+ if ( !is_array( $extra ) )
+ $extra = self::attr_to_array( $extra );
+ $const_args['extra'] = $extra;
+ }
+
+ $i = 0;
+ foreach ( $a as $name => $val ) {
+ $cur_args = $const_args;
+
+ if ( $$i1 !== NULL )
+ $cur_args['name'] = $$i1;
+
+ if ( $$i2 !== NULL )
+ $cur_args['value'] = $$i2;
+
+ // Set desc
+ if ( is_array( $desc ) )
+ $cur_args['desc'] = $desc[$i];
+ elseif ( isset( $desc ) )
+ $cur_args['desc'] = $desc;
+
+ // Find relevant formdata
+ $match = NULL;
+ if ( $checked === NULL ) {
+ if(isset(self::$formdata) && !empty(self::$formdata)){
+ $match = @self::$formdata[str_replace( '[]', '', $$i1 )];
+ if ( is_array( $match ) ) {
+ $match = $match[$i];
+ }
+ }
+ } else if ( is_array( $checked ) ) {
+ $cur_args['checked'] = isset( $checked[$i] ) && $checked[$i];
+ }
+
+ $output[] = self::$func( $cur_args, $match );
+
+ $i++;
+ }
+
+ return implode( "\n", $output ) . $_after;
+ }
+
+ // Handle args for checkboxes and radio inputs
+ private static function _checkbox_single( $args, $data ) {
+ $args = wp_parse_args( $args, array(
+ 'name' => NULL,
+ 'value' => true,
+ 'desc_pos' => 'after',
+ 'desc' => NULL,
+ 'checked' => NULL,
+ 'extra' => array(),
+ ) );
+
+ foreach ( $args as $key => &$val )
+ $$key = &$val;
+ unset( $val );
+
+ if ( $checked === NULL && $value == $data )
+ $checked = true;
+
+ if ( $checked )
+ $extra['checked'] = 'checked';
+
+ if ( is_null( $desc ) && !is_bool( $value ) )
+ $desc = str_replace( '[]', '', $value );
+
+ return self::_input_gen( $args );
+ }
+
+ // Handle args for text inputs
+ private static function _input_single( $args, $data ) {
+ $args = wp_parse_args( $args, array(
+ 'value' => $data,
+ 'desc_pos' => 'after',
+ 'extra' => array( 'class' => 'regular-text' ),
+ ) );
+
+ foreach ( $args as $key => &$val )
+ $$key = &$val;
+ unset( $val );
+
+ if ( FALSE === strpos( $name, '[' ) )
+ $extra['id'] = $name;
+
+ return self::_input_gen( $args );
+ }
+
+ // Generate html with the final args
+ private static function _input_gen( $args ) {
+ extract( wp_parse_args( $args, array(
+ 'name' => NULL,
+ 'value' => NULL,
+ 'desc' => NULL,
+ 'extra' => array()
+ ) ) );
+
+ $extra = self::array_to_attr( $extra );
+
+ if ( 'textarea' == $type ) {
+ $value = esc_html( $value );
+ $input = "<textarea name='{$name}'{$extra}>{$value}</textarea>\n";
+ }
+ else {
+ $value = esc_attr( $value );
+ $input = "<input name='{$name}' value='{$value}' type='{$type}'{$extra} /> ";
+ }
+
+ return self::add_label( $input, $desc, $desc_pos );
+ }
+
+ private static function _select() {
+ extract( wp_parse_args( self::$args, array(
+ 'name' => '',
+ 'value' => array(),
+ 'text' => '',
+ 'selected' => array( 'foo' ), // hack to make default blank
+ 'extra' => array(),
+ 'numeric' => false, // use numeric array instead of associative
+ 'desc' => '',
+ 'desc_pos' => '',
+ ) ), EXTR_SKIP );
+
+ if ( empty( $value ) )
+ $value = array( '' => '' );
+
+ if ( !is_array( $value ) )
+ return trigger_error( "'value' argument is expected to be an array", E_USER_WARNING );
+
+ if ( !self::is_associative( $value ) && !$numeric )
+ $value = array_combine( $value, $value );
+
+ if ( isset( self::$formdata[$name] ) )
+ $cur_val = self::$formdata[$name];
+ else
+ $cur_val = $selected;
+
+ if ( false === $text ) {
+ $opts = '';
+ } else {
+ $opts = "\t<option value=''" . selected( $cur_val, array( 'foo' ), false ) . ">{$text}</option>\n";
+ }
+
+ foreach ( $value as $key => $value ) {
+ if ( empty( $key ) || empty( $value ) )
+ continue;
+
+ $opts .= "\t<option value='{$key}'" . selected( (string) $key, (string) $cur_val, false) . '>' . $value . "</option>\n";
+ }
+
+ if ( !is_array( $extra ) )
+ $extra = self::attr_to_array( $extra );
+ $extra = self::array_to_attr( $extra );
+
+ $input = "<select name='{$name}'$extra>\n{$opts}</select>";
+
+ return self::add_label( $input, $desc, $desc_pos );
+ }
+
+ private static function add_label( $input, $desc, $desc_pos ) {
+ if ( empty( $desc_pos ) )
+ $desc_pos = 'after';
+
+ $label = '';
+ if ( false === strpos( $desc, self::token ) ) {
+ switch ( $desc_pos ) {
+ case 'before': $label = $desc . ' ' . self::token; break;
+ case 'after': $label = self::token . ' ' . $desc;
+ }
+ } else {
+ $label = $desc;
+ }
+
+ $label = trim( str_replace( self::token, $input, $label ) );
+
+ if ( empty( $desc ) )
+ $output = $input . "\n";
+ else
+ $output = "<label>{$label}</label>\n";
+
+ return $output;
+ }
+
+
+// Utilities
+
+
+ private static function attr_to_array( $html ) {
+ return shortcode_parse_atts( $html );
+ }
+
+ private static function array_to_attr( $attr ) {
+ $out = '';
+ foreach ( $attr as $key => $value )
+ $out .= ' ' . $key . '=' . '"' . esc_attr( $value ) . '"';
+
+ return $out;
+ }
+
+ private static function is_associative( $array ) {
+ if ( !is_array( $array ) || empty( $array ) )
+ return false;
+
+ $keys = array_keys( $array );
+
+ return array_keys( $keys ) !== $keys;
+ }
+
+ private static function array_extract( $array, $keys ) {
+ $r = array();
+ foreach ( $keys as $key )
+ if ( isset( $array[$key] ) )
+ $r[$key] = $array[$key];
+
+ return $r;
+ }
+}
+
+// PHP < 5.2
+if ( !function_exists( 'array_fill_keys' ) ) :
+function array_fill_keys( $keys, $value ) {
+ if ( !is_array( $keys ) )
+ trigger_error( 'First argument is expected to be an array.' . gettype( $keys ) . 'given', E_USER_WARNING );
+
+ $r = array();
+ foreach ( $keys as $key )
+ $r[$key] = $value;
+
+ return $r;
+}
+endif;
+
diff --git a/plugins/picasa-albums/scb/Options.php b/plugins/picasa-albums/scb/Options.php
new file mode 100644
index 00000000..54eb4668
--- /dev/null
+++ b/plugins/picasa-albums/scb/Options.php
@@ -0,0 +1,172 @@
+<?php
+
+// Documentation: http://scribu.net/wordpress/scb-framework/scb-options.html
+
+class scbOptions {
+
+ protected $key; // the option name
+
+ protected $defaults; // the default value( s )
+
+ public $wp_filter_id; // used by WP hooks
+
+ /**
+ * Create a new set of options
+ *
+ * @param string $key Option name
+ * @param string $file Reference to main plugin file
+ * @param array $defaults An associative array of default values ( optional )
+ */
+ public function __construct( $key, $file, $defaults = '' ) {
+ $this->key = $key;
+ $this->defaults = $defaults;
+
+ scbUtil::add_activation_hook( $file, array( $this, '_update_reset' ) );
+
+ scbUtil::add_uninstall_hook( $file, array( $this, 'delete' ) );
+ }
+
+ /**
+ * Get option name
+ */
+ public function get_key() {
+ return $this->key;
+ }
+
+ /**
+ * Get option values for one, many or all fields
+ *
+ * @param string|array $field The field( s ) to get
+ * @return mixed Whatever is in those fields
+ */
+ public function get( $field = '' ) {
+ $data = get_option( $this->key );
+
+ if ( is_array( $this->defaults ) )
+ $data = ( array ) $data;
+
+ return $this->_get( $field, $data );
+ }
+
+ /**
+ * Get default values for one, many or all fields
+ *
+ * @param string|array $field The field( s ) to get
+ * @return mixed Whatever is in those fields
+ */
+ public function get_defaults( $field = '' ) {
+ return $this->_get( $field, $this->defaults );
+ }
+
+ /**
+ * Set all data fields, certain fields or a single field
+ *
+ * @param string|array $field The field to update or an associative array
+ * @param mixed $value The new value ( ignored if $field is array )
+ * @return null
+ */
+ public function set( $field, $value = '' ) {
+ if ( is_array( $field ) )
+ $newdata = $field;
+ else
+ $newdata = array( $field => $value );
+
+ $this->update( array_merge( $this->get(), $newdata ) );
+ }
+
+ /**
+ * Reset option to defaults
+ *
+ * @return null
+ */
+ public function reset() {
+ $this->update( $this->defaults, false );
+ }
+
+ /**
+ * Remove any keys that are not in the defaults array
+ *
+ * @return bool
+ */
+ public function cleanup() {
+ $this->update( $this->_clean( $this->get() ) );
+ }
+
+ /**
+ * Update raw data
+ *
+ * @param mixed $newdata
+ * @param bool $clean wether to remove unrecognized keys or not
+ * @return null
+ */
+ public function update( $newdata, $clean = true ) {
+ if ( $clean )
+ $newdata = $this->_clean( $newdata );
+
+ update_option( $this->key, $newdata );
+ }
+
+ /**
+ * Delete the option
+ *
+ * @return null
+ */
+ public function delete() {
+ delete_option( $this->key );
+ }
+
+
+//_____INTERNAL METHODS_____
+
+
+ // Add new fields with their default values
+ function _update_reset() {
+ if ( is_array( $this->defaults ) )
+ $this->update( array_merge( $this->defaults, $this->get() ) );
+ else
+ add_option( $this->key, $this->defaults );
+ }
+
+ private function _clean( $data ) {
+ if ( !is_array( $data ) || !is_array( $this->defaults ) )
+ return $data;
+
+ $r = array();
+ foreach ( array_keys( $this->defaults ) as $key )
+ $r[$key] = @$data[$key];
+
+ return $r;
+ }
+
+ // Get one, more or all fields from an array
+ private function &_get( $field, $data ) {
+ if ( empty( $field ) )
+ return $data;
+
+ if ( is_string( $field ) )
+ return $data[$field];
+
+ foreach ( $field as $key )
+ if ( isset( $data[$key] ) )
+ $result[] = $data[$key];
+
+ return $result;
+ }
+
+ // Magic method: $options->field
+ function __get( $field ) {
+ return $this->get( $field );
+ }
+
+ // Magic method: $options->field = $value
+ function __set( $field, $value ) {
+ $this->set( $field, $value );
+ }
+
+ // Magic method: isset( $options->field )
+ function __isset( $field ) {
+ $data = $this->get();
+ return isset( $data[$field] );
+ }
+}
+
diff --git a/plugins/picasa-albums/scb/QueryManipulation.php b/plugins/picasa-albums/scb/QueryManipulation.php
new file mode 100644
index 00000000..f6adef19
--- /dev/null
+++ b/plugins/picasa-albums/scb/QueryManipulation.php
@@ -0,0 +1,81 @@
+<?php
+
+class scbQueryManipulation {
+
+ private $bits = array();
+ private $wp_query;
+
+ private static $filters = array(
+ 'posts_where',
+ 'posts_join',
+ 'posts_groupby',
+ 'posts_orderby',
+ 'posts_distinct',
+ 'post_limits',
+ 'posts_fields'
+ );
+
+ public function __construct( $callback, $once = true ) {
+ $this->callback = $callback;
+
+ $this->enable();
+
+ if ( !$once )
+ return;
+
+ add_filter( 'posts_request', array( $this, '_disable' ) );
+ }
+
+ function _disable( $request ) {
+ remove_filter( 'posts_request', array( $this, '_disable' ) );
+
+ $this->disable();
+
+ return $request;
+ }
+
+ public function enable() {
+ foreach ( self::$filters as $filter ) {
+ add_filter( $filter, array( $this, 'collect' ), 999, 2 );
+ add_filter( $filter . '_request' , array( $this, 'update' ), 9 );
+ }
+
+ add_action( 'posts_selection' , array( $this, 'alter' ) );
+ }
+
+ public function disable() {
+ foreach ( self::$filters as $filter ) {
+ remove_filter( $filter, array( $this, 'collect' ), 999, 2 );
+ remove_filter( $filter . '_request' , array( $this, 'update' ), 9 );
+ }
+
+ remove_action( 'posts_selection' , array( $this, 'alter' ) );
+ }
+
+ function collect( $value, $wp_query ) {
+ // remove 'posts_'
+ $key = explode( '_', current_filter() );
+ $key = array_slice( $key, 1 );
+ $key = implode( '_', $key );
+
+ $this->bits[ $key ] = $value;
+
+ $this->wp_query = $wp_query;
+
+ return $value;
+ }
+
+ function alter( $query ) {
+ $this->bits = call_user_func( $this->callback, $this->bits, $this->wp_query );
+ }
+
+ function update( $value ) {
+ // remove 'posts_' and '_request'
+ $key = explode( '_', current_filter() );
+ $key = array_slice( $key, 1, -1 );
+ $key = implode( '_', $key );
+
+ return $this->bits[ $key ];
+ }
+}
+
diff --git a/plugins/picasa-albums/scb/Table.php b/plugins/picasa-albums/scb/Table.php
new file mode 100644
index 00000000..b4529b88
--- /dev/null
+++ b/plugins/picasa-albums/scb/Table.php
@@ -0,0 +1,49 @@
+<?php
+
+// Takes care of creating, updating and deleting database tables
+class scbTable {
+ protected $name;
+ protected $columns;
+ protected $upgrade_method;
+
+ function __construct( $name, $file, $columns, $upgrade_method = 'dbDelta' ) {
+ global $wpdb;
+
+ $this->name = $wpdb->$name = $wpdb->prefix . $name;
+ $this->columns = $columns;
+ $this->upgrade_method = $upgrade_method;
+
+ scbUtil::add_activation_hook( $file, array( $this, 'install' ) );
+ scbUtil::add_uninstall_hook( $file, array( $this, 'uninstall' ) );
+ }
+
+ function install() {
+ global $wpdb;
+
+ $charset_collate = '';
+ if ( $wpdb->has_cap( 'collation' ) ) {
+ if ( ! empty( $wpdb->charset ) )
+ $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset";
+ if ( ! empty( $wpdb->collate ) )
+ $charset_collate .= " COLLATE $wpdb->collate";
+ }
+
+ if ( 'dbDelta' == $this->upgrade_method ) {
+ require_once ABSPATH . 'wp-admin/includes/upgrade.php';
+ dbDelta( "CREATE TABLE $this->name ( $this->columns ) $charset_collate" );
+ return;
+ }
+
+ if ( 'delete_first' == $this->upgrade_method )
+ $wpdb->query( "DROP TABLE IF EXISTS $this->name;" );
+
+ $wpdb->query( "CREATE TABLE IF NOT EXISTS $this->name ( $this->columns ) $charset_collate;" );
+ }
+
+ function uninstall() {
+ global $wpdb;
+
+ $wpdb->query( "DROP TABLE IF EXISTS $this->name" );
+ }
+}
+
diff --git a/plugins/picasa-albums/scb/Util.php b/plugins/picasa-albums/scb/Util.php
new file mode 100644
index 00000000..36086a23
--- /dev/null
+++ b/plugins/picasa-albums/scb/Util.php
@@ -0,0 +1,159 @@
+<?php
+
+class scbUtil {
+
+ // Force script enqueue
+ static function do_scripts( $handles ) {
+ global $wp_scripts;
+
+ if ( ! is_a( $wp_scripts, 'WP_Scripts' ) )
+ $wp_scripts = new WP_Scripts();
+
+ $wp_scripts->do_items( ( array ) $handles );
+ }
+
+ // Force style enqueue
+ static function do_styles( $handles ) {
+ self::do_scripts( 'jquery' );
+
+ global $wp_styles;
+
+ if ( ! is_a( $wp_styles, 'WP_Styles' ) )
+ $wp_styles = new WP_Styles();
+
+ ob_start();
+ $wp_styles->do_items( ( array ) $handles );
+ $content = str_replace( array( '"', "\n" ), array( "'", '' ), ob_get_clean() );
+
+ echo "<script type='text/javascript'>\n";
+ echo "jQuery( document ).ready( function( $ ) {\n";
+ echo "$( 'head' ).prepend( \"$content\" );\n";
+ echo "} );\n";
+ echo "</script>";
+ }
+
+ // Enable delayed activation ( to be used with scb_init() )
+ static function add_activation_hook( $plugin, $callback ) {
+ add_action( 'scb_activation_' . plugin_basename( $plugin ), $callback );
+ }
+
+ // Have more than one uninstall hooks; also prevents an UPDATE query on each page load
+ static function add_uninstall_hook( $plugin, $callback ) {
+ register_uninstall_hook( $plugin, '__return_false' ); // dummy
+
+ add_action( 'uninstall_' . plugin_basename( $plugin ), $callback );
+ }
+
+ // Apply a function to each element of a ( nested ) array recursively
+ static function array_map_recursive( $callback, $array ) {
+ array_walk_recursive( $array, array( __CLASS__, 'array_map_recursive_helper' ), $callback );
+
+ return $array;
+ }
+
+ static function array_map_recursive_helper( &$val, $key, $callback ) {
+ $val = call_user_func( $callback, $val );
+ }
+
+ // Extract certain $keys from $array
+ static function array_extract( $array, $keys ) {
+ $r = array();
+
+ foreach ( $keys as $key )
+ if ( array_key_exists( $key, $array ) )
+ $r[$key] = $array[$key];
+
+ return $r;
+ }
+
+ // Extract a certain value from a list of arrays
+ static function array_pluck( $array, $key ) {
+ $r = array();
+
+ foreach ( $array as $value ) {
+ if ( is_object( $value ) )
+ $value = get_object_vars( $value );
+ if ( array_key_exists( $key, $value ) )
+ $r[] = $value[$key];
+ }
+
+ return $r;
+ }
+
+ // Transform a list of objects into an associative array
+ static function objects_to_assoc( $objects, $key, $value ) {
+ $r = array();
+
+ foreach ( $objects as $obj )
+ $r[$obj->$key] = $obj->$value;
+
+ return $r;
+ }
+
+ // Prepare an array for an IN statement
+ static function array_to_sql( $values ) {
+ foreach ( $values as &$val )
+ $val = "'" . esc_sql( trim( $val ) ) . "'";
+
+ return implode( ',', $values );
+ }
+
+ // Example: split_at( '</', '<a></a>' ) => array( '<a>', '</a>' )
+ static function split_at( $delim, $str ) {
+ $i = strpos( $str, $delim );
+
+ if ( false === $i )
+ return false;
+
+ $start = substr( $str, 0, $i );
+ $finish = substr( $str, $i );
+
+ return array( $start, $finish );
+ }
+}
+
+
+//_____Minimalist HTML framework_____
+
+
+if ( ! function_exists( 'html' ) ):
+function html( $tag, $attributes = array(), $content = '' ) {
+ if ( is_array( $attributes ) ) {
+ $closing = $tag;
+ foreach ( $attributes as $key => $value ) {
+ $tag .= ' ' . $key . '="' . esc_attr( $value ) . '"';
+ }
+ } else {
+ $content = $attributes;
+ list( $closing ) = explode(' ', $tag, 2);
+ }
+
+ return "<{$tag}>{$content}</{$closing}>";
+}
+endif;
+
+// Generate an <a> tag
+if ( ! function_exists( 'html_link' ) ):
+function html_link( $url, $title = '' ) {
+ if ( empty( $title ) )
+ $title = $url;
+
+ return sprintf( "<a href='%s'>%s</a>", esc_url( $url ), $title );
+}
+endif;
+
+
+//_____Compatibility layer_____
+
+// WP < ?
+if ( ! function_exists( 'set_post_field' ) ) :
+function set_post_field( $field, $value, $post_id ) {
+ global $wpdb;
+
+ $post_id = absint( $post_id );
+ $value = sanitize_post_field( $field, $value, $post_id, 'db' );
+
+ return $wpdb->update( $wpdb->posts, array( $field => $value ), array( 'ID' => $post_id ) );
+}
+endif;
+
diff --git a/plugins/picasa-albums/scb/Widget.php b/plugins/picasa-albums/scb/Widget.php
new file mode 100644
index 00000000..93fbb228
--- /dev/null
+++ b/plugins/picasa-albums/scb/Widget.php
@@ -0,0 +1,89 @@
+<?php
+
+// Adds compatibility methods between WP_Widget and scbForms
+
+abstract class scbWidget extends WP_Widget {
+ protected $defaults = array();
+
+ private static $scb_widgets = array();
+
+ static function init( $class, $file = '', $base = '' ) {
+ self::$scb_widgets[] = $class;
+
+ add_action( 'widgets_init', array( __CLASS__, '_scb_register' ) );
+
+ // for auto-uninstall
+ if ( $file && $base && class_exists( 'scbOptions' ) )
+ new scbOptions( "widget_$base", $file );
+ }
+
+ static function _scb_register() {
+ foreach ( self::$scb_widgets as $widget )
+ register_widget( $widget );
+ }
+
+ // A pre-filled method, for convenience
+ function widget( $args, $instance ) {
+ $instance = wp_parse_args( $instance, $this->defaults );
+
+ extract( $args );
+
+ echo $before_widget;
+
+ $title = apply_filters( 'widget_title', isset( $instance['title'] ) ? $instance['title'] : '', $instance, $this->id_base );
+
+ if ( ! empty( $title ) )
+ echo $before_title . $title . $after_title;
+
+ $this->content( $instance );
+
+ echo $after_widget;
+ }
+
+ // This is where the actual widget content goes
+ function content( $instance ) {}
+
+
+//_____HELPER METHODS_____
+
+
+ // See scbForms::input()
+ // Allows extra parameter $args['title']
+ protected function input( $args, $formdata = array() ) {
+ // Add default class
+ if ( !isset( $args['extra'] ) )
+ $args['extra'] = 'class="regular-text"';
+
+ // Add default label position
+ if ( !in_array( $args['type'], array( 'checkbox', 'radio' ) ) && empty( $args['desc_pos'] ) )
+ $args['desc_pos'] = 'before';
+
+ // Then add prefix to names and formdata
+ $new_formdata = array();
+ foreach ( ( array ) $args['name'] as $name )
+ $new_formdata[$this->scb_get_field_name( $name )] = @$formdata[$name];
+ $new_names = array_keys( $new_formdata );
+
+ // Finally, replace the old names
+ if ( 1 == count( $new_names ) )
+ $args['name'] = $new_names[0];
+ else
+ $args['name'] = $new_names;
+
+ return scbForms::input( $args, $new_formdata );
+ }
+
+
+//_____INTERNAL METHODS_____
+
+
+ private function scb_get_field_name( $name ) {
+ if ( $split = scbUtil::split_at( '[', $name ) )
+ list( $basename, $extra ) = $split;
+ else
+ return $this->get_field_name( $name );
+
+ return str_replace( '[]', '', $this->get_field_name( $basename ) ) . $extra;
+ }
+}
+
diff --git a/plugins/picasa-albums/scb/load.php b/plugins/picasa-albums/scb/load.php
new file mode 100644
index 00000000..633c437c
--- /dev/null
+++ b/plugins/picasa-albums/scb/load.php
@@ -0,0 +1,85 @@
+<?php
+
+$GLOBALS['_scb_data'] = array( 25, __FILE__, array(
+ 'scbUtil', 'scbOptions', 'scbForms', 'scbTable',
+ 'scbWidget', 'scbAdminPage', 'scbBoxesPage',
+ 'scbQueryManipulation', 'scbCron',
+) );
+
+if ( !class_exists( 'scbLoad4' ) ) :
+class scbLoad4 {
+
+ private static $candidates;
+ private static $classes;
+ private static $callbacks = array();
+
+ private static $loaded;
+
+ static function init( $callback = '' ) {
+ list( $rev, $file, $classes ) = $GLOBALS['_scb_data'];
+
+ self::$candidates[$file] = $rev;
+ self::$classes[$file] = $classes;
+
+ if ( !empty( $callback ) ) {
+ self::$callbacks[$file] = $callback;
+
+ add_action( 'activate_plugin', array( __CLASS__, 'delayed_activation' ) );
+ }
+
+ // TODO: don't load when activating a plugin ?
+ add_action( 'plugins_loaded', array( __CLASS__, 'load' ), 10, 0 );
+ }
+
+ static function delayed_activation( $plugin ) {
+ $plugin_dir = dirname( $plugin );
+
+ if ( '.' == $plugin_dir )
+ return;
+
+ foreach ( self::$callbacks as $file => $callback )
+ if ( plugin_basename( dirname( dirname( $file ) ) ) == $plugin_dir ) {
+ self::load( false );
+ call_user_func( $callback );
+ do_action( 'scb_activation_' . $plugin );
+ break;
+ }
+ }
+
+ static function load( $do_callbacks = true ) {
+ arsort( self::$candidates );
+
+ $file = key( self::$candidates );
+
+ $path = dirname( $file ) . '/';
+
+ foreach ( self::$classes[$file] as $class_name ) {
+ if ( class_exists( $class_name ) )
+ continue;
+
+ $fpath = $path . substr( $class_name, 3 ) . '.php';
+ if ( file_exists( $fpath ) ) {
+ include $fpath;
+ self::$loaded[] = $fpath;
+ }
+ }
+
+ if ( $do_callbacks )
+ foreach ( self::$callbacks as $callback )
+ call_user_func( $callback );
+ }
+
+ static function get_info() {
+ arsort( self::$candidates );
+
+ return array( self::$loaded, self::$candidates );
+ }
+}
+endif;
+
+if ( !function_exists( 'scb_init' ) ) :
+function scb_init( $callback = '' ) {
+ scbLoad4::init( $callback );
+}
+endif;
+
diff --git a/plugins/picasa-albums/scripts.js b/plugins/picasa-albums/scripts.js
new file mode 100644
index 00000000..3156d2c8
--- /dev/null
+++ b/plugins/picasa-albums/scripts.js
@@ -0,0 +1,25 @@
+var $j =jQuery.noConflict();
+$j(document).ready(function(){
+ $j("a.fancybox").fancybox();
+ $j(".picasa_carousel").jcarousel();
+
+});
+
+
+
+/*!
+ * jCarousel - Riding carousels with jQuery
+ * http://sorgalla.com/jcarousel/
+ *
+ * Copyright (c) 2006 Jan Sorgalla (http://sorgalla.com)
+ * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
+ * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
+ *
+ * Built on top of the jQuery library
+ * http://jquery.com
+ *
+ * Inspired by the "Carousel Component" by Bill Scott
+ * http://billwscott.com/carousel/
+ */
+
+(function(i){var q={vertical:false,rtl:false,start:1,offset:1,size:null,scroll:3,visible:null,animation:"normal",easing:"swing",auto:0,wrap:null,initCallback:null,reloadCallback:null,itemLoadCallback:null,itemFirstInCallback:null,itemFirstOutCallback:null,itemLastInCallback:null,itemLastOutCallback:null,itemVisibleInCallback:null,itemVisibleOutCallback:null,buttonNextHTML:"<div></div>",buttonPrevHTML:"<div></div>",buttonNextEvent:"click",buttonPrevEvent:"click",buttonNextCallback:null,buttonPrevCallback:null, itemFallbackDimension:null},r=false;i(window).bind("load.jcarousel",function(){r=true});i.jcarousel=function(a,c){this.options=i.extend({},q,c||{});this.autoStopped=this.locked=false;this.buttonPrevState=this.buttonNextState=this.buttonPrev=this.buttonNext=this.list=this.clip=this.container=null;if(!c||c.rtl===undefined)this.options.rtl=(i(a).attr("dir")||i("html").attr("dir")||"").toLowerCase()=="rtl";this.wh=!this.options.vertical?"width":"height";this.lt=!this.options.vertical?this.options.rtl? "right":"left":"top";for(var b="",d=a.className.split(" "),f=0;f<d.length;f++)if(d[f].indexOf("jcarousel-skin")!=-1){i(a).removeClass(d[f]);b=d[f];break}if(a.nodeName.toUpperCase()=="UL"||a.nodeName.toUpperCase()=="OL"){this.list=i(a);this.container=this.list.parent();if(this.container.hasClass("jcarousel-clip")){if(!this.container.parent().hasClass("jcarousel-container"))this.container=this.container.wrap("<div></div>");this.container=this.container.parent()}else if(!this.container.hasClass("jcarousel-container"))this.container= this.list.wrap("<div></div>").parent()}else{this.container=i(a);this.list=this.container.find("ul,ol").eq(0)}b!==""&&this.container.parent()[0].className.indexOf("jcarousel-skin")==-1&&this.container.wrap('<div class=" '+b+'"></div>');this.clip=this.list.parent();if(!this.clip.length||!this.clip.hasClass("jcarousel-clip"))this.clip=this.list.wrap("<div></div>").parent();this.buttonNext=i(".jcarousel-next",this.container);if(this.buttonNext.size()===0&&this.options.buttonNextHTML!==null)this.buttonNext= this.clip.after(this.options.buttonNextHTML).next();this.buttonNext.addClass(this.className("jcarousel-next"));this.buttonPrev=i(".jcarousel-prev",this.container);if(this.buttonPrev.size()===0&&this.options.buttonPrevHTML!==null)this.buttonPrev=this.clip.after(this.options.buttonPrevHTML).next();this.buttonPrev.addClass(this.className("jcarousel-prev"));this.clip.addClass(this.className("jcarousel-clip")).css({overflow:"hidden",position:"relative"});this.list.addClass(this.className("jcarousel-list")).css({overflow:"hidden", position:"relative",top:0,margin:0,padding:0}).css(this.options.rtl?"right":"left",0);this.container.addClass(this.className("jcarousel-container")).css({position:"relative"});!this.options.vertical&&this.options.rtl&&this.container.addClass("jcarousel-direction-rtl").attr("dir","rtl");var j=this.options.visible!==null?Math.ceil(this.clipping()/this.options.visible):null;b=this.list.children("li");var e=this;if(b.size()>0){var g=0,k=this.options.offset;b.each(function(){e.format(this,k++);g+=e.dimension(this, j)});this.list.css(this.wh,g+100+"px");if(!c||c.size===undefined)this.options.size=b.size()}this.container.css("display","block");this.buttonNext.css("display","block");this.buttonPrev.css("display","block");this.funcNext=function(){e.next()};this.funcPrev=function(){e.prev()};this.funcResize=function(){e.reload()};this.options.initCallback!==null&&this.options.initCallback(this,"init");if(!r&&i.browser.safari){this.buttons(false,false);i(window).bind("load.jcarousel",function(){e.setup()})}else this.setup()}; var h=i.jcarousel;h.fn=h.prototype={jcarousel:"0.2.7"};h.fn.extend=h.extend=i.extend;h.fn.extend({setup:function(){this.prevLast=this.prevFirst=this.last=this.first=null;this.animating=false;this.tail=this.timer=null;this.inTail=false;if(!this.locked){this.list.css(this.lt,this.pos(this.options.offset)+"px");var a=this.pos(this.options.start,true);this.prevFirst=this.prevLast=null;this.animate(a,false);i(window).unbind("resize.jcarousel",this.funcResize).bind("resize.jcarousel",this.funcResize)}}, reset:function(){this.list.empty();this.list.css(this.lt,"0px");this.list.css(this.wh,"10px");this.options.initCallback!==null&&this.options.initCallback(this,"reset");this.setup()},reload:function(){this.tail!==null&&this.inTail&&this.list.css(this.lt,h.intval(this.list.css(this.lt))+this.tail);this.tail=null;this.inTail=false;this.options.reloadCallback!==null&&this.options.reloadCallback(this);if(this.options.visible!==null){var a=this,c=Math.ceil(this.clipping()/this.options.visible),b=0,d=0; this.list.children("li").each(function(f){b+=a.dimension(this,c);if(f+1<a.first)d=b});this.list.css(this.wh,b+"px");this.list.css(this.lt,-d+"px")}this.scroll(this.first,false)},lock:function(){this.locked=true;this.buttons()},unlock:function(){this.locked=false;this.buttons()},size:function(a){if(a!==undefined){this.options.size=a;this.locked||this.buttons()}return this.options.size},has:function(a,c){if(c===undefined||!c)c=a;if(this.options.size!==null&&c>this.options.size)c=this.options.size;for(var b= a;b<=c;b++){var d=this.get(b);if(!d.length||d.hasClass("jcarousel-item-placeholder"))return false}return true},get:function(a){return i(".jcarousel-item-"+a,this.list)},add:function(a,c){var b=this.get(a),d=0,f=i(c);if(b.length===0){var j,e=h.intval(a);for(b=this.create(a);;){j=this.get(--e);if(e<=0||j.length){e<=0?this.list.prepend(b):j.after(b);break}}}else d=this.dimension(b);if(f.get(0).nodeName.toUpperCase()=="LI"){b.replaceWith(f);b=f}else b.empty().append(c);this.format(b.removeClass(this.className("jcarousel-item-placeholder")), a);f=this.options.visible!==null?Math.ceil(this.clipping()/this.options.visible):null;d=this.dimension(b,f)-d;a>0&&a<this.first&&this.list.css(this.lt,h.intval(this.list.css(this.lt))-d+"px");this.list.css(this.wh,h.intval(this.list.css(this.wh))+d+"px");return b},remove:function(a){var c=this.get(a);if(!(!c.length||a>=this.first&&a<=this.last)){var b=this.dimension(c);a<this.first&&this.list.css(this.lt,h.intval(this.list.css(this.lt))+b+"px");c.remove();this.list.css(this.wh,h.intval(this.list.css(this.wh))- b+"px")}},next:function(){this.tail!==null&&!this.inTail?this.scrollTail(false):this.scroll((this.options.wrap=="both"||this.options.wrap=="last")&&this.options.size!==null&&this.last==this.options.size?1:this.first+this.options.scroll)},prev:function(){this.tail!==null&&this.inTail?this.scrollTail(true):this.scroll((this.options.wrap=="both"||this.options.wrap=="first")&&this.options.size!==null&&this.first==1?this.options.size:this.first-this.options.scroll)},scrollTail:function(a){if(!(this.locked|| this.animating||!this.tail)){this.pauseAuto();var c=h.intval(this.list.css(this.lt));c=!a?c-this.tail:c+this.tail;this.inTail=!a;this.prevFirst=this.first;this.prevLast=this.last;this.animate(c)}},scroll:function(a,c){if(!(this.locked||this.animating)){this.pauseAuto();this.animate(this.pos(a),c)}},pos:function(a,c){var b=h.intval(this.list.css(this.lt));if(this.locked||this.animating)return b;if(this.options.wrap!="circular")a=a<1?1:this.options.size&&a>this.options.size?this.options.size:a;for(var d= this.first>a,f=this.options.wrap!="circular"&&this.first<=1?1:this.first,j=d?this.get(f):this.get(this.last),e=d?f:f-1,g=null,k=0,l=false,m=0;d?--e>=a:++e<a;){g=this.get(e);l=!g.length;if(g.length===0){g=this.create(e).addClass(this.className("jcarousel-item-placeholder"));j[d?"before":"after"](g);if(this.first!==null&&this.options.wrap=="circular"&&this.options.size!==null&&(e<=0||e>this.options.size)){j=this.get(this.index(e));if(j.length)g=this.add(e,j.clone(true))}}j=g;m=this.dimension(g);if(l)k+= m;if(this.first!==null&&(this.options.wrap=="circular"||e>=1&&(this.options.size===null||e<=this.options.size)))b=d?b+m:b-m}f=this.clipping();var p=[],o=0,n=0;j=this.get(a-1);for(e=a;++o;){g=this.get(e);l=!g.length;if(g.length===0){g=this.create(e).addClass(this.className("jcarousel-item-placeholder"));j.length===0?this.list.prepend(g):j[d?"before":"after"](g);if(this.first!==null&&this.options.wrap=="circular"&&this.options.size!==null&&(e<=0||e>this.options.size)){j=this.get(this.index(e));if(j.length)g= this.add(e,j.clone(true))}}j=g;m=this.dimension(g);if(m===0)throw Error("jCarousel: No width/height set for items. This will cause an infinite loop. Aborting...");if(this.options.wrap!="circular"&&this.options.size!==null&&e>this.options.size)p.push(g);else if(l)k+=m;n+=m;if(n>=f)break;e++}for(g=0;g<p.length;g++)p[g].remove();if(k>0){this.list.css(this.wh,this.dimension(this.list)+k+"px");if(d){b-=k;this.list.css(this.lt,h.intval(this.list.css(this.lt))-k+"px")}}k=a+o-1;if(this.options.wrap!="circular"&& this.options.size&&k>this.options.size)k=this.options.size;if(e>k){o=0;e=k;for(n=0;++o;){g=this.get(e--);if(!g.length)break;n+=this.dimension(g);if(n>=f)break}}e=k-o+1;if(this.options.wrap!="circular"&&e<1)e=1;if(this.inTail&&d){b+=this.tail;this.inTail=false}this.tail=null;if(this.options.wrap!="circular"&&k==this.options.size&&k-o+1>=1){d=h.margin(this.get(k),!this.options.vertical?"marginRight":"marginBottom");if(n-d>f)this.tail=n-f-d}if(c&&a===this.options.size&&this.tail){b-=this.tail;this.inTail= true}for(;a-- >e;)b+=this.dimension(this.get(a));this.prevFirst=this.first;this.prevLast=this.last;this.first=e;this.last=k;return b},animate:function(a,c){if(!(this.locked||this.animating)){this.animating=true;var b=this,d=function(){b.animating=false;a===0&&b.list.css(b.lt,0);if(!b.autoStopped&&(b.options.wrap=="circular"||b.options.wrap=="both"||b.options.wrap=="last"||b.options.size===null||b.last<b.options.size||b.last==b.options.size&&b.tail!==null&&!b.inTail))b.startAuto();b.buttons();b.notify("onAfterAnimation"); if(b.options.wrap=="circular"&&b.options.size!==null)for(var f=b.prevFirst;f<=b.prevLast;f++)if(f!==null&&!(f>=b.first&&f<=b.last)&&(f<1||f>b.options.size))b.remove(f)};this.notify("onBeforeAnimation");if(!this.options.animation||c===false){this.list.css(this.lt,a+"px");d()}else this.list.animate(!this.options.vertical?this.options.rtl?{right:a}:{left:a}:{top:a},this.options.animation,this.options.easing,d)}},startAuto:function(a){if(a!==undefined)this.options.auto=a;if(this.options.auto===0)return this.stopAuto(); if(this.timer===null){this.autoStopped=false;var c=this;this.timer=window.setTimeout(function(){c.next()},this.options.auto*1E3)}},stopAuto:function(){this.pauseAuto();this.autoStopped=true},pauseAuto:function(){if(this.timer!==null){window.clearTimeout(this.timer);this.timer=null}},buttons:function(a,c){if(a==null){a=!this.locked&&this.options.size!==0&&(this.options.wrap&&this.options.wrap!="first"||this.options.size===null||this.last<this.options.size);if(!this.locked&&(!this.options.wrap||this.options.wrap== "first")&&this.options.size!==null&&this.last>=this.options.size)a=this.tail!==null&&!this.inTail}if(c==null){c=!this.locked&&this.options.size!==0&&(this.options.wrap&&this.options.wrap!="last"||this.first>1);if(!this.locked&&(!this.options.wrap||this.options.wrap=="last")&&this.options.size!==null&&this.first==1)c=this.tail!==null&&this.inTail}var b=this;if(this.buttonNext.size()>0){this.buttonNext.unbind(this.options.buttonNextEvent+".jcarousel",this.funcNext);a&&this.buttonNext.bind(this.options.buttonNextEvent+ ".jcarousel",this.funcNext);this.buttonNext[a?"removeClass":"addClass"](this.className("jcarousel-next-disabled")).attr("disabled",a?false:true);this.options.buttonNextCallback!==null&&this.buttonNext.data("jcarouselstate")!=a&&this.buttonNext.each(function(){b.options.buttonNextCallback(b,this,a)}).data("jcarouselstate",a)}else this.options.buttonNextCallback!==null&&this.buttonNextState!=a&&this.options.buttonNextCallback(b,null,a);if(this.buttonPrev.size()>0){this.buttonPrev.unbind(this.options.buttonPrevEvent+ ".jcarousel",this.funcPrev);c&&this.buttonPrev.bind(this.options.buttonPrevEvent+".jcarousel",this.funcPrev);this.buttonPrev[c?"removeClass":"addClass"](this.className("jcarousel-prev-disabled")).attr("disabled",c?false:true);this.options.buttonPrevCallback!==null&&this.buttonPrev.data("jcarouselstate")!=c&&this.buttonPrev.each(function(){b.options.buttonPrevCallback(b,this,c)}).data("jcarouselstate",c)}else this.options.buttonPrevCallback!==null&&this.buttonPrevState!=c&&this.options.buttonPrevCallback(b, null,c);this.buttonNextState=a;this.buttonPrevState=c},notify:function(a){var c=this.prevFirst===null?"init":this.prevFirst<this.first?"next":"prev";this.callback("itemLoadCallback",a,c);if(this.prevFirst!==this.first){this.callback("itemFirstInCallback",a,c,this.first);this.callback("itemFirstOutCallback",a,c,this.prevFirst)}if(this.prevLast!==this.last){this.callback("itemLastInCallback",a,c,this.last);this.callback("itemLastOutCallback",a,c,this.prevLast)}this.callback("itemVisibleInCallback", a,c,this.first,this.last,this.prevFirst,this.prevLast);this.callback("itemVisibleOutCallback",a,c,this.prevFirst,this.prevLast,this.first,this.last)},callback:function(a,c,b,d,f,j,e){if(!(this.options[a]==null||typeof this.options[a]!="object"&&c!="onAfterAnimation")){var g=typeof this.options[a]=="object"?this.options[a][c]:this.options[a];if(i.isFunction(g)){var k=this;if(d===undefined)g(k,b,c);else if(f===undefined)this.get(d).each(function(){g(k,this,d,b,c)});else{a=function(m){k.get(m).each(function(){g(k, this,m,b,c)})};for(var l=d;l<=f;l++)l!==null&&!(l>=j&&l<=e)&&a(l)}}}},create:function(a){return this.format("<li></li>",a)},format:function(a,c){a=i(a);for(var b=a.get(0).className.split(" "),d=0;d<b.length;d++)b[d].indexOf("jcarousel-")!=-1&&a.removeClass(b[d]);a.addClass(this.className("jcarousel-item")).addClass(this.className("jcarousel-item-"+c)).css({"float":this.options.rtl?"right":"left","list-style":"none"}).attr("jcarouselindex",c);return a},className:function(a){return a+" "+a+(!this.options.vertical? "-horizontal":"-vertical")},dimension:function(a,c){var b=a.jquery!==undefined?a[0]:a,d=!this.options.vertical?(b.offsetWidth||h.intval(this.options.itemFallbackDimension))+h.margin(b,"marginLeft")+h.margin(b,"marginRight"):(b.offsetHeight||h.intval(this.options.itemFallbackDimension))+h.margin(b,"marginTop")+h.margin(b,"marginBottom");if(c==null||d==c)return d;d=!this.options.vertical?c-h.margin(b,"marginLeft")-h.margin(b,"marginRight"):c-h.margin(b,"marginTop")-h.margin(b,"marginBottom");i(b).css(this.wh, d+"px");return this.dimension(b)},clipping:function(){return!this.options.vertical?this.clip[0].offsetWidth-h.intval(this.clip.css("borderLeftWidth"))-h.intval(this.clip.css("borderRightWidth")):this.clip[0].offsetHeight-h.intval(this.clip.css("borderTopWidth"))-h.intval(this.clip.css("borderBottomWidth"))},index:function(a,c){if(c==null)c=this.options.size;return Math.round(((a-1)/c-Math.floor((a-1)/c))*c)+1}});h.extend({defaults:function(a){return i.extend(q,a||{})},margin:function(a,c){if(!a)return 0; var b=a.jquery!==undefined?a[0]:a;if(c=="marginRight"&&i.browser.safari){var d={display:"block","float":"none",width:"auto"},f,j;i.swap(b,d,function(){f=b.offsetWidth});d.marginRight=0;i.swap(b,d,function(){j=b.offsetWidth});return j-f}return h.intval(i.css(b,c))},intval:function(a){a=parseInt(a,10);return isNaN(a)?0:a}});i.fn.jcarousel=function(a){if(typeof a=="string"){var c=i(this).data("jcarousel"),b=Array.prototype.slice.call(arguments,1);return c[a].apply(c,b)}else return this.each(function(){i(this).data("jcarousel", new h(this,a))})}})(jQuery);
diff --git a/plugins/picasa-albums/style.css b/plugins/picasa-albums/style.css
new file mode 100644
index 00000000..cef670a3
--- /dev/null
+++ b/plugins/picasa-albums/style.css
@@ -0,0 +1,13 @@
+#content .alignleft.picasa_image{
+ margin-right:10px;
+}
+.picasa_album_embed{
+ margin:10px 0;
+}
+#content .type-album .wp-caption {
+ margin:0 10px 10px 0;
+}
+
+
+/* clear fix*/
+.clear {clear: both;display: block;overflow: hidden;visibility: hidden;width: 0;height: 0;}.clearfix:after {clear: both;content:' ';display: block;font-size: 0;line-height: 0;visibility: hidden;width: 0;height: 0;}.clearfix {display: inline-block;}* html .clearfix {height: 1%;}.clearfix {display: block;} \ No newline at end of file