View Full Version : Disallow visitors to see the 'images'
Creative Suite
02-06-2005, 10:00 PM
What it does ?
Disallows visitors to see the images in the Forum :)
++++++++
----------
++++++++
in the functions_bbcodeparse.php find :
$link = strip_smilies(str_replace('\\"', '"', $link));
// remove double spaces -- fixes issues with wordwrap
$link = str_replace(' ', '', $link);
return '<img src="' . $link . '" border="0" alt="" />';
replace it with :
global $bbuserinfo;
$link = strip_smilies(str_replace('\\"', '"', $link));
// remove double spaces -- fixes issues with wordwrap
$link = str_replace(' ', '', $link);
if($bbuserinfo[userid] != 0){
return '<img src="' . $link . '" border="0" alt="" />';
}else{
return "
<b><font color='#FF0000' face='Microsoft Sans Serif' size='2'>
<a target='_blank' href='register.php'><font color='#FF0000'>
<span style='text-decoration: none'>[<span lang='ar-kw'>
</span>Sorry you can</font><font color='#FF0000' face='Tahoma' size='2'>'</font><font color='#FF0000' face='Microsoft Sans Serif' size='2'>t see this image before </font>
</span></font></a><a target='_blank' href='register.php'>
<span style='text-decoration: none'>
<font color='#008000' face='Microsoft Sans Serif' size='2'>registering</font><font color='#FF0000' face='Microsoft Sans Serif' size='2'><span lang='ar-kw'>
</span>]</font></span></a></b>
";
}
all done :)
don't forget to click install* :p
tnguy3n
02-07-2005, 07:07 AM
interesting! however, this would be much simplier using template mod. i.e
<if conditional="$bbuserinfo==0">message<else>show image</if>
SmEdD
02-07-2005, 07:18 AM
He isn't doing attached images, he is removing the [ IMG ] tags and replacing them!
Phalynx
02-07-2005, 08:45 AM
Nice, thanks!
Beermonster
02-07-2005, 09:14 AM
good idea will also save bandwidth :)
* Beermonster clicks install
Creative Suite
02-07-2005, 01:28 PM
Thanks 4 replying 2 all :)
"Registering"
Other than that, nice idea. :)
Creative Suite
02-07-2005, 07:52 PM
kall
error with writing on the keyboard :) , been edited ;)
msimplay
02-07-2005, 08:10 PM
hmm it also takes away the text thats in those posts
good idea but needs a bit of work
apfparadise
02-07-2005, 10:08 PM
Another Great hack CS. Installed.
BUT, here are a couple of things I would like to be better:
1. The word "registering" should be a link to the register.php page. I dont know how to do it, but it seems easy. I thought it was from your images, but it does not click.
2. It takes out the whole post, there could be tons of text, but it takes it all out, can it be limited to just IMG and URL links, but leave the text intact? That would be great.
Eagerly waiting for the fixes :)
Creative Suite
02-08-2005, 01:37 AM
msimplay
thanks
apfparadise
thanks 4 your nice words ,
all thing been fixed , plz go up and do as shown :)
if you'r now using the old one plz do as shown below :
find :
global $vboptions, $bbuserinfo;
if($bbuserinfo[userid] != 0){
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);
}else{
$bbcode = "
<p><font color='#FF0000' face='Tahoma' size='2'>[<span lang='ar-kw'>
</span>Sorry you can't see this image before </font>
<font color='#0000FF' face='Tahoma' size='2'>registering</font><font color='#FF0000' face='Tahoma' size='2'><span lang='ar-kw'>
</span>]</font></p>
";
}
return $bbcode;
replace it with :
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;
regards :)
apfparadise
02-08-2005, 09:41 PM
Yeah, that is perfect. The only thing I changed was the wording. It now says:
Sorry, you can't see the image until you register
Just a better English wording :)
Thanks a lot, I have been so looking for that, for my Photography forum, my registrations today after installing it are OFF THE CHART!!!! No more lurkers :)
Rireal
02-09-2005, 02:53 PM
Is there any way to add this as an option in the user cp for registered members who just want to disable images in posts?
ccplim
04-13-2005, 12:38 PM
I was trying this on my test server and I got the following error when trying to view the thread (be it login or not). Wonder what have I done wrong?
Parse error: parse error in c:\inetpub\wwwroot\forums\includes\functions_bbcod eparse.php on line 1625
ConKien
05-30-2005, 11:07 PM
I got this "<<< " instead of
"Sorry, you can't see the image until you register". Does this code work for vb3.0.7?
Thanks,
ConKien
Andreas
05-30-2005, 11:28 PM
I think this hack does not work correctly if the postcache is turned on.
wolfyman
08-13-2005, 02:50 AM
nice thanks :D
Dark_Lilly
03-21-2008, 04:16 PM
Is anywhere a working version for 3.6.8?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.