vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Why does "Post New Thread" button appear for usergroup member's that cannot post? (https://vborg.vbsupport.ru/showthread.php?t=260132)

vestaviascott 03-09-2011 09:46 PM

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

BoostedK20 03-10-2011 12:28 PM

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."

vestaviascott 03-10-2011 01:11 PM

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;
?>


vestaviascott 03-21-2011 05:03 PM

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 :-)

HMBeaty 03-21-2011 05:06 PM

<a href="https://vborg.vbsupport.ru/showthread.php?t=231525" target="_blank">https://vborg.vbsupport.ru/showthread.php?t=231525</a>

vestaviascott 03-21-2011 05:15 PM

Quote:

Originally Posted by HMBeaty (Post 2175873)

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.

Lynne 03-21-2011 05:30 PM

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.

vestaviascott 03-21-2011 05:40 PM

Quote:

Originally Posted by Lynne (Post 2175881)
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.

Lynne 03-21-2011 11:09 PM

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.

Gator Bite 12-21-2011 12:30 PM

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


All times are GMT. The time now is 07:28 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.01132 seconds
  • Memory Usage 1,739KB
  • 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
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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