2015-03-04, 04:25 PM
2015-03-04, 04:36 PM
PHP should do it. Even though I have never done it myself, it will work.
2015-03-04, 06:54 PM
(2015-03-04, 04:36 PM)PhantomD Wrote: [ -> ]PHP should do it. Even though I have never done it myself, it will work.
Anybody know what PhantomD might mean or any other suggestions. On the same note, where do you see all members of a group, like a page or link?
2015-03-04, 07:11 PM
you can use View Groups plugin
2015-03-04, 09:35 PM
(2015-03-04, 06:54 PM)user25 Wrote: [ -> ]On the same note, where do you see all members of a group, like a page or link?
AdminCP > Users & Groups: click Find Users
In "Is member of one or more of these user groups" select a group.
At bottom of page in "Display Options" enter number in "Results per page" field and click "Find Users" button.
2015-03-04, 10:09 PM
(2015-03-04, 09:35 PM)Puppyite Wrote: [ -> ](2015-03-04, 06:54 PM)user25 Wrote: [ -> ]On the same note, where do you see all members of a group, like a page or link?
AdminCP > Users & Groups: click Find Users
In "Is member of one or more of these user groups" select a group.
At bottom of page in "Display Options" enter number in "Results per page" field and click "Find Users" button.
I meant for members on the front end.
2015-03-04, 11:57 PM
<?php
global $db;
$query = "SELECT u.username, u.usergroup
FROM `".TABLE_PREFIX."users` u
JOIN `".TABLE_PREFIX."usergroups` g ON u.usergroup = g.gid
WHERE g.gid = ".$usergroup_id.";";
$user_details = array();
while ($result = $db->fetch_array( $query )) {
$user_details[$result['username']] = $result['usergroup'];
}
?>
This is the basic idea albeit it only checks primary right now. You would need NOT to do a join for the additional groups and use explode(',', $variable) to split the additional groups into individual gids. Then loop through with foreach to check. Edit the code as you see fit.
2015-03-05, 09:22 PM
(2015-03-04, 11:57 PM)Ircher Wrote: [ -> ]<?php global $db; $query = "SELECT u.username, u.usergroup FROM `".TABLE_PREFIX."users` u JOIN `".TABLE_PREFIX."usergroups` g ON u.usergroup = g.gid WHERE g.gid = ".$usergroup_id.";"; $user_details = array(); while ($result = $db->fetch_array( $query )) { $user_details[$result['username']] = $result['usergroup']; } ?>
This is the basic idea albeit it only checks primary right now. You would need NOT to do a join for the additional groups and use explode(',', $variable) to split the additional groups into individual gids. Then loop through with foreach to check. Edit the code as you see fit.
Thanks Ircher, but I am a novice that does catch on pretty quick. Where would I put the code (which page) and what would I use to call the code in the template. {$usergroup['uid']}?
2015-03-06, 01:06 AM
(2015-03-05, 09:22 PM)user25 Wrote: [ -> ](2015-03-04, 11:57 PM)Ircher Wrote: [ -> ]<?php global $db; $query = "SELECT u.username, u.usergroup FROM `".TABLE_PREFIX."users` u JOIN `".TABLE_PREFIX."usergroups` g ON u.usergroup = g.gid WHERE g.gid = ".$usergroup_id.";"; $user_details = array(); while ($result = $db->fetch_array( $query )) { $user_details[$result['username']] = $result['usergroup']; } ?>
This is the basic idea albeit it only checks primary right now. You would need NOT to do a join for the additional groups and use explode(',', $variable) to split the additional groups into individual gids. Then loop through with foreach to check. Edit the code as you see fit.
Thanks Ircher, but I am a novice that does catch on pretty quick. Where would I put the code (which page) and what would I use to call the code in the template. {$usergroup['uid']}?
I only gave a template for you to follow; further questions should be asked either in plugin development or theme development where you're more likely to get help on the subject. I recommend looking at the help doc article for templates & plugins.