vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Hide New Thread button for visitors w/o posting permissiosn (https://vborg.vbsupport.ru/showthread.php?t=191284)

mooreaa 09-19-2008 02:06 AM

Hide New Thread button for visitors w/o posting permissiosn
 
Hello,

I would like to hide the "New Thread" button for those who do not have permission to post a new thread. I realize that they will be prompted to login, but for my site I'd rather hide the button. Any suggestions on how to do this?

I'm hoping I can edit the templates and do something with an if condition but I'm not sure.

Thanks

Lynne 09-19-2008 02:45 AM

I think it would be something like..
Find this in FORUMDISPLAY (I think it's in there twice):
HTML Code:

<td class="smallfont"><if condition="$show['newthreadlink']"><a href="newthread.php?$session[sessionurl]do=newthread&amp;f=$foruminfo[forumid]" rel="nofollow"><img src="$stylevar[imgdir_button]/newthread.gif" alt="$vbphrase[post_new_thread]" border="0" /></a><else />&nbsp;</if></td>
Replace with:
HTML Code:

<td class="smallfont"><if condition="$show['newthreadlink'] and $show['member']"><a href="newthread.php?$session[sessionurl]do=newthread&amp;f=$foruminfo[forumid]" rel="nofollow"><img src="$stylevar[imgdir_button]/newthread.gif" alt="$vbphrase[post_new_thread]" border="0" /></a><else />&nbsp;</if></td>
See if that works. I have not tested it.

Opserty 09-19-2008 07:23 AM

Code:

<td class="smallfont"><if condition="$show['newthreadlink'] AND $show['member']"><a href="newthread.php?$session[sessionurl]do=newthread&amp;f=$foruminfo[forumid]" rel="nofollow"><img src="$stylevar[imgdir_button]/newthread.gif" alt="$vbphrase[post_new_thread]" border="0" /></a><else />&nbsp;</if></td>
AND should be uppercase :p

Lynne 09-19-2008 03:49 PM

Quote:

Originally Posted by Opserty (Post 1625480)
AND should be uppercase :p

Um..... I can't even come up with an excuse for why I didn't do that. (Where is the shakes-head-in-disbelief smilie here?)

mooreaa 09-22-2008 05:24 AM

is there a way to get at the userpermissions? I am trying to use this to hide a button that says "new article" as such only a special group of people have acceess to post articles... what would I use in place?

Isn't there a rule thing at the bottom that says, you can ... post/reply/view in this forum? How is that info generated and can I not derive this system based on weather or not the user has posting permissions?

Lynne 09-22-2008 03:29 PM

It depends on what userpermissions you are talking about. A lot of that is figured out in the php script for use in the template but it depends on exactly what is needed in the page. You can easily see if a user is a member of a usergroup like this:

HTML Code:

<if condition="is_member_of($bbuserinfo, 5, 6, 7)">
 Stuff just for those that are members of usergroup 5,6, or 7
</if>



All times are GMT. The time now is 07:53 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.01313 seconds
  • Memory Usage 1,726KB
  • 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
  • (3)bbcode_html_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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