/** * Method to update Dailymotion cloud Meta tags * */ public function updateDMCloudMetatags() { $meta = array(); $originalmetameta = array(); $mediaId = !empty($_POST['media_id']) ? $_POST['media_id'] : null; $imageurl = !empty($_POST['attach_url']) ? $_POST['attach_url'] : null; $imageid = !empty($_POST['at_id']) ? $_POST['at_id'] : null; if ($mediaId) { $dailymotioncloud = new DailymotionCloudOwnMethod($this->dcuname, $this->dcpass); $meta['title'] = !empty($_POST['title']) ? $_POST['title'] : null; $updatemeta = !empty($_POST['originalmeta']) ? array_keys($_POST['originalmeta']) : null; if (!empty($_POST['meta'])) { foreach ($_POST['meta'] as $key => $data) { if (!empty($data[0]) && !empty($data[1])) { $meta[$data[0]] = (string) $data[1]; } } } if (!empty($_POST['originalmeta'])) { foreach ($_POST['originalmeta'] as $originalmetakey => $originalmetadata) { if (!empty($originalmetadata[0]) && !empty($originalmetadata[1])) { $originalmetameta[$originalmetadata[0]] = (string) $originalmetadata[1]; } } } if ($imageurl) { $dailymotioncloud->setDailyMotionCloudVideoThumbnail($mediaId, $imageurl); } if ($updatemeta) { $dailymotioncloud->removeDailymotionCloudVideoMetas($mediaId, $updatemeta); $dailymotioncloud->setDailyMotionCloudVideoMetas($mediaId, $originalmetameta); } if ($meta) { $dailymotioncloud->setDailyMotionCloudVideoMetas($mediaId, $meta); } session_start(); if (!isset($_SESSION['dmc_success']) || $_SESSION['dmc_success'] == "") { $_SESSION['dmc_success'] = 'Your video was saved successfully.'; } print json_encode(array('msg' => 'Succesfuly update data')); exit; } }