-
Notifications
You must be signed in to change notification settings - Fork 0
/
catalog.php
85 lines (63 loc) · 2.2 KB
/
catalog.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
75
76
77
78
79
80
81
82
83
84
85
<?php
// ini_set('display_errors', 1);
// ini_set('display_startup_errors', 1);
// error_reporting(E_ALL);
include 'arena.php';
$arena = new Arena();
$page = $arena->set_page(); // this checks if page is set, if not sets page to 1
$per = 24; // how many items per page
$slug = 'blend-is-beautiful'; // channel slug (e.g. http://are.na/arena-influences)
$channel = $arena->get_channel($slug, array('page' => $page, 'per' => $per));
?>
<!DOCTYPE html>
<html>
<head>
<title><?= $channel->title; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="assets/css/app.css" type="text/css">
</head>
<body>
<nav id="options">
<a href="index.php">Blend</a>
<a href="catalog.php" class="current">Catalog</a>
</nav>
<div class="pagination">
<?php $channel->each_page($page, function($num, $current_page){ ?>
<?php if($num == $current_page){ ?>
<span class="current"><?= $num ?></span>
<?php }else{ ?>
<a href="?page=<?= $num ?>"><?= $num ?></a>
<?php } ?>
<?php }); ?>
</div>
<div class="container">
<!-- start looping through channel items and provide each type of block -->
<!-- (image, embed, link, text, attachment, channel) with a template -->
<div class="images">
<?php $channel->each_item(function($item) {?>
<?php if($item->is_image()) { ?>
<a class="image" href="lightbox.php?id=<?= $item->id ?> ">
<img src="<?= $item->image_url('display') ?>" />
</a>
<?php } ?>
<?php if($item->is_embed()){ ?>
<div class="video">
<?= $item->embed['html'] ?>
</div>
<?php } ?>
<?php }); ?>
</div>
<!-- end channel loop -->
<p class="ltb"></p>
<div class="pagination">
<?php $channel->each_page($page, function($num, $current_page){ ?>
<?php if($num == $current_page){ ?>
<span class="current"><?= $num ?></span>
<?php }else{ ?>
<a href="?page=<?= $num ?>"><?= $num ?></a>
<?php } ?>
<?php }); ?>
</div>
</div>
</body>
</html>