root/albumembed/example.php

Revision 280, 6.2 KB (checked in by m, 21 months ago)

IE6 Layout fixes.

  • Property svn:keywords set to Id Rev
Line 
1<?php
2
3    // +----------------------------------------------------------------------+
4    // | Embed a Picasa Web album in your website                             |
5    // +----------------------------------------------------------------------+
6    // | Copyright (C) 2006 Markus Tacker <m@tacker.org>                      |
7    // +----------------------------------------------------------------------+
8    // | This library is free software; you can redistribute it and/or        |
9    // | modify it under the terms of the GNU Lesser General Public           |
10    // | License as published by the Free Software Foundation; either         |
11    // | version 2.1 of the License, or (at your option) any later version.   |
12    // |                                                                      |
13    // | This library is distributed in the hope that it will be useful,      |
14    // | but WITHOUT ANY WARRANTY; without even the implied warranty of       |
15    // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU    |
16    // | Lesser General Public License for more details.                      |
17    // |                                                                      |
18    // | You should have received a copy of the GNU Lesser General Public     |
19    // | License along with this library; if not, write to the                |
20    // | Free Software Foundation, Inc.                                       |
21    // | 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA               |
22    // +----------------------------------------------------------------------+
23
24    /**
25    * Embed a Picasa Web album in your website
26    *
27    * @package AlbumEmbed
28    * @author Markus Tacker <m@tacker.org>
29    * @version $Id$
30    */
31
32    require_once 'AlbumEmbed.php';
33    require_once 'HTML/Page2.php';
34
35    $rss_url = 'http://picasaweb.google.com/data/feed/base/user/m.tacker.org/albumid/5002578314588389393?category=photo&alt=rss';
36    $rss2_url = 'http://picasaweb.google.com/data/feed/base/user/m.tacker.org/albumid/4965635415607345169?category=photo&alt=rss&hl=en_US';
37
38    $HTML = new HTML_Page2('doctype="XHTML 1.1"');
39    // The prototype library is required
40    $HTML->addScript('prototype-1.4.0.js');
41    $HTML->addStyleDeclaration('
42        body { font-size: 0.6em; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 1.5em; color: #666666; margin: 20px; width: 550px; }
43        a { color: #ff0033; }
44        /* The AlbumEmbed code is plain. You may easily apply your own styles. */
45        div.albumembed { float: right; clear: right; margin: 0 0 10px 10px; text-align: center; border: 1px solid #aaa; }
46        div.albumembed div.box { margin: 12px 0 0 0; }
47        div.albumembed img { border: 1px solid #666666; background-color: #000; padding: 0; margin: 0; }
48        div.albumembed p { margin: 0 0 12px 0; clear: both; }
49        div.albumembed p.caption { margin: 12px 12px 0 12px; font-style: italic; clear: both; }
50        div.albumembed ul { list-style: none; margin: 0; padding: 0; }
51        div.albumembed li { margin: 0; padding: 0; float: left; }
52        div.albumembed li.prev, div.albumembed li.next { color: #A00000; cursor: pointer; font-weight: bold; width: 12px; margin: 0; padding: 0;  }
53        div.albumembed li.prev:hover, div.albumembed li.next:hover { background-color: #f0f0f0; }
54        div.albumembed-gallery2 div.portrait { width: 214px; }
55        div.albumembed-gallery2 div.portrait li.prev { height: 252px; line-height: 252px; }
56        div.albumembed-gallery2 div.portrait li.next { height: 252px; line-height: 252px; }
57        div.albumembed-gallery2 div.portrait img { width: 188px; height: 250px; }
58        div.albumembed-gallery2 div.landscape { width: 276px; }
59        div.albumembed-gallery2 div.landscape li.prev { height: 190px; line-height: 190px; }
60        div.albumembed-gallery2 div.landscape li.next { height: 190px; line-height: 190px; }
61        div.albumembed-gallery2 div.landscape img { width: 250px; height: 188px; }
62        div.albumembed-picasa div.portrait { width: 214px; }
63        div.albumembed-picasa div.portrait li.prev { height: 252px; line-height: 252px; }
64        div.albumembed-picasa div.portrait li.next { height: 252px; line-height: 252px; }
65        div.albumembed-picasa div.portrait img { width: 188px; height: 250px; }
66        div.albumembed-picasa div.landscape { width: 314px; }
67        div.albumembed-picasa div.landscape li.prev { height: 218px; line-height: 218px; }
68        div.albumembed-picasa div.landscape li.next { height: 218px; line-height: 218px; }
69        div.albumembed-picasa div.landscape img { width: 288px; height: 216px; }
70    ');
71
72    // Add some dummy-content
73    $dummy_content = '<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum.</p>';
74
75    $HTML->addBodyContent('<h1>AlbumEmbed Demo</h1>');
76    $HTML->addBodyContent(AlbumEmbed::getContainer($rss_url));
77    $HTML->addBodyContent($dummy_content);
78    $HTML->addBodyContent($dummy_content);
79    $HTML->addBodyContent(AlbumEmbed::getContainer($rss2_url));
80    $HTML->addBodyContent($dummy_content);
81    $HTML->addBodyContent($dummy_content);
82    $HTML->display();
83
84?>
Note: See TracBrowser for help on using the browser.