Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Retrieve email quota with <cpanel... function

Discussion in 'cPanel Developers' started by Gino Viroli, Aug 20, 2009.

  1. Gino Viroli

    Gino Viroli Well-Known Member

    Joined:
    Oct 2, 2007
    Messages:
    48
    Likes Received:
    1
    Trophy Points:
    58
    SOLVED: Retrieve email quota with <?cp... function

    Hello, I'm branding my lovely CP to provide a nice looking interface to my customers.

    I would like to show in webmail main page (the one: https://...:2096/webmail/x3/index.html) the quota of the currently looged in mail account.

    I thought to just write it out in a <div> block inside the stdmheader.html. I know stdmheader.html is rendered also in pages other than the webmail main page, but I will take care of this later.


    So I suppose I could add in the stdmheader.html some sort of line like:

    HTML:
    <div id="quote"><?cp Email="...></div>

    but what exactly should I write in the cpanel tag line? :confused:
    I looked everywhere, in forum, in documentation, in code, but I can't find out the solution.

    Plz help, I would really appreciate it! :rolleyes:


    ---------------------------------------------------------------------

    I found the solution by myself :p yepppyaieeeeeeeeee:


    We can simply add to stdmheader.html branding this line:

    HTML:
    <div id="cp_mail_quota"><?cp Email::listpopswithdisk(% % % email,diskused,diskquota) ?></div>
    just before the line:
    HTML:
    <!-- <div class="clearitsm">&nbsp;</div> -->
    I start to understand the lovely CP, and I love it more and more! :D
     
    #1 Gino Viroli, Aug 20, 2009
    Last edited: Aug 21, 2009
  2. XenomediaBV

    XenomediaBV Well-Known Member

    Joined:
    Sep 3, 2009
    Messages:
    60
    Likes Received:
    0
    Trophy Points:
    56
    Location:
    The Netherlands
    cPanel Access Level:
    Root Administrator
    Request for implementation in X3

    Nice! Showing diskused and diskquota at the start screen of webmail is an very customer-friendly addition.

    It would be nice if this can be implemented in de default X3 "http://webmail.domain.com/webmail/x3/"-page.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Gino Viroli

    Gino Viroli Well-Known Member

    Joined:
    Oct 2, 2007
    Messages:
    48
    Likes Received:
    1
    Trophy Points:
    58
    WARNING this does not work anymore since cPanel 11.25.
    Clueless about the reason!
     
  4. cPanelDon

    cPanelDon cPanel Quality Assurance Analyst
    Staff Member

    Joined:
    Nov 5, 2008
    Messages:
    2,554
    Likes Received:
    9
    Trophy Points:
    168
    Location:
    Houston, Texas, U.S.A.
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    For this to be considered I recommend posting a feature request in the following forums area; this will help to ensure greater attention and visibility for the idea while allowing more people to contribute feedback and suggestions for implementation: Feature Requests for cPanel and WHM - cPanel Forums

    I was able to use the following steps to have the e-mail account disk usage and quota displayed after logging-into webmail:
    1. Clone cPanel x3 theme to x3custom (via WHM: Main >> Themes >> Universal Theme Manager)
    2. Clone Webmail x3 theme to x3custom (via WHM: Main >> Themes >> Universal Theme Manager)
    3. Set the desired cPanel accounts to use the new theme (by editing their packages via WHM: Main >> Packages >> Edit a Package); this will ensure any custom changes take effect and are not reverted.
    4. In the new webmail theme x3custom edit index.html and add the following:
      Code:
      <cpanel langprint="usage"></span>: <?cp Email::getdiskusage(%,diskused) ?> <acronym title="<cpanel langprint="EAdoaddmegs">">MB</acronym>
      <br>
      <cpanel langprint="quota_title">: <cpanel Email="getpopquota()"> <acronym title="<cpanel langprint="EAdoaddmegs">">MB</acronym>
      As an example, here is a before and after view of the surrounding area that I modified in the file "index.html" of the webmail x3 theme:
      Before:
      Code:
      <div align="center">
      <p><cpanel langprint="cpanel-loggedin"> <span class="status"><cpanel print="$authuser"></span></p>
      </div>
      <br><br>
      After:
      Code:
      <div align="center">
      <p><cpanel langprint="cpanel-loggedin"> <span class="status"><cpanel print="$authuser"></span></p>
      <cpanel langprint="usage"></span>: <?cp Email::getdiskusage(%,diskused) ?> <acronym title="<cpanel langprint="EAdoaddmegs">">MB</acronym>
      <br>
      <cpanel langprint="quota_title">: <cpanel Email="getpopquota()"> <acronym title="<cpanel langprint="EAdoaddmegs">">MB</acronym>
      </div>
      <br><br>
      For reference, here is the full path to the file that was modified:
      Code:
      /usr/local/cpanel/base/webmail/x3custom/index.html
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    #4 cPanelDon, Mar 1, 2010
    Last edited: Mar 1, 2010
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice