function _DatabaseHandler::z__add_to_log
Search API
5.x _DatabaseHandler.php | _DatabaseHandler::z__add_to_log($action, $extra_data = "", $notes = "") |
File
- classes/
_DatabaseHandler.php, line 91
Class
Code
function z__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);
}