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
Imran Offline
Member
***
Posts: 204
Joined: Apr 2010
Post: #2
RE: [Tutorial] Adding "Edit Profile" button
There is no need to credit me but its appreciated Smile

Thank You very much.

[Image: logo.png]

[Image: twitter.png]
11-22-2010 08:31 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Skiilz Offline
Member
***
Posts: 198
Joined: Nov 2010
Post: #3
RE: [Tutorial] Adding "Edit Profile" button
You gave me the code and I just ported to Template Conditionals Smile

[Image: 468x602b.png]
11-22-2010 08:40 AM
Find all posts by this user Quote this message in a reply
Imran Offline
Member
***
Posts: 204
Joined: Apr 2010
Post: #4
RE: [Tutorial] Adding "Edit Profile" button
Much appreciated.

[Image: logo.png]

[Image: twitter.png]
11-22-2010 08:42 AM
Visit this user's website Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,333
Joined: Mar 2010
Post: #5
RE: [Tutorial] Adding "Edit Profile" button
Thanks for sharing, Skiilz Smile

11-23-2010 06:40 AM
Find all posts by this user Quote this message in a reply
Skiilz Offline
Member
***
Posts: 198
Joined: Nov 2010
Post: #6
RE: [Tutorial] Adding "Edit Profile" button
No problem. Its a little contribution to this community that is helping me a lot.

[Image: 468x602b.png]
11-23-2010 07:32 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: