Systemprotokoll exportieren

Hilfe zu Modulen und Tags
Post Reply
tholler
Forum Members
Forum Members
Posts: 104
Joined: Sat Jan 13, 2007 12:23 pm

Systemprotokoll exportieren

Post by tholler »

Hallo zusammen,
gibt es eine Möglichkeit das Systemprotokoll zu exportieren oder zu drucken?

Wenn NEIN, kann man so etwas einbauen?

Wenn NEIN, warum nicht ?

lg
Thorsten
User avatar
amh
Forum Members
Forum Members
Posts: 187
Joined: Sun Apr 17, 2005 2:40 pm

Re: Systemprotokoll exportieren

Post by amh »

Nun kann ich endlich auch mal richitg helfen  ;D

Ganz einfach: Per Datenbank-Abfrage! Spitzensache. So kannst Du Dir die Abfrage individualisieren. Hier mal eine Code-Hilfe:

Code: Select all

<?php require_once('Connections/arbeit.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

mysql_select_db($database_arbeit, $arbeit);
$query_Recordset1 = "SELECT * FROM cms_adminlog ORDER BY `timestamp` ASC";
$Recordset1 = mysql_query($query_Recordset1, $arbeit) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<__html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Unbenanntes Dokument</title>
</head>

</__body>
<table border="1">
  <tr>
    <td>timestamp</td>
    <td>user_id</td>
    <td>username</td>
    <td>item_id</td>
    <td>item_name</td>
    <td>action</td>
  </tr>
  <?php do { ?>
    <tr>
      <td><?php echo date("d.m.y, H:i", $row_Recordset1['timestamp']); ?></td>
      <td><?php echo $row_Recordset1['user_id']; ?></td>
      <td><?php echo $row_Recordset1['username']; ?></td>
      <td><?php echo $row_Recordset1['item_id']; ?></td>
      <td><?php echo $row_Recordset1['item_name']; ?></td>
      <td><?php echo $row_Recordset1['action']; ?></td>
    </tr>
    <?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
</table>
<__body>
</__html>
<?php
mysql_free_result($Recordset1);
?>
Und hier noch die Zugangsdaten-Datei

Code: Select all

<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_arbeit = "www.****.de";
$database_arbeit = "****";
$username_arbeit = "*****";
$password_arbeit = "*****";
$arbeit = mysql_pconnect($hostname_arbeit, $username_arbeit, $password_arbeit) or trigger_error(mysql_error(),E_USER_ERROR); 
?>
__/\_|\/|_|-|__  --  designer not coder
User avatar
amh
Forum Members
Forum Members
Posts: 187
Joined: Sun Apr 17, 2005 2:40 pm

Re: Systemprotokoll exportieren

Post by amh »

Hier mal meine kompletten Dateien wie sie auch bei mir funktionieren. Der Code ist schlicht und ergreifend von Dreamweaver.

ACHTUNG: Die Datei ist KEINE pdf, sondern eine zip. Also umbenennen. Wer mir nicht traut (Viren und so), sollte es lassen. Kleiner Tipp: Ich arbeite am Mac ;-)

[gelöscht durch Administrator]
__/\_|\/|_|-|__  --  designer not coder
tholler
Forum Members
Forum Members
Posts: 104
Joined: Sat Jan 13, 2007 12:23 pm

Re: Systemprotokoll exportieren

Post by tholler »

;D :D Wunderbar, wenn man den Prefix der DB-Einträge anpasst funktioniert es; Danke
Post Reply

Return to “Module und Tags”