Пример #1
0
                            continue;
                        }
                        $sharedfriends[] = $friend;
                    }
                }
                $path = $upfile;
                $detail = $_POST['description'];
                $candiscuss = isset($_POST['discuss']) ? 1 : 0;
                $canrate = isset($_POST['rate']) ? 1 : 0;
                $keywords = preg_replace('/\\s+/', '', $_POST['keywords']);
                //$keywords = '';
                //foreach( $_POST['keyword'] as $word) {
                //  $keywords .= $Keywords[$word]. ',';
                //}
                //insert into media table
                addMedia($title, $username, $type, $catetory, $sharetype, $sharedfriends, $path, $detail, $candiscuss, $canrate, $keywords);
                $result = "0";
                $errortext = "successfully uploaded file";
                chmod($upfile, 0644);
            }
        } else {
            $result = "7";
            //upload file failed
            $errortext = "failed to upload file, error code is {$result}";
        }
        //}
    }
    //You can process the error code of the $result here.
    $myUploads = getUploads($_SESSION["username"]);
    render("upload_template.php", ["errortext" => $errortext, "titile" => "Uploads", "keywords" => $Keywords, "myuploads" => $myUploads]);
} else {
Пример #2
0
    writeToLog('ERROR: kaltura notification params empty');
    return FALSE;
} elseif ($noti->valid_signature === FALSE) {
    writeToLog('ERROR: kaltura notification signature not valid');
    return FALSE;
} else {
    // assert: valid notification
    $data = array_shift($noti->data);
    $notiType = $data['notification_type'];
    writeToLog("Notifications type: {$notiType}\n");
    $msg = "kaltura notification (" . date("H:i:s") . ") {$notiType}\n";
    // check notification type
    if ("entry_update" == $notiType) {
        writeToLog("in Entry update\n");
        // on "entry_update" notification is fired then addMedia to appropriated database
        addMedia($data);
    }
}
/* 
 * add row to media table for the appropriate database by reading 'tags' of uploaded video
 * to determine the version of OVAL ie. 'clas_dev_server' or 'clas_prod_server'
 */
function addMedia($data)
{
    global $kalturaUploadsUser, $kalturaUploadsPassword;
    $tags = $data['tags'];
    $tags = json_decode($tags, true);
    $userID = $tags['userid'];
    $serverVersion = $tags['version'];
    writeToLog("tags: {$tags}\n");
    writeToLog("userID: {$userID}\n");