47
47
curl_setopt ($ ch , CURLOPT_RETURNTRANSFER , 1 );
48
48
$ response = json_decode (curl_exec ($ ch ));
49
49
$ photos = property_exists ($ response , 'data ' ) ? $ response ->data : array ();
50
- $ next_max_id = property_exists ($ response , 'pagination ' ) ? $ response ->pagination ->next_max_id : NULL ;
50
+ $ next_min_id = property_exists ($ response , 'pagination ' ) ? $ response ->pagination ->next_min_id : NULL ;
51
51
52
52
/*
53
53
@@ -98,7 +98,7 @@ class="button"
98
98
</p>
99
99
</div>
100
100
101
- <ul id="photos" data-next-max -ID="<?= $ next_max_id ?> ">
101
+ <ul id="photos" data-next-min -ID="<?= $ next_min_id ?> ">
102
102
103
103
<?php foreach ($ photos as $ photo ): ?>
104
104
<li>
@@ -155,7 +155,7 @@ class="login button">Login →</a>
155
155
pusher = new Pusher('<?= $ pusher_key?> '),
156
156
channel = pusher.subscribe('photos'),
157
157
photos = $('photos'),
158
- max_ID = photos.data('next-max -ID');
158
+ min_ID = photos.data('next-min -ID');
159
159
160
160
channel.bind('new-photo', function(data){
161
161
@@ -182,7 +182,7 @@ class="login button">Login →</a>
182
182
{
183
183
'access_token': '<?= $ token?> ',
184
184
'count': 16,
185
- 'max_id ': max_ID
185
+ 'min_id ': min_ID
186
186
}
187
187
)
188
188
.done(function(response){
@@ -191,8 +191,8 @@ class="login button">Login →</a>
191
191
delay = 0,
192
192
anim_speed = 400;
193
193
194
- // Sets the new max ID for loading images
195
- max_ID = pagination.next_max_id ;
194
+ // Sets the new min ID for loading images
195
+ min_ID = pagination.next_min_id ;
196
196
197
197
for (x in new_photos) {
198
198
var photoCont = $("#photos"),
@@ -207,12 +207,12 @@ class="login button">Login →</a>
207
207
html: img
208
208
})
209
209
.hide()
210
+ .delay(delay)
210
211
.prependTo($("#photos"))
211
212
.append($('<strong />'), {
212
213
text: 'Photo by ' + photo.user.username
213
214
})
214
215
.wrap('<li />')
215
- .delay(delay)
216
216
.show(anim_speed);
217
217
218
218
delay += anim_speed;
0 commit comments