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.

Available Bandwidth? Disk Quota?

Discussion in 'User Experience' started by ecoutez, Aug 18, 2002.

  1. ecoutez

    ecoutez Well-Known Member

    Joined:
    May 23, 2002
    Messages:
    152
    Likes Received:
    0
    Trophy Points:
    0
    Hey folks,

    I'm creating a new skin and ideally would like to present both Bandwidth and Quota in the form:
    Bandwidth: Used / Total
    Disk Quota: Used / Total

    I found that &cpanel print=&$CPDATA{'BWLIMIT'}&& will express the total bandwidth available for the user in BYTES. This number matches what one finds for the user in /var/cpanel/users/ Is there some way to either get the value in MB or GB? If not, is there some way I can divide this figure by 1048576? (That's 1024^2 in case you're wondering what the heck I'm thinking).
    This is pretty important since I'd like for users to be able to see both their bandwidth usage and be well aware of their allocation!

    I haven't found anything to express the total disk quota available for a user - only the commonly used &cpanel Quota=&showquotaused()&& and &cpanel Quota=&showquotaremain()&&... but nothing to show the max quota. Anyone know of a way to pull up this number? I can always change the design to work like all the others out there which just express the used and remaining numbers, but I'd like to show used and total if possible.

    Thanks!

    - Jason
     
  2. ecoutez

    ecoutez Well-Known Member

    Joined:
    May 23, 2002
    Messages:
    152
    Likes Received:
    0
    Trophy Points:
    0
    Answering my own question...

    I was able to do the bandwidth calculation with a javascript:
    & SCRIPT &
    f = &cpanel print=&$CPDATA{'BWLIMIT'}&& / 1048576;
    document.write ( String(f) +& MB& );
    & /SCRIPT &


    Same deal for the Disk Quota - just did a sum of &cpanel Quota=&showquotaused()&& and &cpanel Quota=&showquotaremain()&&

    :)

    - Jason
     
  3. thesilentman

    thesilentman Registered

    Joined:
    Oct 4, 2002
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Jason,
    I'd like to get those information out of cpanel, too.
    The code you wrote, on which code does it rely? What do you include ? do you have any info to the interface of WHM/Cpanel?

    Thanks
    Frank :)
     
Loading...

Share This Page