View Full Version : Hide New Thread button for visitors w/o posting permissiosn
mooreaa
09-19-2008, 02:06 AM
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):
<td class="smallfont"><if condition="$show['newthreadlink']"><a href="newthread.php?$session[sessionurl]do=newthread&f=$foruminfo[forumid]" rel="nofollow"><img src="$stylevar[imgdir_button]/newthread.gif" alt="$vbphrase[post_new_thread]" border="0" /></a><else /> </if></td>
Replace with:
<td class="smallfont"><if condition="$show['newthreadlink'] and $show['member']"><a href="newthread.php?$session[sessionurl]do=newthread&f=$foruminfo[forumid]" rel="nofollow"><img src="$stylevar[imgdir_button]/newthread.gif" alt="$vbphrase[post_new_thread]" border="0" /></a><else /> </if></td>
See if that works. I have not tested it.
Opserty
09-19-2008, 07:23 AM
<td class="smallfont"><if condition="$show['newthreadlink'] AND $show['member']"><a href="newthread.php?$session[sessionurl]do=newthread&f=$foruminfo[forumid]" rel="nofollow"><img src="$stylevar[imgdir_button]/newthread.gif" alt="$vbphrase[post_new_thread]" border="0" /></a><else /> </if></td>AND should be uppercase :p
Lynne
09-19-2008, 03:49 PM
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:
<if condition="is_member_of($bbuserinfo, 5, 6, 7)">
Stuff just for those that are members of usergroup 5,6, or 7
</if>
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.