vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=155)
-   -   Moderators can see the Mod CP link (https://vborg.vbsupport.ru/showthread.php?t=104841)

JsnakeJ 01-08-2006 10:00 PM

Moderators can see the Mod CP link
 
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:
Code:

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

Code:

<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.

Please make sure that you enter the correct groups.

Daniel 01-09-2006 01:52 AM

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 01-09-2006 04:34 AM

Nevermind

FROGGYJ 01-09-2006 09:26 PM

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 01-11-2006 10:32 AM

Quote:

Originally Posted by FROGGYJ
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 01-19-2006 09:45 PM

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 01-20-2006 12:47 AM

The code to do this is already in 3.5.3, just commented out.

cyberhypnotic 01-20-2006 11:43 PM

It actually didn't work for me. I had to change

Code:

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

Code:

<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 01-20-2006 11:53 PM

You shouldn't need to do any template changes, revert the change and look for this in global.php

Code:

$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 01-21-2006 05:00 PM

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 01-25-2006 03:53 AM

thanx man . it good to add some saftey fro ur vb

Smiry Kin's 02-06-2006 07:49 PM

/me installs - Thank You

Smiry Kin's 02-07-2006 09:32 AM

seam to be a problem in 3.5.2

could you please make one that works with it?

error

Code:

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
Code:

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 02-07-2006 09:39 AM

Quote:

Originally Posted by Paul M
You shouldn't need to do any template changes, revert the change and look for this in global.php

Code:

$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 02-22-2006 07:49 PM

Quote:

Originally Posted by Paul M
You shouldn't need to do any template changes, revert the change and look for this in global.php

Code:

$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 03-02-2006 07:31 AM

Quote:

Originally Posted by cyberhypnotic
It actually didn't work for me. I had to change

Code:

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

Code:

<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:
Code:

<if condition="$bbuserinfo[usergroupid] == '6' OR $bbuserinfo[usergroupid] == 'Super Mod Group ID' OR $bbuserinfo[userid] == 'Moderator USER ID'">$vbphrase[mod] -

peterpigman 11-05-2007 06:28 PM

Quote:

Originally Posted by Paul M (Post 878267)
You shouldn't need to do any template changes, revert the change and look for this in global.php

Code:

$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 01-30-2008 10:52 PM

Quote:

Originally Posted by Paul M (Post 878267)
You shouldn't need to do any template changes, revert the change and look for this in global.php

Code:

$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 08-14-2008 06:57 AM

Thanks work for me on 3.7.2

peleh 05-17-2009 05:48 AM

Worked on 3.8.2


All times are GMT. The time now is 05:33 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01236 seconds
  • Memory Usage 1,791KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (14)bbcode_code_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (20)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete