MyBB Community Forums

Full Version: Linking user profile to ModCP/adminCP
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi

My forum URL is gbatmw.net (although for this it may not really be relevant).

Anyway.

When I first installed myBB, I swear there was a box in a users profile with the options to go to the modCP for that user or to ban that user. It's disapeared (or I saw it somewhere else). Does it exist? Is there a setting that would disable it? I'm new to myBB and I've probably just changed the wrong setting.

Also. Is there any way of linking the users profile to the admin profile editor? Right now, if I want to edit a users profile, the only way I can see of doing that is to copy the users UID, and then paste it into the adminCP, eg

user profile:
http://gbatmw.net/member.php?action=profile&uid=xx
AdminCP URL:
admin/index.php?module=user/users&action=edit&uid=xx

There must be an easier way of doing this. Is there a setting to enable a link, or would the only option to be to edit something/write a plugin?

If the only option is hard coding, can someone point me in the direction of the user profile.

Thanks!

Leo
You can do this with just a tiny edit to member.php - just follow the instructions in the thread below... if you have any problems, post them in this thread please Smile

Basically, if a moderator is logged in, they will see the moderator options. If the admin is logged in, then they will see admin options.

http://community.mybboard.net/thread-410...#pid276779
@OP
The box is still there. Ive not seen it in UserCP but it's at bottom right of all user profiles.
(2009-01-01, 08:01 PM)sayakb Wrote: [ -> ]@OP
The box is still there. Ive not seen it in UserCP but it's at bottom right of all user profiles.

Hi

I followed the steps outlined in the other thread, but it still isn't appearing. The code is in the member.php file, so I don't understand what the problem is. I guess it could be that for some reason my account (admin) isn't registering as an admin account.

I installed 2 plugins that made changes to the member profile. The notes plugin and the show member groups plugin. I uninstalled both of them, restored member.php from the orginal upload, and still no luck. It's bizarre. I've cleared my browser cache, (I'll try again in IE to start with a fresh cache). The most obvious thing seems to be that it is not recognising my account as being an admin account.
In this part of the code:

if($mybb->user['usergroup'] == 4){

...you need to change this to the admin usergroups. You can do this:

if($mybb->user['usergroup'] == 4 || $mybb->user['usergroup'] == 6){

...etc. to add more usergroups. So this means users in group 4 and 6 will see the admin options, any others will see the ModCP actions.
(2009-01-01, 08:54 PM)Tom.M Wrote: [ -> ]In this part of the code:

if($mybb->user['usergroup'] == 4){

...you need to change this to the admin usergroups. You can do this:

if($mybb->user['usergroup'] == 4 || $mybb->user['usergroup'] == 6){

...etc. to add more usergroups. So this means users in group 4 and 6 will see the admin options, any others will see the ModCP actions.

Hi

Thanks for the help.

Now this is looking increasingly odd. The group is set as the admin usergroup (4) which I am a member of.

Where the code
       $modoptions = '';
is, I placed
echo "ThisIsATest";
but searching the source of the generated page didn't show that to be present. While it could be that I'm just being an idiot, and that text won't be output to the generated page, it could also signify the whole section not being executed for some strange reason.

E: I'm an idiot. Obviously as an administrator I'm not relevant for that "else". When I placed the echo code next to the link-to-admin box code, it displayed. For some reason the templates simply aren't working.

I'm not running the default theme, but I would imagine that wouldn't make a difference. I have the member_profile_adminoptions in the global templates category, while each of the custom themes I'm using appears to have its own member_profile_modoptions template.

None of the code from the templates is in the source of the generated page. It's obviously not loading the template files when it should, but I'm not sure why.

Thanks!

Leo
(2009-01-01, 09:08 PM)leoedin Wrote: [ -> ]I'm not running the default theme, but I would imagine that wouldn't make a difference. I have the member_profile_adminoptions in the global templates category, while each of the custom themes I'm using appears to have its own member_profile_modoptions template.

None of the code from the templates is in the source of the generated page. It's obviously not loading the template files when it should, but I'm not sure why.

I've just tried it on my test board, and it works perfectly. It is right that each theme uses it's own modoptions template - this is what we use to display the moderator options.

Are you sure you have edited member.php right (and uploaded it to your server)?...
(2009-01-01, 10:26 PM)Tom.M Wrote: [ -> ]
(2009-01-01, 09:08 PM)leoedin Wrote: [ -> ]I'm not running the default theme, but I would imagine that wouldn't make a difference. I have the member_profile_adminoptions in the global templates category, while each of the custom themes I'm using appears to have its own member_profile_modoptions template.

None of the code from the templates is in the source of the generated page. It's obviously not loading the template files when it should, but I'm not sure why.

I've just tried it on my test board, and it works perfectly. It is right that each theme uses it's own modoptions template - this is what we use to display the moderator options.

Are you sure you have edited member.php right (and uploaded it to your server)?...

I'm more than sure. The problem is not with member.php - it has got the correct code, and if I put an echo "text"; into it, the text is displayed on the generated page.

however

The code to generate the admin options box isn't working. Either the code itself is at fault (unlikely, direct copy and paste) or the template isn't loading for some reason.

Can you suggest any reason that would happen? It seems a little strange. I'm going to keep investigating and post back anything I find.

Edit: Found it. The moderator notes in user profile plugin replaced {modoptions} in member_profile with {modnotes}, and so cleared out the block that has the moderator options in it.

Thanks for all your help!