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 08-02-2002, 11:39 AM
Halx Halx is offline
 
Join Date: Jun 2002
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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.
Reply With Quote
  #2  
Old 08-02-2002, 02:11 PM
Chris M's Avatar
Chris M Chris M is offline
 
Join Date: Dec 2001
Location: Northampton, England
Posts: 6,186
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sounds like a good idea...

Satan
Reply With Quote
  #3  
Old 08-04-2002, 08:07 AM
Halx Halx is offline
 
Join Date: Jun 2002
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone willing to give it a shot?
Reply With Quote
  #4  
Old 08-04-2002, 04:32 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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..
Reply With Quote
  #5  
Old 08-06-2002, 02:29 PM
Halx Halx is offline
 
Join Date: Jun 2002
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you very much

That gives me a little to work on.. perhaps add some DB integration and a front end.
Reply With Quote
  #6  
Old 08-08-2002, 10:32 PM
steppin steppin is offline
 
Join Date: Jul 2002
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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)
Reply With Quote
  #7  
Old 08-21-2002, 07:03 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 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?
Reply With Quote
  #8  
Old 11-13-2002, 12:17 PM
marcel-ea marcel-ea is offline
 
Join Date: Oct 2002
Posts: 48
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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;

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

try to add your code after this part:

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

Reply With Quote
  #10  
Old 11-26-2002, 12:04 PM
ryancooper ryancooper is offline
 
Join Date: Jul 2002
Posts: 433
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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)
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 12:07 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04487 seconds
  • Memory Usage 2,272KB
  • 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
  • (7)bbcode_php
  • (1)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