-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfacebook-cdn-photo-gallery.php
74 lines (60 loc) · 1.69 KB
/
facebook-cdn-photo-gallery.php
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
/**
* @copyright Copyright (c) 2011, Stephen Reese
* @license http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)
* @policy See facebooks policy to ensure you abide by their TOS https://developers.facebook.com/policy/
*/
require 'facebook.php';
/**
* Create an application instance on Facebook developers.
* Replace with your own values.
*/
$facebook = new Facebook(array(
'appId' => '1234567890',
'secret' => '1234567890',
'cookie' => true,
));
?>
<!doctype html>
<html xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<title>Photos</title>
<style>
body {
font-family: 'Lucida Grande', Verdana, Arial, sans-serif;
}
h1 a {
text-decoration: none;
color: #3b5998;
}
h1 a:hover {
text-decoration: underline;
}
</style>
</head>
<body>
<?php
// Replace these with you values.
$page_id = '1234567890';
$album_id = '1234567890';
$albums = $facebook->api('/'.$page_id.'/albums?access_token='.$session['access_token']);
$photos = $facebook->api('/'.$album_id.'/photos?access_token='.$session['access_token']);
echo "<h3>{$albums['data'][0]['name']}</h3>";
echo "<h3>{$albums['data'][0]['count']} Photos</h3>";
foreach ($photos['data'] as $fbdata) {
echo "<img src=\"{$fbdata['images'][1][source]}\"></a>\n";
echo '<br><br>';
}
foreach ($photos['data'] as $fbdata) {
echo "<img src=\"{$fbdata['source']}\"></a>\n";
echo '<br>';
echo "{$fbdata['name']}";
echo '<br><br>';
}
?>
<!-- Album information -->
<pre><?php print_r($albums); ?></pre>
<!-- Photo information -->
<pre><?php print_r($photos); ?></pre>
</body>
</html>