Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 [Tutorial] Adding "Edit Profile" button
Skiilz Offline
Member
***
Posts: 198
Joined: Nov 2010
Post: #1
[Tutorial] Adding "Edit Profile" button
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:
    1
    2
    3
    4
    5
    6
    <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.

[Image: 468x602b.png]
(This post was last modified: 11-22-2010 07:23 AM by Skiilz.)
11-22-2010 07:21 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
[Tutorial] Adding "Edit Profile" button - Skiilz - 11-22-2010 07:21 AM

 Standard Tools
Forum Jump: