Hi
Real Quick....
User Group Can Change Styles Permissions
Follow me!!!
Go to the Admin Directory....
Open './admin/usergroup.php'
FIND THIS...
Code:
require_once('./includes/adminfunctions_ranks.php');
BELOW IT ADD...
Code:
require_once ( './includes/adminfunctions_template.php' );
FIND THIS...
Code:
// set default yes permissions (bitfields)
$ug_bitfield = array(
'showgroup' => 1,
'canview' => 1,
'canviewmembers' => 1,
'canviewothers' => 1,
'cagetattachment' => 1,
'cansearch' => 1,
'canmodifyprofile' => 1,
'canthreadrate' => 1,
'canpostattachment' => 1,
'canpostpoll' => 1,
'canvote' => 1,
'canwhosonline' => 1,
'allowhidden' => 1,
'showeditedby' => 1,
'canseeprofilepic' => 1,
'canusesignature' => 1,
'cannegativerep' => 1,
'canuserep' => 1,
);
REPLACE WITH...
Code:
// set default yes permissions (bitfields)
$ug_bitfield = array(
'showgroup' => 1,
'canview' => 1,
'styleid' => '',
'canviewmembers' => 1,
'canviewothers' => 1,
'cagetattachment' => 1,
'cansearch' => 1,
'canmodifyprofile' => 1,
'canthreadrate' => 1,
'canpostattachment' => 1,
'canpostpoll' => 1,
'canvote' => 1,
'canwhosonline' => 1,
'allowhidden' => 1,
'showeditedby' => 1,
'canseeprofilepic' => 1,
'canusesignature' => 1,
'cannegativerep' => 1,
'canuserep' => 1,
'canselectskin' => 1,
);
FIND THIS...
Code:
print_yes_no_row($vbphrase['can_download_attachments'], 'usergroup[cangetattachment]', $ug_bitfield['cangetattachment']);
print_table_break();
print_column_style_code(array('width: 70%', 'width: 30%'));
REPLACE WITH...
Code:
print_yes_no_row($vbphrase['can_download_attachments'], 'usergroup[cangetattachment]', $ug_bitfield['cangetattachment']);
print_yes_no_row($vbphrase['can_select_skin'], 'usergroup[canselectskin]', $ug_bitfield['canselectskin']);
if ($usergroup['styleid'] == 0)
{
$usergroup['styleid'] = -1;
}
print_style_chooser_row('usergroup[styleid]', $usergroup['styleid'], $vbphrase['use_default_style'], $vbphrase['force_usergroup_style'], 1);
print_table_break();
print_column_style_code(array('width: 70%', 'width: 30%'));
Close and save './admin/usergroup.php'
Open './global.php'
FIND THIS...
Code:
// is style in the forum/thread set?
if ($codestyleid)
{
// style specified by forum
$styleid = $codestyleid;
$userselect = true;
}
else if ($bbuserinfo['styleid'] > 0 AND ($vboptions['allowchangestyles'] == 1 OR ($bbuserinfo['permissions']['adminpermissions'] & CANCONTROLPANEL)))
{
// style specified in user profile
$styleid = $bbuserinfo['styleid'];
}
else
{
// no style specified - use default
$styleid = $vboptions['styleid'];
}
REPLACE WITH...
Code:
if ( $codestyleid )
{
$styleid = $codestyleid;
$userselect = true;
}
else if ( ( $permissions['genericpermissions'] & 16777216 ) <> 0 )
{
if ( $bbuserinfo['styleid'] > 0 AND ($vboptions['allowchangestyles'] == 1 OR ( $bbuserinfo['permissions']['adminpermissions'] & CANCONTROLPANEL ) ) )
{
$styleid = $bbuserinfo['styleid'];
}
else
{
$styleid = $vboptions['styleid'];
}
}
else
{
$styleid = $permissions['styleid'];
}
FIND THIS...
Code:
if ($vboptions['allowchangestyles'])
{
$stylecount = 0;
$quickchooserbits = construct_style_options(-1, '--', true, true);
$show['quickchooser'] = iif ($stylecount > 1, true, false);
unset($stylecount);
}
else
{
$show['quickchooser'] = false;
}
REPLACE WITH...
Code:
if ( ( $permissions['genericpermissions'] & 16777216 ) <> 0 )
{
if ( $vboptions['allowchangestyles'] )
{
$stylecount = 0;
$quickchooserbits = construct_style_options ( -1, '--', true, true );
$show['quickchooser'] = iif ( $stylecount > 1, true, false );
unset ( $stylecount );
}
else
{
$show['quickchooser'] = false;
}
}
else
{
$show['quickchooser'] = false;
}
Save, close './global.php'
Open './profile.php'
FIND THIS...
Code:
if ($vboptions['allowchangestyles'])
{
$stylecount = 0;
if (!empty($stylechoosercache))
{
$stylesetlist = construct_style_options();
}
$show['styleoption'] = iif($stylecount > 1, true, false);
}
else
{
$show['styleoption'] = false;
}
REPLACE WITH...
Code:
if ( ( $permissions['genericpermissions'] & 16777216 ) <> 0 )
{
if ( $vboptions['allowchangestyles'] )
{
$stylecount = 0;
if ( ! empty ( $stylechoosercache ) )
{
$stylesetlist = construct_style_options ();
}
$show['styleoption'] = iif($stylecount > 1, true, false);
}
else
{
$show['styleoption'] = false;
}
}
else
{
$show['styleoption'] = false;
}
save, close './profile.php'
Open './includes/init.php'
FIND THIS...
Code:
'canhaverepleft' => 8388608,
BELOW IT ADD...
Code:
'canselectskin' => 16777216,
save, close './includes/init.php'
Now just run these querys (change 'bbs_' to the TABLE PREFIX YOU ARE USING, if not using one, then just remove it!)
Code:
ALTER TABLE bbs_usergroup ADD styleid TINYINT(1) UNSIGNED NOT NULL default '1';
INSERT INTO bbs_phrase VALUES ( '', -1, 'can_select_skin', 'Can Select Forum Styles', 3 );
INSERT INTO bbs_phrase VALUES ( '', -1, 'use_default_style', 'Use Default Style', 3 );
INSERT INTO bbs_phrase VALUES ( '', -1, 'force_usergroup_style', 'Force this usergroup to use this style only.<br />\r\n<span class=\'smallfont\'>If usergroup can not select styles, select one.</span>', 3 );
After go to Admin Panel >> Language Manger >> click Rebuild All Languages!
Then go to Usergroups >> Usergroup Manager >> Select group
Then configure your groups! (by default all groups have no permission to change styles and they are set to use the default style!!!)
You now have Change Style Permissions Based On User Groups!
I did this real quick, so there is no Admin Help phrases, if you want them I will show you how to add them, just tell me!
c, ya...
Sonia