View Full Version : Administrative and Maintenance Tools - Give Moderators ModCP Link In Footer
Pakblogger
11-10-2015, 10:00 PM
I have many manual created moderators groups, just today one of my moderator asked me that modcp option is not showing for him,.
There is small template modification in footer template for the same.
Template Edit (1)
In Template "footer", find:
if condition="$show['modcplink']">
Replace With:
if condition="can_moderate()">
Thats all,..
100% working checked on Vbulletin 4.2.3
Zachery
11-12-2015, 12:15 AM
Welcome to 1 extra query per page view for every non moderator/admin on your site!
Why do you think it was changed in the first place? :)
Pakblogger
11-12-2015, 04:13 AM
Welcome to 1 extra query per page view for every non moderator/admin on your site!
Why do you think it was changed in the first place? :)
Can you explain what you want to say
Alan_SP
11-12-2015, 08:12 PM
That your site would work a bit slower (every query slow down website a bit).
On the other hand, this is always a question do you need functionality and if you do, how much do you need it. Also, depending on how popular your site is, you maybe wouldn't even notice this.
Zachery
11-12-2015, 09:02 PM
vBulletin originally used the can_moderate() check in the show modcp link, but removed it because it caused an extra query on every page that was viewed for any user who was not a admin/mod
If you have 1000 hits per hour, and only 10 of those are from staff, you ran an extra 990 queries, for no real reason.
Pakblogger
11-13-2015, 04:01 PM
That your site would work a bit slower (every query slow down website a bit).
On the other hand, this is always a question do you need functionality and if you do, how much do you need it. Also, depending on how popular your site is, you maybe wouldn't even notice this.
vBulletin originally used the can_moderate() check in the show modcp link, but removed it because it caused an extra query on every page that was viewed for any user who was not a admin/mod
If you have 1000 hits per hour, and only 10 of those are from staff, you ran an extra 990 queries, for no real reason.
100% correct
alcazarx
11-13-2015, 06:58 PM
We use a modified version of the call// 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'] = (
$vbulletin->userinfo['permissions']['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel']
OR $vbulletin->userinfo['permissions']['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['ismoderator']
OR is_member_of($vbulletin->userinfo,7)
);
Group #7 is the standard Moderators group which contains all users that are declared as moderator.
Would this also generate extra queries?
Thanks.
Alan_SP
11-14-2015, 03:10 PM
Basically, you only need conditionals before can_moderate if user is moderator (member of usergroup 7, or others if you use different usergroup settings). Other checks you don't need, as supermods and admins already can see that link.
And no, in that case, if check returns false, code within check is skipped, so no additional queries.
Zachery
11-15-2015, 10:42 PM
Can't assume users who are in a specific usergroup are even moderators.
Paul M
11-16-2015, 10:34 AM
While its true this will add an extra query, in reality these days its not that big a deal.
Unless you sql server is on the brink of collapse (in which case you have for more serious issues than this mod) then you really are never going to notice the difference.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.