File: //usr/src/mechbunny/templates/default_tube2016/template.aweblacklabel.php
<?php
//prepare category
if($_GET['category']) {
$thisCategory = htmlentities($_GET['category']);
} else {
$thisCategory = $blacklabel['blacklabel_category'];
}
//prepare searchText (subcategory)
if($_GET['searchText']) {
$thisSearchText = htmlentities($_GET['searchText']);
} else {
$thisSearchText = ""; //implode(" ",$blacklabel['blacklabel_subcategory_'.$thisCategory]);
}
//prepare pagination
if($_GET['thisPageSize']) {
$thisPageSize = (int)$_GET['thisPageSize'];
} else {
$thisPageSize = (int)$blacklabel['blacklabel_pagesize'];
}
//prepare translation api usage
if($blacklabel['blacklabel_use_translation_api']) {
$thisUserApiTranslation = 1;
} else {
$thisUserApiTranslation = 0;
}
/*
echo "<div>";
echo "?category=".$thisCategory."&searchText=".$thisSearchText."&pageSize=".$thisPageSize."&useApiTranslation=".$thisUserApiTranslation;
echo "</div>";
*/
$performers = aweBlacklabelCurlRequest('performers',"?category=".$thisCategory."&searchText=".$thisSearchText."&pageSize=".$thisPageSize."&useApiTranslation=".$thisUserApiTranslation);
if(!is_array($performers['data']['performers']) || count($performers['data']['performers']) == 0 ) {
echo "No live performers found.";
} else {
foreach($performers['data']['performers'] as $row) {
getTemplate("awe_blacklabel/template.content_item_aweblacklabel.php");
}
}
?>
<?
if($performers['data']['isLastPage'] != true) {
$listPageId = $performers['data']['listPageId'];
$container = "aweLoadMore".time();
?>
<div id='<? echo $container; ?>'>
<div style='clear: both;'>
<a id='aweLoadMoreBtn' href="#" class="btn -default btn-default">
<span class="btn__label">Show More</span>
</a>
</div>
<script>
$( "#aweLoadMoreBtn" ).click(function( event ) {
event.preventDefault();
console.log("More clicked...");
$("#<? echo $container; ?>").load("<? echo $basehttp; ?>/live-webcams/loadMore/<? echo $performers['data']['listPageId']; ?>&container=<? echo $container; ?>")
});
</script>
</div>
<?
}
?>
<? if($_GET['paymentCallback'] == 1) { ?>
<script>
$( document ).ready(function() {
var modalUrl = "<? echo $basehttp; ?>/live-webcams/loadMaster/<? echo $_SESSION['aweBlacklabelLastViewedModel']; ?>";
$.get(modalUrl, function(html) {
$("#aweblacklabelModal").html(html).jModal();
});
});
</script>
<? } ?>