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
  #107  
Old 06-02-2004, 01:15 PM
supernet supernet is offline
 
Join Date: Sep 2003
Location: Greece
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ooops! I fill silly! :speechless:

Loged in, and its ok. Thanks Gary
Reply With Quote
  #108  
Old 06-02-2004, 01:50 PM
magmaink magmaink is offline
 
Join Date: Feb 2004
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

is there a way to restrict access to non-vb pages???? Meaning users have to log in to browse certain pages of the site?
Reply With Quote
  #109  
Old 06-03-2004, 12:05 PM
Gary King's Avatar
Gary King Gary King is offline
 
Join Date: Jan 2002
Posts: 2,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by magmaink
is there a way to restrict access to non-vb pages???? Meaning users have to log in to browse certain pages of the site?
Use this at the top of your files, changing the forum/ to match your site:
PHP Code:
<?php

// require the vBulletin sessions
chdir('forum/');
require_once(
'global.php');

// check if user is a guest
if (!$bbuserinfo['userid'])
{
    
// tell them they have to register first
    
print_no_permission();
}

?>
Reply With Quote
  #110  
Old 06-12-2004, 04:49 AM
Wolffman Wolffman is offline
 
Join Date: Apr 2004
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

For the showthread.php edit, instead of the normal text, my file says:

PHP Code:
globalize($_REQUEST, array(
    
'perpage' => INT,
    
'pagenumber' => INT,
    
'highlight' => STR,
    
'goto'
)); 
I put the added text under that ^, and it didn't work.

Any help is appreciated. Thanks.
Reply With Quote
  #111  
Old 06-13-2004, 11:23 AM
Streetjob Streetjob is offline
 
Join Date: Jan 2004
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi all!

This seems to still block the MSN spider. I want him to be able to browse my site with his friends. How can I do this?

Thank you
Reply With Quote
  #112  
Old 06-14-2004, 04:42 AM
Wolffman Wolffman is offline
 
Join Date: Apr 2004
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nevermind. It works perfect now that I figured it out.
Reply With Quote
  #113  
Old 06-15-2004, 11:28 AM
Onkel_Tom's Avatar
Onkel_Tom Onkel_Tom is offline
 
Join Date: Mar 2002
Location: Stuttgart- Germany
Posts: 208
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi,
makes it sense to expand the spider and bot line to other names like
Code:
if ($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']))
???
Reply With Quote
  #114  
Old 06-15-2004, 12:48 PM
Onkel_Tom's Avatar
Onkel_Tom Onkel_Tom is offline
 
Join Date: Mar 2002
Location: Stuttgart- Germany
Posts: 208
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you are using vbindex just change the following to prevent showing the preview on mouse over threadtitle of lastest threads for unregistered people.

find in Template vbindex_latestthreadbit :
PHP Code:
<a href="$vboptions[bburl]/showthread$ext?$session[sessionurl]threadid=$thread[threadid]title="$thread[preview]"
and replace it with:
PHP Code:
<a href="$vboptions[bburl]/showthread$ext?$session[sessionurl]threadid=$thread[threadid]<if condition="$show['member']">title="$thread[preview]"</if>> 
Reply With Quote
  #115  
Old 06-16-2004, 01:53 PM
Raitsa's Avatar
Raitsa Raitsa is offline
 
Join Date: Mar 2004
Location: Finland
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am feeling really stupid cos i cant get this hack to work: my postcount remains at 0 at all forums. I am using another (finnish) language at my site here , but that cant be causing it, can it?

Any ideas?

Using VB 3.01
Reply With Quote
  #116  
Old 06-16-2004, 03:58 PM
RonH.'s Avatar
RonH. RonH. is offline
 
Join Date: May 2004
Location: Splendora, TX
Posts: 70
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice hack! I hope this has the intended effect that I desire to have happen, to decrease lurking as unregistered and convert (at least spme of) them to registered users on my small board. Thanks.
Reply With Quote
  #117  
Old 06-18-2004, 12:19 AM
Streetjob Streetjob is offline
 
Join Date: Jan 2004
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

BUMP. So where are the smart hackers? I still have not received an answer to my question. How do I make sure MSN has access to my archives as well? And if you want to throw in Jeeves or any other good ones please go ahead!

Thanks!
Reply With Quote
  #118  
Old 06-18-2004, 09:15 AM
Onkel_Tom's Avatar
Onkel_Tom Onkel_Tom is offline
 
Join Date: Mar 2002
Location: Stuttgart- Germany
Posts: 208
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Streetjob,
I use the hack with the line I wrote few postings before
Code:
if ($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']))
now since 3 days and the site was visited from several spiders and bots right now. Just have a look at the attached .jpg to see that MSN has access to the Archive and also to the forum.
Reply With Quote
  #119  
Old 06-18-2004, 10:00 AM
Onkel_Tom's Avatar
Onkel_Tom Onkel_Tom is offline
 
Join Date: Mar 2002
Location: Stuttgart- Germany
Posts: 208
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Another question to all,
Is it possible to show unregistered guest a message which show that they have to register to read threads when they are in the archive ?
At the moment the archive shows a blank screen for the guest.

any idea to fix this ?
Reply With Quote
  #120  
Old 06-18-2004, 10:33 AM
Onkel_Tom's Avatar
Onkel_Tom Onkel_Tom is offline
 
Join Date: Mar 2002
Location: Stuttgart- Germany
Posts: 208
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay, i fixed it with this change.

find in /archive/index.php:
PHP Code:

     
print_no_permission(); 

replace it with:
PHP Code:

      echo 
"<center><font face=verdana, arial, helvetica size=3>You are not allowed to view posts in $vboptions[bbtitle] until you will <a href=\"$vboptions[bburl]/register.php?\">register</a> as member.</font></center>\n<hr />\n";
     
    
print_no_permission(); 

Reply With Quote
  #121  
Old 06-18-2004, 12:32 PM
Streetjob Streetjob is offline
 
Join Date: Jan 2004
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Onkel_Tom
Hi Streetjob,
I use the hack with the line I wrote few postings before
Code:
if ($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']))
now since 3 days and the site was visited from several spiders and bots right now. Just have a look at the attached .jpg to see that MSN has access to the Archive and also to the forum.
Wow! Thanks Tom! I did see your previous post but it didn't seem like you were 100% sure. And since these are hacks I don't want to run the risk of doing something bad to my site. Anyway, thanks again and i'll give this a try!
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:39 AM.


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.06187 seconds
  • Memory Usage 2,392KB
  • 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
  • (3)bbcode_code
  • (12)bbcode_php
  • (2)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