vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Anyone can post, but restrict thread view to usergroup (https://vborg.vbsupport.ru/showthread.php?t=46423)

matthew tucker 12-06-2002 04:58 AM

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

Logician 12-08-2002 12:16 PM

1 Attachment(s)
enjoy..

matthew tucker 12-08-2002 10:36 PM

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

Logician 12-08-2002 10:57 PM

are u sure your registered users is 4? 4 is suppose to be COPPA while registered users are 2.. check it out

matthew tucker 12-09-2002 12:27 AM

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

Logician 12-09-2002 08:50 AM

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

matthew tucker 12-13-2002 03:28 AM

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.

Logician 12-13-2002 06:17 AM

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']; 


Logician 12-13-2002 06:26 AM

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

matthew tucker 12-15-2002 10:32 PM

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.

TECK 12-16-2002 03:01 AM

Logician, is alot more extensive then this... with your code, I can see the posts, while I search...
I wrote one for my board so i know the little bells...

Logician 12-16-2002 06:11 AM

Quote:

Originally posted by TECK
Logician, is alot more extensive then this... with your code, I can see the posts, while I search...
I wrote one for my board so i know the little bells...

I know that user can see part of the post if he uses search. The quick cure of it may be disabling his search rights..

Anyway this not a full release hack, it's one of my 2 minute hacks which I give away to help requesters. So if you patched the searching gap in your hack, please feel welcomed to share yours in Full Releases or here..


All times are GMT. The time now is 02:43 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.01124 seconds
  • Memory Usage 1,743KB
  • 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
  • (3)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (12)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete