The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
VM question
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): Code:
if ( ($vbulletin->options['vm_contactonly'] && !$userinfo['bbuser_iscontact_of_user'] { standard_error(fetch_error('ban_visitor_message', $vbulletin->userinfo['username'])); } Code:
$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'])); } |
#2
|
|||
|
|||
It looks like the first one should work, but you have mismatched parentheses (but maybe that's just in the code you posted). If it doesn't work then maybe you should figure out a way to display the values you're checking and make sure they're what you expect (Sometimes I just temporarily throw in echo statements followed by a die(); ).
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|