Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 09-08-2001, 05:24 PM
LanciaStratos's Avatar
LanciaStratos LanciaStratos is offline
 
Join Date: Oct 2001
Location: somewhere you're not
Posts: 221
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #2  
Old 09-08-2001, 09:20 PM
tweak's Avatar
tweak tweak is offline
 
Join Date: Oct 2001
Location: Canada
Posts: 113
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

All done in your CNTRL panel

User Groups and Permissions
Add | Modify
Modify forums <-------HERE
Reply With Quote
  #3  
Old 09-09-2001, 02:38 AM
LanciaStratos's Avatar
LanciaStratos LanciaStratos is offline
 
Join Date: Oct 2001
Location: somewhere you're not
Posts: 221
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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...
Reply With Quote
  #4  
Old 09-09-2001, 08:07 AM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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).
Reply With Quote
  #5  
Old 09-09-2001, 05:12 PM
LanciaStratos's Avatar
LanciaStratos LanciaStratos is offline
 
Join Date: Oct 2001
Location: somewhere you're not
Posts: 221
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #6  
Old 09-09-2001, 05:14 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oh right, global.php was yet to be included. I'll work something out and post it here.
Reply With Quote
  #7  
Old 09-09-2001, 05:15 PM
LanciaStratos's Avatar
LanciaStratos LanciaStratos is offline
 
Join Date: Oct 2001
Location: somewhere you're not
Posts: 221
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sounds great, thanks!
Reply With Quote
  #8  
Old 09-09-2001, 05:18 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #9  
Old 09-09-2001, 05:40 PM
LanciaStratos's Avatar
LanciaStratos LanciaStratos is offline
 
Join Date: Oct 2001
Location: somewhere you're not
Posts: 221
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #10  
Old 09-09-2001, 05:42 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

(also remove that file)
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 09:50 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.04471 seconds
  • Memory Usage 2,259KB
  • Queries Executed 11 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (6)bbcode_code
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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