Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Create a new forum in X forum only if user has minimum post in X forum
nier3 Offline
Member
***
Posts: 125
Joined: Jul 2012
Post: #1
Create a new forum in X forum only if user has minimum post in X forum
Hi,

I would like to ask if there's a code to allow users with minimum X postnum to create a new thread in a specific forum.
I try to write better.

With this code <if $post['postnum'] >= 10 then>Create a new thread</if> users with minimum 10 posts in all forum can create a new thread.

But if I want minimum 10 posts in a specific X forum, how can I do (if it's possible)?

<if $thread['fid'] == 115 || $post['postnum'] >= 10 then>Create new thread
    <else>No
      </if>

But this code takes still postnum for all forums..I need a plugin? Frown

This is for a forum about exchange votes, I would like only users with minimum 10 posts in exchange votes forum can create new thread.

- If user has 10 posts in fid 115 and 0 in all forum = can creates new thread
- If user has 50 posts in all forum but 0 in fid 115 = can't create new thread in fid 115 but he can create new threads in other fids

Thank you in advance
11-13-2014 08:00 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #2
RE: Create a new forum in X forum only if user has minimum post in X forum
1. Template conditionals shouldn't be used for permissions checking as it can't actually stop the user from doing specified action
2. It's not easy to know this information since it has to be tracked (or queried, if you don't mind the overhead), and cannot be obtained via conditional

My Blog
11-13-2014 09:30 AM
Find all posts by this user Quote this message in a reply
xensor Offline
Junior Member
**
Posts: 22
Joined: Jan 2014
Post: #3
RE: Create a new forum in X forum only if user has minimum post in X forum
i know this is old but change the || to && and it will check for both not one or the other. || is or. && is and. with or it will check if one or the other matches and display. and it will check that both matches and if none does it shows the else.

or is for wanting to check if one or the other is correct.

so in this case you want both to be checked so or is not needed.

Code:
<if $thread['fid'] == 115 && $post['postnum'] >= 10 then>Create new thread
    <else>No
      </if>

06-08-2016 05:06 PM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: