MyBB Hacks

Full Version: [Tutorial] Adding "Edit Profile" button
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello guys.

I did this code based on the Template Conditionals features and to contribute (little contribution) to this community that helped/is helping me a lot.

What you will need:
  1. Template Conditionals Plugin - Download

Step-By-Step:
  1. Go to AdminCP>Templates>**YOUR_THEME**>Member Templates>member_profile
    (MAKE A BACKUP OF THIS TEMPLATE IF ANYTHING GOES WRONG YOU CAN GO BACK ON CHANGES)
  2. After the backup, search for:

    PHP Code:
    {$header}


    Add after:

    PHP Code:
    <if $GLOBALS['mybb']->user['uid'] == $memprofile['uid'] then>
    <div align="right"><a href="{$mybb->settings['bburl']}/usercp.php"><img src="IMAGE_URL_HERE"></a></div>
    <br />
    <else>
    <!--NOTHING!-->
    </if>



And that's it!
It will show the "Edit Profile" button in the member profile for the owner of the PROFILE ONLY. You can edit the code to fit your needs, like admin can see all buttons..


Thanks to:
- RateU - Helping me with Template Conditionals
- ZiNgA BuRgA - Helping me with Template Conditionals and the maker of Template Conditionals
- Imran - For the code base
- Skiilz (Me) - For creating the tutorial and code adaptation


Enjoy.
There is no need to credit me but its appreciated Smile

Thank You very much.
You gave me the code and I just ported to Template Conditionals Smile
Much appreciated.
Thanks for sharing, Skiilz Smile
No problem. Its a little contribution to this community that is helping me a lot.
Reference URL's