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
  #142  
Old 09-16-2004, 09:07 PM
DoKoK DoKoK is offline
 
Join Date: Sep 2004
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

great job,

Install
Reply With Quote
  #143  
Old 09-17-2004, 01:43 AM
DoKoK DoKoK is offline
 
Join Date: Sep 2004
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I read a few pages of this topic and I don't see my question answered.

It might be in the other pages but anyway here it is:

Is there a way to let my guests see the News forum topics and not be able to open the others?
Reply With Quote
  #144  
Old 09-17-2004, 03:31 AM
PAINTBALLM's Avatar
PAINTBALLM PAINTBALLM is offline
 
Join Date: Oct 2003
Location: Orlando, FL
Posts: 126
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

installed
Reply With Quote
  #145  
Old 11-12-2004, 02:32 PM
nonet nonet is offline
 
Join Date: Jul 2004
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've been playing around with this hack and MAY have come up with a forumula to allow spiders to still view threads while denying permission to guest. I am not a coder by trade so please check this code out and see if it works for you. I've been running it about 3-4 hours and it seems spider friendly on my site.

There are three files to change and one file to upload.

archive/index.php
includes/functions.php
showthread.php

Upload this file and place in your forum root directory and the archive directory.
spiders.txt



Open archive/index.php and find:
Code:
$title .= ' - ' . $foruminfo['title'];
}
else
{
$do = 'index';
}
Below, add:
Code:
if (restrict_guest($bbuserinfo['userid']))
{
print_no_permission();
}
Open showthread.php and find:
Code:
globalize($_REQUEST, array('perpage' => INT, 'pagenumber', 'highlight'
=> STR, 'goto'));
Below, add:
Code:
if (restrict_guest($bbuserinfo['userid']))
{
print_no_permission();
}
In the same file find the lines:
Code:
if ($bbuserinfo['userid'] == 0 or $bbuserinfo['usergroupid'] == 3)
{
print_no_permission();
}
And replace them with:
Code:
if ($bbuserinfo['userid'] == 0 or $bbuserinfo['usergroupid'] == 3 and
!$spider_flag) 

{

print_no_permission();

}
In the same file find the lines:
Code:
if (!($forumperms & CANVIEWOTHERS) AND ($thread['postuserid'] !=
$bbuserinfo['userid'] OR $bbuserinfo['userid'] == 0)) {
print_no_permission();
}
And replace them with:
Code:
if (!($forumperms & CANVIEWOTHERS) AND ($thread['postuserid'] !=
$bbuserinfo['userid'] OR ($bbuserinfo['userid'] == 0 AND
!$spider_flag))) {
print_no_permission();
}
Open functions.php and at the end before
Code:
?>
Add:
Code:
function restrict_guest($user_id)
{

global $_SERVER, $spider_flag;

$user_agent = strtolower($_SERVER['HTTP_USER_AGENT']);

$spider_flag = false;

if ($user_agent != "")

{

$spiders = file('./spiders.txt');

for ($i=0, $n=sizeof($spiders); $i<$n; $i++)

{

if (!empty($spiders[$i]))

{

if (is_integer(strpos($user_agent,

trim($spiders[$i]))))

                                {

                                      $spider_flag = true;

                                       break;

                               }

                       }

               }

       }



       if ($user_id == 0 AND !$spider_flag)

       {

                return true;

        }

       return false;

}
DONE!
Reply With Quote
  #146  
Old 11-30-2004, 12:38 PM
dorkus dorkus is offline
 
Join Date: Nov 2004
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Gary.
Reply With Quote
  #147  
Old 12-13-2004, 07:40 AM
cschuck3 cschuck3 is offline
 
Join Date: Sep 2004
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yea I needed this, I was waiting for this!!
Reply With Quote
  #148  
Old 12-14-2004, 09:27 AM
Neutral Singh's Avatar
Neutral Singh Neutral Singh is offline
 
Join Date: Sep 2004
Location: Sikh Philosophy Network
Posts: 545
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by cschuck3
Yea I needed this, I was waiting for this!!
Hi

I have installed this hack with gr8 results... my only problem is that i have a links partner section on the main forum itself... now what is happening is that when these link partners try to periodically locate their links in the forum they get the access denied message and they remove my links from their website.

Just as we did with archive section... Can we also exclude a selected forum from being affected by this hack. i mean that single particular forum should available as usual to anyone and everyone without any restriction.

Please guide me otherwise i am left with no option but to compromise on this hack.

Regards
Reply With Quote
  #149  
Old 12-19-2004, 01:15 AM
Sleepyk Sleepyk is offline
 
Join Date: Dec 2004
Location: CT
Posts: 234
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

before i install this, does it work with vb 3.0.3?
Reply With Quote
  #150  
Old 12-19-2004, 05:21 AM
bamaster bamaster is offline
 
Join Date: Dec 2004
Posts: 51
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Sleepyk
before i install this, does it work with vb 3.0.3?

Works on mine!

See here, for a protected forum:
http://www.allbowling.com/forum/forumdisplay.php?f=11
Reply With Quote
  #151  
Old 12-19-2004, 05:59 AM
Oreamnos's Avatar
Oreamnos Oreamnos is offline
 
Join Date: Dec 2004
Posts: 130
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by bamaster
Works on mine!

See here, for a protected forum:
http://www.allbowling.com/forum/forumdisplay.php?f=11
BTW, who has access to this forum on your site? all registered users? special usergroups? admins?

I am just about to install this and just wanted to check what you were doing.
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 11:23 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04763 seconds
  • Memory Usage 2,329KB
  • Queries Executed 25 (?)
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
  • (10)bbcode_code
  • (6)bbcode_php
  • (3)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
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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