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.
License
GPLv3
Visible branding
No
190894

Description

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
  • DESCRIBE_YOUR_DREAM_TROPHY_HERE
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!
190895
___

Features

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:

190897


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:

190904


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

190905


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

190906


Using criteria

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

190907


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:

190898


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

190899


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:

190900


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

190901


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
190902


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:

190908


Extendable

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!
___

Installation
  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
Unistallation
  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!
190915
Author
CMTV
Downloads
89
Views
3,844
First release
Last update

Ratings

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