MyBB Community Forums

Full Version: Grabbing the member profile ID?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm trying to show a box on a user's profile if it's their own profile only, but am having a problem in that I cant find the variable for the meber profile's id. I've tried the following (using the hook member_profile_end);

global $mybb, $theme, $templates, $userfields, $db, $memprofile;

if ($mybb->user['uid'] == $memprofile['uid']) {
		eval("\$mystatusedit = \"".$templates->get("mystatusedit")."\";");
	}

Yet the box doesn't show up - which I'm guessing means that I have a variable incorrect, right?
Globalised $memprofile in your function??
I sure have - just edited the code above to show the globals. I've just tried using $mybb->input['uid'] too and it didn't work either...



Okay, it seems that the variables are correct - I just tried

print $mybb->user['uid']." ".$mybb->input['uid'];

and

print $mybb->user['uid']." ".$memprofile['uid'];

So there's either a problem with my eval or my if... Either way, I'd love some more help haha
For member profile ID, you should have to use "$memprofile['uid']" to fetch the uid of the current profile user.
Yes, I know about that and I found out how to sort that specific part of the problem, yet the code I'm using still isn't working as I think it should.
Oh, ha, I see what it is, you've not globalised $mystatusedit
Oh darn! Thank matt haha. I always miss something simple >.>
Toungue No problem, the same thing has had me stuck for ages before too.
Thanks anyway. Now to solve the next problem xD Shouldnt need any more help though.