The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Show Bandwidth Available command

Discussion in 'User Experience' started by rackio, Nov 19, 2002.

  1. rackio

    rackio Registered

    Joined:
    Nov 19, 2002
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    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
     
  2. ThunderHostingDotCom

    ThunderHostingDotCom Well-Known Member

    Joined:
    Nov 18, 2002
    Messages:
    450
    Likes Received:
    1
    Trophy Points:
    16
    Location:
    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?
     
  3. rackio

    rackio Registered

    Joined:
    Nov 19, 2002
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    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.
     
  4. ThunderHostingDotCom

    ThunderHostingDotCom Well-Known Member

    Joined:
    Nov 18, 2002
    Messages:
    450
    Likes Received:
    1
    Trophy Points:
    16
    Location:
    All over!
    Sounds good. I wish there was a list somewhere we could pull from instead of having to pick apar all the skins out there.
     
  5. rackio

    rackio Registered

    Joined:
    Nov 19, 2002
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    yeah

    yeah that would be nice..
     
  6. Juanra

    Juanra Well-Known Member

    Joined:
    Sep 22, 2001
    Messages:
    777
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Spain
    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
     
  7. powerhouse

    powerhouse Well-Known Member

    Joined:
    Nov 5, 2001
    Messages:
    93
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    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.
     
  8. ozzi4648

    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.
     
  9. Juanra

    Juanra Well-Known Member

    Joined:
    Sep 22, 2001
    Messages:
    777
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Spain
    Version 0.3.2 is available, it should be fixed now. Please see http://html.conclase.net/cp/scripts/HCCApi.doc
     
  10. ozzi4648

    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
     
  11. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    If you cannot read word doc here is a text version.

    http://server10.virtual-hosting.ca/HCCApi.txt
     
  12. Juanra

    Juanra Well-Known Member

    Joined:
    Sep 22, 2001
    Messages:
    777
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    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] ;) ]
     
Loading...

Share This Page