if (!in_array($_POST['showvideos'], $arrVideoDisplayCheck) || !is_numeric($_POST['showvideos'])) { $dispError = " <b>·</b> You selected an invalid video display amount.<br>"; $countErrors++; } if ($countErrors == 0) { $setShowInfoCard = $_POST['showinfocard'] == 1 ? 1 : 0; $setAllowLogin = $_POST['allowlogin'] == 1 ? 1 : 0; if ($ytObj->update(array("allowlogin", "showsubscribe", "showvideos"), array($_POST['allowlogin'], $_POST['showinfocard'], $_POST['showvideos']))) { $dispSuccess = true; } else { $countErrors++; $dispError .= " <b>·</b> Unable to save information to the database. Please contact the website administrator.<br>"; } } } $ytInfo = $ytObj->get_info_filtered(); $checkVideos = array(); if ($ytInfo['showvideos'] == 0) { $checkVideos[0] = " selected"; } elseif ($ytInfo['showvideos'] == 1) { $checkVideos[1] = " selected"; } $checkInfoCard = $ytInfo['showsubscribe'] == 1 ? " checked" : ""; $checkAllowLogin = $ytInfo['allowlogin'] == 1 ? " checked" : ""; echo "\n\t\t\t<div id='loadingSpiralDisconnect' class='loadingSpiral'>\n\t\t\t\t<p align='center'>\n\t\t\t\t\t<img src='" . $MAIN_ROOT . "themes/" . $THEME . "/images/loading-spiral.gif'><br>Loading\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t\t<div id='connectedDiv'>\n\t\t\t<form action='" . $MAIN_ROOT . "members/console.php?cID=" . $_GET['cID'] . "' method='post'>\n\t\t\t<div class='formDiv'>\n\t\t\t"; if ($dispError != "") { echo "\n\t\t\t<div class='errorDiv'>\n\t\t\t<strong>Unable to save Youtube settings because the following errors occurred:</strong><br><br>\n\t\t\t{$dispError}\n\t\t\t</div>\n\t\t\t"; } echo "\n\t\t\t\n\t\t\t\t<table class='formTable'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td colspan='2'>\n\t\t\t\t\t\t\t<div class='main dottedLine' style='margin-bottom: 20px; padding-bottom: 3px'>\n\t\t\t\t\t\t\t\t<b>Connected:</b>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td colspan='2'>\n\t\t\t\t\t\t\t<div id='loadingSpiral' class='loadingSpiral' style='padding-top: 0px'>\n\t\t\t\t\t\t\t\t<p align='center'>\n\t\t\t\t\t\t\t\t\t<img src='" . $MAIN_ROOT . "themes/" . $THEME . "/images/loading-spiral.gif'><br>Refreshing Data\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div id='ytInfoCard'>" . $ytObj->dispSubscribeButton() . "</div>\n\t\t\t\t\t\t\t<div style='font-style: italic; text-align: center; margin-top: 3px; margin-left: auto; margin-right: auto; position: relative' class='main'>\n\t\t\t\t\t\t\t\tLast updated <span id='lastUpdateTime'>" . getPreciseTime($ytInfo['lastupdate']) . "</span>\n\t\t\t\t\t\t\t\t<p class='largeFont' style='font-style: normal; font-weight: bold' align='center'>\n\t\t\t\t\t\t\t\t\t<a style='cursor: pointer' id='btnDisconnect'>DISCONNECT ACCOUNT</a>\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td colspan='2'>\n\t\t\t\t\t\t\t<div class='main dottedLine' style='margin-bottom: 20px; padding-bottom: 3px'>\n\t\t\t\t\t\t\t\t<b>Profile Display Options:</b>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class='formLabel'>Show Info Card: <a href='javascript:void(0)' onmouseover=\"showToolTip('An example of the Info Card is shown in the "Connected" section above.')\" onmouseout='hideToolTip()'>(?)</a></td>\n\t\t\t\t\t\t<td class='main'><input type='checkbox' name='showinfocard' value='1'" . $checkInfoCard . "></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td class='formLabel'>Video Display:</td>\n\t\t\t\t\t\t<td class='main'>\n\t\t\t\t\t\t\t<select name='showvideos' class='textBox'>\n\t\t\t\t\t\t\t\t<option value='0'" . $checkVideos[0] . ">Don't Show Videos</option>\n\t\t\t\t\t\t\t\t<option value='1'" . $checkVideos[1] . ">Most Recent Video</option>\n\t\t\t\t\t\t\t\t"; for ($i = 2; $i <= 5; $i++) { $dispChecked = "";