View Full Version : vB3 Block PHP, CODE and HTML from unregistered users
vB3 Block PHP, CODE and HTML from unregistered visitors v1.1
(By Boofo)
What does this hack do?
This will block all php, code and html code from all unregistered users. Any code bewteen those tags will be replaced will a line telling them they are not allowed to view the code and to please register. (You can change the messages to whatever you like.) Included is also the code for the QUOTE boxes. I don't use the QUOTE boxes bypass on my board, but I have the option ready in case someone decides to quote code, php or html code to bypass this hack. Anything between the code, php or html tags will be parsed out, even quote tags, as long as it is between one of the other tags within the quote itself. If someone just puts QUOTE tags around the code itself, then it will show as normal (unless you add the quote bypass below).
Version Information:
Version 1.0 --Initial release
Version 1.1 --Updated to now work in the archive. Also added the ability to double-click the code box to copy the code to the clipboard. Only works in IE so far. Will be adding the double-clicking ability for other browers as I find what will work with them.
Installation overview:
Files to edit: (2)
--includes/functions_bbcodeparse.php
--archive/index.php
Templates to edit: 3 (Optional: 2)
--bbcode_code
--bbcode_html
--bbcode_php
(Optional)
--bbcode_sql
--bbcode_quote
Phrases to add: 3 (Optional: 2)
--bf2_block_code
--bf2_block_html
--bf2_block_php
(Optional)
--bf2_sql_code
--bbcode_quote
If you find this hack useful, please click the install button. ;)
Hehe you beat me to porting it. Good to see you back again Bob :)
I could never get this to work right before the Gamma. The template conditionals make it so easy now. Would have done it all that way except the global doesn't work in templates (at least I couldn't get it to work there). ;)
I run RC1 and it works fine for me. Go through the hack again and make sure you added the stuff to the file.
Koutaru
04 Jan 2004, 17:39
Neat :) I'll definately try this one.
Chroder
04 Jan 2004, 19:21
Ah, sweet stuff Boofo :D I'm ginna add this to my board too.
*install
cirisme
04 Jan 2004, 19:27
Does this work with post caching?
Chroder
04 Jan 2004, 19:56
Seems to work fine :)
Thank you, Chroder, for verifying that. I don't have post caching enabled but I thought it should work with it. ;)
Don't forget the install button, guys. ;)
MindTrix
04 Jan 2004, 21:02
Can this be edited for other bbcode? For example the spoiler one that was recently released, can it be edited along with this so that unregistered users cannot see it?
I don't think this hack will work with that. Just do an if conditon for the bbuserinfo['userid'] before the spoiler in the postbit (if that's where it is, I haven't looked at the hack). ;)
cirisme
04 Jan 2004, 22:00
Cool. That surpises me considering how the templates, etc work... I tried something similar in b7 so things must have changed with gamma/rc1.
I will definately check it out :)
Then click the button, my man! ;)
very nice addition Boofo :D
/me does the infamous lick of the install button ;)
Nice Job.. I'l be using this one as well! Thanks!
Boofo, can this hack be used to block replies to a post? I want to have cetain user groups see the first question but not the answers. The user group that has paid for membership will be able to see the answers.
So I need to block text in the replies. I don't have any code to block just text. Will this work on 2.3.0?
This can be modified to work on vB2 fairly easily. As far as blocking text within a message, yes it will. To block part of the text in a message, as it it, no it won't. Again, it can be modified to do so fairly easily I think. Does that help answer your question? If not, pm me with exactly wat you want this to do and we will see about setting it up for you to do that. ;)
coldpride
02 Mar 2004, 02:13
this works good on vb rc4.. Useful hack for coder forums.
I have an update in the works. ;)
Bulent Tekcan
20 Apr 2004, 23:45
Not work in 3.0.1.....ANy suggestion ?
I'm not running 3.01 yet. What code is different?
Bulent Tekcan
21 Apr 2004, 11:10
I don't know.But when I post any code,unregistered members still see...
Then you must have missed a step somewhere.
Bulent Tekcan
21 Apr 2004, 12:49
I think only templates is different.
This is original temp.....
bbcode_code
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
bbcode_html
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
bbcode_php
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Bulent Tekcan
22 Apr 2004, 09:27
Any suggestion ?
All you need to do is add the code I have in the hack around this part of the template:
$code
Beermonster
22 Apr 2004, 10:28
Can this be changed so that only above a certain user group can see it, not just unregistered.
on my forum once you have registered you still have to make at least 10 posts before becoming a full member with all it's privileges. as I was fed up of people registering to PM a member with a reply :(
/me clicks install :)
Can this be changed so that only above a certain user group can see it, not just unregistered.
on my forum once you have registered you still have to make at least 10 posts before becoming a full member with all it's privileges. as I was fed up of people registering to PM a member with a reply :(
* Beermonster clicks install :)
Sure. Just change this in the templates for this hack:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
to whatever you want it to be. You could do this:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
and so on. ;)
Beermonster
22 Apr 2004, 11:29
Thanks :)
Bulent Tekcan
22 Apr 2004, 16:07
Still not working my board,anyone test in 3.0.1 ?
Realy great hack but I cannot use :(
I can't believe it has changed that much where it won't work in 3.0.1. Carefully go through the hack again and make sure you didn't miss anything. Then, let me know and we will see what needs to be done to get it working for you.
Mr. HillBilly
23 Apr 2004, 00:47
Boofo, I think people are having problems with 3.0.1 because the hacks templates are out of date.
I added the lines needed into the default vB 3.0.1 BBcode templates so it will work with the latest versions. I have tested this on an vB 3.0.1 board.
bbcode_code:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
bbcode_html:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
bbcode_php:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
bbcode_quote:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
I suggest people use this code on their 3.0.1 boards.
Also, could you provide a way to make it so guests can't see the code in the threads archive?
Bulent Tekcan
23 Apr 2004, 19:33
Did you different change in functions_bbcodeparse.php ? Because my board still not work.
Mr. HillBilly
23 Apr 2004, 20:32
Did you different change in functions_bbcodeparse.php ? Because my board still not work.
Nope. Make sure you got ever line because the instructions can be confusing since they look the same.
Boofo, I think people are having problems with 3.0.1 because the hacks templates are out of date.
I added the lines needed into the default vB 3.0.1 BBcode templates so it will work with the latest versions. I have tested this on an vB 3.0.1 board.
I suggest people use this code on their 3.0.1 boards.
Also, could you provide a way to make it so guests can't see the code in the threads archive?
Can you attach a txt file of the exact code for those templates in a default 3.0.1 installation? I have an update to do for this and I have other code that needs to be added to them as well (Click in box to copy to clipboard, etc.). Also, was the code to find in the php files different?
How can i use it with the url-tag? I would like to make Links hidden to guests.
Mr. HillBilly
23 Apr 2004, 22:37
Can you attach a txt file of the exact code for those templates in a default 3.0.1 installation? I have an update to do for this and I have other code that needs to be added to them as well (Click in box to copy to clipboard, etc.). Also, was the code to find in the php files different?
PHP files had no different code.
Heres the .txt you requested
Liquid1ce
23 Apr 2004, 22:39
what about bbcode for links?
IE: [url] tags?
Mr. HillBilly
23 Apr 2004, 22:46
what about bbcode for links?
IE: [url] tags?
Let me see if I can do this
Liquid1ce
23 Apr 2004, 22:54
This would hide the links to unreg'd?
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
This would hide the links to unreg'd?
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
As long as the links are inside the php, code or html tags, they would be hidden with this hack.
Liquid1ce
23 Apr 2004, 23:06
ok thnx man
PHP files had no different code.
Heres the .txt you requested
Thank you, sir. I will get this updated and add the new additons and release it in a few days. ;)
You're on my site, aren't you?
Mr. HillBilly
24 Apr 2004, 00:24
Thank you, sir. I will get this updated and add the new additons and release it in a few days. ;)
You're on my site, aren't you?
Not that I know of :eek:
But I'll join
Logikos
03 May 2004, 04:00
Hey Boofoo just so you know, this hack does no good as the code in the archive is still viewable :( Could you maybe fix this. I tried and coudn't figure it out. I have disabled my Archive for this. BTW im using vB 3.0.0
Logikos
04 May 2004, 11:55
Any idea when this could be fixed? Or anyone eles know how to fix this problem?
Just be patient young man. Relax. I am working on it now. ;)
Logikos
05 May 2004, 03:15
Just wanted to make sure you saw the post :) Thanks bud
Bulent Tekcan
11 May 2004, 18:05
Realy interesting because my forum is 3.0.1 but every code still visible,see in http://www.turkeyforum.com/satforum/showthread.php?t=10112 very interesting.
Any idea ?
Realy interesting because my forum is 3.0.1 but every code still visible,see in http://www.turkeyforum.com/satforum/showthread.php?t=10112 very interesting.
Any idea ?
You must have missed something somewhere. Make sure you do ALL of the edits for the functions_bbcodeparse.php.
Did you download the latest version of this hack? I don't see the double-click line in it on your site.
Logikos
12 May 2004, 04:19
Worked perfect for me :) vb 3.0.0 THANKS!!!!!
Worked perfect for me :) vb 3.0.0 THANKS!!!!!
You're very welcome, sir. ;)
Maybe it's me but when I install this hack I get a javascript error when the page loads and the double-click doesn't work... :(
Can someone please help?
cLord
(vBulletin version: 3.0.1)
Maybe it's me but when I install this hack I get a javascript error when the page loads and the double-click doesn't work... :(
Can someone please help?
cLord
(vBulletin version: 3.0.1)
What browser are you using?
IE 6.0.2800.1106 XPSP1...
cLord ;)
You either have another hack installed conflicting with this or you missed some code somewhere when installing this hack. Those are the only things I can see that would be causing the problem you are having. Go through the hack instructions very carefully again and let me know if that fixes it. ;)
Logikos
14 May 2004, 07:07
Hey Boofo, could you maybe show me how to block it from a usergroup id also? I tried conditions but didn't work. I want to make sure people check there email before they can see the inside the tags. Thanks!
Hey Boofo, could you maybe show me how to block it from a usergroup id also? I tried conditions but didn't work. I want to make sure people check there email before they can see the inside the tags. Thanks!
That's not a bad idea. I forgot all about people who don't verify. I'll get something together and get it to you.
Logikos
14 May 2004, 18:36
Sweet man, thanks a bunch
Bulent Tekcan
15 May 2004, 20:53
Hello
EDIT: Boofo has removed the attachment as vBulletin files are not to be posted here.
This is my file,is it correct.....
Charlie Argueta
26 May 2004, 12:29
Hi Boofo
I have a question, if I also want to block the Spoiler Code, how do I do it with this Hack or I have to do something else?
See Ya
SaN-DeeP
14 Jun 2004, 23:21
this hack is not working for me.
i am using vb 3.0
I just want to disable the php code tag and rest leave enabled.
i have just modified the bbcode_php template and left the rest as it is.
its not working for me.
where can be the prob ??
this is the test thread.
http://207.58.143.178/forums/showthread.php?p=32928#post32928
and also the doubleclick php box to copy to clipboard not working.
would prefer to remove that.
is there any way to change this hack and enable it for displaying contents in this code tags for users with 20+ posts only.
Thnx.
Sandy...
SaN-DeeP
18 Jun 2004, 00:24
this hack is not working for me.
i am using vb 3.0
I just want to disable the php code tag and rest leave enabled.
i have just modified the bbcode_php template and left the rest as it is.
its not working for me.
where can be the prob ??
this is the test thread.
http://207.58.143.178/forums/showthread.php?p=32928#post32928
and also the doubleclick php box to copy to clipboard not working.
would prefer to remove that.
is there any way to change this hack and enable it for displaying contents in this code tags for users with 20+ posts only.
Thnx.
Sandy...
bump
need some help
thnx.
It looks to me like you forgot to edit the includes/functions_bbcodeparse.php. Post the bbcode_php template here and let me see it. We'll get you going. ;)
sabret00the
27 Jun 2004, 15:21
are the templates upto date yet?
are the templates upto date yet?
Yessir. ;)
sabret00the
28 Jun 2004, 14:22
nice one, i was worried as i removed the javascript from the boxes then thought, darn these might be the old templates lol
SaN-DeeP
28 Jun 2004, 15:53
It looks to me like you forgot to edit the includes/functions_bbcodeparse.php. Post the bbcode_php template here and let me see it. We'll get you going. ;)
hello boofo :)
thnx for ur time this is the template
i am using vb 3.0 and want to hide the code only for only for PHP tag.
can u possibly also tell me, to make this work only for users who have more then 25 posts.
only users above 25 posts should be able to read the content under hidden tags
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
thnx.
Sandy...
sabret00the
29 Jun 2004, 23:49
want to be using the vb3 tabless code instead?
bbcode_code
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
bbcode_html
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
bbcode_php
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Bulent Tekcan
01 Sep 2004, 15:18
HTML code still viewing.....How can I hide it ?
Ruffneck
16 Jan 2005, 14:56
Can i use this hack also only for the code: [URL] ?
Ruffneck
16 Jan 2005, 15:52
Other question can i use this hack only on the forum id: 36 ?
ogetbilo
16 Jan 2005, 19:54
Is this working on 3.0.5 ?
Is this working on 3.0.5 ?
For some reson this mod dose not work with me i use 3.0.6 and ihave many mod and hack installing in my board..
i try this one and it dont work .. the php and html and code.. is stillshowing .. any idea why this ..
i know that u are going to ask me .. i do not modify the php code.. in the bbcode.. but this code i have use it in 3.0..5 and it was work then after upgtade to the new v.. of vb 3.0.6 and i installing alot of mod hack then i try to install this one .. and it dont work with me .. everything is howing.
i have installing
ushop
Warn system
/you bbcode
and there is many other as well so i dont no if this is the reson or not..
thankyou
For some reson this mod dose not work with me i use 3.0.6 and ihave many mod and hack installing in my board..
i try this one and it dont work .. the php and html and code.. is stillshowing .. any idea why this ..
i know that u are going to ask me .. i do not modify the php code.. in the bbcode.. but this code i have use it in 3.0..5 and it was work then after upgtade to the new v.. of vb 3.0.6 and i installing alot of mod hack then i try to install this one .. and it dont work with me .. everything is howing.
i have installing
ushop
Warn system
/you bbcode
and there is many other as well so i dont no if this is the reson or not..
thankyou
Something is really wrong i have install this hack in the localhost.. and it work great.
when i upload the file .. it dont work .. i can view all the code php or html etc..
and know i dont no what wrong .. even i'am login . wiht my username. and it tel me unregisiter user can't view this .. anyidea about this erro r?
thankyou
how can i get it to work in 3.0.7???
T3MEDIA
18 Apr 2005, 13:28
I find sometimes the code gets blocked even if your logged in. SOME TIMES not all the time.
King Kovifor
21 Jul 2005, 02:50
I got this error:
Parse error: parse error, unexpected T_STRING in /home/mytho4/public_html/vbrenegades/includes/functions_bbcodeparse.php on line 55
Line 55 is this:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Unless I counted Wrong.
EDIT: About to do a revert so that the board is viewable and I'll redo the hack tomorrow.
Crazy Serb
02 Oct 2005, 02:12
is there a new version of this for vbulletin 3.5?!! pleasssseeee!!!
Psionic Vision
13 Nov 2005, 00:28
Are you going to port this hack to 3.5.x? Thanks
3.5 version would be nice.
DS MrSinister
07 Jan 2006, 05:15
anyword on porting this hack?
sabret00the
11 Dec 2006, 12:21
did this ever make it to vB3.5/vB3.6?
taheri6
05 Apr 2007, 07:30
I too would love to see this for 3.6.x
Ive been looking for this for a while now :)
The Notorious
05 Feb 2008, 05:34
Yup, would be nice to have this for 3.6...
I will see what I can do about updating this.
compact123
21 Feb 2009, 20:19
Seems to work fine
vBulletin® v3.6.12, Copyright ©2000-2012, Jelsoft Enterprises Ltd.