gamaken
01-05-2013, 10:18 PM
I'm trying to write a plugin to do the following:
When a member attempts to post a VM on another member's profile, the plugin checks -
A) Is your own privacy setting set to only allow friends?
B) Is the recipient of the VM a friend?
If A is true and B is false, the VM is not posted, and the member attempting to post the VM gets an error dialog.
What I've attempted (Hook Location is visitor_message_start):
if (
($vbulletin->options['vm_contactonly'] && !$userinfo['bbuser_iscontact_of_user']
{
standard_error(fetch_error('ban_visitor_message', $vbulletin->userinfo['username']));
}
and:
$novmperm = explode(",", $vbulletin->options['vm_contactonly']);
if (!$userinfo['bbuser_iscontact_of_user' && in_array($vbulletin->userinfo['userid'], $novmperm))
{
standard_error(fetch_error('ban_visitor_message', $vbulletin->userinfo['username']));
}
Neither of the above codes is working. Any ideas?
When a member attempts to post a VM on another member's profile, the plugin checks -
A) Is your own privacy setting set to only allow friends?
B) Is the recipient of the VM a friend?
If A is true and B is false, the VM is not posted, and the member attempting to post the VM gets an error dialog.
What I've attempted (Hook Location is visitor_message_start):
if (
($vbulletin->options['vm_contactonly'] && !$userinfo['bbuser_iscontact_of_user']
{
standard_error(fetch_error('ban_visitor_message', $vbulletin->userinfo['username']));
}
and:
$novmperm = explode(",", $vbulletin->options['vm_contactonly']);
if (!$userinfo['bbuser_iscontact_of_user' && in_array($vbulletin->userinfo['userid'], $novmperm))
{
standard_error(fetch_error('ban_visitor_message', $vbulletin->userinfo['username']));
}
Neither of the above codes is working. Any ideas?