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)

Rambo 03-12-2005 11:07 PM

Installed on VB 3.0.7 and works a charm ;)

Good job.

CavGsi.co.uk 03-30-2005 12:05 AM

When i open the showthread.php i cant find

globalize($_REQUEST, array('perpage' => INT, 'pagenumber', 'highlight' => STR, 'goto'));

Any help please ?? ??

CavGsi.co.uk 03-30-2005 12:06 AM

Quote:

Originally Posted by CavGsi.co.uk
When i open the showthread.php i cant find

globalize($_REQUEST, array('perpage' => INT, 'pagenumber', 'highlight' => STR, 'goto'));

Any help please ?? ??

am using version 3.0.7

kadafi_alive 04-07-2005 09:26 AM

Quote:

Originally Posted by boiboi
no impact on yahoo whatsover.

Exactly, it seems that it's allowing the Googlebot but disallowing [Slurp] Yahoo.

Onkel_Tom 04-07-2005 10:58 AM

I'm using this line:
PHP Code:

preg_match("#(googlebot|slurp@inktomi|yahoo! slurp|lycos|ask jeeves|scooter|fast-webcrawler|turntinbot|msnbot|webcrawler|Infoseek|W3C_Val|Googlebot)#si"$_SERVER['HTTP_USER_AGENT'

and yahoo is working fine ;)

Breathex 04-07-2005 11:31 AM

installed

thnx for this nice hack

CavGsi.co.uk 04-12-2005 10:18 PM

Quote:

Originally Posted by CavGsi.co.uk
When i open the showthread.php i cant find

globalize($_REQUEST, array('perpage' => INT, 'pagenumber', 'highlight' => STR, 'goto'));

Any help please ?? ??

anyone ?????

twinsmom 04-13-2005 12:52 AM

It should be the first thing right after "Start Main Script"

CavGsi.co.uk 04-13-2005 05:37 AM

Quote:

Originally Posted by twinsmom
It should be the first thing right after "Start Main Script"

I searched the file and it said 'not in this document' worked fine when i was running 3.0.3 but am now at 3.0.7

Marco van Herwaarden 04-13-2005 06:59 AM

This line now reads (in 3.0.3, 3.0.6 and 3.0.7):
PHP Code:

globalize($_REQUEST, array(
    
'perpage' => INT,
    
'pagenumber' => INT,
    
'highlight' => STR,
    
'posted'    => INT,
    
'goto'
)); 

In 3.0.1 the 'posted' line was not there.

VirtualBurn 07-30-2005 11:42 PM

Code:

if ($bbuserinfo['userid'] == 0 and $forumid != X) 

    print_no_permission(); 
}

Quote:

Originally Posted by Gary King
Replace
PHP Code:

$forumid != 102 or $forumid != 103 

with
PHP Code:

$forumid != 102 and $forumid != 103 


I've found this thread to be really interesting and it has helped out with a lot of things. I've added the code to dissalow guest to view a couple of non vb pages but these pages should be only accessable by a certain user group.

Usergroup (id:9) are the only members that should have access to these pages, how can I modify this code to enable this feature?

Thankyou.

VirtualBurn 07-31-2005 01:29 AM

Ok, after scanning back through all the replies to this thread I finaly sussed it also added something else on ;)

This code stops guests (ID:0) and registered users (ID:2) from accesing the non-vb pages but with let the 'Premium Member' group (ID:9) walk right in.

For the users who aren't allwowed in a custom notice will appear telling the user to subscribe to access these areas.

https://vborg.vbsupport.ru/showthrea...threadid=93253

Thanks greg and all who replied here.

swa 08-07-2005 02:00 PM

awesome, works on 3.07!

Bozkurtum 08-26-2005 08:57 AM

Works on 3.5.x?

stan111 09-16-2005 11:35 AM

thanks a lot
i will try to get this installed when i get home

mkdevo 09-23-2005 12:29 PM

great hack!

i have a question as far as spiders go:

i have Kanoodle and TargetPoint ads on my board. after installing this hack, the TargetPoint ads (in threads) still show up, but the Kanoodle ads do not (because you now need to be logged in to view threads, etc.).

is there something i can add to this line in order to allow the Kanoodle ads in?

PHP Code:

