Show Bandwidth Available command

rackio

Registered
Nov 19, 2002
3
0
151
Hi,

I hope i came to the right place for help. I have submitted 2 tickets to try to and figure out how to do this. I know most the commands but would like to show

Bandwidth Allowed
Bandwidth Available

I know there is a Bandwidth Used command just looking for these 2. Anyone help would be great.

Thank you so much
 

ThunderHostingDotCom

Well-Known Member
Nov 18, 2002
449
1
168
All over!
BW

This is the one that lets you know how much you used but I haven't seen one for how much you have left or what you are allocated in total. If you find one let me know.

&cpanel stats=&countbandwidth()&&

P.S. I am working on a great cPanel skin also. Would you like to trade code to better both our skins?
 

rackio

Registered
Nov 19, 2002
3
0
151
I know that command i am looking for the other two. But thanks anyway.

I know pretty much all commands but was just looking for something to do the ones i need.
 

powerhouse

Well-Known Member
Nov 5, 2001
93
0
306
Ok
Javascript makes it MUCH easier!

Here you go.... this is how I do it....


Bandwidth Usage:&br&
&cpanel Stats=&countbandwidth()&& MB of &script language=&JavaScript&&
&!--
function printbw(){
var bwcheck=&&cpanel print=&$CPDATA{'BWLIMIT'}&&&;
var bandwidth=&&;
if (!bwcheck) {
bwcheck = 1;
}
if (bwcheck != 1){
bandwidth= bwcheck/1048576;
} else {
bandwidth=&Unlimited&;
}
document.write(bandwidth);
}
printbw();
--&
&/script& MB's&/font&

If they have unlimted Bandwidth as our Admin Accounts do, then it shows unlimited as being the amount they are allowed.:p

I changed it a little bit from how I use it, but It SHOULD work;)...

Let me know if it does not.
 
O

ozzi4648

Guest
[quote:ece81058f9][i:ece81058f9]Originally posted by Juanra[/i:ece81058f9]

For bandwidth allowed you have:
&cpanel print=&$CPDATA{'BWLIMIT'}&&
which returns bytes.

See here, I've added 3 new functions to my custom API :P
http://html.conclase.net/cp/scripts/HCCApi.txt

or here if you want it implemented by a pro:
http://forums.cpanel.net/read.php?TID=3288[/quote:ece81058f9]

Im using this on my Xskin theme. Installed # &cpanel HCCApi=&BandwidthAvailable()&& - GB available until Max is reached
but im seeing things like this:

Bandwidth Available -43.00 Megabytes

The first day i installed this it was correct, its now showing a negative as being available and this account has unlimited bwidth assigned.
 
O

ozzi4648

Guest
[quote:7ab7334071][i:7ab7334071]Originally posted by Juanra[/i:7ab7334071]

Version 0.3.2 is available, it should be fixed now. Please see http://html.conclase.net/cp/scripts/HCCApi.doc[/quote:7ab7334071]

Thanks so this i a word document? Have a problem reading it on my system. It tried to convert the document when opened. What is this document all about?

-Thanks
 

Juanra

Well-Known Member
Sep 22, 2001
777
0
316
Spain
[quote:5fc9919aa7][i:5fc9919aa7]Originally posted by ozzi4648[/i:5fc9919aa7]
Thanks so this i a word document? Have a problem reading it on my system. It tried to convert the document when opened. [/quote:5fc9919aa7]I knew I was forgetting something... Actually it's a plain text document, but I didn't change its MIME type. You shouldn't have any problem loading it now.

I've put a PDF format now as well, it's neater :p

[quote:5fc9919aa7]What is this document all about?[/quote:5fc9919aa7]Installation instructions and a brief documentation for the API calls.

[ [i:5fc9919aa7]Edit: Thanks David[/i:5fc9919aa7] ;) ]