Files
Testing/browse_videos.php
sean 0e8a8b3028
Some checks are pending
deploy-testing / deploy (push) Waiting to run
Initial testing snapshot
2026-11-17 16:15:01 -05:00

244 lines
8.5 KiB
PHP

<?php
/* $Id: browse_videos.php 22 2009-01-16 05:50:49Z john $ */
$page = "browse_videos";
include "header.php";
// DISPLAY ERROR PAGE IF USER IS NOT LOGGED IN AND ADMIN SETTING REQUIRES REGISTRATION
if( !$user->user_exists && !$setting['setting_permission_video'] )
{
$page = "error";
$smarty->assign('error_header', 639);
$smarty->assign('error_message', 656);
$smarty->assign('error_submit', 641);
include "footer.php";
}
// DISPLAY ERROR FOR MEMBERS WITH INSUFFICIENT USER LEVEL
if ($user->user_info['user_level_id'] != 2&&$user->user_info['user_level_id'] != 7) :
header("Location: /premium.php?premiumonly=1");
exit;
endif;
function chaturbatead()
{
$url="https://chaturbate.com/api/public/affiliates/onlinerooms/?wm=jFpVD&client_ip=request_ip&gender=m&tag=bateworld&num_users=1";
$ch = curl_init();
// Set URL to download
curl_setopt($ch, CURLOPT_URL, $url);
// Include header in result? (0 = yes, 1 = no)
curl_setopt($ch, CURLOPT_HEADER, 0);
// Should cURL return or print out the data? (true = return, false = print)
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Timeout in seconds
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
// Download the given URL, and return output
$output = curl_exec($ch);
// Close the cURL resource, and free system resources
curl_close($ch);
$j=json_decode($output);
if($j->count==0){
$url="https://chaturbate.com/api/public/affiliates/onlinerooms/?wm=jFpVD&client_ip=request_ip&gender=m&num_users=1";
$ch = curl_init();
// Set URL to download
curl_setopt($ch, CURLOPT_URL, $url);
// Include header in result? (0 = yes, 1 = no)
curl_setopt($ch, CURLOPT_HEADER, 0);
// Should cURL return or print out the data? (true = return, false = print)
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Timeout in seconds
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
// Download the given URL, and return output
$output = curl_exec($ch);
// Close the cURL resource, and free system resources
curl_close($ch);
$j=json_decode($output);
}
/* ?>
<a href="<?php echo $j->results[0]->chat_room_url;?>" target="_blank"><img src="<?php echo $j->results[0]->image_url;?>"></a><br>
<a href="<?php echo $j->results[0]->chat_room_url_revshare;?>" target="_blank"><img src="<?php echo $j->results[0]->image_url;?>"></a><br>
*/?>
<div class="albums_browse_item1_img" >
<a href="<?php echo str_replace("chaturbate.com", "bateworld.chaturbate.com", $j->results[0]->chat_room_url);?>" target="_blank" style="position:relative;height: 100%; display: block;"><img src="<?php echo $j->results[0]->image_url;?>" ><span style="position: absolute;right: -1px;bottom: 0px;background: black;padding: 5px;"><i class="fa-solid fa-arrow-up-right-from-square"></i></span></a><br>
</div>
<div style="font-weight: bold; font-size: 13px; margin-top:5px;"><a href="<?php echo str_replace("chaturbate.com", "bateworld.chaturbate.com", $j->results[0]->chat_room_url);?>" target="_blank" STYLE="color:white;">Chaturbate</a></div>
<div style='font-weight: bold; font-size: 10px; margin-top:5px;'><a href="<?php echo str_replace("chaturbate.com", "bateworld.chaturbate.com", $j->results[0]->chat_room_url);?>" target="_blank"><?php echo $j->results[0]->username;?></a><div class="pull-right" style="font-size: 10px; font-weight:normal;"></div></div>
<?php
}
function chaturbatead1()
{
$url="https://chaturbate.com/api/public/affiliates/onlinerooms/?wm=jFpVD&client_ip=request_ip&gender=m&tag=bateworld&num_users=1";
$ch = curl_init();
// Set URL to download
curl_setopt($ch, CURLOPT_URL, $url);
// Include header in result? (0 = yes, 1 = no)
curl_setopt($ch, CURLOPT_HEADER, 0);
// Should cURL return or print out the data? (true = return, false = print)
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Timeout in seconds
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
// Download the given URL, and return output
$output = curl_exec($ch);
// Close the cURL resource, and free system resources
curl_close($ch);
$j=json_decode($output);
if($j->count==0){
$url="https://chaturbate.com/api/public/affiliates/onlinerooms/?wm=jFpVD&client_ip=request_ip&gender=m&num_users=1";
$ch = curl_init();
// Set URL to download
curl_setopt($ch, CURLOPT_URL, $url);
// Include header in result? (0 = yes, 1 = no)
curl_setopt($ch, CURLOPT_HEADER, 0);
// Should cURL return or print out the data? (true = return, false = print)
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Timeout in seconds
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
// Download the given URL, and return output
$output = curl_exec($ch);
// Close the cURL resource, and free system resources
curl_close($ch);
$j=json_decode($output);
}
/* ?>
<a href="<?php echo $j->results[0]->chat_room_url;?>" target="_blank"><img src="<?php echo $j->results[0]->image_url;?>"></a><br>
<a href="<?php echo $j->results[0]->chat_room_url_revshare;?>" target="_blank"><img src="<?php echo $j->results[0]->image_url;?>"></a><br>
*/?>
<div class="albums_browse_item1_img" >
<a href="<?php echo str_replace("chaturbate.com", "bateworld.chaturbate.com", $j->results[0]->chat_room_url);?>" target="_blank"><img src="<?php echo $j->results[0]->image_url;?>"></a><br>
</div>
<div style='font-weight: bold; font-size: 13px; margin-top:5px;'><a href="<?php echo str_replace("chaturbate.com", "bateworld.chaturbate.com", $j->results[0]->chat_room_url);?>" target="_blank"><?php echo $j->results[0]->username;?></a><div class="pull-right" style="font-size: 10px; font-weight:normal;"></div></div>
<?php
}
// PARSE GET/POST
if(isset($_POST['p'])) { $p = $_POST['p']; } elseif(isset($_GET['p'])) { $p = $_GET['p']; } else { $p = 1; }
if(isset($_POST['s'])) { $s = $_POST['s']; } elseif(isset($_GET['s'])) { $s = $_GET['s']; } else { $s = "video_datecreated DESC"; }
if(isset($_POST['v'])) { $v = $_POST['v']; } elseif(isset($_GET['v'])) { $v = $_GET['v']; } else { $v = 0; }
// ENSURE SORT/VIEW ARE VALID
if($s != "video_datecreated DESC" && $s != "video_views DESC" && $s != "video_cache_rating_weighted DESC") { $s = "video_dateupdated DESC"; }
if($v != "0" && $v != "1" && $v!="3") { $v = 0; }
// SET WHERE CLAUSE
$where = "video_search='1' AND se_videos.video_is_converted='1' AND
(CASE
WHEN se_videos.video_user_id='{$user->user_info['user_id']}'
THEN TRUE
"./*WHEN ((se_videos.video_privacy & @SE_PRIVACY_REGISTERED) AND '{$user->user_exists}'<>0)
THEN TRUE
"./*WHEN ((se_videos.video_privacy & @SE_PRIVACY_ANONYMOUS) AND '{$user->user_exists}'=0)
THEN TRUE*/
"
WHEN ((se_videos.video_privacy & @SE_PRIVACY_FRIEND) AND (SELECT TRUE FROM se_friends WHERE friend_user_id1=se_videos.video_user_id AND friend_user_id2='{$user->user_info['user_id']}' AND friend_status='1' LIMIT 1))
THEN TRUE
"./*WHEN ((se_videos.video_privacy & @SE_PRIVACY_SUBNET) AND '{$user->user_exists}'<>0 AND (SELECT TRUE FROM se_users WHERE user_id=se_videos.video_user_id AND user_subnet_id='{$user->user_info['user_subnet_id']}' LIMIT 1))
THEN TRUE*/"
WHEN ((se_videos.video_privacy & @SE_PRIVACY_FRIEND2))
THEN TRUE
ELSE FALSE
END)";
$where1 = "video_search='1' AND se_videos.video_is_converted='1' AND video_admin_approved='1' ";
// ONLY MY FRIENDS' VIDEOS
if($v == "1" && $user->user_exists) {
// SET WHERE CLAUSE
$where .= " AND (SELECT TRUE FROM se_friends WHERE friend_user_id1='{$user->user_info['user_id']}' AND friend_user_id2=se_videos.video_user_id AND friend_status=1)";
}
// CREATE VIDEO OBJECT
$video = new se_video();
// GET TOTAL VIDEOS
$total_videos = $video->video_total($where);
// MAKE ENTRY PAGES
$videos_per_page = 14;
$chaturbatead=rand(0, $videos_per_page);
$page_vars = make_page($total_videos, $videos_per_page, $p);
if($v==3){
$video_array = $video->randomvideos($where1);
$video_array=array_slice($video_array, 0, $videos_per_page);
}
//var_dump($signup_array); exit;
// GET VIDEO ARRAY
if($v==0||$v==1){
$video_array = $video->video_list_all($page_vars[0], $videos_per_page, $s, $where, 1);
}
for($x=$page_vars[1]; $x<=$page_vars[2]; $x++)
{
if(($page_vars[1]+4)==$x)
{break;}
$for[$y]=$x;
$y++;
}
$smarty->assign('chaturbatead', $chaturbatead);
$smarty->assign('ip', $_SERVER['REMOTE_ADDR']);
$smarty->assign('for', $for);
$smarty->assign_by_ref('signups', $signup_array);
// ASSIGN SMARTY VARIABLES AND DISPLAY VIDEOS PAGE
$smarty->assign('videos', $video_array);
$smarty->assign('total_videos', $total_videos);
$smarty->assign('p', $page_vars[1]);
$smarty->assign('maxpage', $page_vars[2]);
$smarty->assign('p_start', $page_vars[0]+1);
$smarty->assign('p_end', $page_vars[0]+count($video_array));
$smarty->assign('s', $s);
$smarty->assign('v', $v);
include "footer.php";
?>