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)

Preds 03-26-2004 01:34 AM

Very easy to install, this hack is a big improvement in showing that the board is indeed active yet keeps the posts locked to unregistered guests. I like it.

BTW, for those that might be interested, I installed this on vB 3.0.0 Gold without any problems.

You can check it out at predsff.com/forums

WreckRman2 03-27-2004 02:12 AM

I really like this however I'd like to see it work on select forums only... can that be done?

Gary King 03-27-2004 01:08 PM

Quote:

Originally Posted by IndyWebDesign
I really like this however I'd like to see it work on select forums only... can that be done?

Use this code, replacing X with whatever forumid you want to block to guests:
PHP Code:

if ($bbuserinfo['userid'] == AND !preg_match("#(google|slurp@inktomi|yahoo! slurp)#si"$_SERVER['HTTP_USER_AGENT']) AND $forumid == X

    
print_no_permission(); 



Aleksey 03-28-2004 03:11 PM

Does work for me.

Aleksey 03-28-2004 03:13 PM

ok it works now :-\

Gary King 03-29-2004 07:06 PM

Quote:

Originally Posted by Hibernated
Does work for me.

So what's the problem then..?

Logikos 03-30-2004 07:28 AM

Quote:

Originally Posted by Zilvia
Does this work with vB 3.0.0 Final? I cant find the first edit in showthread.php

Yes look for this

PHP Code:

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


manguish 03-30-2004 08:04 AM

Fantastic! :D

Clicks Install...... This should`ve been in from scratch ;)

WreckRman2 04-01-2004 05:02 PM

Quote:

Originally Posted by Gary W
Use this code, replacing X with whatever forumid you want to block to guests:
PHP Code:

if ($bbuserinfo['userid'] == AND !preg_match("#(google|slurp@inktomi|yahoo! slurp)#si"$_SERVER['HTTP_USER_AGENT']) AND $forumid == X

    
print_no_permission(); 



That does work for a single forum. Is there a way to block multiple ones?

Gary King 04-01-2004 07:48 PM

Quote:

Originally Posted by IndyWebDesign
That does work for a single forum. Is there a way to block multiple ones?

Just keep on adding AND $forumid == X after AND $forumid == X

WreckRman2 04-01-2004 08:32 PM

Hmm, for some reason that didn't work... should it be AND $forumid == X OR $forumid == X OR $forumid == X OR $forumid == X OR $forumid == X OR $forumid == X ???

Code:

if ($bbuserinfo['userid'] == 0 AND !preg_match("#(google|slurp@inktomi|yahoo! slurp)#si", $_SERVER['HTTP_USER_AGENT']) AND $forumid == 78 AND $forumid == 111 AND $forumid == 108 AND $forumid == 141 AND $forumid == 110 AND $forumid == 129 AND $forumid == 109 AND $forumid == 112 AND $forumid == 150 AND $forumid == 151 AND $forumid == 152 AND $forumid == 153 AND $forumid == 154 AND $forumid == 155 AND $forumid == 156 AND $forumid == 157)
{
    print_no_permission();
}


WreckRman2 04-01-2004 08:34 PM

Yep that was it... I changed the AND to OR and it works now. Thanks!

sabret00the 04-01-2004 08:37 PM

Quote:

Originally Posted by Gary W
I think I posted this before I knew there was a mini-mod forum anyways :)

2 questions, how would i go about only applying this to certain forums and also making sure that those threads are also unaccessible via the archive?

sabret00the 04-01-2004 08:38 PM

Quote:

Originally Posted by Gary W
Use this code, replacing X with whatever forumid you want to block to guests:
PHP Code:

if ($bbuserinfo['userid'] == AND !preg_match("#(google|slurp@inktomi|yahoo! slurp)#si"$_SERVER['HTTP_USER_AGENT']) AND $forumid == X

    
print_no_permission(); 



that's one question answered :)

sabret00the 04-01-2004 08:41 PM

i thought of another question is this/can this be used to just "override the visiable but must be registered to view threads" option or is it all hardcoded?

the reason i ask is because i don't want unactive usergroups viewing the threads either.

WreckRman2 04-01-2004 08:48 PM

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.

NeoBlu 04-08-2004 07:55 PM

Great Hack. Thx

Pigs 04-15-2004 05:43 AM

Great Hack Gary,
I have a question. With non apache servers the archive is disabled. What is the implecation with this and spiders.

Gary King 04-16-2004 11:19 AM

Quote:

Originally Posted by Pigs
Great Hack Gary,
I have a question. With non apache servers the archive is disabled. What is the implecation with this and spiders.

It should still be working fine, because this hack has nothing to do with the archive, really :)

Pigs 04-16-2004 09:31 PM

Quote:

Originally Posted by Gary W
It should still be working fine, because this hack has nothing to do with the archive, really :)

I understand your comment however if running and IIS setup with no archive ability then aren't spiders unable to index the site?

I probably worded it wrongly.

The hack by the way works perfectly. It should be the default setup IMHO.

Cheers.

koon 04-26-2004 04:35 PM

Quote:

Originally Posted by tenbucks
I think I've come across an unwanted side effect.
The archives can be read by guests when this hack is installed.

Was looking at online.php today and saw a guest reading away.


Yes! I have just noticed this too and thought it was just a problem with Vbulletin itself until I cam across your discovery and after testing your right.

Is there any chance of this getting fixed or a work around?

webtam 05-22-2004 11:32 AM

Is there a simple way to just make it show a ? or - when the postcount is zero?

Vega 05-25-2004 04:18 PM

Awesome! Thx!

supernet 06-01-2004 12:37 PM

Hi. When i browse into archive/index.php i get a blank white page.

If i understood correctly, i insert right after this code:

$title .= ' - ' . $foruminfo['title'];
}
else
{
$do = 'index';
}


This code:

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


What might have gone wrong? :ermm:

Gary King 06-02-2004 01:02 PM

Are you logged in?

supernet 06-02-2004 01:15 PM

Ooops! I fill silly! :speechless:

Loged in, and its ok. Thanks Gary

magmaink 06-02-2004 01:50 PM

is there a way to restrict access to non-vb pages???? Meaning users have to log in to browse certain pages of the site?

Gary King 06-03-2004 12:05 PM

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();
}

?>


Wolffman 06-12-2004 04:49 AM

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.

Streetjob 06-13-2004 11:23 AM

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

Wolffman 06-14-2004 04:42 AM

Nevermind. It works perfect now that I figured it out.

Onkel_Tom 06-15-2004 11:28 AM

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']))
???

Onkel_Tom 06-15-2004 12:48 PM

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>> 


Raitsa 06-16-2004 01:53 PM

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

RonH. 06-16-2004 03:58 PM

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.

Streetjob 06-18-2004 12:19 AM

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!

Onkel_Tom 06-18-2004 09:15 AM

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.

Onkel_Tom 06-18-2004 10:00 AM

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 ?

Onkel_Tom 06-18-2004 10:33 AM

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(); 



Streetjob 06-18-2004 12:32 PM

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!


All times are GMT. The time now is 12:53 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.01611 seconds
  • Memory Usage 1,850KB
  • 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
  • (4)bbcode_code_printable
  • (10)bbcode_php_printable
  • (12)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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