View Video2 Clone

‘;
echo do_shortcode(‘
video
play-sharp-fill
‘);
echo ‘
Player: ‘ . $videoInfo[‘playerInfo’][‘firstName’] . ‘ ‘ . $videoInfo[‘playerInfo’][‘lastName’] . ‘

Note: ‘ . $videoInfo[‘videoInfo’][‘note’] . ‘

‘;
if ($currentUser[2] >= 0) {
if (isset($actResponse[‘results’])) {
// Comments retrieved
$results = $actResponse[‘results’];
// Loop through results. If no toUser toEmail, it is a regular comment.
// Otherwise it is a share.
for ($i=0; $iformat(‘M d, Y’);
if ($results[$i][‘toUser’] == null && strlen($results[$i][‘toEmail’]) == 0) {
// Is a comment
// Get date

echo ‘

‘;
echo $results[$i][‘fromUser’][‘firstName’] . ‘ ‘ . $results[$i][‘fromUser’][‘lastName’] .
‘@’ . $dateStr . ‘:
‘ . $results[$i][‘content’];
echo ‘

‘;
} else {
// Is a share
if ($i == 0) {
// Is first result
if (strlen($results[0][‘content’]) > 0) {
// Has a comment
echo ‘

‘;
echo $results[0][‘fromUser’][‘firstName’] . ‘ ‘ . $results[0][‘fromUser’][‘lastName’] .
‘@’ . $dateStr . ‘:
‘ . $results[0][‘content’];
echo ‘

‘;
}
}
}
}
} else {
// Curl to retrieve comments failed
}
/* // Check if user is logged in
if ($currentUser[1] === true) {
// Valid session token
// Show comment box
echo ‘

‘;
} else {
// No valid session token
} */
} else {
// Don’t have subscription
echo ‘

You must be logged in with an ELITE or above subscription to view comments here. Check out our subscription plans!

‘;
}
echo ‘

‘;
} else {
// Object not found
echo ‘Video not found.’;
}

} else {
// Url doesn’t contain v parameter
echo ‘Invalid link.’;
}

if (isset($_POST[‘submit’])) {
if ($currentUser[1] === true) {
// Valid session token
$comment = $_POST[‘newComment’];
// Upload comment to Parse activity table
$url = ‘https://api.parse.com/1/classes/Activity’;
$headers = array(
“X-Parse-Application-Id: 9s7Zfx1VQafAc1raQ9iHvWpNIfYk7nGV8YX8h5jq”,
“X-Parse-REST-API-Key: TiWvQ83bIfqAKIjl292jPN3zx3RIjDb15X5pYtKZ”,
“Content-Type: application/json”
);
$data = ‘{“content”:”‘ . $comment . ‘”,”type”:”comment”,”fromUser”:{“__type”:”Pointer”,”className”:”_User”,”objectId”:”‘. $currentUser[0] . ‘”},”photo”:{“__type”:”Pointer”,”className”:”Photo”,”objectId”:”‘ . $_GET[‘v’] . ‘”},”photoId”:”‘ . $_GET[‘v’] . ‘”,”toEmail”:””,”toUser”:null}’;

$rest = curl_init();
curl_setopt($rest, CURLOPT_URL, $url);
curl_setopt($rest, CURLOPT_HTTPHEADER, $headers);
curl_setopt($rest, CURLOPT_POST, 1);
curl_setopt($rest, CURLOPT_POSTFIELDS, $data);
curl_setopt($rest, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($rest, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($rest);
$response = json_decode($response, 1);
curl_close($rest);
} else {
// User not logged in
}
}
?>

Download Now For FREE

SwingProfile golf swing analyzer and training aid is a must-have for golfers of all level.

Download on the App Store