vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Guests cannot view threads (https://vborg.vbsupport.ru/showthread.php?t=27679)

LanciaStratos 09-08-2001 04:24 PM

I want to block guests from viewing individual topics. (e.g. A guest enters the forum home page, clicks on a forum, sees the topic titles, click on a topic title, and is then asked to log-in or register.)

I know that there is a similar option in the AdminCP that prevents guests from "viewing other's topics", but it makes each forum appear blank, as if there were no topics at all. :(

Hopefully someone can help, as I believe this would be a hack that others would appreciate as well. :)

tweak 09-08-2001 08:20 PM

All done in your CNTRL panel

User Groups and Permissions
Add | Modify
Modify forums <-------HERE

LanciaStratos 09-09-2001 01:38 AM

Tweak, please read my post again.

Quote:

I know that there is a similar option in the AdminCP that prevents guests from "viewing other's topics", but it makes each forum appear blank, as if there were no topics at all.
This is the "similar option" that I'm mentioning, and that's the effect that it creates (which isn't what I want).

showthread.php is really the only thing I don't want guests to see...

Admin 09-09-2001 07:07 AM

Try this.
In your showthread.php, add the code in red
Code:

error_reporting(7);
if ( isset($goto) and ($goto=='lastpost' or $goto=='newpost')) {
  $noheader=1;
}

if ($bbuserinfo[userid]!=0) {

and also this
Code:

getforumrules($forum,$getperms);
eval("dooutput(\"".gettemplate("showthread")."\");");

} else {
  show_nopermission();
}

This should work (untested).

LanciaStratos 09-09-2001 04:12 PM

Thanks FireFly, but it didn't work. :( Showthread.php only returned this error:

Quote:

Fatal error: Call to undefined function: show_nopermission() in /home/gtplanet/public_html/forums/showthread.php on line 442

Admin 09-09-2001 04:14 PM

Oh right, global.php was yet to be included. I'll work something out and post it here. :)

LanciaStratos 09-09-2001 04:15 PM

Sounds great, thanks! :)

Admin 09-09-2001 04:18 PM

Undo all changes. :)

Add the code in red in all 4 places.
Code:

        include('./global.php');

        if ($bbuserinfo[userid]!=0) {

        if (isset($postid) and $postid!=0 and $postid!="") {
          $postid = verifyid("post",$postid);
       
          $getthread=$DB_site->query_first("SELECT threadid FROM post WHERE postid='$postid'");
          $threadid=$getthread[threadid];
        }

Code:

        eval("dooutput(\"".gettemplate("showpost")."\");");
        exit;
} else {
  show_nopermission();
}

Code:

require('./global.php');

if ($bbuserinfo[userid]!=0) {

// oldest first or newest first
if ($postorder==0) {
  $postorder="";
} else {
  $postorder="DESC";
}

Code:

getforumrules($forum,$getperms);
eval("dooutput(\"".gettemplate("showthread")."\");");
} else {
  show_nopermission();
}

Now it has to work. :)

LanciaStratos 09-09-2001 04:40 PM

Uh-oh, now I'm getting a new error:

Quote:

Parse error: parse error in /home/gtplanet/public_html/forums/showthread.php on line 448
I'm almost positive I placed the code in all the right places, I've checked and re-checked. But, here's a copy of my (modified) showthread.php file, if you'd like to look at it.

Admin 09-09-2001 04:42 PM

You dropped one } right before that ### block that says showthread.

(also remove that file)


All times are GMT. The time now is 01:03 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.01998 seconds
  • Memory Usage 1,736KB
  • 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
  • (6)bbcode_code_printable
  • (3)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
  • (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