preg_match("#(googlebot|slurp@inktomi|yahoo! slurp|lycos|ask jeeves|scooter|fast-webcrawler|turntinbot|msnbot|webcrawler|Infoseek|W3C_Val|Googlebot)#si"$_SERVER['HTTP_USER_AGENT'

?

etaslim 11-07-2005 03:51 PM

Quote:

Originally Posted by Bozkurtum
Works on 3.5.x?

same here, pls inform if there's any. thanks

99SIVTEC 12-08-2005 10:55 PM

I got it to work with 3.5, but it took a couple modifications. The code that you paste in showthread should now be
Code:

if ($vbulletin->userinfo['userid'] == 0 AND !preg_match("#(googlebot|slurp@inktomi|yahoo! slurp|lycos|ask jeeves|scooter|fast-webcrawler|turntinbot|msnbot|webcrawler|Infoseek|W3C_Val|Googlebot)#si", $_SERVER['HTTP_USER_AGENT']))
{
    print_no_permission();
}

and should be done right after:

// ################################################## #####################
// ######################## START MAIN SCRIPT ############################
// ################################################## #####################

Zachery 12-09-2005 12:41 AM

Quote:

Originally Posted by 99SIVTEC
I got it to work with 3.5, but it took a couple modifications. The code that you paste in showthread should now be
Code:

if ($vbulletin->userinfo['userid'] == 0 AND !preg_match("#(googlebot|slurp@inktomi|yahoo! slurp|lycos|ask jeeves|scooter|fast-webcrawler|turntinbot|msnbot|webcrawler|Infoseek|W3C_Val|Googlebot)#si", $_SERVER['HTTP_USER_AGENT']))
{
    print_no_permission();
}

and should be done right after:

// ################################################## #####################
// ######################## START MAIN SCRIPT ############################
// ################################################## #####################

Yo, stock feature in vB 3.5, nice job hacking a feature thats already in the system :)

99SIVTEC 12-09-2005 04:13 AM

and how is this a feature in the system already? The stock system doesn't allow search engine spiders while blocking guests.

Snake 12-09-2005 08:41 AM

Is this a good idea to install this hack? Do you think it'll get me more members?

Zachery 12-09-2005 05:26 PM

Quote:

Originally Posted by 99SIVTEC
and how is this a feature in the system already? The stock system doesn't allow search engine spiders while blocking guests.

Thats content cloaking and a big no no. (This can get you black listed from sites like google and yahoo).

The Default vB system allows you to disallow users from viewing the thread content but see the titles etc.

Zachery 12-09-2005 05:26 PM

Quote:

Originally Posted by Aftermath
Is this a good idea to install this hack? Do you think it'll get me more members?

If your using the 3.5 you already have it built in.

Can view forum > Yes
Can View Others Threads > Yes
Can view thread content > No

99SIVTEC 12-09-2005 07:45 PM

lol, and good luck getting caught doing it. Myspace does the same thing as do other very large websites. You are highly unlikely to get penalized for something like this. Cloaking infers that you are showing DIFFERENT content to a search engine than a regular user. This isn't the case. The two see the exact same info they just must be registered to view it. Thus this is not cloaking. Do some research on the subject (I know quite a bit about the subject as I have built ip based cloaking system for sites in the past)

Quote:

Originally Posted by Zachery
Thats content cloaking and a big no no. (This can get you black listed from sites like google and yahoo).

The Default vB system allows you to disallow users from viewing the thread content but see the titles etc.


Justice 12-14-2005 01:03 AM

I'm very interested in this topic... not so much the arguing, but the tangible differences between this hack and the built-in method.

Also, was this a built-in feature in 3.0 or was it just added in 3.5? I don't recall vbulletin always having this.

99SIVTEC 12-14-2005 01:58 AM

THIS is NOT a built in feature.

Justice 12-14-2005 02:52 AM

I didn't think so, but I haven't installed 3.5 yet. *shrug*

MRGTB 12-28-2005 01:02 AM

Quote:

Originally Posted by Onkel_Tom
As I wrote one post before my code is working for all vB 3 Versions right now. I using vB3.0.3 on my Boards too and it works.

Your find the instruction of the Hack in the first post. I only changed some parts for better fitting on my own wishes, so I posted my code which is working for the most recent search engines.

This code can be placed in /archive/index.php to allow search engines which are written in the code to index this pages.

If you want to use my code instead of Gary W's code for the archive just replace in /archive/index.php:
Code:

if ($bbuserinfo['userid'] == 0 AND !preg_match("#(google|slurp@inktomi|yahoo! slurp)#si", $_SERVER['HTTP_USER_AGENT']))
{
    print_no_permission();
}

With my code:
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();
}

You can add or remove search engines by editing this line:
Code:

