2010-12-22, 03:33 PM
Im having a problem adding both user and user group options to my plugin.
This is the function with only the user option (working perfectly)
This is the same function with the "usergroup" option added (not working)
Cant seem to figure this out
This is the function with only the user option (working perfectly)
function userpoblker_run($post)
{
global $db, $mybb, $uid, $fid, $thread;
$gid = $mybb->user['uid'];
$xgid = explode(",",$mybb->settings['userpoblker_1']);
$fid = $thread['fid'];
$xfid = explode(",",$mybb->settings['userpoblker_4']);
$usergrpmess = $mybb->settings['userpoblker_2'];
if ($mybb->settings['userpoblker_3']== "1")
{
if (in_array($gid,$xgid, TRUE) && in_array($fid,$xfid))
{
$post['message'] = $usergrpmess;
}
}
}
This is the same function with the "usergroup" option added (not working)
function userpoblker_run($post)
{
global $db, $mybb, $uid, $fid, $thread;
$gid = $mybb->user['uid'];
$xgid = explode(",",$mybb->settings['userpoblker_1']);
$fid = $thread['fid'];
$xfid = explode(",",$mybb->settings['userpoblker_4']);
$user = $mybb->user['usergroup'];
$xuser = explode(",",$mybb->settings['userpoblker_1']);
$usergrpmess = $mybb->settings['userpoblker_2'];
if ($mybb->settings['userpoblker_3']== "1")
{
if (in_array($gid,$xgid, TRUE) && in_array($fid,$xfid) && in_array($user,$xuser))
{
$post['message'] = $usergrpmess;
}
}
}
Cant seem to figure this out