PDA

View Full Version : Change from can_moderate to usergroup permission


powerful_rogue
01-09-2008, 05:28 PM
if ($_GET['do'] == 'removewarning')
{
if (!can_moderate() || !$vbulletin->options['can_del_warn'])
{
print_no_permission();

Using the above it shows this feature to mods, super mods and admin. Id like to change it so it only shows to super mods and admins.

(!is_member_of($bbuserinfo, 5,6)

Am i working along the right lines if I change the part in bold to the above?

Also, can anyone help with what the ! is for?

MoT3rror
01-09-2008, 07:15 PM
if ($_GET['do'] == 'removewarning')
{
if (!can_administer() OR !$vbulletin->options['can_del_warn'])
{
print_no_permission();


There is more options you can use with the can_administer that you can see at the link.
http://members.vbulletin.com/api/vBulletin/_includes_adminfunctions_php.html#functioncan_admi nister

powerful_rogue
01-09-2008, 07:55 PM
Thats brilliant! Would that command also include super moderators or is it admins only? Also any idea what the ! means before it?

Its a mod I downloaded and installed, works great but its all hard coded so you cant choose who views and gives warnings. Due to this it also allows mods of forums to view everyones warnings and give them out, and im trying to work out a way to change it to only admins and super mods.

The mods unsupported and had no input from the developer since 2006 :( I dont know a lot about coding, but trying to work my way through to make this alteration.

Opserty
01-10-2008, 09:05 AM
! means not.


if(!can_moderate())
{
//print no permissions
}