2018-03-31, 11:32 PM
I am trying to modify an abandoned nofollow plugin whereby I want to nofollow all links posted by members except admins.
But no matter what I write in the if condition , the control does not go inside the if condition hence I end up with ALL links nofollow (even the ones posted by admin)
I have tried with ($mybb->user['usergroup'] == 4) as well.
Can the experts here please point out what I may be doing wrong?
But no matter what I write in the if condition , the control does not go inside the if condition hence I end up with ALL links nofollow (even the ones posted by admin)
function nofollow_parse($msg)
{
global $mybb;
if ($mybb->usergroup['cancp'] == 1)
{ return null;
}
else
{
$msg = preg_replace("#<a href=\"(.+)\" target=\"_blank\" rel=\"noopener\" class=\"mycode_url\">#i", "<a href=\"$1\" target=\"_blank\" rel=\"noopener nofollow\" class=\"mycode_url\">", $msg);
return $msg;
}
}
I have tried with ($mybb->user['usergroup'] == 4) as well.
Can the experts here please point out what I may be doing wrong?