zoneminder/web/zm_config.php.z

155 lines
7.5 KiB
Plaintext

<?php
//
// ZoneMinder web configuration file, $Date$, $Revision$
// Copyright (C) 2003 Philip Coombes
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
// This section contains options substituted by the zmconfig.pl utility, do not edit these directly
//
define( "ZM_VERSION", "<from zmconfig>" ); // Version Number
define( "ZM_PATH_BIN", "<from zmconfig>" ); // Path to binaries
define( "ZM_PATH_WEB", "<from zmconfig>" ); // Path to web files
define( "ZM_PATH_CGI", "<from zmconfig>" ); // Path to cgi files
define( "ZM_DB_SERVER", "<from zmconfig>" ); // Database server
define( "ZM_DB_NAME", "<from zmconfig>" ); // Database containing the tables
define( "ZM_DB_USERA", "<from zmconfig>" ); // Database login
define( "ZM_DB_PASSA", "<from zmconfig>" ); // Database password
// This section is options normally derived from other options or configuration
//
define( "ZM_DB_USER", ZM_DB_USERA ); // Database login
define( "ZM_DB_PASS", ZM_DB_PASSA ); // Database password
define( "ZMU_PATH", ZM_PATH_BIN."/zmu" ); // Local path to the ZoneMinder Utility
// These are miscellaneous options you won't normally need to change
//
define( "MAX_EVENTS", 10 ); // The maximum number of events to show in the monitor event listing
define( "EVENT_HEADER_LINES", 25 ); // How many events are listed in the event window before a new header is inserted
define( "EVENT_FRAMES_PER_LINE", 4 ); // How many images per line in the event image view
define( "EVENT_FRAME_LINES", 4 ); // How many lines of images to show in paged mode
define( "RATE_SCALE", 100 ); // The additional scaling factor used to help get fractional rates in integer format
define( "SCALE_SCALE", 100 ); // The additional scaling factor used to help get fractional scales in integer format
define( "LEARN_MODE", false ); // Currently unimplemented, do not change
require_once( 'zm_db.php' );
loadConfig();
switch ( $bandwidth )
{
case "high" :
{
define( "REFRESH_MAIN", ZM_WEB_H_REFRESH_MAIN ); // How often (in seconds) the main console window refreshes
define( "REFRESH_CYCLE", ZM_WEB_H_REFRESH_CYCLE ); // How often the cycle watch windows swaps to the next monitor
define( "REFRESH_IMAGE", ZM_WEB_H_REFRESH_IMAGE ); // How often the watched image is refreshed (if not streaming)
define( "REFRESH_STATUS", ZM_WEB_H_REFRESH_STATUS ); // How often the little status frame refreshes itself in the watch window
define( "REFRESH_EVENTS", ZM_WEB_H_REFRESH_EVENTS ); // How often the event listing is refreshed in the watch window, only for recent events
define( "VIDEO_BITRATE", ZM_WEB_H_VIDEO_BITRATE ); // What the bitrate of any streamed video should be
define( "VIDEO_MAXFPS", ZM_WEB_H_VIDEO_MAXFPS ); // What the maximum frame rate of any streamed video should be
define( "IMAGE_SCALING", ZM_WEB_H_IMAGE_SCALING ); // Image scaling for thumbnails, bandwidth versus cpu in rescaling
break;
}
case "medium" :
{
define( "REFRESH_MAIN", ZM_WEB_M_REFRESH_MAIN ); // How often (in seconds) the main console window refreshes
define( "REFRESH_CYCLE", ZM_WEB_M_REFRESH_CYCLE ); // How often the cycle watch windows swaps to the next monitor
define( "REFRESH_IMAGE", ZM_WEB_M_REFRESH_IMAGE ); // How often the watched image is refreshed (if not streaming)
define( "REFRESH_STATUS", ZM_WEB_M_REFRESH_STATUS ); // How often the little status frame refreshes itself in the watch window
define( "REFRESH_EVENTS", ZM_WEB_M_REFRESH_EVENTS ); // How often the event listing is refreshed in the watch window, only for recent events
define( "VIDEO_BITRATE", ZM_WEB_M_VIDEO_BITRATE ); // What the bitrate of any streamed video should be
define( "VIDEO_MAXFPS", ZM_WEB_M_VIDEO_MAXFPS ); // What the maximum frame rate of any streamed video should be
define( "IMAGE_SCALING", ZM_WEB_M_IMAGE_SCALING ); // Image scaling for thumbnails, bandwidth versus cpu in rescaling
break;
}
case "low" :
{
define( "REFRESH_MAIN", ZM_WEB_L_REFRESH_MAIN ); // How often (in seconds) the main console window refreshes
define( "REFRESH_CYCLE", ZM_WEB_L_REFRESH_CYCLE ); // How often the cycle watch windows swaps to the next monitor
define( "REFRESH_IMAGE", ZM_WEB_L_REFRESH_IMAGE ); // How often the watched image is refreshed (if not streaming)
define( "REFRESH_STATUS", ZM_WEB_L_REFRESH_STATUS ); // How often the little status frame refreshes itself in the watch window
define( "REFRESH_EVENTS", ZM_WEB_L_REFRESH_EVENTS ); // How often the event listing is refreshed in the watch window, only for recent events
define( "VIDEO_BITRATE", ZM_WEB_L_VIDEO_BITRATE ); // What the bitrate of any streamed video should be
define( "VIDEO_MAXFPS", ZM_WEB_L_VIDEO_MAXFPS ); // What the maximum frame rate of any streamed video should be
define( "IMAGE_SCALING", ZM_WEB_L_IMAGE_SCALING ); // Image scaling for thumbnails, bandwidth versus cpu in rescaling
break;
}
case "mobile" : // Very incomplete at present
{
define( "REFRESH_MAIN", ZM_WEB_P_REFRESH_MAIN ); // How often (in seconds) the main console window refreshes
define( "REFRESH_IMAGE", ZM_WEB_P_REFRESH_IMAGE ); // How often the watched image is refreshed (if not streaming)
break;
}
}
function loadConfig()
{
global $config;
global $config_cats;
$config = array();
$config_cat = array();
$sql = "select * from Config";
$result = mysql_query( $sql );
if ( !$result )
echo mysql_error();
$monitors = array();
while( $row = mysql_fetch_assoc( $result ) )
{
define( $row['Name'], $row['Value'] );
$config[$row['Name']] = $row;
if ( !($config_cat = &$config_cats[$row['Category']]) )
{
$config_cats[$row['Category']] = array();
$config_cat = &$config_cats[$row['Category']];
}
$config_cat[$row['Name']] = $row;
}
//print_r( $config );
//print_r( $config_cats );
}
// Javascript window sizes
$jws = array(
'console' => array( 'w'=>720, 'h'=>540 ),
'state' => array( 'w'=>300, 'h'=>120 ),
'version' => array( 'w'=>320, 'h'=>140 ),
'cycle' => array( 'w'=>16, 'h'=>32 ),
'montage' => array( 'w'=>20, 'h'=>20 ),
'monitor' => array( 'w'=>360, 'h'=>300 ),
'watch' => array( 'w'=>72, 'h'=>342 ),
'device' => array( 'w'=>196, 'h'=>164 ),
'function' => array( 'w'=>248, 'h'=>92 ),
'events' => array( 'w'=>720, 'h'=>480 ),
'event' => array( 'w'=>72, 'h'=>168 ),
'filter' => array( 'w'=>560, 'h'=>250 ),
'filtersave' => array( 'w'=>560, 'h'=>220 ),
'zones' => array( 'w'=>72, 'h'=>232 ),
'zone' => array( 'w'=>360, 'h'=>500 ),
'video' => array( 'w'=>100, 'h'=>80 ),
'image' => array( 'w'=>48, 'h'=>80 ),
'frames' => array( 'w'=>500, 'h'=>300 ),
'stats' => array( 'w'=>600, 'h'=>200 ),
'options' => array( 'w'=>760, 'h'=>480 ),
'optionhelp' => array( 'w'=>320, 'h'=>240 ),
'restarting' => array( 'w'=>250, 'h'=>150 ),
'user' => array( 'w'=>230, 'h'=>340 ),
'settings' => array( 'w'=>200, 'h'=>225 ),
'logout' => array( 'w'=>200, 'h'=>100 ),
'bandwidth' => array( 'w'=>200, 'h'=>90 ),
);
?>