session_start();
function UR_exists($url){
$headers=get_headers($url);
return stripos($headers[0],"200 OK")?true:false;
}
$user_id = $_SESSION['id'];
$username = $_SESSION['usr'];
// extra features if owner of video by id or session
$ip = getenv('REMOTE_ADDR');
#$video_id = $_GET["id"];
$video_id = $_REQUEST['id'];
$bump = $_GET['id'];
$db = mysqli_connect ("localhost", "pack", "watch3r");
mysqli_select_db ($db,"pack");
####
mysqli_query($db,"UPDATE pack_song_views SET views = views + 1 WHERE id = '$video_id'");
###
$result = mysqli_query($db,"SELECT * FROM pack_song where id = '$video_id'");
$ratch = mysqli_fetch_array($result);
$artist = $ratch["artist"];
$title = $ratch["title"];
$running_time = $ratch["running_time"];
$video_link = $ratch["video_link"];
$youtube_link = $ratch["youtube_link"];
$creation_date = $ratch["creation_date"];
$lyrics = $ratch["lyrics"];
$options = $ratch["options"];
$main_artist = $artist;
$videothumbnail = $ratch["video_still"];
$metadata = $ratch["metadata"];
$privacy = $ratch["video_construct"];
$dailymotion_link = $ratch["dailymotion_link"];
$dmcode = explode("/",$dailymotion_link);
$ytcode = explode("=",$youtube_link);
# print_r($ytcode);
# look up the username/icon for the user.
$video_user_id = $ratch["user_id"];
$video_url = "../video/" . $video_link;
$video_long_url = "http://www.mvgen.com/video/" . $video_link;
if ($metadata == "ARCHIVE"){
$video_long_url = "http://mvgenvideos.s3-website-us-west-2.amazonaws.com/" . $video_link;
}
if ($metadata == "linode"){
$video_long_url = "https://us-east-1.linodeobjects.com/video-storage/" . $video_link;
}
$crack = mysqli_query($db,"SELECT * FROM pack_song_views where id = '$video_id'");
$vidtab = mysqli_fetch_array($crack);
$views = $vidtab["views"];
$likes = $vidtab["likes"];
$crack = mysqli_query($db,"SELECT * FROM pack_song_construct where id = '$video_id'");
$vidtab = mysqli_fetch_array($crack);
$video_dna = $vidtab["video_construct"];
// $video_dna = $video_dna.replace(/(^|\s+)/g, "$1+");
//$video_dna = preg_replace("/(^|\s+)/g", "$1#", $video_dna);
//$video_dna = preg_replace('~(\w+)~', '$1#mv',$video_dna);
//$video_dna = preg_replace('s/(\d.+)(\s|$)/x\1\2/g', '$1#mv',$video_dna);
$video_dna = preg_replace('~\d+~', 'mv#$0', $video_dna);
$still_flag = 1;
if (!UR_exists($video_long_url)){
$still_flag = 0;
}
$timeleft = 86400;
?>
$stuff = mysqli_query($db,"SELECT * FROM pack_user where id = '$video_user_id'");
while ($ratch = mysqli_fetch_array($stuff)) {
$account_id = $ratch["id"];
$createdby = $ratch["usr"];
}
$box = mysqli_query($db,"SELECT * FROM pack_user_extended where user_id = '$account_id'");
while ($rite = mysqli_fetch_array($box)) {
$account_id = $rite["id"];
$logo = $rite["logo"]; $photo = $rite["photo"];
$status = $rite["status"];
// social media
$website = $rite["website"];
$soundcloud = $rite["soundcloud"];
$instagram = $rite["instagram"];
$profile = $rite["profile"];
}
// you need to check the time to turn on the DNA box
?>
// echo $creation_date; ?>
$user_id = $_SESSION['id'];
// really this user id needs to match
if ($privacy == "private" && $user_id != $video_user_id){
header( 'Location: http://www.mvgen.com' ) ;
}
?>
// MVGEN : echo $title; ?> by echo $artist; ?> : GIF Powered Music Video Generator
include "./sidenav.php"; ?>
echo $title; ?>by echo $artist; ?>
$dmflag = 0;
if($dailymotion_link) { ?>
$dmflag = 1;}
?>
$yflag = 0;
if($youtube_link) { ?>
$yflag = 1;}
?>
// this is where you swap it out for the DNA BOX to Cut and paste and add download box
if(UR_exists($video_long_url) && $dmflag == 0 && $yflag == 0) { // youtube drop down next for emebd ?>
} if ($still_flag) { // you need to tie this to the timer // it needs to cehck both ?>
} ?> if($dna_flag){ ?>
VIDEO DNA:
If you wish to recreate this video, just save this VIDEO DNA and upload/paste it into the keyword box! } ?>
// this is via ID, session or cookie? ?>
Video Expires in:
000000Download it before it's gone!
John Doe
BETA TEST
John Doe
BETA TEST
John Doe
BETA TEST