From 87cafe04179c7c20a002aa8c4dbef45e60db43bf Mon Sep 17 00:00:00 2001 From: stan Date: Sun, 12 Jun 2005 18:09:56 +0000 Subject: [PATCH] Bug 83: Fixed broken number of columns in montage mode. git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@1456 e3e1d417-86f3-4887-817a-d78f3d33393f --- web/zm_html_view_console.php | 5 ++--- web/zm_html_view_montage.php | 6 ++---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/web/zm_html_view_console.php b/web/zm_html_view_console.php index e1b7ddf25..4c5eb1c8f 100644 --- a/web/zm_html_view_console.php +++ b/web/zm_html_view_console.php @@ -78,9 +78,8 @@ while( $row = mysql_fetch_assoc( $result ) ) } $monitors[] = $row = array_merge( $row, $row2, $row3 ); } -$max_cols = 8; -$montage_cols = (int)(($cycle_count+1)/((int)(($cycle_count-1)/ZM_WEB_MONTAGE_MAX_COLS)+1)); -$montage_rows = intval(ceil($cycle_count/$montage_cols)); +$montage_rows = intval((($cycle_count-1)/ZM_WEB_MONTAGE_MAX_COLS)+1); +$montage_cols = intval(ceil($cycle_count/$montage_rows)); $montage_width = ZM_WEB_MONTAGE_WIDTH?ZM_WEB_MONTAGE_WIDTH:$max_width; $montage_height = ZM_WEB_MONTAGE_HEIGHT?ZM_WEB_MONTAGE_HEIGHT:$max_height; diff --git a/web/zm_html_view_montage.php b/web/zm_html_view_montage.php index 2df2e5cb0..5dccde479 100644 --- a/web/zm_html_view_montage.php +++ b/web/zm_html_view_montage.php @@ -48,10 +48,8 @@ while( $row = mysql_fetch_assoc( $result ) ) $monitors[] = $row; } -$max_cols = 8; -$cols = (int)((count($monitors)+1)/((int)((count($monitors)-1)/ZM_WEB_MONTAGE_MAX_COLS)+1)); -$rows = intval(ceil(count($monitors)/$cols)); -$last_cols = count($monitors)%$rows; +$rows = intval(((count($monitors)-1)/ZM_WEB_MONTAGE_MAX_COLS)+1); +$cols = intval(ceil(count($monitors)/$rows)); $widths = array(); $heights = array();