PDA

View Full Version : Bandwidth / Disk space graphs



ProWebUK
06-19-2003, 12:33 AM
Im assuming no one has developed anything of the such yet ;)

will try and get a script setup today with some instructions for you :D

Chris

l0rdphi1
07-02-2003, 09:49 AM
This would be cool :D

ProWebUK
07-02-2003, 09:53 AM
sorry i havn't got it yet will have it soon ;)

Chris

l0rdphi1
07-02-2003, 09:57 AM
Ah, that's alright. I just didn't want this thread to die :)

Matt
07-02-2003, 10:45 PM
Great idea, hope to see it soon.

ProWebUK
07-03-2003, 02:38 AM
Speaking to spinnahost Mark nad he handed the code to me straight away!

so thanks to SH-Mark for this :cool:

in any files of your skin put the following code:

between the <head> / </head> tags



<script language="JavaScript">
function percent(used, total) {
return used/total*100;
}

function graph(percent, image, height) {
document.write('<img src="'+image+'" height="'+height+'" width="'+percent+'%" />');
}

// to call: graph(percent(|USERBANDWIDTH|, |USERBANDWIDTHMAX|), IMG_GRAPHPIXEL, 10);
</script>


where you want to display the graphs



<script>
graph(percent(|USERBANDWIDTH|, |USERBANDWIDTHMAX|), IMG_GRAPHPIXEL, 25);
</script>


In file_user.conf add the following line:



IMG_GRAPHPIXEL=/images/graphpixel.gif

upload a 1x1 (or if you want bigger.. have bigger ;) ) so the image, "graphpixel.gif" is in the images directory.

Any problems post here ;)

Chris

FarCry
07-03-2003, 02:51 AM
that last number in the call is how high you want it, the IMG_GRAPHPIXEL should be a 1px by 1px image that you define in the files_user.conf

its all tested, and all works

Jing
11-08-2004, 06:11 PM
anyone mind to post a screenshot?

servertweak
11-14-2005, 04:54 PM
i 2nd that request , i like to see a screen shot

SeLLeRoNe
12-05-2005, 02:32 PM
me too