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.

bandwidth left tag

Discussion in 'User Experience' started by blaze64, Feb 9, 2003.

  1. blaze64

    blaze64 Well-Known Member

    Joined:
    Feb 5, 2003
    Messages:
    159
    Likes Received:
    0
    Trophy Points:
    16
    Has anyone found out the correct tag for bandwidth remaining? The
    &cpanel print=&$CPDATA{'BWLIMIT'}&&

    seems to work great but it displays bites....I would rather have MB.
     
  2. 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
    &SCRIPT&
    f = &cpanel print=&$CPDATA{'BWLIMIT'}&& / 1048576 / 1000;
    document.write ( String(f) +& GIG& );
    &/SCRIPT&

    This works perfectly.
     
  3. blaze64

    blaze64 Well-Known Member

    Joined:
    Feb 5, 2003
    Messages:
    159
    Likes Received:
    0
    Trophy Points:
    16
    Worked great! Thanks!

    Do you happen to know how to make it read MB ONLY? It reads GIGs now....

    Thanks!
     
  4. nieve

    nieve Registered

    Joined:
    Jan 23, 2003
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    &SCRIPT&
    f = &cpanel print=&$CPDATA{'BWLIMIT'}&& / 1048576;
    document.write ( String(f) +& MB& );
    &/SCRIPT&
     
  5. blaze64

    blaze64 Well-Known Member

    Joined:
    Feb 5, 2003
    Messages:
    159
    Likes Received:
    0
    Trophy Points:
    16
    That worked well also! Great!

    Now, this tells displays how much bandwidth your account is allowed. Is there a way for it to show

    1000 mb (per month)
    200 mb (used already)
    -------------------------
    800 mb (amount left) &----- HOW DO YOU DISPLAY ONLY THIS?
     
  6. nieve

    nieve Registered

    Joined:
    Jan 23, 2003
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    &SCRIPT&
    f = &cpanel print=&$CPDATA{'BWLIMIT'}&& / 1048576;
    g = f - &cpanel Stats=&countbandwidth()&&;
    document.write ( String(g) +& MB& );
    &/SCRIPT&
     
  7. blaze64

    blaze64 Well-Known Member

    Joined:
    Feb 5, 2003
    Messages:
    159
    Likes Received:
    0
    Trophy Points:
    16
    YOU DA MAN! Thanks! Worked like a charm! Good Job!
     
  8. casey

    casey Well-Known Member

    Joined:
    Jan 17, 2003
    Messages:
    2,303
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    If there is trouble, it will find me
    Can somebody please write this again how it should be or tell me whether the following is correct?

    I'm not too good with coding....

    ---------------------
    Edit: Got it working. That was it. I'm proud of myself.:)
     
    #8 casey, Aug 17, 2003
    Last edited: Aug 17, 2003
  9. casey

    casey Well-Known Member

    Joined:
    Jan 17, 2003
    Messages:
    2,303
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    If there is trouble, it will find me
    By the way, you'll get a script error if the account has unlimited bandwidth. I just found that out. (It was my own account, so I just changed the limit).

    cPanel.net Support Ticket Number:
     
  10. GetWired

    GetWired Active Member

    Joined:
    Aug 4, 2003
    Messages:
    39
    Likes Received:
    0
    Trophy Points:
    6
Loading...

Share This Page