-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
68 lines (45 loc) · 1.43 KB
/
index.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
<?php
$this_page = "home";
$page = isset($_GET['page']) ? $_GET['page'] : 1;
require_once('lib/phpFlickr.php');
require_once('config/config.php');
$f = new phpFlickr($config["key"]);
$f->enableCache("fs", "cache");
$result = $f->people_findByUsername($config["username"]);
$nsid = $result["id"];
$photos = $f->people_getPublicPhotos($nsid, NULL, NULL, $config['photos_per_page'], $page);
$pages = $photos["photos"]["pages"];
$total = $photos["photos"]["total"];
?>
<?php require_once("inc/doc-head.php"); ?>
<body class="home">
<?php require_once("inc/header.php"); ?>
<section class="main" role="main">
<header class="page-header">
<h1>Recent Photos</h1>
<nav class="paging cf">
<p>Page <?php echo $page;?> of <?php echo $pages; ?></p>
<ul>
<?php
$prev = $page - 1;
$next = $page + 1;
if($page > 1) { ?>
<li class="newer"><a class="button" href="?page=<?php echo $prev; ?>"><span>Newer</span></a></li>
<?php }
// if not last page
if($page != $pages) { ?>
<li class="older"><a class="button" href="?page=<?php echo $next; ?>"><span>Older</span></a></li>
<?php } ?>
</ul>
</nav> <!-- paging -->
</header>
<ul class="thumbs cf">
<?php
foreach ($photos['photos']['photo'] as $photo) {
include ("inc/snippet-thumbs.php");
} ?>
</ul><!-- thumbs -->
</section> <!-- main -->
<?php require_once ("inc/footer.php"); ?>
</body>
</html>