Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Disallow guests to view threads, must register first Details »»
Disallow guests to view threads, must register first
Version: 1.00, by Gary King Gary King is offline
Developer Last Online: Jun 2020 Show Printable Version Email this Page

Version: 3.0.0 Rating:
Released: 01-06-2004 Last Update: Never Installs: 89
 
No support by the author.

Yes I know that there is already a a feature to stop guests from viewing threads, but then this also shows all the posts and threads counters to zero, and under Last Post it will say never (which sucks ). But, with my hack, it just asks guests to either login or register when viewing a thread and still shows all the right numbers

Instructions

Open archive/index.php and find
PHP Code:
    $title .= ' - ' $foruminfo['title'];
}
else
{
    
$do 'index';

Below, add
PHP Code:
if ($bbuserinfo['userid'] == AND !preg_match("#(google|slurp@inktomi|yahoo! slurp)#si"$_SERVER['HTTP_USER_AGENT'])) 

    
print_no_permission(); 

Open showthread.php and find
PHP Code:
globalize($_REQUEST, array('perpage' => INT'pagenumber''highlight' => STR'goto')); 
Below, add:
PHP Code:
if ($bbuserinfo['userid'] == AND !preg_match("#(google|slurp@inktomi|yahoo! slurp)#si"$_SERVER['HTTP_USER_AGENT']))
{
    
print_no_permission();

Open template threadbit and find:
PHP Code:
<td class="alt1Active" id="t$thread[threadid]title="$thread[preview]"
Replace it with
PHP Code:
<td class="alt1Active" id="t$thread[threadid]<if condition="$show['member']">title="$thread[preview]"</if>> 
Done!

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #122  
Old 06-20-2004, 09:29 PM
Onkel_Tom's Avatar
Onkel_Tom Onkel_Tom is offline
 
Join Date: Mar 2002
Location: Stuttgart- Germany
Posts: 208
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There is still a problem if your vB is closed for guest and a user registers at the forum without click on the activation eMail, he can still read threads in the forum!

I found the solution for one usergroupID in the thread.
PHP Code:
if ($bbuserinfo['userid'] == or $bbuserinfo['usergroupid'] == 1
But for more usergroupID's it should look like:
PHP Code:
//if ($bbuserinfo['userid'] == 0 or $bbuserinfo['usergroupid'] == 1 or $bbuserinfo['usergroupid'] == 3 or $bbuserinfo['usergroupid'] == 4 or $bbuserinfo['usergroupid'] == 8 or $bbuserinfo['usergroupid'] == 11 AND !preg_match("#(google|slurp@inktomi|yahoo! slurp|lycos|ask jeeves|scooter|fast-webcrawler|turntinbot|msnbot|webcrawler|Infoseek|W3C_Val|googlebot)#si", $_SERVER['HTTP_USER_AGENT'])) 
Is there a solution to reduce the line with the usergroupid checks like or $bbuserinfo['usergroupid'] == in array[1, 3, 4, 8, 11] or something like that ?
Reply With Quote
  #123  
Old 06-23-2004, 01:36 AM
IIstix IIstix is offline
 
Join Date: Jun 2004
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there a link explaining how to how to do this via a template?

Quote:
Originally Posted by Zachery
could also be done via a template mod
in a slightly differnt way of course ;D
Reply With Quote
  #124  
Old 06-26-2004, 05:05 PM
maggie maggie is offline
 
Join Date: Jan 2004
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've gotten all turned around in this thread, I'm wondering if someone can help me please?
I have one forum that I don't want ANYONE to see in any way (through searches, archives, nothing) unless they have special permission (admin or access masking).
One forum that I want registered members to have access to, and guests at least be able to see that there ARE threads in there, just not be able to view the actual threads.
And one forum that I want guests to be able to participate in.
So basically, I want the "can't view at all" AND the "open" options... pain in the rear, aren't I?
Reply With Quote
  #125  
Old 06-30-2004, 09:51 AM
gorman gorman is offline
 
Join Date: Sep 2002
Posts: 41
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by IIstix
Is there a link explaining how to how to do this via a template?
Yes, I would be interested too...
Reply With Quote
  #126  
Old 07-01-2004, 06:40 AM
Raitsa's Avatar
Raitsa Raitsa is offline
 
Join Date: Mar 2004
Location: Finland
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Raitsa
I am feeling really stupid cos i cant get this hack to work: my postcount remains at 0 at all forums.
Stupid i was. Again.

Of course i did not change the permissions for unregistered guests, i assumed they should see the posts automatically after applying this hack.
But since i had not given them rights to view the forum topics, i could not get this to work at all.
But now that i changed the forum rights settings they are allowed to see the topics, i get the right number of posts for them as well.
(But they still cant read the threads, only view them, as it was meant too).
Reply With Quote
  #127  
Old 07-16-2004, 02:58 AM
WEForums WEForums is offline
 
Join Date: Apr 2003
Location: Jacksonville, Florida
Posts: 195
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice hack and all, but I just did it this way:

PHP Code:
<if condition="$bbuserinfo['userid']">
             
                            <
div>$post[message]</div>
                            <!-- / 
message -->
<else />
Your messageblah blah.</if> 
Reply With Quote
  #128  
Old 07-29-2004, 04:43 AM
Natch's Avatar
Natch Natch is offline
 
Join Date: Nov 2002
Location: Australia
Posts: 851
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there any way to tie in the $vboptions[spiderstrings] array into the spider-list - ???
Reply With Quote
  #129  
Old 07-29-2004, 05:26 AM
N00BIE N00BIE is offline
 
Join Date: Nov 2001
Posts: 45
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nice hack thanx =]
Reply With Quote
  #130  
Old 08-03-2004, 08:34 PM
gr3g0 gr3g0 is offline
 
Join Date: Jan 2004
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm using this to keep out some determined fools on my site. For the benefit of anyone else who may be doing this, make sure you follow similar instructions as described in post #1 of this thread and apply the change to the following files in the same place:
  • printthread.php
  • search.php (it's possible to "find all posts by this user" and read posts that way)
  • showpost.php (in case a direct url is "guessed" or otherwise)
ALSO - we have all new registrants moderated, however these hacks only considered unregistered users. This meant people could "apply" to join the board and thereby skip all of these measures (by virtue of moving from the "guest" usergroup to the COPPA or "wait for email confirmation" usergroup).

As a result, all pages that I changed had a longer line added to them to cover all the appropriate usergroups:

Code:
if (($bbuserinfo['userid'] == 0 or $bbuserinfo['usergroupid'] == 1 or $bbuserinfo['usergroupid'] == 3 or $bbuserinfo['usergroupid'] == 4) AND !preg_match("#(google|slurp@inktomi|yahoo! slurp)#si", $_SERVER['HTTP_USER_AGENT'])) 
{ 
    print_no_permission(); 
}
Don't forget to also amend the usergroup permissions for these usergroups so that they are the same as guests.

Of course, this all depends on your motives for keeping people out. Threads in our board are private so this was appropriate for us
Reply With Quote
  #131  
Old 08-14-2004, 12:04 PM
boiboi boiboi is offline
 
Join Date: Nov 2001
Location: san francisco, ca
Posts: 133
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nice hack can google still index archives?
Reply With Quote
  #132  
Old 08-16-2004, 09:55 AM
TheOmegaCircle TheOmegaCircle is offline
 
Join Date: Jun 2004
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone knows how get this work with 3.0.1?
(Showthread.php does not containt this code:
Code:
globalize($_REQUEST, array('perpage' => INT, 'pagenumber', 'highlight' => STR, 'goto'));
Pasting the new code below a similar place does not work...
Reply With Quote
  #133  
Old 09-01-2004, 08:51 AM
emtee emtee is offline
 
Join Date: Aug 2004
Posts: 95
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by IndyWebDesign
Well the above worked great to tell a guest they needed to login but when I'm logged in even as an admin I get the error:

you do not have permission to access this page. This could be due to one of several reasons:

Your user account may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.
Same here! After awhile banging my head to the walls trying to figure out why it also blocks other usergroups - not just the specified group which is guest/not logged in - to view threads. Too bad I had to uninstall this. I check the codes very carefully but it still refused to work! I'm using 3.0.3 and this hack doesn't let me (admin) and other usergroups view threads that are supposed to block only guests/not logged-in from viewing.

If anyone can find a fix, please post it!!! Thanks in advance. This is a very useful hack. I don't know why this feature is not default in vB3. Plain s2pid!!!!!!!!!
Reply With Quote
  #134  
Old 09-01-2004, 05:23 PM
boiboi boiboi is offline
 
Join Date: Nov 2001
Location: san francisco, ca
Posts: 133
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Google for some reason has stop indexing my site after I blocked the archives from being viewed by non members. The purpose of the archive is has nothing to do with archiving but instead it's work around to make vb3 search-engine-friendly. So the solution would be to uninstall the hack from archive and remove the archive link in the footer?
Reply With Quote
  #135  
Old 09-01-2004, 07:14 PM
Onkel_Tom's Avatar
Onkel_Tom Onkel_Tom is offline
 
Join Date: Mar 2002
Location: Stuttgart- Germany
Posts: 208
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by boiboi
Google for some reason has stop indexing my site after I blocked the archives from being viewed by non members. The purpose of the archive is has nothing to do with archiving but instead it's work around to make vb3 search-engine-friendly. So the solution would be to uninstall the hack from archive and remove the archive link in the footer?
You can also replace your line in index.php of /archive directory to let Google and other important search engines in your archive but not unregistered persons

Code:
$grouparray = array ( 3,4); 
if (in_array($bbuserinfo['usergroupid'],$grouparray) OR $bbuserinfo['userid'] == 0 AND !preg_match("#(google|slurp@inktomi|yahoo! slurp|lycos|ask jeeves|scooter|fast-webcrawler|turntinbot|msnbot|webcrawler|Infoseek|W3C_Val|googlebot)#si", $_SERVER['HTTP_USER_AGENT']))
{ 
	  echo "<center><font face=verdana, arial, helvetica size=3>You are not allowed to show our archive.<br><br>Your have to <a href=\"$vboptions[bburl]/register.php?\">register</a> first at $vboptions[bbtitle] to show threads in our forums.<br><br>If you are registered at our forum it could be that you are not logged in our your account must first be checked and enabled from an Administrator.</font></center>\n<hr />\n";
	 
    print_no_permission(); 
}
just replace the usergroups in $grouparray you want to disallow to have access to your archive.

For my Board Google is idexing all threads in archive and it works great
Reply With Quote
  #136  
Old 09-02-2004, 04:08 PM
DarknessDivine DarknessDivine is offline
 
Join Date: May 2004
Posts: 65
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Onkel_Tom
You can also replace your line in index.php of /archive directory to let Google and other important search engines in your archive but not unregistered persons

Code:
$grouparray = array ( 3,4,8,11); 
if (in_array($bbuserinfo['usergroupid'],$grouparray) OR $bbuserinfo['userid'] == 0 AND !preg_match("#(google|slurp@inktomi|yahoo! slurp|lycos|ask jeeves|scooter|fast-webcrawler|turntinbot|msnbot|webcrawler|Infoseek|W3C_Val|googlebot)#si", $_SERVER['HTTP_USER_AGENT']))
{ 
	  echo "<center><font face=verdana, arial, helvetica size=3>You are not allowed to show our archive.<br><br>Your have to <a href=\"$vboptions[bburl]/register.php?\">register</a> first at $vboptions[bbtitle] to show threads in our forums.<br><br>If you are registered at our forum it could be that you are not logged in our your account must first be checked and enabled from an Administrator.</font></center>\n<hr />\n";
	 
    print_no_permission(); 
}
just replace the usergroups in $grouparray you want to disallow to have access to your archive.

For my Board Google is idexing all threads in archive and it works great
Will this also work with 3.0.1???
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:38 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06021 seconds
  • Memory Usage 2,397KB
  • Queries Executed 30 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_code
  • (9)bbcode_php
  • (6)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (16)post_thanks_box
  • (16)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (16)post_thanks_postbit_info
  • (15)postbit
  • (16)postbit_onlinestatus
  • (16)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete