PDA

View Full Version : Moderators can see the Mod CP link


JsnakeJ
09 Jan 2006, 02:06
Thanks to cyberhypnotic for fixing my mistake.

Just a simple hack to allow your moderators to view the Mod CP link just like your Super Moderators and Administrators can.

Open your Footer template.

Find:
<if condition="$show['modcplink']"><a href="$modcpdir/index.php$session[sessionurl_q]">$vbphrase[mod]</a> -</if>

Replace with:


<if condition="$bbuserinfo[usergroupid] == '6' OR $bbuserinfo[usergroupid] == 'Super Mod Group ID' OR $bbuserinfo[usergroupid] == 'Moderator Group ID'"><a href="$modcpdir/index.php$session[sessionurl_q]">$vbphrase[mod]</a> -</if>

Screenshot isn't needed. This should work on any version of vBulletin 3.5.x or vBulletin 3.0.x.

You can get the 3.0.x version here (http://www.vbulletin.org/forum/showthread.php?t=104842).

Please make sure that you enter the correct groups.

Daniel
09 Jan 2006, 02:52
Nice, I think you made two of the same thread though.

EDIT: Oops, sorry. I just realised that was for 3.0.12 :P My apoligies.

Submerge
09 Jan 2006, 05:34
Nevermind

FROGGYJ
09 Jan 2006, 22:26
this doesn't work for me with 3.5.1. Confirmed usergroup id's. As soon as I hit save it just goes to a blank page instead of returning to the edit template screen....and the link does not show. I changed it to only show <if condition="is_member_of(7)"> and still no go. Any clue?

YOimYO
11 Jan 2006, 11:32
this doesn't work for me with 3.5.1. Confirmed usergroup id's. As soon as I hit save it just goes to a blank page instead of returning to the edit template screen....and the link does not show. I changed it to only show <if condition="is_member_of(7)"> and still no go. Any clue?

I have the same problem in 3.5 gold :S

thx neways ....

we_scooter
19 Jan 2006, 22:45
i like this MOD

I have this concern .

If I want a condition saying (if usergroup Admin or MODERATOR) show "this" else show "blablabla")

what should the code be
:disappointed:

???

Paul M
20 Jan 2006, 01:47
The code to do this is already in 3.5.3, just commented out.

cyberhypnotic
21 Jan 2006, 00:43
It actually didn't work for me. I had to change

<if condition="$show['modcplink']"><a href="$modcpdir/index.php$session[sessionurl_q]">$vbphrase[mod]</a> -</if>

And replace it with:

<if condition="$bbuserinfo[usergroupid] == '6' OR $bbuserinfo[usergroupid] == 'Super Mod Group ID' OR $bbuserinfo[usergroupid] == 'Moderator Group ID'"><a href="$modcpdir/index.php$session[sessionurl_q]">$vbphrase[mod]</a> -</if>
It worked that way. My only concern is that I was hoping it would allow ONE of my forum Moderators access to that ModCP. Does anyone know how to allow that in a code somewhere? I'd greatly appreciate it!

Paul M
21 Jan 2006, 00:53
You shouldn't need to do any template changes, revert the change and look for this in global.php


$show['admincplink'] = iif($permissions['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel'], true, false);
// This generates an extra query for non-admins/supermods on many pages so we have chosen to only display it to supermods & admins
// $show['modcplink'] = iif(can_moderate(), true, false);
$show['modcplink'] = iif ($permissions['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel'] OR $permissions['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['ismoderator'], true, false);

Uncomment the bold line, and comment out the line below it.

cyberhypnotic
21 Jan 2006, 18:00
Paul, is there any possible way to allow ONLY a certain usergroup ID to view the ModCP?

I have a Moderator that I want to be able to view it and have permission to use the menu in the ModCP.

If I uncomment that line, it will allow ALL Mods permission to use it and I don't want all Mods to use all of the menu options on the ModCP.

jeddah_eyes
25 Jan 2006, 04:53
thanx man . it good to add some saftey fro ur vb

Smiry Kin's
06 Feb 2006, 20:49
/me installs - Thank You

Smiry Kin's
07 Feb 2006, 10:32
seam to be a problem in 3.5.2

could you please make one that works with it?

error

The following error occurred when attempting to evaluate this template:

Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in includes/adminfunctions_template.php(3537) : eval()'d code on line 60

This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.
forum error after clicking continue
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in public_html/global.php(513) : eval()'d code on line 60

Smiry Kin's
07 Feb 2006, 10:39
You shouldn't need to do any template changes, revert the change and look for this in global.php


$show['admincplink'] = iif($permissions['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel'], true, false);
// This generates an extra query for non-admins/supermods on many pages so we have chosen to only display it to supermods & admins
// $show['modcplink'] = iif(can_moderate(), true, false);
$show['modcplink'] = iif ($permissions['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel'] OR $permissions['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['ismoderator'], true, false);

Uncomment the bold line, and comment out the line below it.
Thanks Paul! very usful!!!!

JsnakeJ
22 Feb 2006, 20:49
You shouldn't need to do any template changes, revert the change and look for this in global.php


$show['admincplink'] = iif($permissions['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel'], true, false);
// This generates an extra query for non-admins/supermods on many pages so we have chosen to only display it to supermods & admins
// $show['modcplink'] = iif(can_moderate(), true, false);
$show['modcplink'] = iif ($permissions['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel'] OR $permissions['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['ismoderator'], true, false);

Uncomment the bold line, and comment out the line below it.
Nice work Paul.

Xplorer4x4
02 Mar 2006, 08:31
It actually didn't work for me. I had to change

<if condition="$show['modcplink']"><a href="$modcpdir/index.php$session[sessionurl_q]">$vbphrase[mod]</a> -</if>

And replace it with:

<if condition="$bbuserinfo[usergroupid] == '6' OR $bbuserinfo[usergroupid] == 'Super Mod Group ID' OR $bbuserinfo[usergroupid] == 'Moderator Group ID'"><a href="$modcpdir/index.php$session[sessionurl_q]">$vbphrase[mod]</a> -</if>
It worked that way. My only concern is that I was hoping it would allow ONE of my forum Moderators access to that ModCP. Does anyone know how to allow that in a code somewhere? I'd greatly appreciate it!
Thanks for the working code. This hsould be placed in the first post.

As far as one mod goes, try this:
<if condition="$bbuserinfo[usergroupid] == '6' OR $bbuserinfo[usergroupid] == 'Super Mod Group ID' OR $bbuserinfo[userid] == 'Moderator USER ID'">$vbphrase[mod] -

peterpigman
05 Nov 2007, 19:28
You shouldn't need to do any template changes, revert the change and look for this in global.php


$show['admincplink'] = iif($permissions['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel'], true, false);
// This generates an extra query for non-admins/supermods on many pages so we have chosen to only display it to supermods & admins
// $show['modcplink'] = iif(can_moderate(), true, false);
$show['modcplink'] = iif ($permissions['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel'] OR $permissions['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['ismoderator'], true, false);

Uncomment the bold line, and comment out the line below it.

Yeah that works. I didn't realise moderators didn't have access.

River_rush
30 Jan 2008, 23:52
You shouldn't need to do any template changes, revert the change and look for this in global.php


$show['admincplink'] = iif($permissions['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel'], true, false);
// This generates an extra query for non-admins/supermods on many pages so we have chosen to only display it to supermods & admins
// $show['modcplink'] = iif(can_moderate(), true, false);
$show['modcplink'] = iif ($permissions['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel'] OR $permissions['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['ismoderator'], true, false);

Uncomment the bold line, and comment out the line below it.

Cheers for that, got me out of a hole

fulviods
14 Aug 2008, 07:57
Thanks work for me on 3.7.2

peleh
17 May 2009, 06:48
Worked on 3.8.2