since it's a pain to always manualy look for errors in the includes/error.log file
this makes things a bit easier.
create this file
Display All
add in this file
add in this file
it should now look like this(by clicking on an error the whol message opens)
additional feature
this saves the name of the user who caused the error (replace this "file_put_contents('includes/error.log', $errorText, FILE_APPEND);" with following)
this makes things a bit easier.
create this file
PHP Source Code: includes\pages\adm\ShowErrorlogsPage.php
- <?php
- if (!allowedTo(str_replace(array(dirname(__FILE__), '\\', '/', '.php'), '', __FILE__))) throw new Exception("Permission error!");
- function ShowErrorlogsPage()
- {
- echo '<style>
- td{
- border:.2vw solid #666;
- color: #f90;
- font-family: Verdana;
- background:black;
- }
- body{
- background:rgb(33, 37, 43);
- }
- div{
- color:#f90;
- cursor:pointer;
- max-width: 97vw;
- }
- </style><table style="word-wrap: break-word;"><tr><td>errorlogs</td></tr><tr><td>';
- $file = file('./includes/error.log');
- $file = $file;
- $output = array();
- $count = 0;
- foreach($file as $f){
- if(strpos($f,'{main}') !== false){
- $output[$count] = $output[$count] . $f . "</div></td></tr><tr><td>";
- $count++;
- $output[$count] = '<div onclick="document.getElementById(\'f' . $count. '\').style.display = \'block\';">';
- }else{
- if($output[$count] === '<div onclick="document.getElementById(\'f' . $count. '\').style.display = \'block\';">'){
- $output[$count] .= $count . ".".$f."</div><div id='f" . $count . "' style='display:none; color:#fff'; onclick=\"this.style.display = 'none';\"><hr>";
- }else{
- $output[$count] .= $f."<br />";
- }
- }
- }
- $output = array_reverse($output);
- echo implode($output);
- echo '</td></tr></table>';
- }
add in this file
it should now look like this(by clicking on an error the whol message opens)
additional feature
this saves the name of the user who caused the error (replace this "file_put_contents('includes/error.log', $errorText, FILE_APPEND);" with following)