function _DatabaseHandler::add_to_log

4.x _DatabaseHandler.php _DatabaseHandler::add_to_log($action, $extra_data = "", $notes = "")

File

classes/_DatabaseHandler.php, line 39

Class

_DatabaseHandler

Code

function add_to_log($action, $extra_data = "", $notes = "") 
 {

  depricated_message();

  // Add a row to the log table.
  $ip = $_SERVER ["REMOTE_ADDR"];
  $url = mysql_real_escape_string($_SERVER ["REQUEST_URI"]);
  $user_id = $_SESSION ["fp_user_id"];
  $user_type = $_SESSION ["fp_user_type"];
  $user_name = mysql_real_escape_string($_SESSION ["fp_user_name"]);
  $action = mysql_real_escape_string($action);
  $extra_data = mysql_real_escape_string($extra_data);
  $notes = mysql_real_escape_string($notes);

  if ($GLOBALS ["fp_page_is_mobile"]) {
    $notes = "M:" . $notes;
  }

  // This needs to be mysql_query, instead of "this->db_query", because
  // otherwise it might get into an infinite loop.
  $now = time();
  $query = "INSERT INTO log (user_id,
						user_name, user_type, action, extra_data, notes,
						 ip, posted, from_url) VALUES (
						'$user_id','$user_name','$user_type','$action','$extra_data',
						'$notes',
						'$ip', '$now' ,'$url') ";
  $res = mysql_query($query) or die(mysql_error() . " - " . $query);





}