MyBB Community Forums
Hide link? - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Community Archive (https://community.mybb.com/forum-106.html)
+--- Forum: Archived Forums (https://community.mybb.com/forum-143.html)
+---- Forum: Archived Development and Support (https://community.mybb.com/forum-155.html)
+----- Forum: MyBB 1.6 (https://community.mybb.com/forum-138.html)
+------ Forum: 1.6 General Support (https://community.mybb.com/forum-127.html)
+------ Thread: Hide link? (/thread-96653.html)



Hide link? - mukilol - 2011-06-15

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.


RE: Hide link? - Aries-Belgium - 2011-06-15

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.


RE: Hide link? - mukilol - 2011-06-15

I didn't understand the part where I'm supposed to add: if(in_array($mybb->user['usergroup'],array(1,5,7,X)))


RE: Hide link? - Aries-Belgium - 2011-06-15

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)))



RE: Hide link? - mukilol - 2011-06-15

(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?


RE: Hide link? - ranjani - 2011-06-15

^ in the plugin's php file which you copy to your plugin's directory on the server


RE: Hide link? - Aries-Belgium - 2011-06-15

(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.


RE: Hide link? - mukilol - 2011-06-15

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.


RE: Hide link? - Aries-Belgium - 2011-06-15

You don't need a plugin for that. Just use Group Promotion. Look at the link I posted above.