-=Sniper=-
07-07-2005, 05:33 PM
I requested this before but I was told it could be a problem because of post cache. So had a go my self and came up with this. It displays links only for guests while members can choose to view images or not.
I wanted to do this, so to speed up the site for users with slow connections. Wile broadband users can enable it.
So I just wanted to know would this cause any problems with the post cache or add extra work for the server?
function handle_bbcode_img($bbcode, $dobbimagecode)
{
global $vboptions, $bbuserinfo;
if($dobbimagecode AND ($bbuserinfo['userid'] == 0 OR $bbuserinfo['showimages']))
{
// do https://vborg.vbsupport.ru/
$bbcode = preg_replace('#\[img\]\s*(https?://([^<>*"' . iif(!$vboptions['allowdynimg'], '?&') . ']+|[a-z0-9/\\._\- !]+))\[/img\]#iUe', "handle_bbcode_img_match('\\1')", $bbcode);
}
$bbcode = preg_replace('#\[img\]\s*(https?://([^<>*"]+|[a-z0-9/\\._\- !]+))\[/img\]#iUe', "handle_bbcode_url('\\1', '', 'url')", $bbcode);
return $bbcode;
}
to
// ###################### Start bbcodeparseimgcode #######################
function handle_bbcode_img($bbcode, $dobbimagecode)
{
global $vboptions, $bbuserinfo;
if($dobbimagecode AND ($bbuserinfo['showvbcode'] == 1 AND $bbuserinfo['showimages']))
{
// do https://vborg.vbsupport.ru/
$bbcode = preg_replace('#\[img\]\s*(https?://([^<>*"' . iif(!$vboptions['allowdynimg'], '?&') . ']+|[a-z0-9/\\._\- !]+))\[/img\]#iUe', "handle_bbcode_img_match('\\1')", $bbcode);
}
$bbcode = preg_replace('#\[img\]\s*(https?://([^<>*"]+|[a-z0-9/\\._\- !]+))\[/img\]#iUe', "handle_bbcode_url('\\1', '', 'url')", $bbcode);
return $bbcode;
}
thanks
I wanted to do this, so to speed up the site for users with slow connections. Wile broadband users can enable it.
So I just wanted to know would this cause any problems with the post cache or add extra work for the server?
function handle_bbcode_img($bbcode, $dobbimagecode)
{
global $vboptions, $bbuserinfo;
if($dobbimagecode AND ($bbuserinfo['userid'] == 0 OR $bbuserinfo['showimages']))
{
// do https://vborg.vbsupport.ru/
$bbcode = preg_replace('#\[img\]\s*(https?://([^<>*"' . iif(!$vboptions['allowdynimg'], '?&') . ']+|[a-z0-9/\\._\- !]+))\[/img\]#iUe', "handle_bbcode_img_match('\\1')", $bbcode);
}
$bbcode = preg_replace('#\[img\]\s*(https?://([^<>*"]+|[a-z0-9/\\._\- !]+))\[/img\]#iUe', "handle_bbcode_url('\\1', '', 'url')", $bbcode);
return $bbcode;
}
to
// ###################### Start bbcodeparseimgcode #######################
function handle_bbcode_img($bbcode, $dobbimagecode)
{
global $vboptions, $bbuserinfo;
if($dobbimagecode AND ($bbuserinfo['showvbcode'] == 1 AND $bbuserinfo['showimages']))
{
// do https://vborg.vbsupport.ru/
$bbcode = preg_replace('#\[img\]\s*(https?://([^<>*"' . iif(!$vboptions['allowdynimg'], '?&') . ']+|[a-z0-9/\\._\- !]+))\[/img\]#iUe', "handle_bbcode_img_match('\\1')", $bbcode);
}
$bbcode = preg_replace('#\[img\]\s*(https?://([^<>*"]+|[a-z0-9/\\._\- !]+))\[/img\]#iUe', "handle_bbcode_url('\\1', '', 'url')", $bbcode);
return $bbcode;
}
thanks