1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Integrate amember form in to template

Discussion in 'XenForo Development Discussions' started by onlineuk, Oct 4, 2013.

  1. onlineuk

    onlineuk New Member

    Hi all,

    I have posted this on the amember forum but hoping someone here may be able to shed some light.

    I have been attempting to integrate the amember login form in to one of the templates provided in Xenforo for a few days now using the Amember Lite API, with no avail.

    I have been using the following code

    PHP:
    <?phpinclude "/home/usrad/public_html/amember/library/Am/Lite.php";
    echo 
    Am_Lite::getInstance()->renderLoginForm(); ?>
    and

    PHP:
    <?phpinclude '/home/usrad/public_html/amember/library/Am/Lite.php';
    echo 
    Am_Lite::getInstance()->renderLoginForm(); ?>
    When using this in the Xenforo template it doesn't work and just displays the text 'renderLoginForm(); ?>'. After a bit more research I realized that Xenforo requires a tag called 'xen:callback' to operate php commands within a template, so I proceeded to give this a go without any avail.

    I then tried to create a new template in Xenforo and use the xen:include tag to include the template, which again just the echoed text.

    I'm not great with php so not sure if 'echoing' is the right command to use however I decided to paste the aforementioned snippet of code in to a blank php file and upload it to the server, this worked instantly and showed the amember form.

    Is there anything obvious I have been missing? Am I meant to put the include above the HTML? (If so would this then load on every page?)

    EDITED TO ADD: The Amember API is referred to here
     
    Last edited: Oct 4, 2013
  2. onlineuk

    onlineuk New Member

    Anyone any clues on this one? I've had another go but still seem to be struggling.
     
  3. onlineuk

    onlineuk New Member

    One last try on this, I understand not everyone uses amember but wonder if there is something obvious I'm missing with regards to the PHP?
     
  4. tyteen4a03

    tyteen4a03 Well-Known Member

    Is the code you provided in a PHP file or in a template (which obviously won't work)? Not quite sure what you're trying to do.
     

Share This Page