Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-09-2011, 09:46 PM
vestaviascott vestaviascott is offline
 
Join Date: Mar 2011
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Why does "Post New Thread" button appear for usergroup member's that cannot post?

I have a forum called "FAQ" in which I want to restrict all members except Admin from posting new threads.

So for example, members of "Registered Users" should be able to Reply to threads, but not create their own.

However, even though I've set up my forum permissions with "Can Post Threads: NO"

When I impersonate a user in the "registered users" usergroup, they still see the button "Post New Thread" even though they cannot post. Clicking the button takes them to a permission denied screen.

So its confusing the user. Why show the button if you already know they can't post???

So I'm wanting to remove that button for everyone but admin or the admin usergroup.

Thanks in advance for the help :-)

~ scott
Reply With Quote
  #2  
Old 03-10-2011, 12:28 PM
BoostedK20 BoostedK20 is offline
 
Join Date: Mar 2011
Location: NY
Posts: 118
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

IIRC, you can't remove the button. The best someone can do is click it and see the denied screen. You can write in the forum description for that specific one that "Only Admins can post new threads in this forum."
Reply With Quote
  #3  
Old 03-10-2011, 01:11 PM
vestaviascott vestaviascott is offline
 
Join Date: Mar 2011
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Boosted.

How about this:

Can I insert some vbulletin code on this template (I have no idea of the syntax, but something like this in PHP):

Code:
<?php
if (is_forum('FAQ') && !is_user_in('ADMINISTRATORS')) return;
else [INSERT BUTTON CODE];
end if;
?>
Reply With Quote
  #4  
Old 03-21-2011, 05:03 PM
vestaviascott vestaviascott is offline
 
Join Date: Mar 2011
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone know the vb code I would need to do this check and in what php script it resides?

I'd really appreciate the help :-)
Reply With Quote
  #5  
Old 03-21-2011, 05:06 PM
HMBeaty's Avatar
HMBeaty HMBeaty is offline
 
Join Date: Sep 2005
Posts: 4,141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<a href="https://vborg.vbsupport.ru/showthread.php?t=231525" target="_blank">https://vborg.vbsupport.ru/showthread.php?t=231525</a>
Reply With Quote
  #6  
Old 03-21-2011, 05:15 PM
vestaviascott vestaviascott is offline
 
Join Date: Mar 2011
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by HMBeaty View Post
Thanks very much for the link. Its exactly what I was looking for.

Now if anyone happens to know the script that contains the "Post New Thread" button, I'm golden.
Reply With Quote
  #7  
Old 03-21-2011, 05:30 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The other option is to write plugin (you would need to know a little bit of php though). The button has a condition around it based on $show['newthreadlink'], so you could write a plugin that basically sets that variable to false if you are in forumid x and if you are not an admin.
Reply With Quote
  #8  
Old 03-21-2011, 05:40 PM
vestaviascott vestaviascott is offline
 
Join Date: Mar 2011
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
The other option is to write plugin (you would need to know a little bit of php though). The button has a condition around it based on $show['newthreadlink'], so you could write a plugin that basically sets that variable to false if you are in forumid x and if you are not an admin.
I'm cool with that too, and I'm fine with PHP code.

Would you happen to have a quick link reference to a tutorial on how to write a most basic VB plugin?

Otherwise, I'm fine with wrapping the appropriate script in the conditional check if I can determine which script holds the "Post New Thread" button. I'm starting my search with "forumdisplay.php" and working out from there.
Reply With Quote
  #9  
Old 03-21-2011, 11:09 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I would download a real simply mod from the Add-Ons forum to see some basic plugin code.

PHP Code:
if ($foruminfo['forumid'] == xx AND is_member_of($vbulletin->userinfoy,z))
{
$show['newthreadlink'] = false;

Something like that. The variable names will always depend on the hook location you pick for your plugin. Pick a hook location, do a search in your files for the hook, then look at the variable names used right there to find out what is allowed.
Reply With Quote
  #10  
Old 12-21-2011, 12:30 PM
Gator Bite Gator Bite is offline
 
Join Date: Dec 2009
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Lynne,

Is there a way to limit this button based on a user's permissions to post. I have several forums where only members of certain groups can post, but others can read. Is there a way to enhance the "condition="$show['newthreadlink']" so that it simply doesn't display the 'New Thread' button based on a user's permission to post there?

Thanks in advance
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:36 AM.


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.07324 seconds
  • Memory Usage 2,257KB
  • 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
  • (1)bbcode_code
  • (1)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
  • (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