$var = "<script language=javascript>\n\t\t\t\t\tvar field_myvideo_title = {$_REQUEST['field_myvideo_title']};\n\t\t\t\t\tvar field_myvideo_descr = {$_REQUEST['field_myvideo_descr']};\n\t\t\t\t\tvar field_myvideo_keywords = {$_REQUEST['field_myvideo_keywords']};\n\t\t\t\t\tvar listch = {$listch};\n\t\t\t\t\t</script>"; STemplate::assign("var", $var); } } if ($_POST[upload_final] != "") { if ($_FILES['field_uploadfile']['tmp_name'] == "") { $err = "Please provide the video location."; } if ($err == "" && $_FILES['field_uploadfile']['tmp_name'] != "") { $p = $_FILES['field_uploadfile']['name']; $pos = strrpos($p, "."); $ph = strtolower(substr($p, $pos + 1, strlen($p) - $pos)); /* Space in Megabytes (MB) */ $space = round($_FILES['field_uploadfile']['size'] / (1024 * 1024)); if ($config['enable_package'] == "yes") { check_subscriber($space); } if ($ph != "mpg" && $ph != "avi" && $ph != "mpeg" && $ph != "wmv" && $ph != "rm" && $ph != "dat" || $space > $config[max_video_size]) { $err = "Invalid Video Format."; } } if ($err == "") { $sql = "insert into video set\n UID={$_SESSION['UID']},\n title='{$_REQUEST['field_myvideo_title']}',\n description='{$_REQUEST['field_myvideo_descr']}',\n keyword='{$_REQUEST['field_myvideo_keywords']}',\n channel='0|{$_REQUEST['listch']}|0',\n space = '{$_REQUEST['space']}',\n addtime='" . time() . "',\n adddate='" . date("Y-m-d") . "',\n vkey='" . mt_rand() . "',\n type='{$_REQUEST['field_privacy']}',\n filehome='{$_REQUEST['p']}'"; $conn->execute($sql); $vid = mysql_insert_id(); $vdoname = $vid . "." . $ph; if (isset($_FILES['field_uploadfile']['tmp_name']) && is_uploaded_file($_FILES['field_uploadfile']['tmp_name'])) { $ff = $config[vdodir] . "/" . $vdoname; if (move_uploaded_file($_FILES['field_uploadfile']['tmp_name'], $ff)) { $mov = new ffmpeg_movie($ff); video_to_frame($ff, $vid, &$mov, $listch[0]);
if ($guest_row > 0) { $movi_duration = $movi_duration + $my_duration; $sql = "update guest_info set use_bw='{$movi_duration}' where guest_ip='{$guest_ip}' and \tlog_date='{$guest_date}'"; $rs = $conn->execute($sql); } else { $sql = "INSERT into\t\tguest_info set \n\t\t\t\t\t\t\t\t\t\tguest_ip='{$guest_ip}',\n\t\t\t\t\t\t\t\t\t\tlog_date='{$guest_date}',\n\t\t\t\t\t\t\t\t\t\tuse_bw='{$movi_duration}' "; $rs = $conn->execute($sql); } } if ($config['enable_package'] == "yes") { if (!isset($_SESSION[UID])) { $msg = "Guest user"; } else { $sql = "select space from video where vkey='{$_REQUEST['viewkey']}'"; $rs = $conn->execute($sql); check_subscriber($rs->fields['space']); $sql = "update subscriber set used_bw = used_bw + " . $rs->fields['space'] . " where UID={$_SESSION['UID']}"; $conn->execute($sql); } } if ($_REQUEST['flag'] == "F") { $sql = "select VID from video where vkey='{$_REQUEST['viewkey']}'"; $rs = $conn->execute($sql); $sql = "select count(*) as total from feature_req where VID=" . $rs->fields['VID']; $rs1 = $conn->execute($sql); if ($rs1->fields['total'] > 0) { $sql = "update feature_req set req = req + 1, date='" . date("Y-m-d") . "' where VID=" . $rs->fields['VID']; } else { $sql = "insert feature_req set VID=" . $rs->fields['VID'] . ", req = 1, date='" . date("Y-m-d") . "'"; } $rs = $conn->execute($sql);