From e855ad685f1d4f18c07615296e30d3e44c0bd5ae Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 30 May 2017 11:14:22 -0400 Subject: [PATCH] small cleanups --- web/includes/functions.php | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/web/includes/functions.php b/web/includes/functions.php index 075df7a95..4759adb10 100644 --- a/web/includes/functions.php +++ b/web/includes/functions.php @@ -350,13 +350,21 @@ function outputControlStream( $src, $width, $height, $monitor, $scale, $target ) - + - + - + - + @@ -387,29 +395,29 @@ function getImageStill( $id, $src, $width, $height, $title='' ) { function outputControlStill( $src, $width, $height, $monitor, $scale, $target ) { ?> -
+ - + - + - + -
- + '; } $string .= $label; - $string .= ''; + $string .= ''; return( $string ); } @@ -838,12 +844,13 @@ function zmcControl( $monitor, $mode=false ) { $row = NULL; if ( $monitor['Type'] == 'Local' ) { $row = dbFetchOne( "SELECT count(if(Function!='None',1,NULL)) AS ActiveCount FROM Monitors WHERE Device = ?", NULL, array($monitor['Device']) ); - $zmcArgs = '-d '.escapeshellarg( $monitor['Device'] ); + $zmcArgs = '-d '.$monitor['Device']; } else { $row = dbFetchOne( "SELECT count(if(Function!='None',1,NULL)) AS ActiveCount FROM Monitors WHERE Id = ?", NULL, array($monitor['Id']) ); $zmcArgs = '-m '.$monitor['Id']; } $activeCount = $row['ActiveCount']; + if ( (!$activeCount) || ($mode == 'stop') ) { daemonControl( 'stop', 'zmc', $zmcArgs ); } else { @@ -985,7 +992,7 @@ function viewImagePath( $path, $querySep='&' ) { } function createListThumbnail( $event, $overwrite=false ) { -# Load the frame with the highest score to use as a thumbnail + # Load the frame with the highest score to use as a thumbnail if ( !($frame = dbFetchOne( "SELECT * FROM Frames WHERE EventId=? AND Score=? ORDER BY FrameId LIMIT 1", NULL, array( $event['Id'], $event['MaxScore'] ) )) ) return( false ); @@ -1007,6 +1014,7 @@ function createListThumbnail( $event, $overwrite=false ) { if ( ! $imageData ) { return ( false ); } + $thumbData = $frame; $thumbData['Path'] = $imageData['thumbPath']; $thumbData['Width'] = (int)$thumbWidth;