Adding a page properly smarty?

Discussion in 'Customization & add-ons' started by robguit, Apr 2, 2010.

  1. robguit

    robguit New Member

    Joined:
    Apr 2, 2010
    Messages:
    3
    This is going to sound completely dumb, sorry in advance.

    I am messing around with the demo version.

    I would like to create a php webpage that has the proper header and footer, as well as checks to see the level of the user.

    I already wrote one that works, but it does not fit in with the templates, and
    doesn't look like part of the demo site.

    how do I do this?

    Do I need to use smarty?

    I have used config.inc.php to access what I need, but I would like to make
    a page that has the look and feel, as well as the full functionality of amember.

    Thanks in advance!
  2. thehpmc

    thehpmc Member

    Joined:
    Aug 24, 2006
    Messages:
    901
    Post web address of the page you have constructed. We can then make suggestions based upon it.
  3. robguit

    robguit New Member

    Joined:
    Apr 2, 2010
    Messages:
    3
    It is not live.
    I am testing on a local machine.

    but here is an example of what I am doing

    <?php
    include "config.inc.php";

    $_product_id = array(1);


    ?>
    <html>
    <head>
    <title>Level 1 - Page Panel</title>
    </head>
    <body>

    <?php
    $uid=$_SESSION['_amember_user']['member_id'];
    ....my php stuff (I am really only getting the member id from the database.....
    ?>

    </body>
    </html>
    -------------------------
    so I am not including headers, or doing any style sheets that I know of.

    Thanks,
  4. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    Yes you need to use smarty if you need to use aMember header and footer.
    Create php with this code:
    Code:
    include "/path/to/amember/config.inc.php";
    $t =  new_smarty();
    $t->display("yourpage.html");
    
    then create /amember/templates/yourpage.html :
    Code:
    {assign var="title" value="Page title"}
    {include file="header.html"}
    Your smarty code here. 
    
    {include file="footer.html"}
    
    
  5. robguit

    robguit New Member

    Joined:
    Apr 2, 2010
    Messages:
    3
    Thanks,
    I don't really know smarty, I will look into it some more.

    I appreciate the help

Share This Page