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 12-06-2002, 04:58 AM
matthew tucker's Avatar
matthew tucker matthew tucker is offline
 
Join Date: Nov 2002
Location: Sydney, Australia
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Anyone can post, but restrict thread view to usergroup

I've looked for this hack but I can't find how to do it.

I need to have a forum where ANYONE can post a message, ANYONE can view the subject line, but only members of USERGROUP can read the detail of the thread.

i can't seem to do it via the usual forum permissions changes.

Anyone know how to do this?

I need it because I want to be able to have a "jobs available" section that anyone can post a legit job to, ordinary users can see the list of jobs available, but only financial members can read and get the job detail.

thanks

Matthew
Reply With Quote
  #2  
Old 12-08-2002, 12:16 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

enjoy..
Attached Files
File Type: txt permissions can list posts, but not view.txt (1.3 KB, 0 views)
Reply With Quote
  #3  
Old 12-08-2002, 10:36 PM
matthew tucker's Avatar
matthew tucker matthew tucker is offline
 
Join Date: Nov 2002
Location: Sydney, Australia
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No luck yet. edited showthread.php with following code, enabled default permissions for usergroupid==4 (registered members) and made up template. Logged in as a registered member, but can still see all threads in forum id==5.

Quote:
$getperms=getpermissions($thread['forumid'],-1,-1,$forum['parentlist']);
if (!$getperms['canview']) {
show_nopermission();
}
if (!$getperms['canviewothers'] and ($thread['postuserid']!=$bbuserinfo['userid'] or $bbuserinfo['userid']==0)) {
show_nopermission();
}

// ** hack - can view thread titles but not detail **
if ($forum['forumid']==5 AND $bbuserinfo['usergroupid']==4)
{
eval("standarderror(\"".gettemplate("error_youdont havepermission")."\");");
exit;
}
// *** end hack, see also printthread.php ****

$bbcodeon=iif($forum[allowbbcode],$ontext,$offtext);
// etc
Reply With Quote
  #4  
Old 12-08-2002, 10:57 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

are u sure your registered users is 4? 4 is suppose to be COPPA while registered users are 2.. check it out
Reply With Quote
  #5  
Old 12-09-2002, 12:27 AM
matthew tucker's Avatar
matthew tucker matthew tucker is offline
 
Join Date: Nov 2002
Location: Sydney, Australia
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes, I did check that and you were right, I had confusled these (it takes real guts to be stupid ;-) BUT unfortunately after updating the two files to reflect the correct usergroupid, it still doesn't appear to work.

Now, in order for the hack to work, I understand the user permissions must be set so that that usergroup Can see own threads, Can see others threads, Can etc etc, .... and then the hack code short-circuits this and says if you're a member of Y group, you ain't getting any further in this X forum despite what the permissions say.

That right? Seems like it should work but still no joy. Thanks for your help so far.

Matthew
Reply With Quote
  #6  
Old 12-09-2002, 08:50 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

matthew your logic is correct. That's how the hack works..

I believe your problem is related to your somehow. It was a tested hack and after your message I replied it to a test board and it worked: This is what this the hack does:
It allows the usergroup X to browse inside forum Y and list thread titles but if they click on a thread, they receive your custom error message and cant read it.

You might be missing something while installing.. Please double check:

1- you installed correctly
2- you try the hack with a usergroup account you restricted.
3- You enter your forumid correctly and you test the hack in that forum
Reply With Quote
  #7  
Old 12-13-2002, 03:28 AM
matthew tucker's Avatar
matthew tucker matthew tucker is offline
 
Join Date: Nov 2002
Location: Sydney, Australia
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Logician, I checked all above several times, and still no joy.

Can I somehow echo $forum['forumid'] and $bbuserinfo['usergroupid'] to the screen at the point of loading the page so I can check that the values I am trying to restrict are correct? How do I add this sort of debug info to my page?

Thanks for all your help.
Reply With Quote
  #8  
Old 12-13-2002, 06:17 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by matthew tucker
Can I somehow echo $forum['forumid'] and $bbuserinfo['usergroupid'] to the screen at the point of loading the page so I can check that the values I am trying to restrict are correct? How do I add this sort of debug info to my page?
yes good idea:

find
PHP Code:
if ($forum['forumid']==AND $bbuserinfo['usergroupid']==Y
before that add:
PHP Code:
echo "forumid :".$forum['forumid'].' - usergroupid :'.$bbuserinfo['usergroupid']; 
Reply With Quote
  #9  
Old 12-13-2002, 06:26 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nm, I found your problem: please try adding the code in showthread.php right BEFORE here TOO:

PHP Code:
if ((!isset($pagenumber) or $pagenumber==0) and $pagenumber!="lastpage") { 
The location you added in the first place has 2 instances and it should be added to the both..
Reply With Quote
  #10  
Old 12-15-2002, 10:32 PM
matthew tucker's Avatar
matthew tucker matthew tucker is offline
 
Join Date: Nov 2002
Location: Sydney, Australia
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

THANKS that worked, its great, does exactly what I want.

Now I have to read showthread.php and try to understand it!

Again, thanks for your efforts.
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 01:23 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.10097 seconds
  • Memory Usage 2,281KB
  • Queries Executed 12 (?)
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
  • (3)bbcode_php
  • (2)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
  • (1)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
  • (1)postbit_attachment
  • (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
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete