ViR-EnG
01-25-2017, 03:47 AM
Hi friends .
I try to hide links from guests , but I don't find the correct rawtext/parsed text location at source .
on vb4 it's possible to replace post string via preg_replace and replace it with own message , example :
if ((!$this->registry->userinfo[userid]) OR (is_member_of($this->registry->userinfo, 1, 3, 4)))
{
$this->post['message'] = preg_replace("!<a[^>]*(http|www)(.*)</a>!siU", $vbphrase[nolink], $this->post['message']);
}
is there anyone know where is the correct place to use preg_replace for rawtext or parsed text ?
the new code for vb5 must be like this , but where is the correct place ?
if ((!$userinfo[userid]) OR (is_member_of($userinfo, 1, 3, 4)))
{
$parsedText = preg_replace("!<a[^>]*(http|www)(.*)</a>!siU", '<a href="register.php">Register / Login to see links</a>', $parsedText);
}
Thanks
I try to hide links from guests , but I don't find the correct rawtext/parsed text location at source .
on vb4 it's possible to replace post string via preg_replace and replace it with own message , example :
if ((!$this->registry->userinfo[userid]) OR (is_member_of($this->registry->userinfo, 1, 3, 4)))
{
$this->post['message'] = preg_replace("!<a[^>]*(http|www)(.*)</a>!siU", $vbphrase[nolink], $this->post['message']);
}
is there anyone know where is the correct place to use preg_replace for rawtext or parsed text ?
the new code for vb5 must be like this , but where is the correct place ?
if ((!$userinfo[userid]) OR (is_member_of($userinfo, 1, 3, 4)))
{
$parsedText = preg_replace("!<a[^>]*(http|www)(.*)</a>!siU", '<a href="register.php">Register / Login to see links</a>', $parsedText);
}
Thanks