//load bootstrap file for functions //load language files require_once $cmtx_path . 'includes/bootstrap/language.php'; //load bootstrap file for language if (!cmtx_setting('show_average_rating')) { die; } if (!cmtx_is_administrator()) { //if not administrator if (cmtx_in_maintenance()) { //check if under maintenance die; } } /* Error Reporting */ cmtx_error_reporting('includes/logs/errors.log'); /* Time Zone */ cmtx_set_time_zone(cmtx_setting('time_zone')); $ip_address = cmtx_get_ip_address(); //get user's IP address if (isset($_POST['id']) && isset($_POST['rating'])) { $id = $_POST['id']; if (!ctype_digit($id)) { die; } $id = cmtx_sanitize($id, true, true); $rating = $_POST['rating']; if (!preg_match('/[1-5]/', $rating)) { die; } $rating = cmtx_sanitize($rating, true, true);
/*************************************************************** DATABASE (1/2) *********************************************************/ require_once $cmtx_path . 'includes/db/connect.php'; //connect to database if ($cmtx_db_ok) { //if database connection okay /****************************************************************************************************************************************/ /*************************************************************** TIME ZONE **************************************************************/ cmtx_set_time_zone(cmtx_setting('time_zone')); //set the time zone /****************************************************************************************************************************************/ /*************************************************************** LANGUAGE ***************************************************************/ require_once $cmtx_path . 'includes/bootstrap/language.php'; //load bootstrap file for language /****************************************************************************************************************************************/ /*************************************************************** ERROR REPORTING ********************************************************/ cmtx_error_reporting($cmtx_path . 'includes/logs/errors.log'); /****************************************************************************************************************************************/ /*************************************************************** ADMIN DETECTION ********************************************************/ $cmtx_is_admin = cmtx_is_administrator(); //detect admin /****************************************************************************************************************************************/ /*************************************************************** FORM VALUES ************************************************************/ cmtx_load_form_login(); //load login values cmtx_load_form_defaults(); //load default values cmtx_load_form_cookie(); //load cookie values /****************************************************************************************************************************************/ /*************************************************************** MAINTENANCE (1/2) ******************************************************/ if (!cmtx_in_maintenance()) {