MyBB Community Forums

Full Version: Calling another user's UID
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm trying to modify the Mod CP queue to link to the direct banning page when a user's name is displayed in the list. However, I'm having trouble getting the UID from the user who made the post that is in the Mod CP queue. If I use:

{$mybb->user['uid']}

It shows the UID of the user logged in which is not what I want.

The template is currently using this to list the username of the user:

{$profile_link}

But I've been unable to extract the UID from it.

This is the template I'm editing: modcp_modqueue_threads_thread

So what I want to accomplish in the end should look like this:

Thread | Author | Date
--------------------------------
Spam Thread | Spammer [clickable link to ban them rather than take you to their profile] | Date

Appreciate any help.
modcp.php?action=banuser&uid={$thread['uid']}
Thanks a lot, can't believe I missed that variable as it was being called already for the TID in that same section...

Here's the exact code if anyone wants to accomplish what I was trying to do, I'll probably make another post outlining it for those who don't understand any code.

Where it says {$profile_link} you replace it with this:
<a href="http://www.forum.tld/modcp.php?action=banuser&uid={$thread['uid']}">{$thread['username']}</a>

This allows you to simply click on the user who you want to ban from the mod queue without having to go into their profile and click on the ban from Mod CP link. Saves a little time Smile

You'll have to edit the post template as well as the one in the OP was for threads only. The $thread variable also has to change to $post.