vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Permissions: Can list posts, but not view. (https://vborg.vbsupport.ru/showthread.php?t=41815)

Halx 08-02-2002 11:39 AM

Permissions: Can list posts, but not view.
 
What's up people!

I've been thinking of developing a hack, but my proficiency with vB is not all that great yet. So, I'll suggest this hack to you.

Right now I have about 15 forums divided into 3 catagories on my page. Currently unregistered users cannot view anything, when they try to load a page, they are denied with a custom 'no permissions' message. When I allow them access to view some of the forums, the forums that they can't view dont even show up, and thus they are unaware of them, and have no compelling reason to register to be able to view them. So, I allow them access to view the forums, but not the posts. Then, it just looks to them as if all the posts have been removed - again, no motivation. The next step would be to allow them to view the posts, and thus negating the reason why I require registration. (It's mature content, you see.)

So, if there were a happy medium in permissions, where users from a certain usergroup could LIST the thread topics, but not display the threads themselves, that would make things much more productive for the forum in question, while not completely denying access to all the other interesting, yet decidedly less private forums.

Tell me what you think. :)

Chris M 08-02-2002 02:11 PM

Sounds like a good idea...

Satan

Halx 08-04-2002 08:07 AM

Anyone willing to give it a shot?

Logician 08-04-2002 04:32 PM

edit showthread.php, find:

PHP Code:

if (!$getperms['canviewothers'] and $thread['postuserid']!=$bbuserinfo['userid']) {
  
show_nopermission();


After that add:
PHP Code:

  if ($forum['forumid']==AND $bbuserinfo['usergroupid']==Y)
{
eval(
"standarderror(\"".gettemplate("error_youdonthavepermission")."\");");
exit;


(Replace X with the forum id and Y with user group id)

Create a new template named "error_youdonthavepermission" and specify your custom message for no permission..

(Dont forget to enable their permissions in Admin CP)

If you want to apply the hack to 2 usergroups, change:
PHP Code:

    if ($forum['forumid']==AND $bbuserinfo['usergroupid']==Y

as
PHP Code:

    if ($forum['forumid']==AND ($bbuserinfo['usergroupid']==OR $bbuserinfo['usergroupid']==Z)) 

Enjoy..

Halx 08-06-2002 02:29 PM

Thank you very much :) :)

That gives me a little to work on.. perhaps add some DB integration and a front end.

steppin 08-08-2002 10:32 PM

Logician
Is there a way for this to work for a thread instead of the forum & group ?

I want them to view everything except the thread(post)

Logician 08-21-2002 07:03 AM

Quote:

Originally posted by steppin
Is there a way for this to work for a thread instead of the forum & group ?
I want them to view everything except the thread(post)

Isnt it what it already does?

marcel-ea 11-13-2002 12:17 PM

Don?t work by me

In the ACP i set the "View other Threads" for Unreg User
on yes.

Than i insert the code in showthread.php
but the guest can see all :beard:

any idea?

PHP Code:

    $forumid=$foruminfo['forumid'];
if (
$bbuserinfo[usergroupid]==OR $bbuserinfo[usergroupid]==OR $bbuserinfo[usergroupid]==4)
{
eval(
"standarderror(\"".gettemplate("error_youdonthavepermission")."\");");
exit;



Logician 11-13-2002 04:55 PM

try to add your code after this part:

PHP Code:

if (!$getperms['canviewothers'] and $thread['postuserid']!=$bbuserinfo['userid']) {
  
show_nopermission();



ryancooper 11-26-2002 12:04 PM

Hmm nothing seems to work.
PHP Code:

        if (!$getperms['canviewothers'] and ($thread['postuserid']!=$bbuserinfo['userid'] or $bbuserinfo['userid']==0)) {
      
show_nopermission();
    }
if (
$forumid==63 AND $bbuserinfo[usergroupid]==6)
{
eval(
"standarderror(\"".gettemplate("error_youdonthavepermission")."\");");
exit;


Also,
A quick question If i want to restriuct access to 2 or 3 user groups would I jsut do this

if ($forumid==X AND $bbuserinfo[usergroupid]==Y OR $bbuserinfo[usergroupid]==Z)


All times are GMT. The time now is 12:54 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.01057 seconds
  • Memory Usage 1,754KB
  • 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
  • (7)bbcode_php_printable
  • (1)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