MyBB Community Forums

Full Version: Hide link?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey!

How do I hide links for guests and members with X posts? They will need to have 5 posts in order to see the link.
http://mods.mybb.com/view/hide-links-to-guests-for-14

For hiding to members with less than 5 posts, you'll need to set up group promotion. And modify the plugin file a bit.

First of all change the compatibility, change:
"compatibility" => "14*"
to
"compatibility" => "16*"

And then to add extra groups, search:
if($mybb->user['usergroup'] == "1")
to
if(in_array($mybb->user['usergroup'],array(1,5,7,X)))
This also includes: Awaiting activation and the Banned usergroup. You'll need to replace the X with the ID of the usergroup with -5 posts.
I didn't understand the part where I'm supposed to add: if(in_array($mybb->user['usergroup'],array(1,5,7,X)))
You need to search for this line:
if($mybb->user['usergroup'] == "1") 
and replace it with (if you also want to include registered users)
if(in_array($mybb->user['usergroup'],array(1,2,5,7)))
(2011-06-15, 07:10 PM)Aries-Belgium Wrote: [ -> ]You need to search for this line:
if($mybb->user['usergroup'] == "1") 
and replace it with (if you also want to include registered users)
if(in_array($mybb->user['usergroup'],array(1,2,5,7)))

Where do I search for that?
^ in the plugin's php file which you copy to your plugin's directory on the server
(2011-06-15, 08:34 PM)mukilol Wrote: [ -> ]
(2011-06-15, 07:10 PM)Aries-Belgium Wrote: [ -> ]You need to search for this line:
if($mybb->user['usergroup'] == "1") 
and replace it with (if you also want to include registered users)
if(in_array($mybb->user['usergroup'],array(1,2,5,7)))

Where do I search for that?

In the same file you made the compatibility changes.
Small problem...

I replaced the code and the usergroups are getting the message but how do I place the 5 post requirement? The current usergroups can't see the link even if they have and don't have more thank 5 posts.

How do I place the requirement?
Found a plugin, everything is ok now.
You don't need a plugin for that. Just use Group Promotion. Look at the link I posted above.