Criteria Builder

Unmaintained Criteria Builder 1.0.0

No permission to download
Compatible XF 2.x versions
  1. 2.1
  2. 2.2
Additional requirements
• PHP 7 and above
• XenForo 2.1.0 Beta 5 and above.
Visible branding


If you ever tried to create a trophy, you probably noticed "User criteria" tab. It allows you to set some conditions (number of posted messages, for example), which users must met to be awarded with your trophy.

There are some other systems that use XenForo's criteria system: notices when showing a banner, user group promotions.

The problem is that the amount of available criteria to choose from is too small and does not allow you to be creative. Here is just a small list of things you can't do with XenForo's criteria system:
  • A "Collector" trophy for adding 100 bookmarks
  • A "Hater" trophy for leaving 333 :mad: reactions
  • Show a banner with "Thank you" text to users, who have replied 1000+ times in "Questions" forum
  • Grant people with admin rights for creating 888 threads in "Off-topic" forum
In short, Criteria Builder can do all listed above and even more.

It allowes you to import/export criteria just as easy as importing/exporting smilies.
Did not found the criterion you wanted? Not a big problem. You can write your own without leaving ACP!

Your possibilities are limited only by your imagination!

This is an open source addon. Visit GitHub repository for source code.

All my addons are free...

But if you want to
  • Be informed of all news about developing new addons
  • Suggest and vote for new addons
  • Try beta versions
  • Receive 24-hour early access to new addons
Then you can support me on my Patreon!


Full control from ACP

There is no need to create criteria somewhere outside an link them with inconvenient "Class/method callback".

You can import/export/create criteria from one place in admin control panel:


Importing criteria

Criteria can be imported from an .xml file. It can be a pack of criteria downloaded from this forum. Or maybe you just want to transfer criteria from one your forum to another.

First of all, you need to go to "Import" page and select the .xml file with criteria:


Now, you need to select which criteria to import and which to upgrade:


You can also edit new criteria right on "Resolving" page:


Using criteria

When you imported (or created) some criteria, you can select it when creating a trophy/notice/user group promotion:


Create custom criteria

If you are familiar with PHP you can create you own criteria.

First step is to fill the information about the criterion:


After that, you can write a criterion PHP code right in ACP. No need to create .php files and place them in src folder:


Criterion params

Imagine you want to create 3 trophies for adding 1, 15 and 50 bookmarks. Sounds like we need to create 3 similar criteria changing only one number: added bookmarks.... :cautious:

Fortunately, Criteria Builder allows you to create "criterion params" which values can be set when creating a trophy/notice and etc!

So you only need to create a "Bookmarks added" criterion with one parameter: the number of added bookmarks. You can than retrieve parameter value in criterion PHP code!

Criterion params list:


Retrieving the parameter value using $get(_PARAM_NAME_) function:


There are 8 built-in params in Criteria Builder (more can be added easily via addons):
  • Text box (max length, icon, default value, username autocomplete and regex match)
  • Number box (min and max values, default value, step)
  • Switcher (enabled by default)
  • Forum select (mulsti/single select)
  • User group select (mulsti/single select)
  • Thread prefix select
  • Reaction select
  • Date and time

Drag-and-drop sorting

Setting "display order" directly / having a separate "Sort" page - it is all in the past. You can just drag crieria, criteria categories and params and drop them at desired position:



It is possible to create custom parameter defintions. It is as easy as creating a new widget definition. Just enable Development mode and create a definition at "Param definitions" page.

Moreover, you can listen CMTV_CB_criteria_types event to add your own criteria type support!

  1. Download the addon
  2. In admin control panel go to "Addons" section, click on "Install/upgrade from archive" and select downloaded addon archive
Importing basic criteria

In the downloaded archive you can find a file called basic_criteria.xml. It contains 4 criteria to begin with. You can import them on "Import" page (see "Importing criteria" section above).

"Communication" category:
  • Messages posted
    • A number of messages
    • Forums
    • Visible/Deleted/Moderated
  • Messages posted in thread
    • Thread ID
    • Visible/Deleted/Moderated
  • Threads created
    • A number of threads
    • Forums
    • Prefixes
    • Visible/Deleted/Moderated
"Bookmarks" category:
  • Bookmarks added
    • A number of bookmarks
  1. Uninstall the addon from ACP
  2. Go to forum root folder and remove src/addons/CMTV/CriteriaBuilder and js/CMTV/CriteriaBuilder folders.
That's it!

All my addons are free...

But if you want to
  • Be informed of all news about developing new addons
  • Suggest and vote for new addons
  • Try beta versions
  • Receive 24-hour early access to new addons
Then you can support me on my Patreon!
First release
Last update


3.50 star(s) 2 ratings

More resources from CMTV

Latest reviews

How is this addon not more popular?! Very powerful tool for implementing custom criteria for usergroup promotions. The code is well written, and the interface is also very well design!
The plugin has nice but style problem. I shared the discussion. I'm going to rectify the problem. because it creates a bad image. no problem in use, but the xml file is incorrect.
Top Bottom