From 778c98970ac1f87cadb14ff997a7e858e9957b20 Mon Sep 17 00:00:00 2001 From: stan Date: Fri, 31 Mar 2006 10:11:50 +0000 Subject: [PATCH] Bug 304 - Fixed stills issue with events with bulk frames. git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@1900 e3e1d417-86f3-4887-817a-d78f3d33393f --- web/zm_html_view_event.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/web/zm_html_view_event.php b/web/zm_html_view_event.php index ddff521e3..12d08616f 100644 --- a/web/zm_html_view_event.php +++ b/web/zm_html_view_event.php @@ -441,25 +441,25 @@ else { if ( $paged && !empty($page) ) { - $lo_frame_id = (($page-1)*$frames_per_page)+1; + $lo_frame_id = (($page-1)*$frames_per_page); $hi_frame_id = min( $page*$frames_per_page, $event['Frames'] ); } else { - $lo_frame_id = 1; + $lo_frame_id = 0; $hi_frame_id = $event['Frames']; } $sql = "select * from Frames where EventId = '$eid'"; - if ( $paged && !empty($page) ) - $sql .= " and FrameId between $lo_frame_id and $hi_frame_id"; $sql .= " order by FrameId"; + if ( $paged && !empty($page) ) + $sql .= " limit $lo_frame_id, $hi_frame_id"; $result = mysql_query( $sql ); if ( !$result ) die( mysql_error() ); $frames = array(); while( $frame = mysql_fetch_assoc( $result ) ) { - $frames[$frame['FrameId']] = $frame; + $frames[] = $frame; } mysql_free_result( $result ); ?> @@ -471,12 +471,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 ( $frame_id = $lo_frame_id; $frame_id <= $hi_frame_id; $frame_id++ ) + for ( $i = 0; $i < $frames_per_page; $i++ ) { - $frame = $frames[$frame_id]; + $frame = $frames[$i]; $image_data = getImageSrc( $event, $frame, $thumb_scale ); ?> -<?= $frame_id ?>/<?= $frame['Type']=='alarm'?$frame['Score']:0 ?> +<?= $frame['FrameId'] ?>/<?= $frame['Type']=='alarm'?$frame['Score']:0 ?>