MyBB Community Forums

Full Version: What makes buttons visible?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
What determines the visibility of buttons? I notice when I logon that some buttons on each post become visible, such as REPORT for example, when previously only FIND and REPLY were visible.

Why does logging on allow you to see certain buttons?
For your example, the Report button will only appear when someone is logged in so that only registered users can report a post. We'd all like to know who reported the post, and for what reason... If a guest were allowed to report posts, then literally every single post could be reported - causing a nightmare for moderators.

But other buttons, such as the email and PM buttons, will only appear if the user has these options enabled to receive these in their UserCP. The website button will only appear if the author of the post has specified a website in their profile. Editing buttons will only appear if your usergroup has them enabled / you are a moderator or admin.

Is there any other examples you need?
Thanks for your reply, Tom.M

Yes I understand that the Report button will only appear when someone is logged in so that only registered users can report a post.

But only registered users are allowed to reply to posts and yet the REPLY button appears to guests regardless.

Let me put it another way: if a guest clicks the reply button he's told that he's not logged in, so I would have expected the report button to work the same way.
Yeah the only one that I can't think of a reason for it being there is the reply button. It's fine if guest posting is allowed but it isn't here so not too sure why it's in the postbit.
Hmm, looked into it and testing, removing it if the guest doesn't have permission to reply makes the postbit look sort of wierd. However, if you think it's an omission, then post a bug in the Bug Section. You can link to this post if you want.

In ./inc/functions_post.php, circa line 487:

		if($forum['open'] != 0 && ($thread['closed'] != 1 || is_moderator($forum['fid'])))
		{
			eval("\$post['button_quote'] = \"".$templates->get("postbit_quote")."\";");
		}

Change to:

		if($forumpermissions['canpostreplys'] != 0 && ($forum['open'] != 0 && ($thread['closed'] != 1 || is_moderator($forum['fid']))))
		{
			eval("\$post['button_quote'] = \"".$templates->get("postbit_quote")."\";");
		}

This will remove the "reply" button if the guest does not have permission to reply to threads.

At least, I think that will work in all cases... o.O
My own humble view is that the buttons SHOULD be in the postbit and if a guest clicks on either Reply or Report they should be told that they don't have permission.

This is how it works for reply at the moment and to my simple mind it seems logical that report would work the same way.

I think in principle people should know that the report option exists for signed up and logged in users.

EDIT: I've also got a plugin which adds a 'thank you' button and currently this doesn't show. Again, I think it ought to and give a not logged in message if clicked by a guest.