Multi-edit ✏ #571

This commit is contained in:
Jokob-sk
2024-02-24 13:30:18 +11:00
parent 7d715493a6
commit 4f5fbb1316
17 changed files with 612 additions and 141 deletions

View File

@@ -185,7 +185,7 @@ function displayMessage($message, $logAlert = FALSE, $logConsole = TRUE, $logFil
echo '<script>alert(escape("'.$message.'"));</script>';
}
// F12 Browser console
// F12 Browser dev console
if($logConsole)
{
echo '<script>console.log(escape("'.str_replace('"',"'",$message).'"));</script>';
@@ -194,16 +194,26 @@ function displayMessage($message, $logAlert = FALSE, $logConsole = TRUE, $logFil
//File
if($logFile)
{
if(file_exists($logFolderPath.$log_file) != 1) // file doesn't exist, create one
{
$log = fopen($logFolderPath.$log_file, "w") or die("Unable to open file!");
}else // file exists, append
{
$log = fopen($logFolderPath.$log_file, "a") or die("Unable to open file!");
if (is_writable($logFolderPath.$log_file)) {
if(file_exists($logFolderPath.$log_file) != 1) // file doesn't exist, create one
{
$log = fopen($logFolderPath.$log_file, "w") or die("Unable to open file!");
}else // file exists, append
{
$log = fopen($logFolderPath.$log_file, "a") or die("Unable to open file - Permissions issue!");
}
fwrite($log, "[".$timestamp. "] " . str_replace('<br>',"\n ",str_replace('<br/>',"\n ",$message)).PHP_EOL."" );
fclose($log);
} else {
echo 'The file is not writable: '.$logFolderPath.$log_file;
}
fwrite($log, "[".$timestamp. "] " . str_replace('<br>',"\n ",str_replace('<br/>',"\n ",$message)).PHP_EOL."" );
fclose($log);
}
//echo