Baumeister900
09-05-2011, 08:34 PM
Hi,
I would like to hide images from my guests - I tried many different ideas such as this one that comes pretty close: https://vborg.vbsupport.ru/showpost.php?p=580244&postcount=5
But after all it doesn't work because my code is different.
So basically we have to modify "inlcudes/class_bbcode.php"
Then the interesting part looks like this:
// If you wanted to be able to edit when editing a post instead of seeing the image, add the get_class() check from above
if ($has_img_code & BBCODE_HAS_IMG)
{
if ($do_imgcode AND ($this->registry->userinfo['userid'] == 0 OR $this->registry->userinfo['showimages']))
{
// do [img]xxx
$bbcode = preg_replace('#\[img\]\s*(https?://([^*\r\n]+|[a-z0-9/\\._\- !]+))\[/img\]#iUe', "\$this->handle_bbcode_img_match('\\1')", $bbcode);
}
else
{
$bbcode = preg_replace('#\[img\]\s*(https?://([^*\r\n]+|[a-z0-9/\\._\- !]+))\[/img\]#iUe', "\$this->handle_bbcode_url(str_replace('\\\"', '\"', '\\1'), '')", $bbcode);
}
}
So how do I modify this part in order to show my guests a message like " Only registered users can see images" ?
I would like to hide images from my guests - I tried many different ideas such as this one that comes pretty close: https://vborg.vbsupport.ru/showpost.php?p=580244&postcount=5
But after all it doesn't work because my code is different.
So basically we have to modify "inlcudes/class_bbcode.php"
Then the interesting part looks like this:
// If you wanted to be able to edit when editing a post instead of seeing the image, add the get_class() check from above
if ($has_img_code & BBCODE_HAS_IMG)
{
if ($do_imgcode AND ($this->registry->userinfo['userid'] == 0 OR $this->registry->userinfo['showimages']))
{
// do [img]xxx
$bbcode = preg_replace('#\[img\]\s*(https?://([^*\r\n]+|[a-z0-9/\\._\- !]+))\[/img\]#iUe', "\$this->handle_bbcode_img_match('\\1')", $bbcode);
}
else
{
$bbcode = preg_replace('#\[img\]\s*(https?://([^*\r\n]+|[a-z0-9/\\._\- !]+))\[/img\]#iUe', "\$this->handle_bbcode_url(str_replace('\\\"', '\"', '\\1'), '')", $bbcode);
}
}
So how do I modify this part in order to show my guests a message like " Only registered users can see images" ?