diff --git a/docroot/amfphp/services/tuve.php b/docroot/amfphp/services/tuve.php index 228dc26..f6351ca 100755 --- a/docroot/amfphp/services/tuve.php +++ b/docroot/amfphp/services/tuve.php @@ -184,7 +184,7 @@ else $mType = " AND mType = 1"; - $query = "SELECT vid,artist,title,length,thumb,genre FROM videos WHERE (artist like \"%$skey%\" OR title like \"%$skey%\") AND rating <= $srating$mType"; + $query = "SELECT vid,artist,title,length,thumb,genre FROM videos WHERE status = 0 AND (artist like \"%$skey%\" OR title like \"%$skey%\") AND rating <= $srating$mType"; if ($sclass != 0) $query .= " AND classification = $sclass"; if ($exclusive != 0) @@ -199,9 +199,9 @@ } while ($row = $result->fetch_assoc()) { if ($row['length'] > 3600) - $row['length'] = date("H:i:s",$row['length']); + $row['length'] = makeTime($row['length']); //date("H:i:s",$row['length']); else - $row['length'] = date("i:s",$row['length']); + $row['length'] = makeTime($row['length']); date("i:s",$row['length']); $return_array[] = $row; } return($return_array); diff --git a/docroot/amfphp/services/tuveAdmin.php b/docroot/amfphp/services/tuveAdmin.php index 64d6cc3..c24f2e4 100755 --- a/docroot/amfphp/services/tuveAdmin.php +++ b/docroot/amfphp/services/tuveAdmin.php @@ -371,9 +371,9 @@ $sKey = $data['skey']; $uid = $data['uid']; if ($data['gid'] == 1) - $query = "SELECT channel FROM channels WHERE channel LIKE \"%$sKey%\" ORDER BY channel"; + $query = "SELECT channel,cid FROM channels WHERE channel LIKE \"%$sKey%\" ORDER BY channel"; else - $query = "SELECT channel FROM channels WHERE oid = $uid AND channel LIKE \"%$sKey%\" ORDER BY channel"; + $query = "SELECT channel,cid FROM channels WHERE oid = $uid AND channel LIKE \"%$sKey%\" ORDER BY channel"; if (!$result=@$this->mysqli->query($query)) { $errno=$this->mysqli->errno; @@ -417,7 +417,23 @@ $row = $result->fetch_assoc(); return($row); } + function getSchedule($data) { + $stime = strtotime($data[date]); + $etime = $stime + 86400; + $query = "SELECT sid,time,artist,title FROM schedule s INNER JOIN videos v ON s.vid = v.vid WHERE cid = $data[cid] AND (time >= $stime AND time < $etime) ORDER BY time"; + 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()) { + $row['time'] = date("H:i:s",$row['time']); + $return_array[] = $row; + } + return($return_array); + } + function getChannel($data) { $query = "SELECT * FROM channels WHERE channel = '$data'"; if (!$result=@$this->mysqli->query($query)) { @@ -425,10 +441,9 @@ $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 addArtist($data) {