Results 1 to 3 of 3

Thread: set variables based off of an api

  1. #1
    Member morissette's Avatar
    Join Date
    May 2009
    Location
    Austin, TX
    Posts
    103
    cPanel/WHM Access Level

    Root Administrator

    Default set variables based off of an api

    Hey all,

    I don't suppose it's possible to set variables based off of an api call something that would be like

    my($pref, $exchange) = return of <?cp Email::listmxs(% %, entries:: ${priority}:, entries:: ${mx} domain=$FORM{'domain'} ?>

    Any idea on this?

    Thanks!
    http://mattharris.org
    System Administrator

  2. #2
    cPanel Staff cpanelnick's Avatar
    Join Date
    Feb 2003
    Location
    Houston, TX
    Posts
    4,772

    Default re: set variables based off of an api

    It would probably best to use the template toolkit interface with <?cptt mail/yourfile.tmpl ?>

    Then yourfile.tmpl
    Code:
    [%
    USE Api2;
    USE CPList;
    USE HTTP;
    USE JSON;
    USE NVData;
    
    SET result =  Api2.exec( 'Email', 'listmxs', { domain =>CPANEL.FORM.domain } );
    
    %]
    For a better example see
    /usr/local/cpanel/base/frontend/x3/stats/lastvisit.html
    and
    /usr/local/cpanel/base/frontend/x3/stats/latest_visitors_entries.tmpl


    Also http://docs.cpanel.net/twiki/bin/vie.../UsingCpttTags


    **Note cptt is a bit slow in 11.32. cptt has been improved significantly in 11.34, however the speed improvements are not yet available publicly.
    -Nick
    cPanel Inc.

    Need support? Submit a request here. Complimentary support is available to all license holders regardless of where you purchased your license.
    Need a complimentary support account? Create one here.

  3. #3
    Member morissette's Avatar
    Join Date
    May 2009
    Location
    Austin, TX
    Posts
    103
    cPanel/WHM Access Level

    Root Administrator

    Default Re: set variables based off of an api

    Thanks! That helps significantly.
    http://mattharris.org
    System Administrator

Similar Threads

  1. Replies: 1
    Last Post: 04-15-2010, 12:25 AM
  2. JDK based payment gateway set up
    By meeven in forum cPanel & WHM Discussions
    Replies: 1
    Last Post: 07-15-2009, 01:24 PM
  3. API set reseller limits
    By bogdancri in forum New User Questions
    Replies: 1
    Last Post: 03-10-2009, 07:41 AM
  4. Changing IP's that named based accounts are set up on
    By techark in forum cPanel & WHM Discussions
    Replies: 1
    Last Post: 06-08-2002, 09:50 PM

Tags for this Thread