Results 1 to 3 of 3

Thread: add new line to stats menu in Cpanel

  1. #1
    Registered User
    Join Date
    Jul 2012
    Posts
    2
    cPanel/WHM Access Level

    Root Administrator

    Default add new line to stats menu in Cpanel

    hello

    i want to add new line to cpanel stats menu


    the value of this line is from a mysql database


    so i want when the user open the cpanel show him the line with a value accorded with his account


    i mean stats menu is this
    add new line to stats menu in Cpanel-cpanel-stats-expanded.jpg


    thanx

  2. #2
    Integration Developer cPanelDavidN's Avatar
    Join Date
    Dec 2009
    Location
    Houston, TX
    Posts
    570

    Default Re: add new line to stats menu in Cpanel

    Hi Movsme Mxsltv,

    You need to create a Standardized Hook which injects your data into the reference that is used when rendering the status bar.

    Standardized Hooks Documentation

    You will want to hook the cPanel API2 call StatsBar::stat.

    Putting the above to things together you'll be creating a Standarized Hook that uses the "post" stage of the "Api2::StatsBar::stat" Hookable Event (reference doc here). Inside your hook's logic you will modify the value of the 'output' element found in the data hash. You will have to code this in Perl so that you can get the input data hash passed by reference.

    OR

    If you don't want to do that (or mess with Perl directly), you can make a custom theme/branding that can fetch the info and place it where you want. There's a number of ways this could be done so, I won't elaborate unless necessary.

    Personally I find the first solution cleaner from an implementation and maintenance perspective, albeit sounds more daunting. I try to only mess with branding when I want to affect the presentation of data, not the presence of it.

    Regards,
    -DavidN
    David Neimeyer
    Integration Developer

    sdk.cpanel.net
    APIs: XML-API API1 & API2
    Check Out: Developer Downloads Integration Blog
    Need Support? Support Ticket Developer Forum Feature Requests

  3. #3
    Registered User
    Join Date
    Jul 2012
    Posts
    2
    cPanel/WHM Access Level

    Root Administrator

    Default Re: add new line to stats menu in Cpanel

    you have exemple for the 1 and the 2 solution ?

Similar Threads

  1. Add link to Interact Menu of cPanel.net to Documentation Suggestions site
    By inetbizo in forum Feature Requests for cPanel & WHM
    Replies: 1
    Last Post: 12-01-2010, 08:03 AM
  2. cPanel Stats Menu Error
    By mikelegg in forum cPanel & WHM Discussions
    Replies: 6
    Last Post: 03-29-2010, 03:20 PM
  3. Add a Menu
    By Sash in forum Themes and Branding
    Replies: 6
    Last Post: 08-19-2008, 03:06 PM
  4. Add-ons menu doesn't appear!!
    By Fbarajas in forum cPanel & WHM Discussions
    Replies: 2
    Last Post: 10-13-2005, 08:21 PM
  5. Add a custom link to your Cpanel menu
    By glassjoe in forum cPanel & WHM Discussions
    Replies: 4
    Last Post: 06-14-2004, 03:16 AM