Jump to content
WebFlake
  • 0

Reputation Required to view a forum


GROTiUS

Question

6 answers to this question

Recommended Posts

  • 0

You would have to us an if statement in possibly 3 templates.

In board index > boardindextemplate if you don't want them to know they exist.

In forum view  > forumindextemplate if you don't want them to see the topic listings

In topic view  > topicviewtemplate if you don't want them to see the actual topic posts

 

use something like this if

<if test="enoughPoints :|:$this->memberData['pp_reputation_points'] > 49"> 

at the top of topicviewtemplate and </if> at the very bottom.

 

Look at the other templates and if you need help on where to put the if.

 

You can also add an else at the bottom to give them a message  like this adding any styles you would like..

<else /> <h4> you need 50 reputation points to view this forum..</h4></if>

The above if is for all forums for certain forums you can use this in the topicviewtemplate

 

Below is for your selected forums by forum id number.

<if test="enoughPoints :|:!in_array($forum['id'],array(47,54,75)) || $this->memberData['pp_reputation_points'] > 49"> 

The numbers represent the forum id numbers.

<else />  <h1> 50 Reputation points required to view forum {$forum['id']} </h1> </if>
  • Upvote 2
Link to comment
Share on other sites

  • 0

The above if is for all forums for certain forums you can use this in the topicviewtemplate

 

Below is for your selected forums by forum id number.

<if test="enoughPoints :|:!in_array($forum['id'],array(47,54,75)) || $this->memberData['pp_reputation_points'] > 49"> 

The numbers represent the forum id numbers.

<else />  <h1> 50 Reputation points required to view forum {$forum['id']} </h1> </if>

Thanks, works great! but how can I use this in : forumindextemplate (because there this code dont work!)

Link to comment
Share on other sites

  • 0

You are welcome.

 

the if would use $forum_data['id'] instead of $forum['id']

 

or if you use after a foreach like this one

<foreach loop="forums:$_data['forum_data'] as $forum_id => $forum_data">

try the $forum_id in the if statement..

 

Hey, works fine! Can I do that a little more elegant ? (Different count of Reputation required for 2 different forums)

<if test="enoughPoints :|:!in_array($forum_data['id'],array(1)) || $this->memberData['pp_reputation_points'] > 5"> // FORUM ID 1 / REP 5
<if test="enoughPoints :|:!in_array($forum_data['id'],array(2)) || $this->memberData['pp_reputation_points'] > 10"> // FORUM ID 2 / REP 10
--- TEMPLATE ---
<else>
You need more Reputation !
</if>
Link to comment
Share on other sites

  • 0

The question(s) in this support topic have been answered and the owner has been able to solve the problem. Because of this, the support topic has been closed and moved.

If you have other questions, please open a new topic.

  • Downvote 1
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...