MyBB Community Forums

Full Version: Viewed by only YOU [Help]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, if I posted in wrong section - i'm sorry.

However, I'm stuck with something i'm working on. For real I don't know how would I approach to this code.

So, code would need to do this:

- When user is on his profile, he would see "Edit profile" and "Edit profile 2 Test" - an example.
but if the user is on different profile (anyone else) he would see "Send PM" and "Report User".

if someone can help me approach this code, I would be thankful.
go to your Template Sets > member_profile templates and add this two variable {$contact_details} {$report_options} and go to member_profile_contact_details and keep only {$sendpm}
Seems that you didn't understand me,

i am asking if there is any way to check it via if and else code? thats one approach but I wouldn't use that one because I would lose that field.

Example on my profile it would show a button: https://prnt.sc/-nfJBaZX_pNq
but if its not my profile, it won't display "Edit" but instead of that it would display various buttons example: https://prnt.sc/cSdHRgRwVnyl (send pm)
you can use the plugin template conditionals for this

http://mybbhacks.zingaburga.com/showthread.php?tid=260
(2024-01-05, 03:21 PM)bv64 Wrote: [ -> ]you can use the plugin template conditionals for this

http://mybbhacks.zingaburga.com/showthread.php?tid=260

which i’m using but I need help how do I obtain code to check if its his profile or not to display that button ? If its not display Send PM example? I need example code (variable)
sorry, I don't use this plugin, so I can't help you with that
Anyone else can provide solution?
In member_profile using Template Conditionals :

<if (int)$memprofile['uid'] === (int)$mybb->user['uid'] then>
Hey there, this is your profile page !
<else>
Hey there, this is NOT your profile page !
</if>
(2024-01-05, 10:29 PM)Omar G. Wrote: [ -> ]In member_profile using Template Conditionals :

<if (int)$memprofile['uid'] === (int)$mybb->user['uid'] then>
Hey there, this is your profile page !
<else>
Hey there, this is NOT your profile page !
</if>

I'll try that tomorrow, belive it or not... I was waiting for your reply..  Big Grin

edit: nevermind, I've implemented it rn and it works. Thank you bro!   Cool