democloud

$v) {
if (is_array($v)) {
foreach ($v as $k2 => $v2) {
if ($k2 == $key) {
$tempArray[$k] = $v2;
}
}
} else {
$tempArray[$k] = $v;
}
}

// Sort temporary array based on order
switch ($order) {
case SORT_ASC:
asort($tempArray);
break;
case SORT_DESC:
arsort($tempArray);
break;
default:
}

// Copy original array into new array based on the order in the temporary array
foreach ($tempArray as $k => $v) {
$sortedArray[$k] = $array[$k];
}

return $sortedArray;
}

session_start();
$pagedata = pathinfo($_SERVER[‘REQUEST_URI’]);
$_SESSION[‘lastPageVisited’] = $pagedata[‘basename’];
$currentUser = getCurrentUser();

// Valid session token
// Get all the files belonging to this user

// Build the url
$query = urlencode(‘where={“user”:{“__type”:”Pointer”,”className”:”_User”, “objectId”:”Cs8RAZ2atl”}}’);
$retrieveUrl = ‘https://api.parse.com/1/classes/Video?’ . $query;
// Headers
$retrieveHeaders = array(
“X-Parse-Application-Id: 9s7Zfx1VQafAc1raQ9iHvWpNIfYk7nGV8YX8h5jq”,
“X-Parse-REST-API-Key: TiWvQ83bIfqAKIjl292jPN3zx3RIjDb15X5pYtKZ”
);

// Set up and execute curl
$retrieveRest = curl_init();

curl_setopt($retrieveRest, CURLOPT_URL, $retrieveUrl);
curl_setopt($retrieveRest, CURLOPT_HTTPGET, 1);
curl_setopt($retrieveRest, CURLOPT_HTTPHEADER, $retrieveHeaders);
curl_setopt($retrieveRest, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($retrieveRest, CURLOPT_RETURNTRANSFER, true);
$retrieveResponse = curl_exec($retrieveRest);
$retrieveResponse = json_decode($retrieveResponse, true);
curl_close($retrieveRest);

if (isset($retrieveResponse[‘results’][‘0’])) {
// Uploads found
// Sort by date
$retrieveResponse[‘results’] = sortArray($retrieveResponse[‘results’], ‘createdAt’, SORT_DESC);

// Show video gallery
echo ‘

‘;

} else {
// No uploads found
echo ‘
No videos found.
‘;
}

?>[/fusion_builder_column][/fusion_builder_row][/fusion_builder_container]

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