" ); // Version Number define( "ZM_CONFIG", "" ); // Path to config file define( "ZM_PATH_BIN", "" ); // Path to binaries define( "ZM_PATH_WEB", "" ); // Path to web files define( "ZM_PATH_CGI", "" ); // Path to cgi files $cfg = fopen( ZM_CONFIG, "r") or die("Could not open config file."); while ( !feof($cfg) ) { $str = fgets( $cfg, 256 ); if ( preg_match( '/^\s*$/', $str )) { continue; } elseif ( preg_match( '/^\s*#/', $str )) { continue; } elseif ( preg_match( '/^\s*([^=\s]+)\s*=\s*([^=\s]+)\s*$/', $str, $matches )) { if (( $matches[1] == "ZM_DB_SERVER") || ( $matches[1] == "ZM_DB_NAME") || ( $matches[1] == "ZM_DB_USER") || ( $matches[1] == "ZM_DB_PASS")) { define( $matches[1], $matches[2] ); } } } fclose( $cfg ); // This section is options normally derived from other options or configuration // define( "ZMU_PATH", ZM_PATH_BIN."/zmu" ); // Local path to the ZoneMinder Utility // Alarm states // define( "STATE_IDLE", 0 ); define( "STATE_PREALARM", 1 ); define( "STATE_ALARM", 2 ); define( "STATE_ALERT", 3 ); define( "STATE_TAPE", 4 ); // 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( "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 define( 'DEVICE_WIDTH', 150 ); // Default device width for phones and handhelds define( 'DEVICE_HEIGHT', 150 ); // Default device height for phones and handhelds define( 'DEVICE_LINES', 10 ); // Default device lines for phones and handhelds require_once( 'zm_db.php' ); loadConfig(); switch ( $bandwidth ) { case "high" : { define( "ZM_WEB_REFRESH_MAIN", ZM_WEB_H_REFRESH_MAIN ); // How often (in seconds) the main console window refreshes define( "ZM_WEB_REFRESH_CYCLE", ZM_WEB_H_REFRESH_CYCLE ); // How often the cycle watch windows swaps to the next monitor define( "ZM_WEB_REFRESH_IMAGE", ZM_WEB_H_REFRESH_IMAGE ); // How often the watched image is refreshed (if not streaming) define( "ZM_WEB_REFRESH_STATUS", ZM_WEB_H_REFRESH_STATUS ); // How often the little status frame refreshes itself in the watch window define( "ZM_WEB_REFRESH_EVENTS", ZM_WEB_H_REFRESH_EVENTS ); // How often the event listing is refreshed in the watch window, only for recent events define( "ZM_WEB_DEFAULT_SCALE", ZM_WEB_H_DEFAULT_SCALE ); // What the default scaling factor applied to 'live' or 'event' views is (%) define( "ZM_WEB_DEFAULT_RATE", ZM_WEB_H_DEFAULT_RATE ); // What the default replay rate factor applied to 'event' views is (%) define( "ZM_WEB_VIDEO_BITRATE", ZM_WEB_H_VIDEO_BITRATE ); // What the bitrate of any streamed video should be define( "ZM_WEB_VIDEO_MAXFPS", ZM_WEB_H_VIDEO_MAXFPS ); // What the maximum frame rate of any streamed video should be define( "ZM_WEB_IMAGE_SCALING", ZM_WEB_H_IMAGE_SCALING ); // Image scaling for thumbnails, bandwidth versus cpu in rescaling break; } case "medium" : { define( "ZM_WEB_REFRESH_MAIN", ZM_WEB_M_REFRESH_MAIN ); // How often (in seconds) the main console window refreshes define( "ZM_WEB_REFRESH_CYCLE", ZM_WEB_M_REFRESH_CYCLE ); // How often the cycle watch windows swaps to the next monitor define( "ZM_WEB_REFRESH_IMAGE", ZM_WEB_M_REFRESH_IMAGE ); // How often the watched image is refreshed (if not streaming) define( "ZM_WEB_REFRESH_STATUS", ZM_WEB_M_REFRESH_STATUS ); // How often the little status frame refreshes itself in the watch window define( "ZM_WEB_REFRESH_EVENTS", ZM_WEB_M_REFRESH_EVENTS ); // How often the event listing is refreshed in the watch window, only for recent events define( "ZM_WEB_DEFAULT_SCALE", ZM_WEB_M_DEFAULT_SCALE ); // What the default scaling factor applied to 'live' or 'event' views is (%) define( "ZM_WEB_DEFAULT_RATE", ZM_WEB_M_DEFAULT_RATE ); // What the default replay rate factor applied to 'event' views is (%) define( "ZM_WEB_VIDEO_BITRATE", ZM_WEB_M_VIDEO_BITRATE ); // What the bitrate of any streamed video should be define( "ZM_WEB_VIDEO_MAXFPS", ZM_WEB_M_VIDEO_MAXFPS ); // What the maximum frame rate of any streamed video should be define( "ZM_WEB_IMAGE_SCALING", ZM_WEB_M_IMAGE_SCALING ); // Image scaling for thumbnails, bandwidth versus cpu in rescaling break; } case "low" : { define( "ZM_WEB_REFRESH_MAIN", ZM_WEB_L_REFRESH_MAIN ); // How often (in seconds) the main console window refreshes define( "ZM_WEB_REFRESH_CYCLE", ZM_WEB_L_REFRESH_CYCLE ); // How often the cycle watch windows swaps to the next monitor define( "ZM_WEB_REFRESH_IMAGE", ZM_WEB_L_REFRESH_IMAGE ); // How often the watched image is refreshed (if not streaming) define( "ZM_WEB_REFRESH_STATUS", ZM_WEB_L_REFRESH_STATUS ); // How often the little status frame refreshes itself in the watch window define( "ZM_WEB_REFRESH_EVENTS", ZM_WEB_L_REFRESH_EVENTS ); // How often the event listing is refreshed in the watch window, only for recent events define( "ZM_WEB_DEFAULT_SCALE", ZM_WEB_L_DEFAULT_SCALE ); // What the default scaling factor applied to 'live' or 'event' views is (%) define( "ZM_WEB_DEFAULT_RATE", ZM_WEB_L_DEFAULT_RATE ); // What the default replay rate factor applied to 'event' views is (%) define( "ZM_WEB_VIDEO_BITRATE", ZM_WEB_L_VIDEO_BITRATE ); // What the bitrate of any streamed video should be define( "ZM_WEB_VIDEO_MAXFPS", ZM_WEB_L_VIDEO_MAXFPS ); // What the maximum frame rate of any streamed video should be define( "ZM_WEB_IMAGE_SCALING", ZM_WEB_L_IMAGE_SCALING ); // Image scaling for thumbnails, bandwidth versus cpu in rescaling break; } case "mobile" : // Very incomplete at present { define( "ZM_WEB_REFRESH_MAIN", ZM_WEB_P_REFRESH_MAIN ); // How often (in seconds) the main console window refreshes define( "ZM_WEB_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 order by Id asc"; $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( 'bandwidth' => array( 'w'=>200, 'h'=>90 ), 'console' => array( 'w'=>720, 'h'=>312 ), 'control' => array( 'w'=>380, 'h'=>480 ), 'controlcaps' => array( 'w'=>700, 'h'=>320 ), 'controlcap' => array( 'w'=>360, 'h'=>440 ), 'cycle' => array( 'w'=>16, 'h'=>32 ), 'device' => array( 'w'=>196, 'h'=>164 ), 'donate' => array( 'w'=>500, 'h'=>280 ), 'event' => array( 'w'=>96, 'h'=>168 ), 'eventdetail' => array( 'w'=>400, 'h'=>220 ), 'events' => array( 'w'=>720, 'h'=>480 ), 'export' => array( 'w'=>400, 'h'=>340 ), 'filter' => array( 'w'=>560, 'h'=>250 ), 'filtersave' => array( 'w'=>560, 'h'=>220 ), 'frames' => array( 'w'=>500, 'h'=>300 ), 'function' => array( 'w'=>248, 'h'=>92 ), 'groups' => array( 'w'=>400, 'h'=>220 ), 'image' => array( 'w'=>48, 'h'=>80 ), 'login' => array( 'w'=>720, 'h'=>480 ), 'logout' => array( 'w'=>200, 'h'=>100 ), 'monitor' => array( 'w'=>360, 'h'=>324 ), 'montage' => array( 'w'=>10, 'h'=>20 ), 'optionhelp' => array( 'w'=>320, 'h'=>240 ), 'options' => array( 'w'=>760, 'h'=>480 ), 'preset' => array( 'w'=>240, 'h'=>90 ), 'restarting' => array( 'w'=>250, 'h'=>150 ), 'settings' => array( 'w'=>200, 'h'=>225 ), 'state' => array( 'w'=>300, 'h'=>120 ), 'stats' => array( 'w'=>680, 'h'=>200 ), 'timeline' => array( 'w'=>760, 'h'=>500 ), 'user' => array( 'w'=>280, 'h'=>340 ), 'version' => array( 'w'=>320, 'h'=>140 ), 'video' => array( 'w'=>100, 'h'=>80 ), 'watch' => array( 'w'=>96, 'h'=>384 ), 'zone' => array( 'w'=>360, 'h'=>500 ), 'zones' => array( 'w'=>72, 'h'=>232 ), ); ?>