!preg_match("#(google|slurp@inktomi|yahoo! slurp|lycos|ask jeeves|scooter|fast-webcrawler|turntinbot|msnbot|webcrawler|Infoseek|W3C_Val|googlebot)#si",
for each new spider add his user agent identification to the line with a "|" between like "spider1|spider2|spider3"

The echo syntax is only for index.php of archive because if you use this code and a unauthorised person will access the archive only a white page is shown. Therefore I added the echo information to the screen to show "what is wrong".

I used the "$grouparray = array ( 3,4); " function to define my usergroups which are not allowed to access the archive. You can put here any usergroup ID you want not to access your archive separated by ",". Usergroup 8 and 11 are defined groups from my board, just remove that both group ID's.

I hope I could help and the instructions are easy to understand ;)

Thanks for that, works great to stop other usergroups awaiting email. But there is still one problem you might know the answer to. If you logon to an account you create that needs email validation. You can still hover over thread titles on your board and read the full THREAD PREVIEW as a member waiting email validation.

Which defeats the whole object if they can read the thread that way

MRGTB 12-28-2005 03:07 AM

I've spotted a problem with this. Even if you protect the Archive and threads from being viewed on the forum board.

They can still view them via the printthread.php link instead to bypass the permissions as a guest and still view the full thread as a printable thread version. By simply replacing the showthread name in the link they want to view with "printthread" instead. This can be done manually quite easy to view all threads as printable versions.

Does anybody know how to use the same method to stop certain usergroups from accessing the printthread page?

EDIT:

Fixed it now for printthread.

Find:
Code:

globalize($_REQUEST, array('perpage' => INT, 'pagenumber' => INT));
below it put:
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']))

    print_no_permission(); 
}


Snoop-It 12-28-2005 02:20 PM

Quote:

Originally Posted by Zachery
If your using the 3.5 you already have it built in.

Can view forum > Yes
Can View Others Threads > Yes
Can view thread content > No

that does not work with 3.5.x

it makes no difference what so ever. guests can still view thread content. iv had that option on since 3.5.0 was released even now i still have it on 3.5.2 and guests still can view the posts.

if i edit the files that is explained on here would it work with 3.5.x ?? :ermm:

MRGTB 12-28-2005 02:44 PM

Quote:

Originally Posted by dholaholic
that does not work with 3.5.x

it makes no difference what so ever. guests can still view thread content. iv had that option on since 3.5.0 was released even now i still have it on 3.5.2 and guests still can view the posts.

if i edit the files that is explained on here would it work with 3.5.x ?? :ermm:

Do you not have to setup them settings in the Usergroups rather than board settings. I don't use vB 3.5. So I'm not sure, but I would have suspected you set that up as a Usergroup setting to stop guests from viewing threads if the option is there.

Snoop-It 12-28-2005 03:34 PM

Yes thats correct. In the unregistered / not logged in usergroup - I selected those permissions and it didnt make a difference...

very annoying..

MRGTB 12-28-2005 03:57 PM

Quote:

Originally Posted by dholaholic
Yes thats correct. In the unregistered / not logged in usergroup - I selected those permissions and it didnt make a difference...

very annoying..

Did you also check the permission on forum boards for Guests. To make sure the same permission was in place for them to not view thread content. I would just double check your forum category and boards usergroup permissions also to see if the permissions has be over ridden.

Snoop-It 12-28-2005 04:08 PM

that means in each category i have i will need to set the permission? but then it will display to them that no posts been made in that category.

I remember using your hack on the 3.0.x version... it was cool. It displayed the number of posts and latest post made etc... but then when the guest tried reading it or checking it out it will say log in..

Snoop-It 12-28-2005 04:14 PM

ok it displays PRIVATE... but it should act as normal.. thats what i want to show the guests and others that yeh there are posts inside that category.. but once some 1 clicks the category the LOGIN comes up

MRGTB 01-07-2006 01:10 PM

Quote:

Originally Posted by Zachery
If your using the 3.5 you already have it built in.

Can view forum > Yes
Can View Others Threads > Yes
Can view thread content > No

Yes, but they can still view threads through the "Archive Pages" or "Printthread Pages" (not sure which one, or if they can view through both). As a way of getting around that feature logged out as a guest in vB 3.5. Making that a pretty flawed feature that doesn't really stop anyone at all if they know what address to type in there browser to still view the content.

Were as this hack stops guest from doing that by blocking them from viewing threads while still allowing you to add bots you list in the code that can have access like Google Adsence, Googlebot, Yahoo Slurp etc.


All times are GMT. The time now is 10:52 PM.

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.01606 seconds
  • Memory Usage 1,844KB
  • 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
  • (8)bbcode_code_printable
  • (5)bbcode_php_printable
  • (15)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (36)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