File size: 3.22Kb
<div class="valign pg_page_title">
<h4><span><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z"></path></svg></span>{{LANG my_downloads}}</h4>
</div>
<div class="explore-page-container">
<div class="explore-posts-container">
<?php
if ($context['transactions']) {
echo '<div class="explore-posts-container pg_store_posts">';
foreach ($context['transactions'] as $key => $post_data) {
$post_data['post_id'] = $post_data['item_data']['id'];
$post_data['price'] = $post_data['item_data']['price'];
$post_data['views'] = $post_data['item_data']['views'];
$post_data['sells'] = $post_data['item_data']['sells'];
$post_data['downloads'] = $post_data['item_data']['downloads'];
$post_data['created_date'] = $post_data['item_data']['created_date'];
$post_data['license'] = $post_data['item_data']['license'];
$post_data['category_name'] = $context['lang'][$post_data['item_data']['category']];
$post_data['type'] = 'image';
$post_data['thumb'] = $post_data['item_data']['small_file'];
$post_data['boosted'] = 0;
$post_data['avatar'] = $context['me']['avatar'];
$post_data['username'] = $context['me']['username'];
//var_dump($post_data);
include 'list-item.html';
}
echo '</div>';
} else{
include $context['dirname_theme'].'/store/templates/store/includes/no-posts-found.html';
}
?>
</div>
</div>
<?php
include $context['dirname_theme'].'/main/templates/includes/lazy-load.html';
?>
<script>
var myLazyLoad = new LazyLoad({
elements_selector: ".lazy_"
});
jQuery(document).ready(function($) {
var scrolled = 0;
var last_id = 0;
$(window).scroll(function() {
if($(window).scrollTop() + $(window).height() > $(document).height() - 100) {
if (scrolled == 0 && $('.explore-postset').length > 0) {
scrolled = 1;
var list_ids = $("div.explore-postset[id]").map(function() {
return $(this).attr('id');
}).get();
if (!list_ids) {
return false;
}
var last_id = Math.min.apply(Math,list_ids);
$.ajax({
url: link('store/explore-user-store'),
type: 'GET',
dataType: 'json',
data: {offset:last_id},
}).done(function(data) {
if (data.status == 200) {
$(".explore-posts-container").append(data.html);
scrolled = 0;
}
else{
$(window).unbind('scroll');
}
});
}
}
});
});
</script>