GROTiUS Posted May 13, 2014 Share Posted May 13, 2014 (edited) Its possible to deny access to a forum and unlock these if the users reputation at (for example) 50 ? Edited May 13, 2014 by GROTiUS 1 Link to comment Share on other sites More sharing options...
0 Lock Down Posted May 13, 2014 Share Posted May 13, 2014 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> 2 Link to comment Share on other sites More sharing options...
0 GROTiUS Posted May 15, 2014 Author Share Posted May 15, 2014 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 More sharing options...
0 Lock Down Posted May 15, 2014 Share Posted May 15, 2014 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.. 1 Link to comment Share on other sites More sharing options...
0 GROTiUS Posted May 17, 2014 Author Share Posted May 17, 2014 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 More sharing options...
0 Lock Down Posted May 17, 2014 Share Posted May 17, 2014 try this fo elegance.. <if test="enoughPoints :|:!in_array($__id,array(1,2)) || $this->memberData['pp_reputation_points'] > 10 || (in_array($__id,array(2)) && $this->memberData['pp_reputation_points'] > 5 )"> --- TEMPLATE --- <else> You need more Reputation ! </if> Link to comment Share on other sites More sharing options...
0 Norg Posted May 21, 2014 Share Posted May 21, 2014 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. 1 Link to comment Share on other sites More sharing options...
Question
GROTiUS
Its possible to deny access to a forum and unlock these if the users reputation at (for example) 50 ?
Edited by GROTiUSLink to comment
Share on other sites
6 answers to this question
Recommended Posts