View Full Version : Restrict Guest Viewing Threads in a Forum
Scott MacVicar
11-03-2001, 10:00 PM
I'm actually suprised that you can't stop guests from viewing threads themselves in forum and the only solution is to stop them Viewing others and that includes the thread titles on forumdisplay.
This lets guests see threads made by someone else on the forumdisplay page but not the thread itself, they'll get a nice error telling them to register.
Can be enabled on a forum by forum basis within the forum options.
I use this for a member forum on my board and I would rather show a guest what the thread title is, instead of showing no title at all :)
amykhar
11-05-2001, 02:26 AM
Firefly wrote one up that is a bit simpler. He posted it in the requests forum.
Amy
bokhalifa
11-05-2001, 04:06 AM
good hack :)
Scott MacVicar
11-05-2001, 06:07 AM
yeah i noticed but you need to edit the file to add more forums and i don't play to give out the ftp password to every admin :D
Lesane
11-05-2001, 07:02 PM
Does this hack works in 2.0.3?
Scott MacVicar
11-05-2001, 08:29 PM
yes should do
Lesane
11-06-2001, 11:50 AM
I love this hack :), thanks for this great neat hack
supernut
11-06-2001, 01:20 PM
when i go to change a forum to not allow guest view and save it, when i look back in admin its still turned on and all the posts they can still read ?
any advise what i may have done wrong ?
Lesane
11-06-2001, 02:02 PM
Originally posted by supernut
when i go to change a forum to not allow guest view and save it, when i look back in admin its still turned on and all the posts they can still read ?
any advise what i may have done wrong ?
Not 100% sure but i guess this in the /admin/forum.php file:
a couple of lines below that look for
$DB_site->query("INSERT INTO forum
(forumid,styleid,title,description,active,displayo rder,parentid,
parentlist,allowposting,cancontainthreads,daysprun e,newpostemail,newthreademail,
moderatenew,allowhtml,allowbbcode,allowimages,allo wsmilies,allowicons,
styleoverride,allowratings,countposts,moderateatta ch)
VALUES
(NULL,'$styleset','".addslashes($title)."','".addslashes($description)."','$isactive','$displayorder','$parentid',
'','$allowposting','$cancontainthreads','$daysprun e','".addslashes($newpostemail)."','".addslashes($newthreademail)."',
'$moderatenew','$aallowhtmlcode','$aallowbbcode',' $aallowimgcode','$aallowsmilies','$aallowicons',
'$styleoverride','$allowratings','$countposts','$m oderateattach')");
change to
$DB_site->query("INSERT INTO forum
(forumid,styleid,title,description,active,displayo rder,parentid,
parentlist,allowposting,cancontainthreads,daysprun e,newpostemail,newthreademail,
moderatenew,allowhtml,allowbbcode,allowimages,allo wsmilies,allowicons,
styleoverride,allowratings,countposts,moderateatta ch,allowguestpostview)
VALUES
(NULL,'$styleset','".addslashes($title)."','".addslashes($description)."','$isactive','$displayorder','$parentid',
'','$allowposting','$cancontainthreads','$daysprun e','".addslashes($newpostemail)."','".addslashes($newthreademail)."',
'$moderatenew','$aallowhtmlcode','$aallowbbcode',' $aallowimgcode','$aallowsmilies','$aallowicons',
'$styleoverride','$allowratings','$countposts','$m oderateattach', '$allowguestpostview')");
supernut
11-06-2001, 03:38 PM
re-installed and its still not working, i just cannot change the option in admin to stop guests viewing the posts
Lesane
11-06-2001, 04:15 PM
Are you sure that you executed the SQL Query?
supernut
11-06-2001, 04:32 PM
yes, that is all done, i have had it checked and its 100%
i found that problem
moderateattach='$moderateattach'
i did not put the correct part after and added the same thing 2 time, so now its saving ok, but guests can still read the posts ?
supernut
11-06-2001, 04:49 PM
got it working... thanks for the help
am I doing this right? I got this hack worked, but everytime I change the forum description, it creates a duplicate forum, force me to mass move topic from the old one to the new one just for description change. Is that suppose to happen if you use this hack?
SgtSling
11-12-2001, 05:30 AM
I got it working
Will this drain my server at all?
Scott MacVicar
11-12-2001, 06:18 AM
Nam i belive you have an INSERT query where it should be an update query make sure you followed the instructions correctly.
I did what the instruction says:
ALTER TABLE `forum` ADD `allowguestpostview` SMALLINT(6) DEFAULT '1' NOT NULL
May be I did something wrong, I'm very dumb in PHP stuff, only know "copy and paste" command when install hacks. So please tell me how to change (remove) that query out using PHPMyAdmin?
Everytime when I change the forum description, it automatically create a duplicated one, I had to do mass topic moving alot, it's really tired. Please help, thanks a lot.
And btw, I love this hack, it's a great hack for a new forum, the traffic and member joining are increasing fast. Thanks.
Scott MacVicar
11-14-2001, 06:31 AM
make sure on line 1498 of /admin/forum.php looks like
$DB_site->query("UPDATE forum SET replycount='$numberposts',threadcount='$numberthre ads',lastpost='$lastpost',lastposter='".addslashes(htmlspecialchars($lastposter))."',lasttitle='".addslashes(htmlspecialchars($lasttitle))."' WHERE forumid='$forumid'");
I'm sure at this point you have an INSERT query where it should be the update one above.
Sorry, my file has only 550 lines, were you talking about double lines? I did try to search it carefully but couldn't find the line you told me.
Here is my admin/forum.php file, please check it for me too see if anything wrong, there was nothing like what you've told me. Thanks a lot.
Scott MacVicar
11-14-2001, 03:04 PM
ok em sorted you had added the insert query into the doupdate part of the file.
Just reload this to the admin directory.
Scott
You're great PPN, thank you so so much.
I compared 2 files and saw that you've changed much of it, without you changing it, no way I could modify it myself.
Thanks again,
kanima
11-30-2001, 08:15 PM
here is what i get when trying ot make a new forum after adding hack, so what is wrong ???
Database error in vBulletin Control Panel 2.2.1:
Invalid SQL: INSERT INTO forum
(forumid,styleid,title,description,active,displayo rder,parentid,
parentlist,allowposting,cancontainthreads,daysprun e,newpostemail,newthreademail,
moderatenew,allowhtml,allowbbcode,allowimages,allo wsmilies,allowicons,
styleoverride,allowratings,countposts,moderateatta ch,allowguestpostview)
VALUES
(NULL,'1','Request to join-|TKP|-','All your joining request go here.','1','1','-1',
'','1','1','30','dstinson@troycable.net','',
'1','0','1','0','1','1',
'0','1','1','0','1')
mysql error: Unknown column 'allowguestpostview' in 'field list'
mysql error number: 1054
Date: Friday 30th of November 2001 04:31:00 PM
Script: http://www.ip-subspace.com/forum/forum/admin/forum.php
Referer: http://www.ip-subspace.com/forum/admin/forum.php?action=add
kanima
11-30-2001, 09:32 PM
NeverMind
Too used to Perl and all teh #### at top
that i don't read lol
Marc T Smith
12-01-2001, 06:54 PM
Originally posted by PPN
ok em sorted you had added the insert query into the doupdate part of the file.
Just reload this to the admin directory.
ScottSo - if I run the SQL query via phpmyadmin as prep:
ALTER TABLE `forum` ADD `allowguestpostview` SMALLINT(6) DEFAULT '1' NOT NULL
And then upload the file you posted for Nam (which is essentially forum.php already hacked), it will work.
Is this correct?
Scott MacVicar
12-02-2001, 08:59 AM
won't advise it, i'm sure that was for version 2.2.0 and the latest is 2.2.1, the hack isn't hard to install so it would be simplier for you just to copy and paste.
kanima
12-03-2001, 08:01 PM
Got the No view working, but it is not putting up the resigter page for guest to view ideas ?
frozt
03-25-2002, 06:54 PM
Great hack!
I have this hack installed and had no problems with it, see no errors etc.
But if I go to my Who's Online page I still see people browsing threads!
How is this possible?
Scott MacVicar
03-27-2002, 10:50 PM
This has been addressed on vBulletin.com, I can't remember specific details but if they try to view the thread, it puts the page their at still into the session table which will give you the opinion that their viewing the thread.
Though all their viewing is the no permission page.
Ok, than it must be all ok, because when I logged off and entered my site as guest I didn't see anything and thought maybe they have still some tricks to get in!
Wow, i'm happy now!
Thanks PPN for the fast reply.
Keep up the great work.
Okiewan
03-28-2002, 03:06 PM
Yet another great -useful- hack! Thanks for sharing it.
Got it installed without a hitch, nice work.
Question...
I have a couple levels of members. There are private forums for "level 2" members... I'd like to allow guests to see the forum/threads, and get the error template, but a different one.
Regular forums: "sorry you'll need to be a member, join here"
Level 2 forums:" sorry, you need to be a level 2 member, join here"
Would this be difficult? My "level 2 " members pay a subscription for access to additional forums, would entice regular members to subscribe if they see the threads but not be able to read them :)
Thanks again for the hack!
Okiewan
03-28-2002, 04:37 PM
One more Q.
Does this effect only "guests" or everyone that is not registered?
Meaning, can users awaiting email conf. read the threads?
Scott MacVicar
04-09-2002, 06:18 AM
Anyone that is not logged in will be unable to see the threads.
There is nothing within the code which requires you to adjust that line which is giving you the error sammy, did you apply any other hacks while doing this one?
sammy22
04-13-2002, 02:35 AM
ok, i changes the two php files, uploaded them, then i ran the query from my server control panel, and guests can still read threads? do i have to turn it off in the cpanel some where?
is there a radio botton i have to click? please help
thank you.
Scott MacVicar
04-13-2002, 09:56 AM
You'll find a new option if you go to modify forums and click edit you will have a new radio button to let you select if guests can view threads.
Twig Deez
04-13-2002, 12:26 PM
i'm unsure how i ever missed this; but now that i've seen it, installed it,
and noticed it's working perfectly, i would just like to say thanks.
thanks! :beard:
sammy22
04-13-2002, 11:14 PM
ok, i re installed, it, no errors, but the guests can still see the board...... i have tried to install this 30 times.
i am on ver 2.2.5
what gives?
Scott MacVicar
04-13-2002, 11:16 PM
this is designed to stop guests viewing a particular forum, not the board.
PM me your board url and i'll have a look at it.
sammy22
04-13-2002, 11:20 PM
so in the query do i need to add a board "number"
like my main board is #3 for example, i need to add 3 in the query is this whats going on?
u have PM, thanks
sammy22
04-13-2002, 11:27 PM
Originally posted by PPN
You'll find a new option if you go to modify forums and click edit you will have a new radio button to let you select if guests can view threads.
Allow guests to view posts?
[ ]Yes No
no is checked. yet they still see the forum... AHHH lol
Scott MacVicar
04-13-2002, 11:29 PM
Yeah the guests can view what is in the forums, but when they click the individual thread to read it they will get this error message.
sammy22
04-13-2002, 11:31 PM
but i logged out, and i can read them fine???
sammy22
04-14-2002, 03:38 AM
BTT. still cannot get this going
Had this been integrated into Vb yet?
sammy22
04-28-2002, 07:54 PM
still cannot get this going after several attemts. must not work on 2.2.5
Hmmm... really I might have to try this
trainer
09-20-2002, 02:03 PM
does anyone know if this works for 2.2.7?
350Chevy
12-01-2002, 06:14 AM
Originally posted by trainer
does anyone know if this works for 2.2.7?
Probably not. Doesn't work for 2.2.9...
All settings are there, dB query added, template added, and option changed in the CP to supposedly disable guest viewing. No errors, it just acts as if it doesn't work. Guests can click on them and view the contents without a problem. :disappointed:
pepitojones
12-02-2002, 08:03 PM
Works just fine on 2.2.9. You should double check all of the steps and make sure you pay close attention to this part of the install:
look for the following on line 208 (second occurence in file)
It won't work if you place it after the first one..
--
Also, the install file db query:
ALTER TABLE `forum` ADD `allowguestpostview` SMALLINT(6) DEFAULT '1' NOT NULL
sets all of the forums to allow viewing. If you wish to turn it off on ALL forums in one easy step, run this query on your vB db:
UPDATE `forum` SET `allowguestpostview` = 0
One other thing you might wish to do is set the default to be off in the db. This can be accomplished via this query:
ALTER TABLE `forum` CHANGE `allowguestpostview` `allowguestpostview` SMALLINT( 6 ) DEFAULT '0' NOT NULL
--
Hope that helps.
350Chevy
12-03-2002, 07:17 PM
ahhhhhhhhhh.. You are correct. Works fine with 2.2.9. I didn't see the little words "(second occurence in file)" LOL
Guess that's what I get for trying to add code when drinking. hehehe!
Nice hack!
Jethro
03-04-2003, 04:38 PM
Thanks ppn exactly what we need for our resource forums. Am going to try installing this immediately :)
king sting
03-11-2003, 01:30 AM
I installed it and its really useful.. but I am getting an error now when I try to add anymore forums.. I don't know what the problem is though.. the error is this..
--
Database error in vBulletin Control Panel 2.3.0:
Invalid SQL: INSERT INTO forum
(forumid,styleid,title,description,active,displayo rder,parentid,
parentlist,allowposting,cancontainthreads,daysprun e,newpostemail,newthreademail,
moderatenew,allowhtml,allowbbcode,allowimages,allo wsmilies,allowicons,
styleoverride,allowratings,countposts,moderateatta ch,allowguestpostview)
VALUES
(NULL,'1','Record Labels','','1','1','-1',
'','1','1','30','','',
'0','0','1','0','1','1',
'0','1','1','0', '1')
mysql error: Unknown column 'allowguestpostview' in 'field list'
mysql error number: 1054
Date: Monday 10th of March 2003 07:09:51 PM
Script: http://www.cali-stylez.net/vb/vb/admin/forum.php
Referer: http://www.cali-stylez.net/vb/admin/forum.php?action=add
---
any ideas???
king sting
03-11-2003, 04:18 AM
Ok i fixed that error.. i forgot to run the query.. now i did.. but now the whole hack doesn't seem to work.. i went over it again and had another admin go over it and we dont know what the problem is.. any help??
king sting
03-11-2003, 04:42 AM
ok i did it.. thanx
I got some error when trying to add forums. I know I ran this query though. (I installed this a while ago) but anyway, all I did was revery to the original file when adding forums, then go back after. lol! Not really a good fix, but it worked. Next time I try to add a forum I'll have to do it again. Dunno what I did. :ermm:
CRego3D
03-29-2003, 05:48 AM
What a wonderfull hack :) .. I got it runnign on 2.2.9 . anybody running it on 2.3 ?
Logikos
04-27-2003, 10:53 PM
Works Great on 2.3.0
NOTE:: You must find the (second occurence in file) in order for this to work, just dont forget it.
subu1
04-28-2003, 08:54 AM
please help, i have run the querie and i have put the Hack in the php's, but it doesn't work on my 2.2.8
can everybuddy look in my forum.php?? hihi
I would be pleased:-))) thxxxx
Any way to make it so the first X number of posts per thread are shown, and then the rest get the error message? That would be cool.
????? Thanks if anyone knows this. :)
subu1
05-25-2003, 06:03 AM
hey sajjid, big thxxx for your help, verry nice, but i am work with this for a long time ago :ermm:
Where is the option for the cp, again, :ermm: sorry i dont find this.
subi hihi
Boofo
05-25-2003, 07:19 AM
Yesterday at 04:06 PM sajjid said this in Post #61 (https://vborg.vbsupport.ru/showthread.php?postid=399528#post399528)
try now it should work
sajjid, you need to delete the file in post #61. Full vb files are not allowed to be uploaded here at vb.org.
Boofo
05-25-2003, 07:22 AM
04-28-03 at 04:54 AM subu1 said this in Post #58 (https://vborg.vbsupport.ru/showthread.php?postid=388329#post388329)
please help, i have run the querie and i have put the Hack in the php's, but it doesn't work on my 2.2.8
can everybuddy look in my forum.php?? hihi
I would be pleased:-))) thxxxx
subu1, you need to delete the file in post #58. Full vb files are not allowed to be uploaded here at vb.org.
subu1
05-25-2003, 07:41 AM
ok boofo , sorry:)
hashesh
07-19-2003, 08:08 AM
How you also restrict 'Users Awaiting Authentication' ?
hashesh
07-19-2003, 08:11 AM
How you also restrict 'Users Awaiting Authentication' ?
Dan Flynn
11-26-2003, 04:39 AM
Hello,
I installed this a long time ago and it works great. Can someone tell me how to disable it so unregistered guest can view threads again?
Is there a way to turn this off and on when I need too? Right now I can't remember how to disable it and I need to for a while.
Thanks
Dan Flynn
11-30-2003, 01:24 PM
Anyone know this????????????????????? PLEASE
Dan Flynn
02-08-2004, 04:49 AM
Come on please. I have a ton of spiders trying to scan my site, they have been coming for a good year now. But I have this hack in place and the search engine spiders can't get though.
I looked at the files that I altered to install this hack and I can't find the code> Please help. What If I get rid of the query I had to run. Will that help?????????????????????????????
Rickie3
06-16-2005, 11:41 AM
can anyone tell me if this hack is available for 3.0.3, my main forum page looks wierd to guests showing all 0 threads and 0 posts,i dont want guests to be able to view posts
Andreas
06-16-2005, 12:03 PM
<a href="https://vborg.vbsupport.ru/showthread.php?t=60178" target="_blank">https://vborg.vbsupport.ru/showthread.php?t=60178</a>
In vBulletin 3.5 it's a standard usergroup permission.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.