The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
![]()
Hello ,
i need php condition " if user is moderator " In other words, I want Run Code only if is this user is a moderator Like : PHP Code:
|
#2
|
||||
|
||||
![]()
Just for certain moderators or the moderator group?
|
#3
|
|||
|
|||
![]() Quote:
Code:
/** * Returns whether or not the given user can perform a specific moderation action in the specified forum * * @param integer Forum ID * @param string If you want to check a particular moderation permission, name it here * @param integer User ID * @param string Comma separated list of usergroups to which the user belongs * * @return boolean */ function can_moderate($forumid = 0, $do = '', $userid = -1, $usergroupids = '') { Code:
if (can_moderate(0, '', $userid)) { // code } |
#4
|
||||
|
||||
![]()
yeah i want show this code for any moderators without use moderator groupid
Quote:
i think is working , but i have problem ... i want show this code for only moderators but it also Shows for admin ![]() |
#5
|
|||
|
|||
![]()
Nice call @Kh99, I would modify that routine. Seems like the way to go, at least I have not found anything better.
![]() |
#6
|
|||
|
|||
![]() Quote:
Code:
<if condition="can_moderate() AND !($vbulletin->userinfo['permissions']['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel'])"> Otherwise, you can write a plugin to do whatever checks you want and set a variable. |
2 благодарности(ей) от: | ||
RichieBoy67, tbworld |
#7
|
||||
|
||||
![]()
One question, is can_moderate available in all areas?
|
#8
|
||||
|
||||
![]() Not sure what you mean.. This conditional goes around what ever you want to have those conditions. It is only going to work where ever that code is placed and surrounded with the conditional. |
#9
|
|||
|
|||
![]()
I think what you're asking is if can_moderate() could be used in any template. I believe the answer is yes, it checks using the current user and/or the parameters you pass, so it should work anywhere. Of course if you want to check if the user can moderate the current forum, you need to pass the forumid.
|
#10
|
||||
|
||||
![]()
THNX kh99, IT'S WORKING GOOD
PHP Code:
Quote:
i try this Conditionals to be sure if user is " moderate the current forum" but not work on template [memberaction_dropdown] for vb4 PHP Code:
PHP Code:
|
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|