Changeset 119 for trollforge/lastmeasure
- Timestamp:
- 11/30/05 15:00:43 (7 years ago)
- Location:
- trollforge/lastmeasure
- Files:
-
- 2 edited
-
index.php (modified) (1 diff)
-
stats/index.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trollforge/lastmeasure/index.php
r115 r119 188 188 $uagent = base64_encode($_SERVER['HTTP_USER_AGENT']); 189 189 $referer = base64_encode($_SERVER['HTTP_REFERER']); 190 $user = base64_encode(' nobody');190 $user = base64_encode(''); 191 191 $clipboard = base64_encode(''); 192 192 -
trollforge/lastmeasure/stats/index.php
r118 r119 3 3 $id = dba_open('../db/hit.db', 'c', 'db4'); 4 4 if(!$id) { 5 echo '<tr><td colspan="5" style="background-color: #f66;">Failed to open database!</td></tr>';5 ?><tr><td colspan="6" style="background-color: #f66;">Failed to open database!</td></tr><?php 6 6 return; 7 7 } 8 8 $key = dba_firstkey($id); 9 9 if($key == false) { 10 echo '<tr><td colspan="5" style="background-color: #f66;">No hits found!</td></tr>';10 ?><tr><td colspan="6" style="background-color: #f66;">No hits found!</td></tr><?php 11 11 return; 12 12 } 13 for($l ines = 0; $lines < 20 && $key != false; $lines++) {13 for($l = 0; $l < 20 && $key != false; $l++) { 14 14 $val = dba_fetch($key, $id); 15 15 list($ip, $port, $hostname, $uagent, 16 16 $referer, $user, $clipboard) = explode(' ', $val); 17 $ str = '<tr>';18 $str .= '<td>' . date('Y-m-d H:i:s', -1 - hexdec(substr($key, 0, 8))) . '</td>';19 $str .= '<td>' . $ip . ':' . $port;20 if($hostname) $str .= ' ('.$hostname.')';21 $str .= '</td>';22 $str .= '<td>' . base64_decode($referer) . '</td>';23 $str .= '<td>' . base64_decode($user) . '</td>';24 $str .= '<td>' . base64_decode($clipboard) . '</td>';25 $str .= '</tr>';26 echo $str;17 $date = -1 - hexdec(substr($key, 0, 8)); ?> 18 <tr style="background-color: <?php echo ($l % 2) ? '#cef' : '#ecf'; ?>"> 19 <td><?php echo date('Y-m-d H:i:s', $date); ?></td> 20 <td><?php echo $ip . ':' . $port; 21 if($hostname) echo ' ('.$hostname.')'; ?></td> 22 <td><?php echo base64_decode($uagent); ?></td> 23 <td><?php echo base64_decode($referer); ?></td> 24 <td><?php echo base64_decode($user); ?></td> 25 <td><?php echo base64_decode($clipboard); ?></td> 26 </tr><?php 27 27 $key = dba_nextkey($id); 28 28 } … … 30 30 } 31 31 32 function print_ uagents() {33 $id = dba_open( '../db/uagent.db', 'c', 'db4');32 function print_table($table) { 33 $id = dba_open($table, 'c', 'db4'); 34 34 if(!$id) { 35 echo '<li style="color:red;">Failed to open database!</li>';35 ?><tr><td colspan="2" style="background-color: #f66;">Failed to open database!</td></tr><?php 36 36 return; 37 37 } 38 38 $key = dba_firstkey($id); 39 39 if($key == false) { 40 echo '<li style="color:red;">No hits found!</li>';40 ?><tr><td colspan="2" style="background-color: #f66;">No hits found!</td></tr><?php 41 41 return; 42 42 } 43 while($key != false) { 44 $val = dba_fetch($key, $id); 45 echo "<li>".base64_decode($key).": $val</li>"; 46 $key = dba_nextkey($id); 47 } 48 dba_close($id); 49 } 50 51 function print_users() { 52 $id = dba_open('../db/user.db', 'c', 'db4'); 53 if(!$id) { 54 echo '<li style="color:red;">Failed to open database!</li>'; 55 return; 56 } 57 $key = dba_firstkey($id); 58 if($key == false) { 59 echo '<li style="color:red;">No hits found!</li>'; 60 return; 61 } 62 while($key != false) { 63 $val = dba_fetch($key, $id); 64 echo "<li>".base64_decode($key).": $val</li>"; 43 for($l = 0; $key != false; $l++) { 44 $val = dba_fetch($key, $id); ?> 45 <tr style="background-color: <?php echo ($l % 2) ? '#cef' : '#ecf'; ?>"> 46 <td><?php echo base64_decode($key); ?></td> 47 <td><?php echo $val; ?></td> 48 </tr><?php 65 49 $key = dba_nextkey($id); 66 50 } … … 79 63 </head> 80 64 <body> 81 <div style="float: left; margin-top: 0px;background-color: transparent;82 border: 30px; clear: both;">65 <div style="float: left; background-color: transparent; 66 border: 10px; clear: both;"> 83 67 <img src="/gnaa.png" width="108" height="40" 84 68 alt="GNAA" /> … … 87 71 <h1> GNAA Last Measure Statistics </h1> 88 72 89 <p> Attempt at some lmstats. Unfinished. </p> 90 <p> Hits: </p> 91 <table style="border: solid black 1px;"> 73 <table style="border: solid black 1px; margin: 10px;"> 92 74 <tr style="background-color: #8af;"> 93 <td>Date</td><td>Host</td><td>Referer</td><td>User</td><td>Clipboard</td> 75 <td>Date</td> 76 <td>Host</td> 77 <td>Browser</td> 78 <td>Referer</td> 79 <td>User</td> 80 <td>Clipboard</td> 94 81 </tr> 82 <?php print_hits(); ?> 95 83 </table> 96 84 97 <ul><?php print_hits(); ?></ul> 98 <p> Browsers: </p> 99 <ul><?php print_uagents(); ?></ul> 100 <p> Users: </p> 101 <ul><?php print_users(); ?></ul> 85 <table style="border: solid black 1px; margin: 10px;"> 86 <tr style="background-color: #8af;"> 87 <td>Browser</td> 88 <td>Count</td> 89 </tr> 90 <?php print_table('../db/uagent.db'); ?> 91 </table> 92 93 <table style="border: solid black 1px; margin: 10px;"> 94 <tr style="background-color: #8af;"> 95 <td>User</td> 96 <td>Count</td> 97 </tr> 98 <?php print_table('../db/user.db'); ?> 99 </table> 100 101 <hr /> 102 103 <p> Generated by Last Measure Unified <?php echo date('Y-m-d H:i:s'); ?> </p> 102 104 103 105 </body>
Note: See TracChangeset
for help on using the changeset viewer.
