This repository was archived by the owner on Jan 22, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathexample-popular.php
More file actions
46 lines (45 loc) · 1.44 KB
/
example-popular.php
File metadata and controls
46 lines (45 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
/* Last updated with phpZenfolio 2.0.0
*
* This example file shows you how to get a list of the 96 most popular public
* galleries created on Zenfolio.
*
* You'll need to set:
*
* - $appname to your application name, version and URL
*
* The application name and version is required, but there is no required format.
* See the README.md for a suggested format.
*/
$appname = 'YOUR_APP_NAME/VER (URL)';
?>
<html>
<head>
<title>phpZenfolio Popular Sets Example</title>
<style type="text/css">
body { background-color: #fff; color: #444; font-family: sans-serif; }
div { width: 750px; margin: 0 auto; text-align: center; }
img { border: 0;}
</style>
</head>
<body>
<div>
<a href="https://phpzenfolio.com"><img src="phpZenfolio-logo.png" /></a>
<h2>phpZenfolio Popular Sets Example</h2>
<?php
require_once 'vendor/autoload.php';
try {
$client = new phpZenfolio\Client($appname);
// Get list of recent galleries
$galleries = $client->GetPopularSets('Gallery', 0, 96);
// Display the 60x60 cropped thumbnails and link to the gallery page for each.
foreach ($galleries as $gallery) {
echo '<a href="'.$gallery->PageUrl.'"><img src="'.phpZenfolio\Client::imageUrl($gallery->TitlePhoto, 1).'" title="'.$gallery->Title.'" alt="'.$gallery->Id.'" width="60" height="60" /></a>';
}
} catch (Exception $e) {
echo "{$e->getMessage()} (Error Code: {$e->getCode()})";
}
?>
</div>
</body>
</html>