[TH] User Criteria Extended

[TH] User Criteria Extended 1.0.6

No permission to download

Lukas W.

Well-known member
katsulynx submitted a new resource:

[KL] User Criteria Extended - Extends the range of available user criteria.

[KL] User Criteria Extended
Description

Heavily extends the range of available user criteria by adding opposite criteria for most existing criteria, along with a whole range of new criteria that can mostly be derived from the existing XenForo criteria setup with no additional calculation effort.

Features

Additional criteria...

Read more about this resource...
 

Tealk

Well-known member
Hi, please can you add:
  • number of posts in a specific thread(s);
  • number of posts in a specific node(s);
 

Xon

Well-known member
Number of posts in a thread requires requires 1 SQL query that hits 1 row (there is a thread post count summary table). This gets expensive as you increase the number of threads.
 

Tealk

Well-known member
That's not good, of course.
I have a node for accepted applications and as soon as the thread is in this node the user should get a group.
I can't think of a better way.
 

sbj

Well-known member
Since there are 3 veteran devs here, as these criteria are mostly used in combination with usergroup promotions, is there any way to force a usergroup promotion immediately other than waiting for the cron to run?

And thank you for this free, new addon, I hope commercially run forums purchase a license!
 

Xon

Well-known member
Since there are 3 veteran devs here, as these criteria are mostly used in combination with usergroup promotions, is there any way to force a usergroup promotion immediately other than waiting for the cron to run?
My free add-on https://xenforo.com/community/resources/user-promotion-on-profile-update.5846/ does this when something on the user profile updates.

It permits my users to opt-in and out of various user group promotions which enable/disable various feature flags (aka permissions)

That's not good, of course.
I have a node for accepted applications and as soon as the thread is in this node the user should get a group.
I can't think of a better way.
You are better off with a custom add-on which triggers when a new thread is posted to that forum rather than trying to retro-fit user criteria into it.
 

kbryant414

Active member
This has some interesting applications for my board. Thanks as always for your hard work, @katsulynx.

That's not good, of course.
I have a node for accepted applications and as soon as the thread is in this node the user should get a group.
I can't think of a better way.

Depending on how your forum is meant to work...

Is there an intro node, and new members can only post there until their application is accepted? In that case, you can set your intro forum not to increase post-count. The accepted application area, however, would add to post-count. Set a usergroup promotion when post-count is greater than zero.

Is this a special node that only certain people can access? In that case, an idea that comes to mind is using one of the currency add-ons on here, like DragonByte Tech Credits, and create a hidden currency that the same mods/admins who can accept the application can view. When accepted, they can give the user a credit, and set usergroup promotion when that currency is greater than zero. This can be useful if there's multiple kinds of applications and groups you want to do this with, since it's expandable.

You may also be able to work something with number of trophy points or like-points and give the mods/admins increased power when giving those.

If there's no real review process (ie, the application is meant for opt-in, rather than for vetting), you can approach it via custom user-fields and Xon's mod above. The user toggles the custom field to "yes," his mod fires, and the usergroup promotion takes effect based on that user-field. Edit: I realize too late that Xon actually described this idea already.
 

Rebuller

Member
@katsulynx, can you add this criterias, please?
  • Custom user field (number) is more than X
  • Custom user field (number) is less than X
  • Custom user field (string) is not empty
 

Tealk

