Need to add info to amember/member.php page

Discussion in 'Templates customization' started by suediaz, Aug 20, 2010.

  1. suediaz

    suediaz New Member

    Joined:
    Aug 20, 2010
    Messages:
    7
    I'm looking to add either an additional tab (to the current - Main Page, Add/Renew Sub, Your Payment History, Edit Profile.)

    Is that possible? If so, how/where?


    If not possible, how can i add a link on that page for the members only?

    thanks!
  2. andyb

    andyb Member

    Joined:
    Jul 10, 2010
    Messages:
    41
    I played about and found this to work..

    you'll need to edit 1 file and create 2 more.

    open up tabs.inc.php in the root directory and near the bottom within the function init(), you can add a new tab with this command..

    Code:
    $this->add(new TabMenu_Tab('My Title','myfile.php',null));
    now you will need to create 2 files.

    First file

    myfile.php which goes in the root directory (same place you found tabs.inc.php). It has to go in the root directory because it will throw an error if you try to put it into the templates directory.

    put this code inside myfile.php

    (This will protect your custom page from non-members seeing it)

    Code:
    <?php
    include('./config.inc.php');
    $t = & new_smarty();
    $_product_id = array('ONLY_LOGIN');
    require($config['plugins_dir']['protect'] . '/php_include/check.inc.php');
    $t->display('myfile.html');
    
    ?>
    second file

    myfile.html which goes in the templates directory (amember/templates/)

    put this inside myfile.html

    Code:
    {assign var="title" value='My Page Title'}
    {include file="header.html"}
    <div class="backend-wrapper">
    {include file="member_menu.inc.html"}
    <p>This is all the stuff I want to show the user</p>
    </div>
    {include file="footer.html"}
    That should do it!

    I'm not sure this is the proper way to do it but, it's what I did to add another tab and page. Maybe Alexander or other CGI guy can correct it if it's wrong

    hope this helps!

    Andy B
  3. suediaz

    suediaz New Member

    Joined:
    Aug 20, 2010
    Messages:
    7
    Hi and thanks for your help, Andy! Appreciate it greatly!

    Where do i include where i want this tab to link to?

    for example, when the member clicks on this tab, i want it to go to http://www.123.com/store

    where would i set up the link?

    thanks again!

    sue
  4. andyb

    andyb Member

    Joined:
    Jul 10, 2010
    Messages:
    41
    you would put the link inside myfile.html where it has

    <p>This is all the stuff I want to show the user</p>


    just use regular html instead of that text
  5. suediaz

    suediaz New Member

    Joined:
    Aug 20, 2010
    Messages:
    7
    Ok got it.... again, many thanks for your help!

    Got the files ready to upload.... they go into the amember folder, right?
  6. suediaz

    suediaz New Member

    Joined:
    Aug 20, 2010
    Messages:
    7
    I just uploaded the files to the /public_html/amember folder and nothing happened.... is that the correct folder?
  7. andyb

    andyb Member

    Joined:
    Jul 10, 2010
    Messages:
    41
    just follow the instructions in the first reply..

    myfile.php goes in public_html/amember/

    myfile.html goes in public_html/amember/templates/


    you need to add the $this->add(new TabMenu_Tab('My Title','myfile.php',null)); command to the file called tabs.inc.php which is in public_html/amember/ folder.
  8. suediaz

    suediaz New Member

    Joined:
    Aug 20, 2010
    Messages:
    7
    Hi Andy...

    Got it working!!! Just need to change teh "my title" to My Store and i'm done :)

    Thanks so much!~
  9. suediaz

    suediaz New Member

    Joined:
    Aug 20, 2010
    Messages:
    7
    last thing.... PROMISE :)

    is there a way to link the tab to the URL itself? so when the member clicks on the tab it routes them to the store page itself?

    thanks!

    ps... about to add you to my will!
  10. suediaz

    suediaz New Member

    Joined:
    Aug 20, 2010
    Messages:
    7
    Got it... again, many thanks!
  11. andyb

    andyb Member

    Joined:
    Jul 10, 2010
    Messages:
    41
    I don't think there is a way because the amember functions for that will only link internal files.

    you can put some javascript in the myfile.html to redirect to your chosen page

    Code:
    <script>window.location = 'http://www.myshop.com/shop/';</script>
    just put that at the bottom of myfile.html or in the <p>this is all the stuff...
  12. vacc_webmaster

    vacc_webmaster Member

    Joined:
    Jan 24, 2007
    Messages:
    51
    Awesome information! Thanks

    Just to add on to that,
    How could the new page display/edit 7 custom fields that are not to be displayed on the sign up page nor the edit profile page?
  13. alexander

    alexander Administrator Staff Member

    Joined:
    Jan 8, 2003
    Messages:
    6,279
    You need advanced php skills in order to do this. Need to query aMember database, display info then handle form submit and save data.

Share This Page