sparklywater
11-21-2009, 05:16 PM
I'm using the following plugin code at hook location 'global_start' to make attachments work in PMs:
if (THIS_SCRIPT == 'newattachment' AND $_REQUEST['type'] == 'pm')
{
$threadid = -1;
$vbulletin->userinfo['forumpermissions']['pm'] |= $vbulletin->bf_ugp_forumpermissions['canpostattachment'] + $vbulletin->bf_ugp_forumpermissions['canview'] + $vbulletin->bf_ugp_forumpermissions['canviewthreads'] + $vbulletin->bf_ugp_forumpermissions['canviewothers'] + $vbulletin->bf_ugp_forumpermissions['canreplyothers'] + $vbulletin->bf_ugp_forumpermissions['canreplyown'] + $vbulletin->bf_ugp_forumpermissions['canpostnew'];
$foruminfo['allowposting'] = 1;
$foruminfo['cancontainthreads'] = 1;
$foruminfo['forumid'] = 'pm';
}
Something in this code causes an error message when uploading attachments to thread posts: 'you don't have sufficient privileges / permissions to perform this action'. When the above plugin is disabled, there is no longer an error message on uploading attachments.
Here is the mod page: https://vborg.vbsupport.ru/showthread.php?t=127113
if (THIS_SCRIPT == 'newattachment' AND $_REQUEST['type'] == 'pm')
{
$threadid = -1;
$vbulletin->userinfo['forumpermissions']['pm'] |= $vbulletin->bf_ugp_forumpermissions['canpostattachment'] + $vbulletin->bf_ugp_forumpermissions['canview'] + $vbulletin->bf_ugp_forumpermissions['canviewthreads'] + $vbulletin->bf_ugp_forumpermissions['canviewothers'] + $vbulletin->bf_ugp_forumpermissions['canreplyothers'] + $vbulletin->bf_ugp_forumpermissions['canreplyown'] + $vbulletin->bf_ugp_forumpermissions['canpostnew'];
$foruminfo['allowposting'] = 1;
$foruminfo['cancontainthreads'] = 1;
$foruminfo['forumid'] = 'pm';
}
Something in this code causes an error message when uploading attachments to thread posts: 'you don't have sufficient privileges / permissions to perform this action'. When the above plugin is disabled, there is no longer an error message on uploading attachments.
Here is the mod page: https://vborg.vbsupport.ru/showthread.php?t=127113