Changeset 121 for trollforge


Ignore:
Timestamp:
11/30/05 16:18:46 (7 years ago)
Author:
sam
Message:
  • support for ?u=user
  • tooltips in stats
Location:
trollforge/lastmeasure
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trollforge/lastmeasure/index.php

    r119 r121  
    188188    $uagent = base64_encode($_SERVER['HTTP_USER_AGENT']); 
    189189    $referer = base64_encode($_SERVER['HTTP_REFERER']); 
    190     $user = base64_encode(''); 
     190    $user = base64_encode($_GET['u']); 
    191191    $clipboard = base64_encode(''); 
    192192 
  • trollforge/lastmeasure/stats/index.php

    r120 r121  
    2020            $val = "$ip $port $hostname $uagent $referer $user $clipboard"; 
    2121            dba_replace($key, $val, $id); 
     22            $uagent = base64_decode($uagent); 
    2223        } ?> 
    2324        <tr style="background-color: <?php echo ($l % 2) ? '#cef' : '#ecf'; ?>"> 
     
    2526          <td><?php echo $ip . ':' . $port; 
    2627                    if($hostname) echo ' ('.$hostname.')'; ?></td> 
    27           <td><?php echo base64_decode($uagent); ?></td> 
     28          <?php if(strlen($uagent) > 30) { ?> 
     29             <div id="hit<?php echo $l;?>" style="visibility:hidden; border:solid black 1px; padding:1px; position:absolute; z-index:100; background-color:#ffffcc; font:10px sans-serif;"><?php echo $uagent; ?></div> 
     30             <td><a onmouseout="tooltip(event,'hit<?php echo $l;?>')" onmouseover="tooltip(event,'hit<?php echo $l;?>')" onclick="return false;"><?php echo substr($uagent, 0, 25); ?></a></td> 
     31          <?php } else { ?> 
     32             <td><?php echo $uagent; ?></td> 
     33          <?php } ?> 
    2834          <td><?php echo base64_decode($referer); ?></td> 
    2935          <td><?php echo base64_decode($user); ?></td> 
     
    6672   <link rel="icon" type="image/x-icon" href="/favicon.ico" /> 
    6773   <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" /> 
     74   <script type="text/javascript"> 
     75var support = false; 
     76if (document.getElementById || document.all) { 
     77  support = true; 
     78  suffix = 'px'; 
     79} else if (navigator.appName.indexOf('Netscape') != -1 
     80            && parseInt(navigator.appVersion) == 4) { 
     81  support = true; 
     82  suffix = ''; 
     83} 
     84 
     85function tooltip(ev, id) { 
     86  if (!support) 
     87    return; 
     88 
     89  if (document.getElementById) { 
     90    tipstyle = document.getElementById(id).style; 
     91    tipentity = document.getElementById(id); 
     92  } else if (document.all) { 
     93    tipstyle = document.all[id].style; 
     94    tipentity = document.all[id]; 
     95  } else { 
     96    tipstyle = document.layers[id]; 
     97    tipentity = document.layers[id]; 
     98  } 
     99 
     100  if (tipstyle.visibility == 'visible' || tipstyle.visibility == 'show') { 
     101    tipstyle.visibility = 'hidden'; 
     102    return; 
     103  } 
     104 
     105  if (ev.pageY) { 
     106    tipx = ev.pageX - 30; 
     107    tipy = ev.pageY + 15; 
     108  } else if (ev.clientY && document.documentElement.scrollTop) { 
     109    tipx = ev.clientX - 30 + document.documentElement.scrollLeft; 
     110    tipy = ev.clientY + 15 + document.documentElement.scrollTop; 
     111  } else if (ev.clientY) { 
     112    tipx = ev.clientX - 30 + document.body.scrollLeft; 
     113    tipy = ev.clientY + 15 + document.body.scrollTop; 
     114  } else { 
     115    tipx = -30; 
     116    tipy = 15; 
     117  } 
     118 
     119  if (tipentity.offsetWidth) 
     120    tipwidth = tipentity.offsetWidth; 
     121  else if (tipentity.clip.width) 
     122    tipwidth = tipentity.clip.width; 
     123  else 
     124    tipwidth = 100; 
     125 
     126  if (window.innerWidth) 
     127    winwidth = window.innerWidth; 
     128  else if (document.body.clientWidth) 
     129    winwidth = document.body.clientWidth; 
     130  else 
     131    winwidth = 800; 
     132 
     133  if (tipwidth + tipx > winwidth) 
     134    tipx = winwidth - tipwidth - 2; 
     135  else if (tipx < 2) 
     136    tipx = 2; 
     137 
     138  tipstyle.left = tipx + suffix; 
     139  tipstyle.top = tipy + suffix; 
     140  tipstyle.visibility = 'visible'; 
     141} 
     142   </script> 
    68143</head> 
    69144<body> 
     
    75150 
    76151  <h1> GNAA Last Measure Statistics </h1> 
     152 
     153 <a onmouseout="tooltip(event,'tooltip1')" onmouseover="tooltip(event,'tooltip1')" onclick="return false;">yes</a> 
    77154 
    78155  <table style="border: solid black 1px; margin: 10px;"> 
Note: See TracChangeset for help on using the changeset viewer.