if (isset($_REQUEST[WpEspritPicasa::$REQUEST_PARAMETER_ALBUM_ID])) { $albumId = $_REQUEST[WpEspritPicasa::$REQUEST_PARAMETER_ALBUM_ID]; } $tab = $_REQUEST[WpEspritPicasa::$REQUEST_PARAMETER_TAB]; $html = "<div id=\"PicasaWrapper\">"; $i = 0; if (is_null($albumId)) { $account = $picasa->getAlbumsByUsername(get_option(WpEspritPicasa::$WP_OPTION_USERNAME), null, null, null, $albumThumbnailSize . "c"); foreach ($account->getAlbums() as $album) { $html .= $i % $albumsPerRow == 0 ? "<div class=\"row\">\n" : ""; $html .= " <div class=\"PicasaAlbums\">\n"; $html .= " <a href=\"" . $_SERVER["PHP_SELF"] . "?" . $uriParams . "&" . WpEspritPicasa::$REQUEST_PARAMETER_ALBUM_ID . "=" . $album->getIdnum() . "\">\n"; $html .= " <img src=\"" . $album->getIcon() . "\" width=\"" . $albumThumbnailSize . "px\" height=\"" . $albumThumbnailSize . "px\">\n"; $html .= " </a>\n"; $html .= " <h5>" . $album->getTitle() . "</h5>\n"; $html .= " <p>" . WpEspritPicasa::gDate('D jS F Y', $album->getTimestamp()) . " (photos: " . $album->getNumphotos() . ")</p>\n"; $html .= " </div>\n"; if (($i + 1) % $albumsPerRow == 0) { $html .= "</div>\n"; $html .= "<div class='clear'><br></div>"; } $i++; } } else { $javascript = "<script type='text/javascript'>\n"; $html .= "<div id=\"PicasaNavigation\">\n"; $html .= " <a href=\"" . $_SERVER["PHP_SELF"] . "?" . $uriParams . "\">Back to Albums</a>\n"; $html .= " <div class='clear'><br></div>\n"; $html .= "</div>"; $images = $picasa->getAlbumById(get_option(WpEspritPicasa::$WP_OPTION_USERNAME), $albumId, null, null, null, null, $albumThumbnailSize . "c," . get_option(WpEspritPicasa::$WP_OPTION_THUMBNAIL_SIZE) . "," . get_option(WpEspritPicasa::$WP_OPTION_FULL_SIZE) . "," . get_option(WpEspritPicasa::$WP_OPTION_PEREX_SIZE))->getImages(); $javascript .= "var picasaImagesArray = new Array();\n";
function wpPicasaTheExcerpt($content) { global $post; $newContent = ""; $style = ""; $beginning = ""; $end = ""; $customFields = get_post_custom($post->ID); if ($customFields[WpEspritPicasa::$WP_META_PEREX_URL][0] != "") { switch (get_option(WpEspritPicasa::$WP_OPTION_PEREX_POSITION)) { case 'left': $style = " class=\"alignleft\""; break; case 'right': $style = " class=\"alignright\""; break; case 'center': $beginning = "<p style=\"text-align: center;\">\n"; $end = "</p>\n"; } $newContent .= $beginning; $newContent .= "<a href=\"" . WpEspritPicasa::getPicasaImageUrl($customFields[WpEspritPicasa::$WP_META_PEREX_URL][0]) . "\""; $newContent .= $customFields[WpEspritPicasa::$WP_META_PEREX_DESCRIPTION][0] != "" ? " title=\"" . $customFields[WpEspritPicasa::$WP_META_PEREX_DESCRIPTION][0] . "\"" : ""; $newContent .= " rel=\"lightbox\">\n"; $newContent .= "<img" . $style . " src=\"" . $customFields[WpEspritPicasa::$WP_META_PEREX_URL][0] . "\""; $newContent .= $customFields[WpEspritPicasa::$WP_META_PEREX_DESCRIPTION][0] != "" ? " alt=\"" . $customFields[WpEspritPicasa::$WP_META_PEREX_DESCRIPTION][0] . "\"" : ""; $newContent .= $customFields[WpEspritPicasa::$WP_META_PEREX_TITLE][0] != "" ? " title=\"" . $customFields[WpEspritPicasa::$WP_META_PEREX_TITLE][0] . "\"" : ""; $newContent .= " class=\"wpPicasaPerex\">\n"; $newContent .= "</a>\n"; $newContent .= $end; } $newContent .= $content; return $newContent; }