Files
Testing/browse_albums.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

342 lines
12 KiB
PHP

<?php
/* $Id: browse_albums.php 42 2009-01-29 04:55:14Z john $ */
$page = "browse_albums";
include "header.php";
// DISPLAY ERROR PAGE IF USER IS NOT LOGGED IN AND ADMIN SETTING REQUIRES REGISTRATION
if( !$user->user_exists && !$setting['setting_permission_album'] )
{
$page = "error";
$smarty->assign('error_header', 639);
$smarty->assign('error_message', 656);
$smarty->assign('error_submit', 641);
include "footer.php";
}
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:10px;"><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>
</div>
<div style="font-weight: bold; font-size: 13px; margin-top:10px;"><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: 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 = "album_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 != "album_datecreated DESC" && $s != "album_dateupdated DESC") { $s = "album_dateupdated DESC"; }
if($v != "0" && $v != "1"&& $v != "2"&& $v != "3"&& $v != "4"&& $v != "5" && $v != "6" && $v != "7" && $v != "8") { $v = 0; }
if($v==0||$v==1){
//$database->database_query("SET @SE_PRIVACY_SELF = 1, @SE_PRIVACY_FRIEND = 2, @SE_PRIVACY_FRIEND2 = 4, @SE_PRIVACY_SUBNET = 8, @SE_PRIVACY_REGISTERED = 16, @SE_PRIVACY_ANONYMOUS = 32");
//echo "(SELECT * FROM se_albums LEFT JOIN se_users ON se_albums.album_user_id=se_users.user_id WHERE album_totalfiles>-1 AND se_users.user_enabled='1' AND se_albums.album_user_id='{$user->user_info['user_id']}') UNION (SELECT * FROM se_albums LEFT JOIN se_users ON se_albums.album_user_id=se_users.user_id WHERE album_totalfiles>-1 AND se_users.user_enabled='1' AND ((se_albums.album_privacy & @SE_PRIVACY_FRIEND) AND (SELECT TRUE FROM se_friends WHERE friend_user_id1=se_albums.album_user_id AND friend_user_id2='{$user->user_info['user_id']}' AND friend_status='1' LIMIT 1)))";
// SET WHERE CLAUSE
$where = "album_search=1 AND album_totalspace>0 AND album_totalfiles>0";
// CREATE ALBUM OBJECT
$album = new se_album();
// ONLY MY FRIENDS' ALBUMS
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_albums.album_user_id AND friend_status=1)";
}
if($v==0){
//$signup_array = $album->randomalbums($where);
}
// GET TOTAL ALBUMS
$total_albums = $album->album_total($where);
// MAKE ENTRY PAGES
$albums_per_page = 14;
$chaturbatead=rand(0, $albums_per_page);
$page_vars = make_page($total_albums, $albums_per_page, $p);
// GET ALBUM ARRAY
$album_array = $album->album_list($page_vars[0], $albums_per_page, $s, $where);
}
elseif($v==7){
//$database->database_query("SET @SE_PRIVACY_SELF = 1, @SE_PRIVACY_FRIEND = 2, @SE_PRIVACY_FRIEND2 = 4, @SE_PRIVACY_SUBNET = 8, @SE_PRIVACY_REGISTERED = 16, @SE_PRIVACY_ANONYMOUS = 32");
//echo "(SELECT * FROM se_albums LEFT JOIN se_users ON se_albums.album_user_id=se_users.user_id WHERE album_totalfiles>-1 AND se_users.user_enabled='1' AND se_albums.album_user_id='{$user->user_info['user_id']}') UNION (SELECT * FROM se_albums LEFT JOIN se_users ON se_albums.album_user_id=se_users.user_id WHERE album_totalfiles>-1 AND se_users.user_enabled='1' AND ((se_albums.album_privacy & @SE_PRIVACY_FRIEND) AND (SELECT TRUE FROM se_friends WHERE friend_user_id1=se_albums.album_user_id AND friend_user_id2='{$user->user_info['user_id']}' AND friend_status='1' LIMIT 1)))";
// SET WHERE CLAUSE
$where = "album_search=1 AND album_totalspace>0 AND album_totalfiles>0";
// CREATE ALBUM OBJECT
$album = new se_album();
// ONLY MY FRIENDS' ALBUMS
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_albums.album_user_id AND friend_status=1)";
}
if($v==0){
//$signup_array = $album->randomalbums($where);
}
// GET TOTAL ALBUMS
$total_albums = $album->album_total($where);
// MAKE ENTRY PAGES
$albums_per_page = 14;
$chaturbatead=rand(0, $albums_per_page);
$page_vars = make_page($total_albums, $albums_per_page, $p);
// GET ALBUM ARRAY
$album_array = $album->randomalbums($where);
$album_array=array_slice($album_array, 0, $albums_per_page);
}
elseif($v==6)
{
$cutdb=$database->database_query("SELECT media_id FROM se_media ORDER BY media_id DESC Limit 1");
$dblatest=$database->database_fetch_array($cutdb);
$offsethigh=15*$p;
$where = "album_search=1 AND se_users.user_enabled=1 ";
$album = new se_album();
if($v==3){
//$signup_array = $album->randomphotos($where);
}
// GET TOTAL FILES IN ALBUM
$total_albums = $album->list_files_count($where);
//echo $total_albums ;
$media_per_page = 14;
$chaturbatead=rand(0, $media_per_page);
$sortby = "media_id DESC";
// MAKE MEDIA PAGES
$page_vars = make_page($total_albums, $media_per_page, $p);
if(SE_DEBUG){
$where.=$whereadd;
//echo $where;
}
$album_array = $album->randomphotos($page_vars[0], $media_per_page, $sortby, $where, $select);
$album_array=array_slice($album_array, 0, $media_per_page);
$photospart=1;
$smarty->assign_by_ref('photospart', $photospart);
}
elseif($v==3||$v==4)
{
$cutdb=$database->database_query("SELECT media_id FROM se_media ORDER BY media_id DESC Limit 1");
$dblatest=$database->database_fetch_array($cutdb);
$offsethigh=15*$p;
$where = "album_search=1 AND se_users.user_enabled=1 ";
if($v == "4" && $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_albums.album_user_id AND friend_status=1)";
$where1.= " AND (SELECT TRUE FROM se_friends WHERE friend_user_id1='{$user->user_info['user_id']}' AND friend_user_id2=se_albums.album_user_id AND friend_status=1)";
}
$album = new se_album();
if($v==3){
//$signup_array = $album->randomphotos($where);
}
// GET TOTAL FILES IN ALBUM
$total_albums = $album->list_files_count($where);
//echo $total_albums ;
$media_per_page = 14;
$chaturbatead=rand(0, $media_per_page);
$sortby = "media_id DESC";
// MAKE MEDIA PAGES
$page_vars = make_page($total_albums, $media_per_page, $p);
if(SE_DEBUG){
$where.=$whereadd;
//echo $where;
}
$album_array = $album->list_files($page_vars[0], $media_per_page, $sortby, $where, $select);
$photospart=1;
$smarty->assign_by_ref('photospart', $photospart);
}
elseif($v==4)
{
$album = new se_album();
// GET TOTAL FILES IN ALBUM
$total_albums = $album->list_files_count();
//echo $total_albums ;
$media_per_page = 14;
$chaturbatead=rand(0, $media_per_page);
$sortby = "media_order ASC";
// MAKE MEDIA PAGES
$page_vars = make_page($total_albums, $media_per_page, $p);
$album_array = $album->list_files($page_vars[0], $media_per_page, $sortby, $where, $select);
$photospart=1;
$smarty->assign_by_ref('photospart', $photospart);
}
$y=0;
for($x=$page_vars[1]; $x<=$page_vars[2]; $x++)
{
if(($page_vars[1]+4)==$x)
{break;}
$for[$y]=$x;
$y++;
}
$smarty->assign_by_ref('chaturbatead', $chaturbatead);
//$signup_array = recent_signups();
$smarty->assign_by_ref('signups', $signup_array);
$smarty->assign('for', $for);
// ASSIGN SMARTY VARIABLES AND DISPLAY ALBUMS PAGE
$smarty->assign('albums', $album_array);
$smarty->assign('total_albums', $total_albums);
$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($album_array));
$smarty->assign('s', $s);
$smarty->assign('v', $v);
include "footer.php";
?>