| Server IP : 10.200.247.200 / Your IP : 216.73.217.19 Web Server : Apache System : Linux synergy-usa-sites 6.8.0-138-generic #138-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 31 22:41:49 UTC 2026 x86_64 User : jeremy ( 1001) PHP Version : 8.4.25 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/church_sites/southgatestake.com/ |
Upload File : |
<?php
/*if(strtotime(date('Y-m-d')) <= strtotime('2023-05-27')) {
header("Location: http://southgate.southgatestake.com/index.php?password=52952&submit=Submit");
exit(0);
}*/
require_once($_SERVER['DOCUMENT_ROOT'].'/includes/mysql.php');
$res = $db->get_results("SELECT youtube_url,twitch_id,private_server FROM church_livestream.southgate_stake WHERE domain='".str_replace('www.','',$db->clean($_SERVER['HTTP_HOST']))."'");
//if(empty($res[0]->private_server)) {
if( !isset($_SERVER['HTTPS'] ) ) {
$url = 'https://'.$_SERVER['SERVER_NAME'];
header("Location: {$url}");
exit(0);
}
/*} else {
if( isset($_SERVER['HTTPS'] ) ) {
$url = 'http://'.$_SERVER['SERVER_NAME'];
header("Location: {$url}");
exit(0);
}
}*/
//check if the status is off
$camera_turned_on = '0';
$res = $db->get_results("SELECT camera_turned_on
FROM church_livestream.southgate_stake
WHERE domain='".$db->clean($_SERVER['HTTP_HOST'])."'");
if(!empty($res)) {
$camera_turned_on = (empty($res[0]->camera_turned_on)) ? '0' : '1';
}
if(!empty($_POST['check_for_camera_status'])) {
die($camera_turned_on);
}
$db->query("INSERT INTO church_livestream.southgate_stake_tracking
(
site
,ip_address
,ts
,user_id
) VALUES (
'southgate_stake'
,'".$db->clean($_SERVER['REMOTE_ADDR'])."'
,NOW()
,'0'
)");
ob_start();
include 'includes/autoload.php';
$page = 'Southgate';
$popup_title = 'Southgate Live';
?>
<script type="text/javascript">
var camera_turned_on = '<?= $camera_turned_on;?>';
function check_is_camera_turned_on() {
var str = 'check_for_camera_status=1';
$.ajax({
url:"index.php",
cache: false,
type: "POST",
data: str,
success: function(results) {
if(results!=camera_turned_on) {
window.location.reload();
} else {
window.setTimeout(function() { check_is_camera_turned_on(); },3000);
}
},
error: function(jqXHR, textStatus, errorThrown) {
}
});
}
window.setTimeout(function() { check_is_camera_turned_on(); },3000);
</script>
<style>
.videoWrapper {
position: relative;
padding-bottom: 56.25%; /* 16:9 */
height: 0;
z-index:2;
}
.videoWrapper iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index:3;
}
#twitch_blocked_out {
width:85px;
height:50px;
position:absolute;
bottom:0px;
right:0px;
background:#9a8758 url(/img/hearhimsmall.jpg) center center no-repeat;
z-index:10;
}
#twitch_blocked_out2 {
width:274px;
height:156px;
position:absolute;
top:0px;
left:0px;
background:transparent;
z-index:10;
}
.feedback_form_holder {
position:relative;
z-index:1;
margin-top:-100px;
}
.feedback_form_holder iframe {
position:relative;
z-index:1;
}
</style>
<center style="margin-bottom:10px;">
<p><i>To hear the audio, click the "unmute" button in the bottom left-hand corner of this screen. If the connection times out, please refresh your browser.</i></p>
<div class="videoWrapper">
<?php
$res = $db->get_results("SELECT youtube_url,twitch_id,private_server FROM church_livestream.southgate_stake WHERE domain='".str_replace('www.','',$db->clean($_SERVER['HTTP_HOST']))."'");
if(!empty($res)) {
if($camera_turned_on=='1') {
if(!empty($res[0]->youtube_url)) {
?>
<iframe width="424" height="240" src="<?= $res[0]->youtube_url;?>" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<?php
} elseif(!empty($res[0]->twitch_id)) {
?>
<div id="twitch-embed"></div>
<script src="https://embed.twitch.tv/embed/v1.js"></script>
<script type="text/javascript">
var player = null;
var embed = new Twitch.Embed("twitch-embed", { width: 854, height: 480, channel: "<?= $res[0]->twitch_id;?>", layout: "video", theme: "dark" });
embed.addEventListener(Twitch.Embed.VIDEO_READY, () => {
player = embed.getPlayer();
player.play();
});
</script>
<div id="twitch_blocked_out" onclick="if(player!=null) { player.play(); }"></div>
<div id="twitch_blocked_out2" onclick="if(player!=null) { player.play(); }"></div>
<?php
} elseif(!empty($res[0]->private_server)) {
if($res[0]->private_server=='castr_manzanita') {
?>
<iframe src="https://player.castr.com/live_97d302d0ed5b11efb94f430b9af73333" width="100%" style="aspect-ratio: 16/9; min-height: 340px;" frameborder="0" scrolling="0" allow="autoplay" allowfullscreen></iframe>
<?php
} elseif($res[0]->private_server=='castr_southgate') {
?>
<iframe src="https://player.castr.com/live_0a87e520ed6611efb94f430b9af73333" width="100%" style="aspect-ratio: 16/9; min-height: 340px;" frameborder="0" scrolling="0" allow="autoplay" allowfullscreen></iframe>
<?php
} elseif($res[0]->private_server=='castr_mulberry') {
?>
<iframe src="https://player.castr.com/live_c82a5010f3ae11efa602d36d13f8831b" width="100%" style="aspect-ratio: 16/9; min-height: 340px;" frameborder="0" scrolling="0" allow="autoplay" allowfullscreen></iframe>
<?php
} else {
//check if it's off
$is_off = 0;
$context = stream_context_create(['http' => ['ignore_errors' => true,'timeout' => 3]]);
$result = file_get_contents("https://easyrtps.com:8888/".$res[0]->private_server, false, $context);
foreach($http_response_header as $r) {
if($r=='HTTP/1.0 404 Not Found') {
$is_off = 1;
}
}
if($is_off) {
?><p>It looks like the camera is not turned on yet. Please refresh the page in a few minutes.</p><?php
} else {
?>
<iframe src="https://easyrtps.com:8888/<?= $res[0]->private_server;?>" scrolling="no"></iframe>
<?php
}
}
}
} else {
?>
<div style="font-size:18px;">The Live Stream will resume after the Sacrament</div>
<div><img src="/img/sacrament.jpg" style="max-width:80%;" /></div>
<?php
}
}
?>
</div>
<script src="https://form.jotform.com/s/umd/latest/for-cardform-feedback-embed.js"></script>
<script>
new JF_FeedbackEmbedButton({
buttonIcon: "default",
buttonFontColor: "#FFFFFF",
buttonBackgroundColor: "#007FEF",
formId: 202625549848971
,
buttonText: "Troubleshooting",
buttonSide: "Bottom",
buttonAlign: "Right",
base: "https://form.jotform.com/",
});
</script>
<script type="text/javascript">
var ifr = document.getElementById("lightbox-202625549848971");
if (ifr) {
var src = ifr.src;
var iframeParams = [];
if (window.location.href && window.location.href.indexOf("?") > -1) {
iframeParams = iframeParams.concat(window.location.href.substr(window.location.href.indexOf("?") + 1).split('&'));
}
if (src && src.indexOf("?") > -1) {
iframeParams = iframeParams.concat(src.substr(src.indexOf("?") + 1).split("&"));
src = src.substr(0, src.indexOf("?"))
}
iframeParams.push("isIframeEmbed=1");
ifr.src = src + "?" + iframeParams.join('&');
}
window.handleIFrameMessage = function(e) {
if (typeof e.data === 'object') { return; }
var args = e.data.split(":");
if (args.length > 2) { iframe = document.getElementById("lightbox-" + args[(args.length - 1)]); } else { iframe = document.getElementById("lightbox"); }
if (!iframe) { return; }
switch (args[0]) {
case "scrollIntoView":
iframe.scrollIntoView();
break;
case "setHeight":
iframe.style.height = args[1] + "px";
if (!isNaN(args[1]) && parseInt(iframe.style.minHeight) > parseInt(args[1])) {
iframe.style.minHeight = args[1] + "px";
}
break;
case "collapseErrorPage":
if (iframe.clientHeight > window.innerHeight) {
iframe.style.height = window.innerHeight + "px";
}
break;
case "reloadPage":
window.location.reload();
break;
case "loadScript":
if( !window.isPermitted(e.origin, ['jotform.com', 'jotform.pro']) ) { break; }
var src = args[1];
if (args.length > 3) {
src = args[1] + ':' + args[2];
}
var script = document.createElement('script');
script.src = src;
script.type = 'text/javascript';
document.body.appendChild(script);
break;
case "exitFullscreen":
if (window.document.exitFullscreen) window.document.exitFullscreen();
else if (window.document.mozCancelFullScreen) window.document.mozCancelFullScreen();
else if (window.document.mozCancelFullscreen) window.document.mozCancelFullScreen();
else if (window.document.webkitExitFullscreen) window.document.webkitExitFullscreen();
else if (window.document.msExitFullscreen) window.document.msExitFullscreen();
break;
}
var isJotForm = (e.origin.indexOf("jotform") > -1) ? true : false;
if(isJotForm && "contentWindow" in iframe && "postMessage" in iframe.contentWindow) {
var urls = {"docurl":encodeURIComponent(document.URL),"referrer":encodeURIComponent(document.referrer)};
iframe.contentWindow.postMessage(JSON.stringify({"type":"urls","value":urls}), "*");
}
};
window.isPermitted = function(originUrl, whitelisted_domains) {
var url = document.createElement('a');
url.href = originUrl;
var hostname = url.hostname;
var result = false;
if( typeof hostname !== 'undefined' ) {
whitelisted_domains.forEach(function(element) {
if( hostname.slice((-1 * element.length - 1)) === '.'.concat(element) || hostname === element ) {
result = true;
}
});
return result;
}
};
if (window.addEventListener) {
window.addEventListener("message", handleIFrameMessage, false);
} else if (window.attachEvent) {
window.attachEvent("onmessage", handleIFrameMessage);
}
</script>
<?php /*
<center style="margin:10px 0px;"><button onclick="$('.feedback_form_holder').show();$(this).hide();">Leave Feedback</center>
<div class="feedback_form_holder" style="display:none;">
<script type="text/javascript" src="https://form.jotform.com/jsform/202625192924051"></script>
</div>
*/ ?>
</center>
<?php
$pageHtml = ob_get_clean();
include 'includes/layout.php';