# If the username is not shown then don't show it if ($user == "guest") { } else { $thisuserobj = new bhuser($user); $usrimgfile = $thisuserobj->type . ".png"; # This is pretty nasty. Lots of tables. # Note I use the humanfilesize() function here for bandwidth - it's bytes all the way, so it sort of makes sense. # Also, this is hardcoded to show last 30 days bandwidth. It may be possible to change this on the user end in the future. # Also note that getbandwidth() accepts a third parameter, end time. Might use it for graphs. # # sec min hr days (rounded) $bandwidthstart = time() - 60 * 60 * 24 * 30; # # e.g. for a year #$bandwidthstart = time() - (60 * 60 * 24 * 356); # # or for last week #$bandwidthstart = time() - (60 * 60 * 24 * 7); # # or yesterday #$bandwidthstart = time() - (60 * 60 * 24); # etc. $str .= "\n\t\t\t<tr><td><img src='" . $this->skinpath . "images/userslist/" . $usrimgfile . "' title='" . $thisuserobj->type . "'></td>\n\t\t\t<td> </td>\n\t\t\t<td align='center'><a href='index.php?page=edituser&username="******"' style='text-decoration:none; color: black;'><b>" . $thisuserobj->username . "</b></a></td>\n\t\t\t<td align='center'> <img src='" . $this->skinpath . "images/userslist/disk.png' alt='" . $bhlang['label:disk_space_used'] . "' title='" . $bhlang['label:disk_space_used'] . "'></td><td> " . bh_humanfilesize($thisuserobj->getusedspace()) . " </td>\n\t\t\t<td><table cellspacing='0'><tr><td><img src='" . $this->skinpath . "images/userslist/band_up.png'></td><td> " . bh_humanfilesize($thisuserobj->getbandwidth("up", $bandwidthstart)) . "</td></tr>\n\t\t\t<tr><td><img src='" . $this->skinpath . "images/userslist/band_down.png'></td><td> " . bh_humanfilesize($thisuserobj->getbandwidth("down", $bandwidthstart)) . "</td></tr></table></td>\n\t\t\t<td align='center'> <a href='index.php?page=edituser&username="******"' style='text-decoration:none; color: black;'>" . $bhlang['button:edit'] . "</a> <a href='index.php?page=deleteuser&username="******"' style='text-decoration:none; color: black;'>" . $bhlang['button:delete'] . "</a></td>\n\t\t\t</tr><tr height='5'></tr>"; } } $str .= "</table></td></tr>"; } else { $str .= "<tr bgcolor='#ECECEC'><td><a href='index.php?page=users&group=" . $group . "'><b><font color='#555555'>" . $group . "</font></b></a></td></tr>\n\r"; } } $str .= "\n\t\t\t</table>\n\t\t\t<br><br>\n\t\t</td>\n\t\t<td width='10' background='" . $this->skinpath . "images/sidebar/rc.png'> </td>\n\t</tr>\n\t<tr height='10'>\n\t\t<td width='10'><img src='" . $this->skinpath . "images/sidebar/bl.png'></td>\n\t\t<td background='" . $this->skinpath . "images/sidebar/bc.png'></td>\n\t\t<td width='10'><img src='" . $this->skinpath . "images/sidebar/br.png'></td>\n\t</tr>\n</table>\n";