diff --git a/docroot/TUplayer.swf b/docroot/TUplayer.swf index 8331cdc..f740e1d 100755 --- a/docroot/TUplayer.swf +++ b/docroot/TUplayer.swf Binary files differ diff --git a/docroot/TUve.swf b/docroot/TUve.swf index bb1dbc1..fb72cc9 100755 --- a/docroot/TUve.swf +++ b/docroot/TUve.swf Binary files differ diff --git a/docroot/amfphp/services/tuve.inc b/docroot/amfphp/services/tuve.inc index c4fc68b..24526ee 100755 --- a/docroot/amfphp/services/tuve.inc +++ b/docroot/amfphp/services/tuve.inc @@ -3,4 +3,7 @@ Define('DATABASE_USERNAME', 'tuve'); Define('DATABASE_PASSWORD', '5558585'); Define('DATABASE_NAME', 'tuve'); + +include("/usr/web/sites/tuve.tv/include/funcs.inc"); + ?> diff --git a/docroot/amfphp/services/tuve.php b/docroot/amfphp/services/tuve.php index 0855782..8ed1b61 100755 --- a/docroot/amfphp/services/tuve.php +++ b/docroot/amfphp/services/tuve.php @@ -16,9 +16,39 @@ } } + /* Get Picture */ + function getPic($data) { + $query = "SELECT profile_image,main_image FROM users WHERE username LIKE '$data'"; + + if (!$result = @$this->mysqli->query($query)) { + $errno=$this->mysqli->errno; + $this->mysqli->close(); + trigger_error("AMFPHP Remoting database SELECT query error: " . $errno); + } + + $row = $result->fetch_assoc(); + + $imIndex = $row['profile_image']; + if ($imIndex == 0) + return($row['main_image'] . "-small.png"); + else { + switch($imIndex) { + case 1: + return("http://www.ubixonline.com/images/sb/none.gif-small.png"); + case 2: + return("http://www.ubixonline.com/images/sb/female_icon.png-small.png"); + case 3: + return("http://www.ubixonline.com/images/sb/male_icon.png-small.png"); + } + } + } + /* Function For TUplayer */ function pVid($vid) { - $query = "SELECT file,count FROM videos WHERE vid = $vid"; + if ($vid == 0) + $query = "SELECT file,count,artist,title,vid FROM videos WHERE rating < 4 AND mType = 1 AND length < 610 ORDER BY rand() LIMIT 1"; + else + $query = "SELECT file,count,artist,title,vid FROM videos WHERE vid = $vid"; if (!$result=@$this->mysqli->query($query)) { $errno=$this->mysqli->errno; $this->mysqli->close(); @@ -98,9 +128,9 @@ $sKey = $data['skey']; $uid = $data['uid']; if ($data['gid'] == 1) - $query = "SELECT artist,title,vid FROM videos WHERE artist LIKE \"%$sKey%\" OR title LIKE \"%$sKey%\" ORDER BY artist,title"; + $query = "SELECT artist,title,vid FROM videos WHERE artist LIKE \"%$sKey%\" OR title LIKE \"%$sKey%\" AND status = 0 ORDER BY artist,title"; else - $query = "SELECT artist,title,vid FROM videos WHERE oid = $uid AND (artist LIKE \"%$sKey%\" OR title LIKE \"%$sKey%\") ORDER BY artist,title"; + $query = "SELECT artist,title,vid FROM videos WHERE oid = $uid AND (artist LIKE \"%$sKey%\" OR title LIKE \"%$sKey%\") status = 0 ORDER BY artist,title"; if (!$result=@$this->mysqli->query($query)) { $errno=$this->mysqli->errno; @@ -266,7 +296,7 @@ function userAuth($data) { $username = $data['username']; $password = $data['password']; - $query = "SELECT uid,username,password,gid,active FROM users WHERE username LIKE '$username' AND password = '$password'"; + $query = "SELECT uid,username,password,gid,active,profile_image,main_image FROM users WHERE username LIKE '$username' AND password = '$password'"; if (!$result=@$this->mysqli->query($query)) { $errno=$this->mysqli->errno; $this->mysqli->close(); @@ -274,38 +304,35 @@ } if ($result->num_rows == 0) { - $return_array[] = array('active' => '0'); + $row['active'] = "0"; //return_array[] = array('active' => '0'); + return($row); } + + $row = $result->fetch_assoc(); + + $query = "UPDATE users SET laston = " . time() . " WHERE uid = " . $row['uid']; + $this->mysqli->query($query); + + + $imIndex = $row['profile_image']; + if ($imIndex == 0) + $row['my_image'] = $row['main_image'] . "-small.png"; else { - while ($row = $result->fetch_assoc()) { - $return_array[] = $row; + switch($imIndex) { + case 1: + $row['my_image'] = "http://www.ubixonline.com/images/sb/none.gif-small.png"; + case 2: + $row['my_image'] = "http://www.ubixonline.com/images/sb/female_icon.png-small.png"; + case 3: + $row['my_image'] = "http://www.ubixonline.com/images/sb/male_icon.png-small.png"; } - $query = "UPDATE users SET laston = " . time() . " WHERE uid = " . $return_array[0]['uid']; - $this->mysqli->query($query); } - - while ($row = $result->fetch_assoc()) { - $return_array[] = $row; - } - return($return_array); - } - - function getView($uid) { - $query = "SELECT viewXML FROM users WHERE uid = $uid"; - if (!$result=@$this->mysqli->query($query)) { - $errno=$this->mysqli->errno; - $this->mysqli->close(); - trigger_error("AMFPHP Remoting database SELECT query error: " . $errno); - } - while ($row = $result->fetch_assoc()) { - $return_array[] = $row; - } - return($return_array); + return($row); } function getFriends($uid) { - $query = "SELECT friendsXML FROM users WHERE uid = $uid"; + $query = "SELECT username,uid FROM friends f INNER JOIN users u ON f.fid = u.uid WHERE oid = $uid"; if (!$result=@$this->mysqli->query($query)) { $errno=$this->mysqli->errno; $this->mysqli->close(); diff --git a/docroot/amfphp/services/tuveAdmin.php b/docroot/amfphp/services/tuveAdmin.php index ecffb10..d2d8812 100755 --- a/docroot/amfphp/services/tuveAdmin.php +++ b/docroot/amfphp/services/tuveAdmin.php @@ -15,15 +15,149 @@ } } - function getMail($uid) { - $query = "SELECT mid,subject,username,date,message,sid FROM mail m INNER JOIN users u ON m.sid = u.uid WHERE m.oid = $uid"; + function deleteVid($vid) { + $query = "UPDATE videos SET status = 1 WHERE vid = $vid"; + $this->mysqli->query($query); + } + + function findUsers($data) { + $skey = $data['skey']; + + $query = "SELECT username,main_image,profile_image,caption,city,state_prov FROM users WHERE username LIKE '%$skey%'"; + + if ($data['gender'] == 1) + $query .= " AND gender = 1"; + else if ($data['gender'] == 2) + $query .= " AND gender = 2"; + + $syear = 2007 - (18 + $data['sAge']); + $eyear = 2007 - (18 + $data['eAge']); + + $query .= " AND (byear <= $syear AND byear >= $eyear)"; + + if (!$result=@$this->mysqli->query($query)) { $errno=$this->mysqli->errno; $this->mysqli->close(); trigger_error("AMFPHP Remoting database SELECT query error: " . $errno . " query: " . $query); } while ($row = $result->fetch_assoc()) { - $row['date'] = date("H:I:s m/d/Y",$row['date']); + $imIndex = $row['profile_image']; + if ($imIndex == 0) + $row['my_image'] = $row['main_image'] . "-small.png"; + else { + switch($imIndex) { + case 1: + $row['my_image'] = "http://www.ubixonline.com/images/sb/none.gif-small.png"; + case 2: + $row['my_image'] = "http://www.ubixonline.com/images/sb/female_icon.png-small.png"; + case 3: + $row['my_image'] = "http://www.ubixonline.com/images/sb/male_icon.png-small.png"; + } + } + $row['location'] = $row['city'] . ", " . $row['state_prov']; + + $return_array[] = $row; + } + return($return_array); + } + + function finBroad($file) { + $query = "UPDATE videos SET status = 5 WHERE file = '$file.flv'"; + $this->mysqli->query($query); + } + + function addVid($data) { + $artist = $data['username']; + $title = $data['title']; + $file = $data['file']; + $oid = $data['uid']; + $added = time(); + $query = "INSERT INTO videos (artist,title,genre,file,rating,classification,oid,count,mType,added,status) VALUES('$artist','$title','Recorded Video','$file.flv',2,6,$oid,0,1,$added,6)"; + if (!$result=@$this->mysqli->query($query)) { + $errno=$this->mysqli->errno; + $this->mysqli->close(); + trigger_error("AMFPHP Remoting database SELECT query error: " . $errno . " query: " . $query); + } + + } + + function updateMsgFolder($data) { + $mid = $data['mid']; + $folder = $data['folder']; + + $query = "UPDATE mail SET folder = $folder WHERE mid = $mid"; + $this->mysqli->query($query); + } + + function mailRead($mid) { + $query = "UPDATE mail SET status = 2 WHERE mid = $mid"; + $this->mysqli->query($query); + } + + function updatePass($data) { + $uid = $data['uid']; + $pass = $data['pass']; + $query = "UPDATE users SET password = '$pass' WHERE uid = $uid"; + $this->mysqli->query($query); + } + + function approveFriend($data) { + $fid = $data['fid']; + $oid = $data['oid']; + $approved = $data['approved']; + + if ($approved == 0) { + $query = "DELETE FROM friends WHERE fid = $fid AND oid = $oid AND approved = 0"; + $this->mysqli->query($query); + $query = "DELETE FROM friends WHERE fid = $oid AND oid = $fid AND approved = 0"; + $this->mysqli->query($query); + + $pdate = time(); + $query = "INSERT INTO mail (oid,sid,date,subject,message,folder) VALUES($fid,$oid,$pdate,'Friend Request Denied','This Friend Request Has Been Denied',0)"; + $this->mysqli->query($query); + + $query = "SELECT firstname,lastname,email FROM users WHERE uid = $fid"; + if (!$result=@$this->mysqli->query($query)) { + $errno=$this->mysqli->errno; + $this->mysqli->close(); + trigger_error("AMFPHP Remoting database SELECT query error: " . $errno . " query: " . $query); + } + $row = $result->fetch_assoc(); + send_mail("$row[firstname] $row[lastname] <$row[email]>","Your request to make $data[username] your friend has been denied","Friend Request Denied","support@tuve.tv","TUve Support"); + + } + else { + $query = "UPDATE friends SET approved = 1 WHERE approved = 0 AND fid = $fid AND oid = $oid"; + $this->mysqli->query($query); + $query = "UPDATE friends SET approved = 1 WHERE approved = 0 AND fid = $oid AND oid = $fid"; + $this->mysqli->query($query); + + $pdate = time(); + $query = "INSERT INTO mail (oid,sid,date,subject,message,folder) VALUES($fid,$oid,$pdate,'Friend Request Approved','This Friend Request Has Been Approved',0)"; + $this->mysqli->query($query); + + $query = "SELECT firstname,lastname,email FROM users WHERE uid = $fid"; + if (!$result=@$this->mysqli->query($query)) { + $errno=$this->mysqli->errno; + $this->mysqli->close(); + trigger_error("AMFPHP Remoting database SELECT query error: " . $errno . " query: " . $query); + } + $row = $result->fetch_assoc(); + send_mail("$row[firstname] $row[lastname] <$row[email]>","Your request to make $data[username] your friend has been approved","Friend Request Approved","support@tuve.tv","TUve Support"); + + } + } + + function getMail($uid) { + $query = "SELECT mid,subject,username,date,message,sid,folder,status FROM mail m INNER JOIN users u ON m.sid = u.uid WHERE m.oid = $uid ORDER BY mid DESC"; + if (!$result=@$this->mysqli->query($query)) { + $errno=$this->mysqli->errno; + $this->mysqli->close(); + trigger_error("AMFPHP Remoting database SELECT query error: " . $errno . " query: " . $query); + } + while ($row = $result->fetch_assoc()) { + $row['date'] = date("m/d/Y g:i A",$row['date']); $return_array[] = $row; } return($return_array); @@ -31,7 +165,7 @@ function getProfile($user) { - $query = "SELECT username,uid,gid,bday,bmonth,byear,about_me,caption,profile_image,gender,city,state_prov,postal_code FROM users WHERE username LIKE '$user'"; + $query = "SELECT username,uid,gid,bday,bmonth,byear,about_me,caption,main_image,profile_image,gender,city,state_prov,postal_code FROM users WHERE username LIKE '$user'"; if (!$result=@$this->mysqli->query($query)) { $errno=$this->mysqli->errno; $this->mysqli->close(); @@ -45,7 +179,7 @@ function getUserInfo($uid) { - $query = "SELECT username,uid,gid,bday,bmonth,byear,about_me,caption,profile_image,gender,city,state_prov,postal_code FROM users WHERE uid = $uid"; + $query = "SELECT username,uid,gid,bday,bmonth,byear,about_me,caption,main_image,profile_image,gender,city,state_prov,postal_code FROM users WHERE uid = $uid"; if (!$result=@$this->mysqli->query($query)) { $errno=$this->mysqli->errno; $this->mysqli->close(); @@ -60,20 +194,24 @@ function updateUserInfo($data) { $uid = $data['uid']; - $caption = $this->mysqli->real_escape_string($data['caption']); - $about_me = $this->mysqli->real_escape_string($data['about_me']); - $city = $this->mysqli->real_escape_string($data['city']); - $state_prov = $this->mysqli->real_escape_string($data['state_prov']); - $zip_postal = $this->mysqli->real_escape_string($data['zip_postal']); - $gender = $data['gender']; - $bday = $data['bday']; - $bmonth = $data['bmonth']; - $byear = $data['byear']; + $caption = $this->mysqli->real_escape_string($data['caption']); + $about_me = $this->mysqli->real_escape_string($data['about_me']); + $city = $this->mysqli->real_escape_string($data['city']); + $state_prov = $this->mysqli->real_escape_string($data['state_prov']); + $zip_postal = $this->mysqli->real_escape_string($data['zip_postal']); + $gender = $data['gender']; + $bday = $data['bday']; + $bmonth = $data['bmonth']; + $byear = $data['byear']; + $profile_image = $data['profile_image']; if ($caption == "") $caption = "No Caption Available"; - $query = "UPDATE users SET caption = '$caption'"; + $query = "UPDATE users SET profile_image = $profile_image"; + + if ($caption != "") + $query .= ",caption='$caption'"; if ($about_me != "") $query .= ",about_me='$about_me'"; @@ -107,16 +245,35 @@ function userAuth($data) { $username = $data['username']; $password = $data['password']; - $query = "SELECT username,uid,gid FROM users WHERE username = '$username' AND password = '$password'"; + $query = "SELECT username,uid,gid,profile_image,main_image FROM users WHERE username = '$username' AND password = '$password'"; if (!$result=@$this->mysqli->query($query)) { $errno=$this->mysqli->errno; $this->mysqli->close(); trigger_error("AMFPHP Remoting database SELECT query error: " . $errno); } +/* while ($row = $result->fetch_assoc()) { $return_array[] = $row; } - return($return_array); +*/ + $row = $result->fetch_assoc(); + + $imIndex = $row['profile_image']; + if ($imIndex == 0) + $row['my_image'] = $row['main_image'] . "-small.png"; + else { + switch($imIndex) { + case 1: + $row['my_image'] = "http://www.ubixonline.com/images/sb/none.gif-small.png"; + case 2: + $row['my_image'] = "http://www.ubixonline.com/images/sb/female_icon.png-small.png"; + case 3: + $row['my_image'] = "http://www.ubixonline.com/images/sb/male_icon.png-small.png"; + } + } + + return($row); + // return($return_array); } function getUsers($data) { @@ -140,9 +297,9 @@ $sKey = $data['skey']; $uid = $data['uid']; if ($data['gid'] == 1) - $query = "SELECT artist,title,vid FROM videos WHERE artist LIKE \"%$sKey%\" OR title LIKE \"%$sKey%\" ORDER BY artist,title"; + $query = "SELECT artist,title,vid FROM videos WHERE (artist LIKE \"%$sKey%\" OR title LIKE \"%$sKey%\") AND status = 0 ORDER BY artist,title"; else - $query = "SELECT artist,title,vid FROM videos WHERE oid = $uid AND (artist LIKE \"%$sKey%\" OR title LIKE \"%$sKey%\") ORDER BY artist,title"; + $query = "SELECT artist,title,vid FROM videos WHERE oid = $uid AND (artist LIKE \"%$sKey%\" OR title LIKE \"%$sKey%\") AND status = 0 ORDER BY artist,title"; if (!$result=@$this->mysqli->query($query)) { $errno=$this->mysqli->errno; @@ -203,10 +360,8 @@ $this->mysqli->close(); trigger_error("AMFPHP Remoting database SELECT query error: " . $errno); } - while ($row = $result->fetch_assoc()) { - $return_array[] = $row; - } - return($return_array); + $row = $result->fetch_assoc(); + return($row); } function getChannel($data) { @@ -338,9 +493,9 @@ $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= 'From: TUve Manager ' . "\r\n"; - $message = "Channel: " . $data['channel'] . "
\n"; - $message .= "Description: " . $data['description'] . "
\n"; - $message .= "User: " . $data['username'] . "\n"; + $message = "Channel: " . $data['channel'] . "
\n"; + $message .= "Description: " . $data['description'] . "
\n"; + $message .= "User: " . $data['username'] . "\n"; mail("Christopher Olsen ,Mark Iuzzolino ","New Chan Reg",$message,$headers); } @@ -537,18 +692,50 @@ return($return_array); } + /* Send Mail For TUve */ function sendMail($data) { - $query = "SELECT username FROM users WHERE uid = $data[toUID]"; - $result = $this->mysqli->query($query); - $userInfo = $result->fetch_array(MYSQLI_ASSOC); + $oid = $data['tid']; + $sid = $data['fid']; + $from = $data['from']; - $email = $userInfo['username'] . "@podz.ubixos.com"; - $from = "From: " . $data['fromName'] . " <" . $data['fromEmail'] . "@cupid.ubixos.com>"; - mail($email,$data['subject'],$data['message'],$from); + if ($oid == "") + $oid = 78; + if ($sid == "") + $sid = 78; + + $subject = $this->mysqli->real_escape_string($data['subject']); + $message = $this->mysqli->real_escape_string($data['message']); + + $pdate = time(); + + $query = "INSERT INTO mail (oid,sid,date,subject,message,folder) VALUES($oid,$sid,$pdate,'$subject','$message',0)"; + if (!$this->mysqli->query($query)) { + $errno=$this->mysqli->errno; + $this->mysqli->close(); + trigger_error("AMFPHP Remoting database SELECT query error: [$query] " . $errno); + } + + $query = "INSERT INTO mail (oid,sid,date,subject,message,folder) VALUES($sid,$oid,$pdate,'$subject','$message',1)"; + if (!$this->mysqli->query($query)) { + $errno=$this->mysqli->errno; + $this->mysqli->close(); + trigger_error("AMFPHP Remoting database SELECT query error: [$query] " . $errno); + } + + + $query = "SELECT firstname,lastname,email FROM users WHERE uid = $oid"; + if (!$result=@$this->mysqli->query($query)) { + $errno=$this->mysqli->errno; + $this->mysqli->close(); + trigger_error("AMFPHP Remoting database SELECT query error: [$query] " . $errno); + } + $row = $result->fetch_assoc(); + + + send_mail("$row[firstname] $row[lastname] <$row[email]>","You have a new message waiting for you.

Message Sender: $from
Message Subject: $data[subject]

Please follow this link http://www.tuve.tv/ to log into your account.

Sincerely,
TUve Staff
","New Message On TUve","support@tuve.tv","TUve Support"); return; } - } ?> diff --git a/docroot/images/profile/72.png b/docroot/images/profile/72.png index fd64a21..aed1bcd 100755 --- a/docroot/images/profile/72.png +++ b/docroot/images/profile/72.png Binary files differ diff --git a/docroot/images/profile/82.png b/docroot/images/profile/82.png index 0210cd4..265f9e5 100755 --- a/docroot/images/profile/82.png +++ b/docroot/images/profile/82.png Binary files differ diff --git a/docroot/upload.php b/docroot/upload.php index 0d3dd53..25ac049 100755 --- a/docroot/upload.php +++ b/docroot/upload.php @@ -37,15 +37,55 @@ if ($orig) { $orig_x = imagesx($orig); $orig_y = imagesy($orig); + + if ($orig_x > $orig_y) { + if (($orig_x <= 300) && ($orig_y <= 225)) { + $thumb_x_l = $orig_x; + $thumb_y_l = $orig_y; + } + else { + $thumb_x_l = 300; + $thumb_y_l = round(($orig_y * $thumb_x_l) / $orig_x); + } + + $thumb_x_m = 200; + $thumb_y_m = round(($orig_y * $thumb_x_m) / $orig_x); + + $thumb_x_s = 100; + $thumb_y_s = round(($orig_y * $thumb_x_s) / $orig_x); + } + else { + if (($orig_x <= 300) && ($orig_y <= 225)) { + $thumb_x_l = $orig_x; + $thumb_y_l = $orig_y; + } + else { + $thumb_y_l = 300; + $thumb_x_l = round(($orig_x * $thumb_y_l) / $orig_y); + } + + $thumb_y_m = 200; + $thumb_x_m = round(($orig_x * $thumb_y_m) / $orig_y); + + $thumb_y_s = 100; + $thumb_x_s = round(($orig_x * $thumb_y_s) / $orig_y); + } + - $thumb_x = 300; - $thumb_y = round(($orig_y * $thumb_x) / $orig_x); - - $thumb = imagecreatetruecolor($thumb_x,$thumb_y); - imagecopyresampled($thumb, $orig, 0, 0, 0, 0, $thumb_x, $thumb_y, $orig_x, $orig_y); + $thumb = imagecreatetruecolor($thumb_x_l,$thumb_y_l); + imagecopyresampled($thumb, $orig, 0, 0, 0, 0, $thumb_x_l, $thumb_y_l, $orig_x, $orig_y); imagepng($thumb,$uploaddir . $file2); + + $thumb = imagecreatetruecolor($thumb_x_m,$thumb_y_m); + imagecopyresampled($thumb, $orig, 0, 0, 0, 0, $thumb_x_m, $thumb_y_m, $orig_x, $orig_y); + imagepng($thumb,$uploaddir . $file2 . "-med.png"); + + $thumb = imagecreatetruecolor($thumb_x_s,$thumb_y_s); + imagecopyresampled($thumb, $orig, 0, 0, 0, 0, $thumb_x_s, $thumb_y_s, $orig_x, $orig_y); + imagepng($thumb,$uploaddir . $file2 . "-small.png"); + $oid = $_GET['oid']; - $query = "UPDATE users SET profile_image = 'http://www.ubixonline.com/images/profile/$file2' WHERE uid = $oid"; + $query = "UPDATE users SET main_image = 'http://www.ubixonline.com/images/profile/$file2' WHERE uid = $oid"; mysql_query($query); } else { diff --git a/include/site.inc b/include/site.inc index 4d7e174..5f7de38 100755 --- a/include/site.inc +++ b/include/site.inc @@ -10,7 +10,7 @@ /* Main includes */ include("fasttemp.inc"); include("session.inc"); - include("funcs.inc"); + include("/usr/web/sites/tuve.tv/include/funcs.inc"); /* MYSQL Connection if needed */ mysql_pconnect("ivorytower.ubixonline.com:3306","tuve","5558585");