MyBB Community Forums

Full Version: Make Shoutbox visible only for a group
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm using MyShoutbox plugin. I want to make my shoutbox visible only for users that have posts >=1. How can I do that?
Open plugin file and find (at two instances);
if ($perms && $perms !== 2) {
and Change it into;
if ($perms && $perms !== 2 && $mybb->user['postnum'] >= "1") {
Work perfectly. Thanks a lot Yaldaram!

Scuse me Yaldaram, guest now cannot view shoutbox! How can I fix it?
You want to make it visible to guests, but not to users who have 0 posts? Makes no sense to me.
OP: Do you allow guest postings on your site?
Anyone can just log out to see the shoutbox. It doesn't even make sense really. Why would you want to benefit a user who hasn't registered but not allow a user who has registered to use the same feature? You should probably re-think your strategy. Either way, to make it work for guests you should change the line Yaldaram mentioned to this instead:

if ($perms && $perms !== 2 && $mybb->user['postnum'] >= "1" && !$mybb->user['uid']) {
I just want that guest can only see the shoutbox, not write on it. By default guests can see shoutbox but they can't write a shout. With Yaldaram's code guest cannot view the shoutbox as before.
I want this way because a guest see the shoutbox and maybe he says:"oh nice, I'd like to talk with others". So he registers and if he want too see his loved shoutbox, he must post his greetings xD Nice story Big Grin
However, I'll try your new code Fàbio and I'll let you know! Thanks!
P.s. Sorry for my bad english!!!!

The code doesn't work, I can't view the shoutbox and I am an admin
Because Fábio has put the !$mybb->user['uid'] in the code and all those "registered" users being online will not see the shoutbox since they've their UserID.

Change the above to this;
if ($perms && $perms !== 2 && $mybb->user['postnum'] >= "1" || !$mybb->user['uid'])

From both instances.
Ok, problem solved, obviously Smile. Thank you very much Yaldaram! You're a MyBB master!
No problem, glad to help Wink