| Server IP : 208.122.213.31 / Your IP : 216.73.216.45 Web Server : Apache System : Linux msd6191.mjhst.com 4.18.0-553.137.1.el8_10.x86_64 #1 SMP Wed Jun 24 11:40:24 UTC 2026 x86_64 User : WHMCS_MIA_382 ( 1001) PHP Version : 7.4.33 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/httpd/html/baberankings.com.bak/members/modules/rating/admin/ |
Upload File : |
<?
/* K-Rate
(C) Qsoft Inc, 2006-2009. All Rights Reserved
http://turn-k.net
Version: 1.00 (22.09.04)
*/
?>
<?
//add the videos
if (isset($_POST['sm'])) {
//get user data
$res = sql_query("SELECT * FROM $membtable WHERE m_user='$en[user]'");
if (sql_num_rows($res) == 0) $err .= '<br>User '.$en['user'].' not found!';
$line = sql_fetch_assoc($res);
$tmp = md5($line['m_user']);
$temp = $tmp.'.'.fileext($_FILES['img']['name']);
chdir('..');
if (!$err) {
// check whether this is a valid youtube video link
$avail = strstr($en['youtube_video_link'], 'youtube.com/watch?v=');
if ($avail) {
$link_exp = explode('youtube.com/watch?v=', $en['youtube_video_link']);
if ( strstr($link_exp[1],'&') ) {
$link_exp_code = explode('&', $link_exp[1]);
$en['youtube_code'] = $link_exp_code[0];
} else {
$en['youtube_code'] = $link_exp[1];
}
}
else {
$err .= '<Br>'._upload_a_valid_video.'<BR>http://www.youtube.com/watch?v=FI76sKLMkMU<BR>';
}
if (!$err && $en['youtube_code']) {
// Function to get the thumbnail of a youtube video from the youtube code
$en['youtube_thumb_link'] = get_youtube_thumbnail($en['youtube_code']);
$path_to_wget = '/usr/bin/wget';
$q_thumbnail = $path_to_wget.' -q -b -nv --output-file=./temp/wget.log --user-agent="Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)" --output-document=./images/thumbnails/'.$tmp.'.jpg "'.$en['youtube_thumb_link'].'"';
exec($q_thumbnail);
// sleeping the application to wait for downloading the thumbnail
usleep(3000000);
// image path to the thumbnail downloaded from youtube server
$img = 'images/thumbnails/'.$tmp.'.jpg';
if ( !file_exists($img) ) {
$err .= _issue_with_youtube_video;
}
$s = getimagesize($img);
if ($s[0] == 0) $err .= '<BR>'._upload_valid_video;
//if ($s[0] <= 120 || $s[1] <= 90) {
//$err .= _doubt_video_not_available;
//}
}
}
if ($err == '') {
$id = $line['m_id'];
// Function to get the full viewable link to a youtube video from encrypted code
$en['youtube_video_full_link'] = getFullYoutubeVideoLink($en['youtube_code']);
// SQL query to insert the youtube video into the pictures table
sql_query("INSERT INTO $picstable (i_user, i_video_status, i_time, i_ip, i_admin,i_name,i_video,i_video_link)
VALUES ($id, 1, ".time().", '$en[ip]',0,'".sql_escape_string(htmlentities(stripslashes($en['des']),ENT_QUOTES))."',1,'".$en['youtube_video_full_link']."')");
$iid = sql_insert_id();
$nimg = 'images/thumbnails/'.$id.'-'.$iid.'.jpg';
rename($img,$nimg);
// there is no need for thumbnail resizing since the youtube thumbnail is in a 130 x 97 resolution
// create_thumbnail(thm_img_w,thm_img_h,$nimg,'images/thumbnails/'.$id.'-'.$iid.'.jpg',pic_q);
create_thumbnail(sma_img_w,sma_img_h,$nimg,'images/small/'.$id.'-'.$iid.'.jpg',pic_q);
// add watermark feature will not be avilable for video
// watermark_img($nimg);
echo "<b>"._video_uploaded."</b><br><br>";
//check if user has main video
$lin = sql_fetch_assoc(sql_query("SELECT COUNT(*) AS cnt FROM $picstable WHERE i_user=$line[m_id] AND i_video_status=2"));
if ($lin['cnt'] == 0)
sql_query("UPDATE $picstable SET i_video_status=2 WHERE i_video_status=1 AND i_user=$line[m_id] LIMIT 1");
} else {
echo "<font color=red><b>$err</b></font><br><Br>";
}
}
?>
<? admin_header('Upload New Video'); ?>
<form action=index.php method=post enctype="multipart/form-data" name=ch>
<input type=hidden name=req value=add_vids>
<table>
<tr><td class=key>Upload Video:</td><td><input type=text id='video_link' name='youtube_video_link' size=60 maxlength=200 value="Please paste the video link here"></td></tr>
<tr><td class=key>Username:</td><td><input type=text size=40 name=user></td></tr>
<tr><td class=key>Video Name:</td><td><input type=text size=40 name=des></td></tr>
</table>
<br>
<input type=submit name=sm value='Add The Video!'>
</form>