From a8c6e4d49ade12edca123d237ddf3c8f5b46518d Mon Sep 17 00:00:00 2001 From: stan Date: Tue, 17 Jan 2006 21:11:49 +0000 Subject: [PATCH] Fixed miscellaneous warnings and errors. git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@1838 e3e1d417-86f3-4887-817a-d78f3d33393f --- web/zm.php | 4 ++-- web/zm_actions.php | 6 +++--- web/zm_funcs.php | 5 ++++- web/zm_html_view_event.php | 31 +++++++++++-------------------- web/zm_html_view_events.php | 2 +- web/zm_html_view_filter.php | 6 +++--- web/zm_html_view_options.php | 2 +- 7 files changed, 25 insertions(+), 31 deletions(-) diff --git a/web/zm.php b/web/zm.php index 4cacb5fdb..84dfd60ad 100644 --- a/web/zm.php +++ b/web/zm.php @@ -18,7 +18,7 @@ // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // -error_reporting (E_ALL ^ E_NOTICE); +error_reporting(E_ALL ^ E_NOTICE); import_request_variables( "CGP" ); $debug = false; @@ -57,7 +57,7 @@ else { $protocol = 'http'; } -define( "ZM_URL", $protocol.'://'.$_SERVER['HTTP_HOST'] ); +define( "ZM_BASE_URL", $protocol.'://'.$_SERVER['HTTP_HOST'] ); if ( empty($format) ) { diff --git a/web/zm_actions.php b/web/zm_actions.php index def9c18e0..9a3848ac7 100644 --- a/web/zm_actions.php +++ b/web/zm_actions.php @@ -218,7 +218,7 @@ if ( isset($action) ) } } } - if ( canView( 'Control', $mid ) ) + if ( isset($mid) && canView( 'Control', $mid ) ) { if ( $action == "control" && isset( $mid ) ) { @@ -925,7 +925,7 @@ if ( isset($action) ) die( mysql_error() ); } } - if ( canEdit( 'Control' ) ) + if ( isset($mid) && canEdit( 'Control' ) ) { if ( $action == "controlcap" && isset( $cid ) ) { @@ -989,7 +989,7 @@ if ( isset($action) ) } } } - if ( canEdit( 'Monitors', $mid ) ) + if ( isset($mid) && canEdit( 'Monitors', $mid ) ) { if ( $action == "function" && isset( $mid ) ) { diff --git a/web/zm_funcs.php b/web/zm_funcs.php index 3c8f8dadd..49e9d031f 100644 --- a/web/zm_funcs.php +++ b/web/zm_funcs.php @@ -130,7 +130,7 @@ function getStreamSrc( $args ) global $_SESSION, $_SERVER; } - $stream_src = ZM_URL.ZM_PATH_ZMS; + $stream_src = ZM_BASE_URL.ZM_PATH_ZMS; if ( ZM_OPT_USE_AUTH ) { @@ -1065,6 +1065,8 @@ function parseSort( $save_to_session=false, $term_sep='&' ) { global $sort_field, $sort_asc; // Inputs global $sort_query, $sort_column, $sort_order; // Outputs + global $limit; + if ( version_compare( phpversion(), "4.1.0", "<") ) { global $_SESSION; @@ -1118,6 +1120,7 @@ function parseSort( $save_to_session=false, $term_sep='&' ) $sort_order = $sort_asc?"asc":"desc"; if ( !$sort_asc ) $sort_asc = 0; $sort_query = $term_sep."sort_field=".$sort_field.$term_sep."sort_asc=".$sort_asc; + if ( !isset($limit) ) $limit = ""; if ( $save_to_session ) { $_SESSION['sort_field'] = $sort_field; diff --git a/web/zm_html_view_event.php b/web/zm_html_view_event.php index 642d54885..69a1a06d1 100644 --- a/web/zm_html_view_event.php +++ b/web/zm_html_view_event.php @@ -56,7 +56,7 @@ if ( !$result ) die( mysql_error() ); while ( $row = mysql_fetch_assoc( $result ) ) { - if ( $row[Id] == $eid ) + if ( $row['Id'] == $eid ) { $prev_event = mysql_fetch_assoc( $result ); break; @@ -70,7 +70,7 @@ if ( !$result ) die( mysql_error() ); while ( $row = mysql_fetch_assoc( $result ) ) { - if ( $row[Id] == $eid ) + if ( $row['Id'] == $eid ) { $next_event = mysql_fetch_assoc( $result ); break; @@ -114,6 +114,9 @@ if ( $mode == "stream" ) //$panel_sections = ((int)($event['Width']/$panel_section_width))+1; //$panel_width = $panel_sections*$panel_section_width; $panel_timeout = (int)((($frame_data['RealDuration']+1)*1000)/$panel_sections); + + if ( !isset( $play ) ) + $play = false; } ob_start(); @@ -403,7 +406,7 @@ if ( $mode == "stream" ) - - + +<?= $frame_id ?>/<?= $frame['Type']=='alarm'?$frame['Score']:0 ?> - - - - - -
-
<?= $frame_id ?>/<?= $frame['Type']=='alarm'?$frame['Score']:0 ?>
+ diff --git a/web/zm_html_view_events.php b/web/zm_html_view_events.php index 658bcdd7c..da969a9a3 100644 --- a/web/zm_html_view_events.php +++ b/web/zm_html_view_events.php @@ -131,7 +131,7 @@ else $events[] = $event; $scale = max( reScale( SCALE_BASE, $event['DefaultScale'], ZM_WEB_DEFAULT_SCALE ), SCALE_BASE ); $event_width = reScale( $event['Width'], $scale ); - $event_height = reScale( $event['Height'], $$scale ); + $event_height = reScale( $event['Height'], $scale ); if ( $max_width < $event_width ) $max_width = $event_width; if ( $max_height < $event_height ) $max_height = $event_height; if ( $event['Archived'] ) diff --git a/web/zm_html_view_filter.php b/web/zm_html_view_filter.php index 4fa66ac44..24086fe5d 100644 --- a/web/zm_html_view_filter.php +++ b/web/zm_html_view_filter.php @@ -31,7 +31,7 @@ if ( !$result ) while ( $row = mysql_fetch_assoc( $result ) ) { $filter_names[$row['Name']] = $row['Name']; - if ( $reload && isset($filter_name) && $filter_name == $row['Name'] ) + if ( isset($reload) && isset($filter_name) && $filter_name == $row['Name'] ) { $filter_data = $row; } @@ -137,7 +137,7 @@ $sort_dirns = array( '1' => $zmSlangSortAsc, '0' => $zmSlangSortDesc ); -if ( !$sort_field ) +if ( empty($sort_field) ) { $sort_field = ZM_WEB_EVENT_SORT_FIELD; $sort_asc = (ZM_WEB_EVENT_SORT_ORDER == "asc"); @@ -316,7 +316,7 @@ else 2 ) { echo buildSelect( $obracket_name, $obracket_types ); } else { ?>  -
+
diff --git a/web/zm_html_view_options.php b/web/zm_html_view_options.php index 8ac38cecd..286264d28 100644 --- a/web/zm_html_view_options.php +++ b/web/zm_html_view_options.php @@ -227,7 +227,7 @@ else foreach ( $config_cat as $name=>$value ) { $option_prompt_var = "zmOlangPrompt".preg_replace( '/^ZM_/', '', $value['Name'] ); - $option_prompt_text = $$option_prompt_var?$$option_prompt_var:$value['Prompt']; + $option_prompt_text = isset($$option_prompt_var)?$$option_prompt_var:$value['Prompt']; ?>