Fixed miscellaneous warnings and errors.
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@1838 e3e1d417-86f3-4887-817a-d78f3d33393fpull/27/merge
parent
006f50211f
commit
a8c6e4d49a
|
@ -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) )
|
||||
{
|
||||
|
|
|
@ -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 ) )
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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" )
|
|||
<?php
|
||||
for ( $i = 0; $i < $panel_sections; $i++ )
|
||||
{
|
||||
$start_frame = 1+(int)round(($i * $event[Frames])/$panel_sections);
|
||||
$start_frame = 1+(int)round(($i * $event['Frames'])/$panel_sections);
|
||||
if ( ZM_WEB_SHOW_PROGRESS && !empty($fid) && $start_frame < $fid )
|
||||
{
|
||||
$section_color = $panel_done_color;
|
||||
|
@ -462,36 +465,24 @@ else
|
|||
}
|
||||
mysql_free_result( $result );
|
||||
?>
|
||||
<tr><td><table border="0" cellpadding="0" cellspacing="2" align="center">
|
||||
<tr>
|
||||
<tr><td><div style="text-align: center">
|
||||
<?php
|
||||
$count = 0;
|
||||
|
||||
$thumb_width = (int)round($event['Width']/ZM_WEB_FRAMES_PER_LINE);
|
||||
$thumb_height = (int)round($event['Height']/ZM_WEB_FRAMES_PER_LINE);
|
||||
$scale = (int)round( SCALE_BASE/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++ )
|
||||
{
|
||||
$frame = $frames[$frame_id];
|
||||
$image_data = getImageSrc( $event, $frame, $scale );
|
||||
$image_data = getImageSrc( $event, $frame, $thumb_scale );
|
||||
?>
|
||||
<td align="center" width="88"><a href="javascript: newWindow( '<?= $PHP_SELF ?>?view=frame&eid=<?= $eid ?>&fid=<?= $frame_id ?>&scale=<?= $scale ?>', 'zmImage', <?= reScale( $event['Width'], $scale )+$jws['image']['w'] ?>, <?= reScale( $event['Height'], $scale )+$jws['image']['h'] ?> );"><img src="<?= $image_data['thumbPath'] ?>" width="<?= $thumb_width ?>" height="<?= $thumb_height ?>" class="<?= $image_data['imageClass'] ?>" alt="<?= $frame_id ?>/<?= $frame['Type']=='alarm'?$frame['Score']:0 ?>"></a></td>
|
||||
<a href="javascript: newWindow( '<?= $PHP_SELF ?>?view=frame&eid=<?= $eid ?>&fid=<?= $frame_id ?>&scale=<?= $scale ?>', 'zmImage', <?= reScale( $event['Width'], $scale )+$jws['image']['w'] ?>, <?= reScale( $event['Height'], $scale )+$jws['image']['h'] ?> );"><img src="<?= $image_data['thumbPath'] ?>" width="<?= $thumb_width ?>" height="<?= $thumb_height ?>" class="<?= $image_data['imageClass'] ?>" alt="<?= $frame_id ?>/<?= $frame['Type']=='alarm'?$frame['Score']:0 ?>"></a>
|
||||
<?php
|
||||
if ( !(++$count % $frames_per_line) )
|
||||
{
|
||||
?>
|
||||
</tr>
|
||||
<?php
|
||||
flush();
|
||||
?>
|
||||
<tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
</table></td></tr>
|
||||
</div></td></tr>
|
||||
<?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'] )
|
||||
|
|
|
@ -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
|
|||
<td class="text"><?php if ( $trms > 2 ) { echo buildSelect( $obracket_name, $obracket_types ); } else { ?> <?php } ?></td>
|
||||
<td class="text"><?= buildSelect( $attr_name, $attr_types, "$value_name.value = ''; submitToFilter( document.filter_form, 0 );" ); ?></td>
|
||||
<?php if ( $$attr_name == "Archived" ) { ?>
|
||||
<td class="text"><center><?= $zmSlangIsEqualTo ?><input type="hidden" name="<?= $op_name ?>" value="="></center></td>
|
||||
<td class="text"><center><?= $zmSlangOpEq ?><input type="hidden" name="<?= $op_name ?>" value="="></center></td>
|
||||
<td class="text"><?= buildSelect( $value_name, $archive_types ); ?></td>
|
||||
<?php } elseif ( $$attr_name ) { ?>
|
||||
<td class="text"><?= buildSelect( $op_name, $op_types ); ?></td>
|
||||
|
|
|
@ -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'];
|
||||
?>
|
||||
<tr>
|
||||
<td align="left" class="text"><?= $value['Name'] ?></td>
|
||||
|
|
Loading…
Reference in New Issue