MyBB Community Forums

Full Version: Show content to people who have +REP
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Could anyone tell me how could I make specific content shown only to those that have +REP?
Maybe there is some modification already?
Thanks in advance.
What do you mean by "+REP"? Any reputation or positive reputation only?
(2012-01-02, 04:06 PM)Fábio Maia Wrote: [ -> ]What do you mean by "+REP"? Any reputation or positive reputation only?

+REP = positive I think Toungue
And content you mean post or any thing else like download link etc. ??
If you just want to add something in a template that is only visible to users with positive reputation you can simply install PHP in Templates or Template Conditionals and use this bit of code:

<if $mybb->user['reputation'] > 0 then>
Lorem ipsum dolor sit amet
<else />
You are not allowed to view this information because you do not have a positive reputation.
</if>

Similarly, if you wanted to display something to users with 0 reputation you would do:

<if $mybb->user['reputation'] != 0 then>
Lorem ipsum dolor sit amet
<else />
You are not allowed to view this information because you do not any reputation.
</if>
By +REP I had in mind positive REP.
And I want to hide a part of post like a link or something.
So I will need to use MyCode for this I think.

Fábio Maia,I will try to combine your code with my code so I could get something to hide tag.
But if you have this code I am talking about then please share.
Thanks in advance.
So you want this as a MyCode? Like [hiderep][/hiderep]? And whatever content is inside the tags is only visible to those with positive reputation?
I guess MyCode doesn't allow php.How could I work around this?
I allready use "PHP in Templates or Template Conditionals" module.
(2012-01-02, 06:56 PM)Fábio Maia Wrote: [ -> ]So you want this as a MyCode? Like [hiderep][/hiderep]? And whatever content is inside the tags is only visible to those with positive reputation?

Yes.
You will need a plugin. I made one really quick. I didn't test it thoroughly, but it should work. To install it upload the file to ./inc/plugins and activate the plugin from the Admin CP. The message that is displayed to users which don't have positive reputation can be edited directly from the plugin file. I also applied a class named .hiderep to it, so you can style it with CSS - give it a color, background and all sorts of things. Let me know how it works.
[attachment=25222]
Thanks for making this.I just installed it and it seems that it doesn't work.Maybe I did something wrong.I just enabled the plugin and posted a content in [hiderep][/hiderep] tags and it showed the content to all users and also "[hiderep][/hiderep]" is visible too.
Pages: 1 2