09-18-2004, 02:42 PM
|
|
|
|
Join Date: Dec 2003
Location: AnimationTalk.com
Posts: 2,367
Благодарил(а): 0 раз(а)
Поблагодарили:
0 раз(а) в 0 сообщениях
|
|
Quote:
Originally Posted by Silverdawn222
Hi,
Works excellently. However, I have a problem. We also run the Articles Hack on our forum. This popular hack uses plugin usergroup permission bitfields like yours (in includes/init.php). There seems to be a conflict because I can't properly set the permissions without it jumping between article permissions and journal permissions. And I'm afraid deleting the articles feature is really not an option because that's what our site is all about. I'm talking about this piece of code (the first part is your custom fields, the second is the Article Hack's):
PHP Code:
// field names for journal permissions
$_BITFIELD['usergroup']['journalpermissions'] = array(
'canviewjournal' => 1,
'canhavejournal' => 2,
'canviewcomments' => 4,
'cancommentjournals' => 8,
'canratejournals' => 16,
'canreportentries' => 32,
'caneditownjournal' => 64,
'caneditownentries' => 128,
'candeleteownjournal' => 256,
'candeleteownentries' => 512,
'cansearchjournal' => 1024 //,
// 'caneditothersjournal' => 2048,
// 'caneditothersentries' => 4096,
// 'candeleteothersjournal' => 8192,
// 'candeleteothersentries' => 16384
);
// ### INSERT PLUGIN USERGROUP PERMISSIONS BITFIELDS HERE ###
// ----------------------------------------------------------
$_BITFIELD['usergroup']['articlepermissions'] = array(
'canviewarticles' => 1,
'canviewcomments' => 2,
'canpostarticles' => 4,
'cancomment' => 8,
'canedownart' => 16,
'canedothart' => 32,
'candelownart' => 64,
'candelothart' => 128,
'canfeature' => 256,
'cansearchart' => 512,
'canratearticles' => 1024,
'canviewartmedia' => 2048
);
// ----------------------------------------------------------
// ### END PLUGIN USERGROUP PERMISSIONS BITFIELDS HERE ###
|
ok change the journals permissions to the following:
PHP Code:
// field names for journal permissions
$_BITFIELD['usergroup']['journalpermissions'] = array(
'canviewjournal' => 1,
'canhavejournal' => 2,
'canviewjournalcomments' => 4,
'cancommentjournals' => 8,
'canratejournals' => 16,
'canreportentries' => 32,
'caneditownjournal' => 64,
'caneditownentries' => 128,
'candeleteownjournal' => 256,
'candeleteownentries' => 512,
'cansearchjournal' => 1024 //,
// 'caneditothersjournal' => 2048,
// 'caneditothersentries' => 4096,
// 'candeleteothersjournal' => 8192,
// 'candeleteothersentries' => 16384
);
and in journal.php
change find:
PHP Code:
if($permissions['journalpermissions'] & CANVIEWCOMMENTS)
{
$canview['comments']= true;
}
else
{
$canview['comments']= false;
}
replace that with:
PHP Code:
if($permissions['journalpermissions'] & CANVIEWJOURNALCOMMENTS)
{
$canview['comments']= true;
}
else
{
$canview['comments']= false;
}
in usergroup.php find:
PHP Code:
print_yes_no_row("Can View Comments", 'usergroup[canviewcomments]', $ug_bitfield['canviewcomments']);
replace that with:
PHP Code:
print_yes_no_row("Can View Comments", 'usergroup[canviewjournalcomments]', $ug_bitfield['canviewjournalcomments']);
that should fix the conflict
|