From c8b03f530c455318dea99118b0ff5fffad9b8fc8 Mon Sep 17 00:00:00 2001 From: stan Date: Thu, 16 Nov 2006 19:06:31 +0000 Subject: [PATCH] Bug 346 - Stills event view now shows all frames. git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@2070 e3e1d417-86f3-4887-817a-d78f3d33393f --- web/zm_html_view_event.php | 13 ++++++++----- web/zm_html_view_frame.php | 6 ++++-- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/web/zm_html_view_event.php b/web/zm_html_view_event.php index 93feebc04..0be6bbec0 100644 --- a/web/zm_html_view_event.php +++ b/web/zm_html_view_event.php @@ -449,12 +449,12 @@ else { if ( $paged && !empty($page) ) { - $lo_frame_id = (($page-1)*$frames_per_page); + $lo_frame_id = (($page-1)*$frames_per_page)+1; $hi_frame_id = min( $page*$frames_per_page, $event['Frames'] ); } else { - $lo_frame_id = 0; + $lo_frame_id = 1; $hi_frame_id = $event['Frames']; } $sql = "select * from Frames where EventId = '$eid'"; @@ -467,7 +467,7 @@ else $frames = array(); while( $frame = mysql_fetch_assoc( $result ) ) { - $frames[] = $frame; + $frames[$frame['FrameId']] = $frame; } mysql_free_result( $result ); ?> @@ -479,9 +479,12 @@ else $thumb_height = (int)round($event['Height']/ZM_WEB_FRAMES_PER_LINE); $thumb_scale = (int)round( SCALE_BASE/ZM_WEB_FRAMES_PER_LINE ); - for ( $i = 0; $i < count($frames); $i++ ) + for ( $i = $lo_frame_id; $i <= $hi_frame_id; $i++ ) { - $frame = $frames[$i]; + if ( !($frame = $frames[$i]) ) + { + $frame = array( 'FrameId'=>$i, 'Type'=>'Normal' ); + } $image_data = getImageSrc( $event, $frame, $thumb_scale ); ?> <?= $frame['FrameId'] ?>/<?= $frame['Type']=='alarm'?$frame['Score']:0 ?> diff --git a/web/zm_html_view_frame.php b/web/zm_html_view_frame.php index 2175a9fc8..d29e81c82 100644 --- a/web/zm_html_view_frame.php +++ b/web/zm_html_view_frame.php @@ -18,7 +18,6 @@ // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // -error_reporting( E_ALL ); if ( !canView( 'Events' ) ) { $view = "error"; @@ -36,7 +35,10 @@ if ( $fid ) $result = mysql_query( "select * from Frames where EventId = '$eid' and FrameId = '$fid'" ); if ( !$result ) die( mysql_error() ); - $frame = mysql_fetch_assoc( $result ); + if ( !($frame = mysql_fetch_assoc( $result )) ) + { + $frame = array( 'FrameId'=>$fid, 'Type'=>'Normal', 'Score'=>0 ); + } mysql_free_result( $result ); } else