PDA

View Full Version : Add "Edit User" in context-menu?


pyd
08-08-2008, 07:13 PM
How can I add a "Edit this user"-Link to the dropdown-menu when clicking a username in a post?

Whitch template should I edit?
And also, this should only appear if I'm loged on as a admin...
Is this hard to do?

Opserty
08-08-2008, 08:20 PM
<a href="https://vborg.vbsupport.ru/showthread.php?t=92390" target="_blank">"Edit User" in postbit username menu</a> < Could maybe get something from that.

pyd
08-08-2008, 08:21 PM
Ok, so I found where the code should go, in the "Postbit"-template.

But how should I make the code?


1 <if condition="$show['profile']">
2 <tr>
3 <td class="vbmenu_option">
4 <a href="moderator.php...">$vbphrase[edit_user_profile]</a>
5 </td>
6 </tr>
7 </if>


Line 1: How do I restrict access to this, so that it only is avalible to admins?
Line 4: How should this line be? So that the correct userID is included?

Opserty
08-08-2008, 09:40 PM
Why don't you follow the instructions given in that thread? Doesn't it do what you wanted to do?

pyd
08-09-2008, 03:44 AM
Sorry, missed that one.
1 min. after posting my own reply! :D

2 questions:
1) Is it possible to get the link to open in a new tab?
2) Does this link only show to admins?

Thanks for the tip though!

Why don't you follow the instructions given in that thread? Doesn't it do what you wanted to do?

Opserty
08-09-2008, 07:11 AM
After the "<a" add target="_blank" so you have:

<a target="_blank" href="...

Will open it in a new window, tabs are a browser feature so you can force a tab to open.

2. Yes. Only members of the usergroup 6 will be able to see it. It may be better if you changed:

<if condition="$post[usergroupid]!= 6 AND $bbuserinfo[usergroupid] == 6">

To:

<if condition="!is_member_of($post, 6) AND is_member_of($bbuserinfo, 6)">


The first "6" is a protection list so to speak, so it won't show up for users in this group. The second "6" is the list of usergroups that can see the link. You can add more groups by adding the usergroupid separated by commas, after the "6"