MDK
Member
We imported our vBulletin forum into Xenforo and at first left all the usergroups untouched.
We had a "premium usergroup" which became after importing the "Primary" usergroup in xF just as the were in vB.
To calculate how many users were in that usergroup (#12) I used this query which gave me the exact count of the members in this usergoup:
<?php
class michael_example_index
{
public static function getHtml()
{
// get database
$db = XenForo_Application::get('db');
// assign userId
$usergroup = '12';
// get username from user_id
$premium = $db->fetchOne("
SELECT COUNT(*)
FROM xf_user
WHERE user_group_id = ?
", $usergroup);
// echo result
echo $premium;
}
}
?>
We tried to clean up things a bit and followed the suggestions from xF to make everybody a "registered user" as the Primary and any other usergroup they might belong to as the Secondary usergroup. No problems.
Therefore everybody form the "premium usergroup" has now "Registered" as the primary and "Premium" as the secondary.
This Premium usergroup is still #12
Problem is the query now returns zero
I guess it has to do with the fact they belong to 2 usergroups now?
If so any help how to change the query?
Thanks
We had a "premium usergroup" which became after importing the "Primary" usergroup in xF just as the were in vB.
To calculate how many users were in that usergroup (#12) I used this query which gave me the exact count of the members in this usergoup:
<?php
class michael_example_index
{
public static function getHtml()
{
// get database
$db = XenForo_Application::get('db');
// assign userId
$usergroup = '12';
// get username from user_id
$premium = $db->fetchOne("
SELECT COUNT(*)
FROM xf_user
WHERE user_group_id = ?
", $usergroup);
// echo result
echo $premium;
}
}
?>
We tried to clean up things a bit and followed the suggestions from xF to make everybody a "registered user" as the Primary and any other usergroup they might belong to as the Secondary usergroup. No problems.
Therefore everybody form the "premium usergroup" has now "Registered" as the primary and "Premium" as the secondary.
This Premium usergroup is still #12
Problem is the query now returns zero
I guess it has to do with the fact they belong to 2 usergroups now?
If so any help how to change the query?
Thanks