Changeset 118 for trollforge


Ignore:
Timestamp:
11/30/05 14:26:36 (7 years ago)
Author:
sam
Message:
  • use a table instead of a list
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trollforge/lastmeasure/stats/index.php

    r117 r118  
    33    $id = dba_open('../db/hit.db', 'c', 'db4'); 
    44    if(!$id) { 
    5         echo '<li style="color:red;">Failed to open database!</li>'; 
     5        echo '<tr><td colspan="5" style="background-color: #f66;">Failed to open database!</td></tr>'; 
    66        return; 
    77    } 
    88    $key = dba_firstkey($id); 
    99    if($key == false) { 
    10         echo '<li style="color:red;">No hits found!</li>'; 
     10        echo '<tr><td colspan="5" style="background-color: #f66;">No hits found!</td></tr>'; 
    1111        return; 
    1212    } 
     
    1515        list($ip, $port, $hostname, $uagent, 
    1616             $referer, $user, $clipboard) = explode(' ', $val); 
    17         $str = "<li>"; 
    18         $str .= date('Y-m-d H:i:s', -1 - hexdec(substr($key, 0, 8))); 
    19         $str .= " $ip:$port ($hostname)"; 
    20         $str .= " referer: " . base64_decode($referer); 
    21         $str .= " user: " . base64_decode($user); 
    22         $str .= " clipboard: " . base64_decode($clipboard); 
    23         $str .= "</li>"; 
     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>'; 
    2426        echo $str; 
    2527        $key = dba_nextkey($id); 
     
    8789  <p> Attempt at some lmstats. Unfinished. </p> 
    8890  <p> Hits: </p> 
     91  <table style="border: solid black 1px;"> 
     92    <tr style="background-color: #8af;"> 
     93      <td>Date</td><td>Host</td><td>Referer</td><td>User</td><td>Clipboard</td> 
     94    </tr> 
     95  </table> 
     96 
    8997  <ul><?php print_hits(); ?></ul> 
    9098  <p> Browsers: </p> 
Note: See TracChangeset for help on using the changeset viewer.