| 170 | | function mini_track_display() { |
|---|
| 171 | | if (!bb_current_user_can('administrate')) {return;} |
|---|
| 172 | | global $mini_track, $mini_track_current, $mini_track_options; |
|---|
| 173 | | $bb_uri=bb_get_option('uri'); $profile=$bb_uri."profile.php?id="; |
|---|
| 174 | | if (isset($_GET['mini_track_reset'])) {mini_track_activation(); mini_track_init();} |
|---|
| 175 | | echo '<html><head><title>'.count($mini_track).' Users Online « '.bb_get_option('name').'</title> |
|---|
| 176 | | <meta http-equiv="refresh" content="'.$mini_track_options['display_refresh_time'].';url='.$bb_uri.'?mini_track_display" /> |
|---|
| 177 | | <style>table {border:1px solid #111; font-size:14px; font-family: arial, san-serif; line-height:150%;} table td {text-align:center; white-space:nowrap;} table .link {text-align:left;} table th.link {padding-left:5em;} |
|---|
| 178 | | table th {background: #aaa;} .alt {background: #eee;} .tiny {font-size:12px;} .bot {color:red; font-size:90%;} .guest {color:green;} |
|---|
| 179 | | .link div {padding-left: 5px; width:500px; white-space:nowrap; overflow; hidden;} </style> |
|---|
| 180 | | <script>window.onload=titlelink; function titlelink() {blank="_blank"; for (i=0;x=document.links[i];++i){x.target=blank; x.title=x.href;}};</script> |
|---|
| 181 | | </head><body>'; |
|---|
| 182 | | echo "<div style='float:right;'>[<a href='$bb_url?mini_track_reset'><small>reset</small></a>]</div>"; |
|---|
| 183 | | mini_track(2); |
|---|
| 184 | | echo "<br clear=both /><table width='99%' cellpadding=1 cellspacing=1> |
|---|
| 185 | | <tr class=alt><th>#</th><th>user</th><th>ip</th><th>referer</th><th>pages</th><th>time online</th><th>last activity</th><th class=link>last URL</th></tr>"; |
|---|
| 186 | | $mini_track=array_reverse($mini_track,true); |
|---|
| 187 | | $counter=0; |
|---|
| 188 | | foreach ($mini_track as $key=>$value) { |
|---|
| 189 | | $url=urldecode($value->url); |
|---|
| 190 | | echo "<tr".(($counter % 2) ? " class=alt" : "")."><td align=right class=tiny ".(($mini_track_options['debug']) ?" title='$value->debug' " : "")."> ".(++$counter)." </td><td>"; // line number |
|---|
| 191 | | if ($value->id) echo "<a href='$profile$value->id'>$value->name</a>"; // member profile link |
|---|
| 192 | | elseif (isset($value->bot)) {echo "<span class=bot>".preg_replace("/[^A-Za-z_ ]+?/is","",$mini_track_options['bots'][$value->bot-1])."</span>";} else {echo "<span class=guest>guest</span>";} |
|---|
| 193 | | echo "</td><td class=tiny><a href='?mini_track_ip=$value->ip'>$value->ip</a></td>"; |
|---|
| 194 | | if (isset($value->referer)) {$parse_url=parse_url($value->referer); // referer |
|---|
| 195 | | $host=substr(ereg_replace("^(www[0-9]?|search|talk|community|support|foro|mitmachen|board[s]?|forum[s]?)(\.?)","",$parse_url['host']),0,30); |
|---|
| 196 | | echo "<td><a href='$value->referer'>".$host."</a></td>";} else {echo "<td> </td>"; |
|---|
| 197 | | } |
|---|
| 198 | | echo "<td>".intval($value->pages)."</td>"; // page count |
|---|
| 199 | | echo "<td class=tiny>".ceil((($value->time)-$value->seen+1)/60)." minutes</td>"; // total activity time |
|---|
| 200 | | echo "<td class=tiny>".ceil(((time())-$value->time+1)/60)." minutes ago</td>"; // last activity time |
|---|
| 201 | | echo "<td class=link><div style='overflow:hidden;'><a href='$url'>$url</a></div></td></tr>"; // last url |
|---|
| 202 | | } |
|---|
| 203 | | echo "</table></body></html>"; |
|---|
| 204 | | exit(); |
|---|
| 205 | | } |
|---|
| 206 | | |
|---|
| | 322 | |
|---|
| | 323 | function mini_track_display() { |
|---|
| | 324 | if (!bb_current_user_can('administrate')) {return;} |
|---|
| | 325 | global $mini_track, $mini_track_current, $mini_track_options; |
|---|
| | 326 | $bb_uri=bb_get_option('uri'); $profile=$bb_uri."profile.php?id="; |
|---|
| | 327 | if (isset($_GET['mini_track_reset'])) {mini_track_activation(); mini_track_init();} |
|---|
| | 328 | echo '<html><head><title>'.count($mini_track).' Users Online « '.bb_get_option('name').'</title> |
|---|
| | 329 | <meta http-equiv="refresh" content="'.$mini_track_options['display_refresh_time'].';url='.$bb_uri.'?mini_track_display" /> |
|---|
| | 330 | <style>table {border:1px solid #111; font-size:14px; font-family: arial, san-serif; line-height:150%;} table td {text-align:center; white-space:nowrap;} table .link {text-align:left;} table th.link {padding-left:5em;} |
|---|
| | 331 | table th {background: #aaa;} .alt {background: #eee;} .tiny {font-size:12px;} .bot {color:red; font-size:90%;} .guest {color:green;} |
|---|
| | 332 | .link div {padding-left: 5px; width:500px; white-space:nowrap; overflow; hidden;} </style> |
|---|
| | 333 | <script>window.onload=titlelink; function titlelink() {blank="_blank"; for (i=0;x=document.links[i];++i){x.target=blank; if (!x.title.length) {x.title=x.href;}}};</script> |
|---|
| | 334 | </head><body>'; |
|---|
| | 335 | echo "<div style='float:right;'>[<a href='$bb_url?mini_track_reset'><small>reset</small></a>]</div>"; |
|---|
| | 336 | mini_track(2); |
|---|
| | 337 | echo "<br clear=both /><table width='99%' cellpadding=1 cellspacing=1> |
|---|
| | 338 | <tr class=alt><th>#</th><th>user</th><th>ip</th><th>referer</th><th>pages</th><th>time online</th><th>last activity</th><th class=link>last URL</th></tr>"; |
|---|
| | 339 | $mini_track=array_reverse($mini_track,true); |
|---|
| | 340 | $counter=0; |
|---|
| | 341 | foreach ($mini_track as $key=>$value) { |
|---|
| | 342 | $url=urldecode($value->url); |
|---|
| | 343 | echo "<tr".(($counter % 2) ? " class=alt" : "")."><td align=right class=tiny> ".(++$counter)." </td><td>"; // line number |
|---|
| | 344 | if ($value->id) echo "<a href='$profile$value->id'>$value->name</a>"; // member profile link |
|---|
| | 345 | elseif (isset($value->bot)) {echo "<span class=bot>".preg_replace("/[^A-Za-z_ ]+?/is","",$mini_track_options['bots'][$value->bot-1])."</span>";} else {echo "<span class=guest>guest</span>";} |
|---|
| | 346 | echo "</td><td class=tiny><a ".(($mini_track_options['debug']) ?" title='$value->debug' " : "")." href='?mini_track_ip=$value->ip'>$value->ip</a></td>"; |
|---|
| | 347 | if (isset($value->referer)) {$parse_url=parse_url($value->referer); // referer |
|---|
| | 348 | $host=substr(ereg_replace("^(www[0-9]?|search|talk|community|support|foro|mitmachen|board[s]?|forum[s]?)(\.?)","",$parse_url['host']),0,30); |
|---|
| | 349 | echo "<td><a href='$value->referer'>".$host."</a></td>";} else {echo "<td> </td>"; |
|---|
| | 350 | } |
|---|
| | 351 | echo "<td>".intval($value->pages)."</td>"; // page count |
|---|
| | 352 | echo "<td class=tiny>".ceil((($value->time)-$value->seen+1)/60)." minutes</td>"; // total activity time |
|---|
| | 353 | echo "<td class=tiny>".ceil(((time())-$value->time+1)/60)." minutes ago</td>"; // last activity time |
|---|
| | 354 | echo "<td class=link><div style='overflow:hidden;'><a href='$url'>$url</a></div></td></tr>"; // last url |
|---|
| | 355 | } |
|---|
| | 356 | echo "</table></body></html>"; |
|---|
| | 357 | exit(); |
|---|
| | 358 | } |
|---|