User logged in and profile
Skiilz Offline
Member
***
Posts: 198
Joined: Nov 2010
Post: #1
User logged in and profile
Hey guys, I'm willing to put one button in the member_profile and this button need to appear ONLY if the user that is viewing the profile is the owner of the profile.
Like if Skiilz is seeing Skiilz's profile the button will appear, if Skiilz is viewing RateU's profile then the button won't appear.

Any help?


Thank you.

[Image: 468x602b.png]
11-21-2010 11:59 PM
Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #2
RE: User logged in and profile
I think you can use Template Conditional for that.

11-22-2010 04:00 AM
Find all posts by this user Quote this message in a reply
1master1 Offline
Member
***
Posts: 232
Joined: Oct 2010
Post: #3
RE: User logged in and profile
i think he needs something like postbit plugin that you made for me, rateu. which hides the add buddy option when i view my profile. but he needs in reverse. he wants to see his profile button when he is on own profile and hide when we visits others.
11-22-2010 04:11 AM
Find all posts by this user Quote this message in a reply
Skiilz Offline
Member
***
Posts: 198
Joined: Nov 2010
Post: #4
RE: User logged in and profile
(11-22-2010 04:00 AM)RateU Wrote:  I think you can use Template Conditional for that.
I think, but I don't know how to do that :/

(11-22-2010 04:11 AM)1master1 Wrote:  i think he needs something like postbit plugin that you made for me, rateu. which hides the add buddy option when i view my profile. but he needs in reverse. he wants to see his profile button when he is on own profile and hide when we visits others.
You got it Smile

[Image: 468x602b.png]
11-22-2010 05:16 AM
Find all posts by this user Quote this message in a reply
Imran Offline
Member
***
Posts: 204
Joined: Apr 2010
Post: #5
RE: User logged in and profile
You can add the button using PHP template Conditional Plugin.
Like;

PHP Code:
1
2
3
4
5
6
7
8
if ($mybb->user['uid'] == $memprofile['uid'])
{
$button = "<img src=\"images/something.gif\">";
}
else
{
$button = "";
}


[Image: logo.png]

[Image: twitter.png]
11-22-2010 05:40 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: #6
RE: User logged in and profile
Temaplte Conditionals:

PHP Code:
<if $GLOBALS['mybb']->user['uid'] == $memprofile['uid'] then>
<img src="images/something.gif">
<else>
<!--NOTHING!-->
</if>


That did it. Thank you for the base code.


[Image: 468x602b.png]
(This post was last modified: 11-22-2010 06:24 AM by Skiilz.)
11-22-2010 06:15 AM
Find all posts by this user Quote this message in a reply
Imran Offline
Member
***
Posts: 204
Joined: Apr 2010
Post: #7
RE: User logged in and profile
Your's welcome Smile

[Image: logo.png]

[Image: twitter.png]
11-22-2010 08:32 AM
Visit this user's website Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: