forked from derivativefx/derivativefx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
log.php
125 lines (101 loc) · 3.83 KB
/
log.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<?php
/*
Copyright Luxo 2008
This file is part of derivativeFX.
derivativeFX is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
derivativeFX is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with derivativeFX. If not, see <http://www.gnu.org/licenses/>.
*/
$b = $_GET['b'];
if ( ! $b OR ! preg_match( "=^[0-9]+$=i", $b ) ) {
$b = 30;
}
$v = $b - 30;
?>
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
<title>derivativeFX - Logfile</title>
</head>
<body style="direction: ltr;">
<img style="border: 0px solid ;" alt="" src="/~luxo/derivativeFX/derivativeFX_small.png">
<h2>Logfile</h2>
Legend:<br>
<span style="background-color:green">Green:</span> everything done<br/>
<span style="background-color:orange">Orange:</span> the bot will make this in the next time<br/>
<span style="background-color:red">Red:</span> error (e.g. derivative work file not found)<br/>
<center>Show <?php echo $v . " to " . $b; ?></center>
<br/>
<table style="text-align: left; width: 100%;" border="1"
cellpadding="3" cellspacing="0">
<tbody>
<tr>
<td style="width: 20%;">Original file</td>
<td style="width: 20%;">Derivative file</td>
<td style="width: 20%;">Status</td>
<td style="width: 20%;">Time</td>
<td style="width: 20%;">Done by bot at:</td>
</tr>
<?php
//Mit MySQL verbinden
include( "/home/luxo/public_html/contributions/logindata.php" ); //pw & bn einbinden
$dblink = @mysql_connect( $databankname, $userloginname, $databasepw ); //Allgemein (TS-Database)
mysql_select_db( "u_luxo", $dblink );
//Abfragen
$resu1 = mysql_query( "SELECT * FROM derivativefx ORDER BY time DESC LIMIT " . mysql_real_escape_string( $v ) . ", " . mysql_real_escape_string( $b ), $dblink ) or die( "error" );
while ( $a_row2 = mysql_fetch_row( $resu1 ) ) {
$file = $a_row2["0"];
$derivative = $a_row2["1"];
$status = $a_row2["2"];
$time = $a_row2["3"];
$donetime = $a_row2["4"];
if ( $status == "done" or $status == "nobot" ) {
$color = "green";
} else if ( $status == "open" ) {
$color = "orange";
} else if ( $status == "noexist" ) {
$color = "red";
} else {
$color = "red;color:yellow";
}
echo "<tr style='background-color: $color'>";
$dotts1 = "";
$dotts2 = "";
if ( strlen( $file ) > 40 ) {
$dotts1 = "...";
}
if ( strlen( $derivative ) > 40 ) {
$dotts2 = "...";
}
echo "<td><a href=\"http://commons.wikimedia.org/wiki/" . htmlspecialchars( $file ) . "\" title=\"" . htmlspecialchars( $file ) . "\">" . substr( htmlspecialchars( $file ), 0, 40 ) . "</a>$dotts1</td>";
echo "<td><a href=\"http://commons.wikimedia.org/wiki/Image:" . htmlspecialchars( $derivative ) . "\" title=\"" . htmlspecialchars( $derivative ) . "\">File:" . substr( htmlspecialchars( $derivative ), 0, 40 ) . "</a>$dotts2</td>";
echo "<td>" . htmlspecialchars( $status ) . "</td>";
echo "<td>" . htmlspecialchars( date( "H:i, d. F Y", $time ) ) . "</td>";
if ( preg_match( "=^[0-9]+$=i", $donetime ) ) {
echo "<td>" . htmlspecialchars( date( "H:i, d. F Y", $donetime ) ) . "</td>";
} else {
if ( $status == "nobot" ) {
echo "<td>-</td>";
} else {
echo "<td>(not done)</td>";
}
}
echo "</tr>\n";
}
?>
</tbody>
</table>
<br/>
<center><a href="?b=<?php echo $b - 30; ?>" title="back">←</a> | <a href="?b=30" title="Home">↑</a>
| <a href="?b=<?php echo $b + 30; ?>" title="Next">→</a><br/><br/>by Luxo
</center>
<br>
</body>
</html>