diff --git a/web/includes/Event.php b/web/includes/Event.php
index 944e55248..627133659 100644
--- a/web/includes/Event.php
+++ b/web/includes/Event.php
@@ -427,31 +427,31 @@ class Event {
$captPath = $eventPath.'/'.$captImage;
if ( ! file_exists($captPath) ) {
- Error( "Capture file does not exist at $captPath" );
+ Error("Capture file does not exist at $captPath");
}
//echo "CI:$captImage, CP:$captPath, TCP:$captPath
";
- $analImage = sprintf( '%0'.ZM_EVENT_IMAGE_DIGITS.'d-analyse.jpg', $frame['FrameId'] );
+ $analImage = sprintf('%0'.ZM_EVENT_IMAGE_DIGITS.'d-analyse.jpg', $frame['FrameId']);
$analPath = $eventPath.'/'.$analImage;
//echo "AI:$analImage, AP:$analPath, TAP:$analPath
";
$alarmFrame = $frame['Type']=='Alarm';
- $hasAnalImage = $alarmFrame && file_exists( $analPath ) && filesize( $analPath );
+ $hasAnalImage = $alarmFrame && file_exists($analPath) && filesize($analPath);
$isAnalImage = $hasAnalImage && !$captureOnly;
- if ( !ZM_WEB_SCALE_THUMBS || $scale >= SCALE_BASE || !function_exists( 'imagecreatefromjpeg' ) ) {
- $imagePath = $thumbPath = $isAnalImage?$analPath:$captPath;
+ if ( !ZM_WEB_SCALE_THUMBS || $scale >= SCALE_BASE || !function_exists('imagecreatefromjpeg') ) {
+ $imagePath = $thumbPath = $isAnalImage ? $analPath : $captPath;
$imageFile = $imagePath;
$thumbFile = $thumbPath;
} else {
if ( version_compare( phpversion(), '4.3.10', '>=') )
- $fraction = sprintf( '%.3F', $scale/SCALE_BASE );
+ $fraction = sprintf('%.3F', $scale/SCALE_BASE);
else
- $fraction = sprintf( '%.3f', $scale/SCALE_BASE );
- $scale = (int)round( $scale );
+ $fraction = sprintf('%.3f', $scale/SCALE_BASE);
+ $scale = (int)round($scale);
$thumbCaptPath = preg_replace( '/\.jpg$/', "-$scale.jpg", $captPath );
$thumbAnalPath = preg_replace( '/\.jpg$/', "-$scale.jpg", $analPath );
diff --git a/web/includes/actions/monitor.php b/web/includes/actions/monitor.php
index 3fd76020c..cfb89a892 100644
--- a/web/includes/actions/monitor.php
+++ b/web/includes/actions/monitor.php
@@ -86,10 +86,15 @@ if ( $action == 'monitor' ) {
unlink($OldStorage->Path().'/'.$saferOldName);
$NewStorage = new ZM\Storage($_REQUEST['newMonitor']['StorageId']);
- if ( ! file_exists($NewStorage->Path().'/'.$mid) )
- mkdir($NewStorage->Path().'/'.$mid, 0755);
+ if ( !file_exists($NewStorage->Path().'/'.$mid) ) {
+ if ( !mkdir($NewStorage->Path().'/'.$mid, 0755) ) {
+ Error('Unable to mkdir ' . $NewStorage->Path().'/'.$mid);
+ }
+ }
$saferNewName = basename($_REQUEST['newMonitor']['Name']);
- symlink($mid, $NewStorage->Path().'/'.$saferNewName);
+ if ( !symlink($NewStorage->Path().'/'.$mid, $NewStorage->Path().'/'.$saferNewName) ) {
+ Warning('Unable to symlink ' . $NewStorage->Path().'/'.$mid . ' to ' . $NewStorage->Path().'/'.$saferNewName);
+ }
}
if ( isset($changes['Width']) || isset($changes['Height']) ) {
$newW = $_REQUEST['newMonitor']['Width'];
diff --git a/web/skins/classic/views/frame.php b/web/skins/classic/views/frame.php
index 55ba1fe8a..7aca36bc9 100644
--- a/web/skins/classic/views/frame.php
+++ b/web/skins/classic/views/frame.php
@@ -37,7 +37,7 @@ if ( !empty($fid) ) {
if ( !($frame = dbFetchOne( $sql, NULL, array($eid, $fid) )) )
$frame = array( 'FrameId'=>$fid, 'Type'=>'Normal', 'Score'=>0 );
} else {
- $frame = dbFetchOne( 'SELECT * FROM Frames WHERE EventId = ? AND Score = ?', NULL, array( $eid, $Event->MaxScore() ) );
+ $frame = dbFetchOne('SELECT * FROM Frames WHERE EventId = ? AND Score = ?', NULL, array($eid, $Event->MaxScore()));
}
$Frame = new ZM\Frame($frame);
@@ -48,7 +48,7 @@ $prevFid = $Frame->FrameId()-1;
$nextFid = $Frame->FrameId()+1;
$lastFid = $maxFid;
-$alarmFrame = $Frame->Type()=='Alarm';
+$alarmFrame = $Frame->Type() == 'Alarm';
if ( isset( $_REQUEST['scale'] ) ) {
$scale = validNum($_REQUEST['scale']);
@@ -59,7 +59,7 @@ if ( isset( $_REQUEST['scale'] ) ) {
} else {
$scale = max( reScale( SCALE_BASE, $Monitor->DefaultScale(), ZM_WEB_DEFAULT_SCALE ), SCALE_BASE );
}
-$scale = $scale ?: "auto";
+$scale = $scale ?: 'auto';
$imageData = $Event->getImageSrc( $frame, $scale, 0 );
if ( ! $imageData ) {
@@ -76,12 +76,12 @@ if (isset($_REQUEST['show']) && in_array($_REQUEST['show'], array('capt', 'anal'
$imagePath = $imageData['thumbPath'];
$eventPath = $imageData['eventPath'];
-$dImagePath = sprintf( '%s/%0'.ZM_EVENT_IMAGE_DIGITS.'d-diag-d.jpg', $eventPath, $Frame->FrameId() );
-$rImagePath = sprintf( '%s/%0'.ZM_EVENT_IMAGE_DIGITS.'d-diag-r.jpg', $eventPath, $Frame->FrameId() );
+$dImagePath = sprintf('%s/%0'.ZM_EVENT_IMAGE_DIGITS.'d-diag-d.jpg', $eventPath, $Frame->FrameId());
+$rImagePath = sprintf('%s/%0'.ZM_EVENT_IMAGE_DIGITS.'d-diag-r.jpg', $eventPath, $Frame->FrameId());
$focusWindow = true;
-xhtmlHeaders(__FILE__, translate('Frame').' - '.$Event->Id()." - ".$Frame->FrameId() );
+xhtmlHeaders(__FILE__, translate('Frame').' - '.$Event->Id().' - '.$Frame->FrameId());
?>