Well-known member
Hi,
is it possible that this error comes from this addon?
Code:
InvalidArgumentException: Accessed unknown getter 'hasExpired' on XF:Warning[17] src/XF/Mvc/Entity/Entity.php:182
Generated by: Unknown account Mar 23, 2018 at 8:24 AM
Stack trace
#0 src/XF/Mvc/Entity/Entity.php(95): XF\Mvc\Entity\Entity->get('hasExpired')
#1 src/addons/KL/UserCriteriaExtended/Listener.php(79): XF\Mvc\Entity\Entity->__get('hasExpired')
#2 [internal function]: KL\UserCriteriaExtended\Listener::criteriaUser('kl_uce_max_acti...', Array, Object(ThemeHouse\QAForums\XF\Entity\User), false)
#3 src/XF/Extension.php(67): call_user_func_array(Array, Array)
#4 src/XF/App.php(2352): XF\Extension->fire('criteria_user', Array, NULL)
#5 src/XF/Criteria/User.php(62): XF\App->fire('criteria_user', Array)
#6 src/XF/Criteria/AbstractCriteria.php(61): XF\Criteria\User->isUnknownMatched('kl_uce_max_acti...', Array, Object(ThemeHouse\QAForums\XF\Entity\User))
#7 src/XF/Repository/UserGroupPromotion.php(112): XF\Criteria\AbstractCriteria->isMatched(Object(ThemeHouse\QAForums\XF\Entity\User))
#8 src/XF/Cron/UserGroupPromotion.php(39): XF\Repository\UserGroupPromotion->updatePromotionsForUser(Object(ThemeHouse\QAForums\XF\Entity\User), Array, Array)
#9 [internal function]: XF\Cron\UserGroupPromotion::runPromotions(Object(XF\Entity\CronEntry))
#10 src/XF/Job/Cron.php(35): call_user_func(Array, Object(XF\Entity\CronEntry))
#11 src/XF/Job/Manager.php(241): XF\Job\Cron->run(8)
#12 src/XF/Job/Manager.php(187): XF\Job\Manager->runJobInternal(Array, 8)
#13 src/XF/Job/Manager.php(76): XF\Job\Manager->runJobEntry(Array, 8)
#14 job.php(15): XF\Job\Manager->runQueue(false, 8)
#15 {main}
Request state
array(4) {
  ["url"] => string(8) "/job.php"
  ["referrer"] => bool(false)
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
 

Lukas W.

Well-known member

Rebuller

Member
@katsulynx
PHP:
ErrorException: [E_NOTICE] Undefined index: tags src/addons/KL/UserCriteriaExtended/Listener.php:167

#0 src/addons/KL/UserCriteriaExtended/Listener.php(167): XF::handlePhpError(8, '[E_NOTICE] Unde...', '/var/www/da...', 167, Array)
#1 [internal function]: KL\UserCriteriaExtended\Listener::criteriaUser('kl_uce_tags', Array, Object(SV\UserEssentials\XF\Entity\User), false)
#2 src/XF/Extension.php(67): call_user_func_array(Array, Array)
#3 src/XF/App.php(2352): XF\Extension->fire('criteria_user', Array, NULL)
#4 src/XF/Criteria/User.php(62): XF\App->fire('criteria_user', Array)
#5 src/XF/Criteria/AbstractCriteria.php(61): XF\Criteria\User->isUnknownMatched('kl_uce_tags', Array, Object(SV\UserEssentials\XF\Entity\User))
#6 src/XF/Repository/Trophy.php(68): XF\Criteria\AbstractCriteria->isMatched(Object(SV\UserEssentials\XF\Entity\User))
#7 src/XF/Cron/Trophy.php(38): XF\Repository\Trophy->updateTrophiesForUser(Object(SV\UserEssentials\XF\Entity\User), Array, Object(XF\Mvc\Entity\ArrayCollection))
#8 [internal function]: XF\Cron\Trophy::runTrophyCheck(Array)
#9 src/XF/Admin/Controller/CronEntry.php(112): call_user_func(Array, Array)
#10 src/XF/Mvc/Dispatcher.php(249): XF\Admin\Controller\CronEntry->actionRun(Object(XF\Mvc\ParameterBag))
#11 src/XF/Mvc/Dispatcher.php(88): XF\Mvc\Dispatcher->dispatchClass('XF:CronEntry', 'Run', 'html', Object(XF\Mvc\ParameterBag), 'cronEntries', Object(XF\Admin\Controller\CronEntry), NULL)
#12 src/XF/Mvc/Dispatcher.php(41): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#13 src/XF/App.php(1891): XF\Mvc\Dispatcher->run()
#14 src/XF.php(328): XF\App->run()
#15 admin.php(13): XF::runApp('XF\\Admin\\App')
#16 {main}
 

imno007

Well-known member
I'm getting lots of these:

  • ErrorException: [E_NOTICE] Undefined index: tags
  • src/addons/KL/UserCriteriaExtended/Listener.php:167
  • Generated by: Unknown account
  • 11 Apr 2018 at 3:22 AM
Stack trace
#0 src/addons/KL/UserCriteriaExtended/Listener.php(167): XF::handlePhpError(8, '[E_NOTICE] Unde...', '/home/.../...', 167, Array)
#1 [internal function]: KL\UserCriteriaExtended\Listener::criteriaUser('kl_uce_tags', Array, Object(SV\UserMentionsImprovements\XF\Entity\User), false)
#2 src/XF/Extension.php(67): call_user_func_array(Array, Array)
#3 src/XF/App.php(2352): XF\Extension->fire('criteria_user', Array, NULL)
#4 src/XF/Criteria/User.php(62): XF\App->fire('criteria_user', Array)
#5 src/XF/Criteria/AbstractCriteria.php(61): XF\Criteria\User->isUnknownMatched('kl_uce_tags', Array, Object(SV\UserMentionsImprovements\XF\Entity\User))
#6 src/XF/Repository/UserGroupPromotion.php(112): XF\Criteria\AbstractCriteria->isMatched(Object(SV\UserMentionsImprovements\XF\Entity\User))
#7 src/XF/Cron/UserGroupPromotion.php(39): XF\Repository\UserGroupPromotion->updatePromotionsForUser(Object(SV\UserMentionsImprovements\XF\Entity\User), Array, Array)
#8 [internal function]: XF\Cron\UserGroupPromotion::runPromotions(Object(XF\Entity\CronEntry))
#9 src/XF/Job/Cron.php(35): call_user_func(Array, Object(XF\Entity\CronEntry))
#10 src/XF/Job/Manager.php(241): XF\Job\Cron->run(8)
#11 src/XF/Job/Manager.php(187): XF\Job\Manager->runJobInternal(Array, 8)
#12 src/XF/Job/Manager.php(76): XF\Job\Manager->runJobEntry(Array, 8)
#13 job.php(15): XF\Job\Manager->runQueue(false, 8)
#14 {main}
Request state
array(4) {
["url"] => string(8) "/job.php"
["referrer"] => string(31) "https://.../admin.php"
["_GET"] => array(0) {
}
["_POST"] => array(0) {
}
}
 
Top