File: /home/httpd/html/baretube.com.new/controllers/control.aweonlinecams.php
<?php
$page = (isset($_GET['page']) && is_numeric($_GET['page'])) ? (int) $_GET['page'] : 1;
$max_results = $results_per_page;
$from = ($page * $max_results) - $max_results;
if(isset($_SERVER["HTTP_CF_CONNECTING_IP"])){
$ipAddress = $_SERVER["HTTP_CF_CONNECTING_IP"];
} else{
$ipAddress = $_SERVER['REMOTE_ADDR'];
}
$data = file_get_contents("https://pt.ptawe.com/api/video-promotion/v1/list?category=girl&clientIp=".$ipAddress."&limit=".$results_per_page."&pageIndex=1&psid=".$AWEmpirePSID."&accessKey=".$AWEmpireAccessKey."&primaryColor=".$AWEmpirePrimaryColor."&labelColor=".$AWEmpireLabelColor."&cobrandId=".$cobrandId."&site=".$site);
$json = json_decode($data,true);
//echo "<pre>";
//print_r($json);
$total_results = $json['data']['pagination']['total'];
$data = file_get_contents("https://pt.ptawe.com/api/video-promotion/v1/list?category=girl&clientIp=".$ipAddress."&limit=".$results_per_page."&pageIndex=".$page."&psid=".$AWEmpirePSID."&accessKey=".$AWEmpireAccessKey."&primaryColor=".$AWEmpirePrimaryColor."&labelColor=".$AWEmpireLabelColor."&cobrandId=".$cobrandId."&site=".$site);
$json = json_decode($data,true);
if(!is_array($json)) {
echo "An error has occured while fetching the feed. ".$data;
} else {
$counter = 0;
foreach($json['data']['videos'] as $i) {
$results[$counter]['id'] = $i['id'];
$results[$counter]['title'] = $i['title'];
$results[$counter]['length'] = $i['duration'];
$results[$counter]['keywords'] = implode(",",$i['tags']);
$results[$counter]['thumbnail'] = $i['thumbImage'];
$results[$counter]['submitter'] = $i['uploader'];
$results[$counter]['rating'] = rand(75,100);
$results[$counter]['views'] = rand(100,10000);
if($i['quality'] == 'sd') { //fake the movie height for hd tags on templates, which are typically based on if statement using $rrow[movie_height]
$results[$counter]['movie_height'] = '480';
} else {
$results[$counter]['movie_height'] = '720';
}
$counter++;
}
}
$total_pages = ceil($total_results / $max_results);
$ads = getAds($homepagePaysite);