vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Disallow guests to view threads, must register first (https://vborg.vbsupport.ru/showthread.php?t=59859)

DoKoK 09-16-2004 09:07 PM

great job,

Install

DoKoK 09-17-2004 01:43 AM

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?

PAINTBALLM 09-17-2004 03:31 AM

installed

nonet 11-12-2004 02:32 PM

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!

dorkus 11-30-2004 12:38 PM

Thanks Gary.

cschuck3 12-13-2004 07:40 AM

Yea I needed this, I was waiting for this!!

Neutral Singh 12-14-2004 09:27 AM

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

Sleepyk 12-19-2004 01:15 AM

before i install this, does it work with vb 3.0.3?

bamaster 12-19-2004 05:21 AM

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

Oreamnos 12-19-2004 05:59 AM

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.


All times are GMT. The time now is 12:24 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.01286 seconds
  • Memory Usage 1,749KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (10)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete