View Thread
';
}
opentable($locale['u110'].": ".$group_name." (".sprintf((dbrows($result2) == 1 ? $locale['u111'] : $locale['u112']), dbrows($result2)).")");
   echo '

'.$locale['433'].' '.$group_description.'

';
   echo '
 Print Thread
away to list certain user group
penehoff
Is the a add-on or a infusion that will list certain user groups on a page by itself. Say like if I want to list all the bands and musicians ...
 
http://unsignedandindependentbands.com/
skpacman
There isn't an addon that I'm aware of that can do that but you can make a custom page to accomplish it. I don't have time today to work on it, but I'm sure someone will answer with some code.

There are 10 kinds of people in this world.
Those who understand binary,
and those who don't...
 
http://www.skpacman.com
KasteR
I'll see what I can put together. Thumb Up
 
http://kaster.us
skpacman
Well, it all basically boils down to one db call and parsing the data from there.

$group_id = 1; //CHANGE THIS TO THE GROUP ID YOU WANT TO DISPLAY 
$get_users = dbquery("SELECT * FROM ".DB_USERS." WHERE USER_GROUPS like '%.".$group_id."'"); //PULL USERS FROM DB WITH THAT ID

//DO STUFF WITH $get_users


This assumes you have less than 10 groups, though. the "fuzzy select" (LIKE) in the database query ('%.1%') would match any string containing ".1" anywhere in it. There may be a less hack-y, more polished way to do this, but I haven't stumbled upon it yet.

There are 10 kinds of people in this world.
Those who understand binary,
and those who don't...
 
http://www.skpacman.com
penehoff
Kaster if you can come up with someone that be awesome .. when you look through the member list you have to scroll through everyone , just wanted to have a link to a custom page that list all the bands & musicians
 
http://unsignedandindependentbands.com/
KasteR
I started a custom page, with a lot of it almost complete. Need to straighten out a few things before it's complete.

The way I'm doing it is by looking up the groups DB_USER_GROUPS table, and joining the DB_USERS table.

I have it in 2 parts. First the groups are displayed in a table, with a link. You click the user group, and then are presented with a new table. The new table contains further details about the group, such as Group Name, Group Details, and Group Usernames.

I can work on this a bit further after this weekend. You know we'll take care of ya Thumb Up
 
http://kaster.us
penehoff
Thanks Kaster .. you guys are the bombs lol
 
http://unsignedandindependentbands.com/
KasteR
I have the custom page ready and available on this post.

For what I know you will be using this for, I believe an infusion would be more appropriate. User Groups is a big part of what your website is all about. This may get you by until something can be developed further.

Take a look at what I have setup. Let me know any feedback. And come up with some ideas of features you would like.



/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2011 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: groups.php
| Author:    KasteR (http://www.php-fusion.us)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at http://www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once 'maincore.php';
require_once THEMES.'templates/header.php';
include LOCALE.LOCALESET."admin/user_groups.php";
include LOCALE.LOCALESET."user_fields.php";

// group is not selected
if(!isset($_GET['group_id'])){
$result = dbquery("
   SELECT group_id, group_name, group_description
   FROM ".DB_USER_GROUPS."
   ORDER BY group_name ASC;
");
opentable($locale['u057']);

if (dbrows($result)) {
   echo '';
   while ($data = dbarray($result)) {
      $group_id =             $data['group_id'];
      $group_name =          $data['group_name'];
      $group_description =    $data['group_description'];
      echo '
         
            
            
         
      ';
      }
   echo '
'.substr($locale['432'],0,-1).''.substr($locale['433'],0,-1).'
'.$group_name.''.$group_description.'
';
} else { echo "
No groups found.
\n"; }

closetable();
}

// group is selected
if(isset($_GET['group_id'])){
$result2 = dbquery("
   SELECT user_id, user_name, user_level, user_status, group_id, group_name, group_description
   FROM ".DB_USERS.",".DB_USER_GROUPS."
   WHERE user_groups REGEXP('^\\\.{$_GET['group_id']}$|\\\.{$_GET['group_id']}\\\.|\\\.{$_GET['group_id']}$')
   AND ".DB_USERS.".user_id = ".DB_USER_GROUPS.".group_id
   ORDER BY user_level DESC, user_name
");
     while($data = dbarray($result2)) {
      $group_name =          $data['group_name'];
      $group_description =    $data['group_description'];
      $user_id =             $data['user_id'];
      $user_name =          $data['user_name'];
      $user_type =         $data['user_status'];
      $tbody .=             '
'.profile_link($data['user_id'], $data['user_name'], $data['user_status']).''.getuserlevel($data['user_level']).'
'.$tbody.'
'.$locale['446'].''.$locale['447'].'
';
closetable();
}

require_once THEMES."templates/footer.php";
?>


Just save this to the root of your site. Name it groups.php  
http://kaster.us
penehoff
Top  #9 Print Post
Posted on 04-20-2015 19:14
User Avatar

Member



Posts: 349
Joined: 11.24.14

unsignedandindependentbands.com/groups.jpg

Not exactly , what i was looking for , what i ment was something that would list all members who were part of a certain group.. like all members who were bands and are musicians ..  
http://unsignedandindependentbands.com/
KasteR
Top  #10 Print Post
Posted on 04-21-2015 09:07
User Avatar

Admin



Posts: 556
Joined: 04.16.12

You are planning on using Groups for this right?

With the script I produced above, when you click on the group, it will then display the group members. So you want All Group Names, and Users within those groups, on a single page?  
http://kaster.us
penehoff
Top  #11 Print Post
Posted on 04-21-2015 13:19
User Avatar

Member



Posts: 349
Joined: 11.24.14

OK u can color me stupid lol

I didnt click anything ...  
http://unsignedandindependentbands.com/
penehoff
Top  #12 Print Post
Posted on 04-21-2015 13:27
User Avatar

Member



Posts: 349
Joined: 11.24.14

unsignedandindependentbands.com/images/photoalbum/useralbum_2/screenshot_2015-04-21-15-21-49_t1.png

Now clicked on the user group didn't get anything but this  
http://unsignedandindependentbands.com/
KasteR
Top  #13 Print Post
Posted on 04-21-2015 16:35
User Avatar

Admin



Posts: 556
Joined: 04.16.12

Ok well that group doesn't have any users I believe. However I did notice an issue with displaying all of the members. So there is an update required to this script. I'll try to fix this and re-post when I get some time (soon).  
http://kaster.us
penehoff
Top  #14 Print Post
Posted on 04-21-2015 18:04
User Avatar

Member



Posts: 349
Joined: 11.24.14

ok  
http://unsignedandindependentbands.com/
KasteR
Top  #15 Print Post
Posted on 04-28-2015 10:05
User Avatar

Admin



Posts: 556
Joined: 04.16.12

Sorry for the delay. I've updated the script below. Let me know if there are any issues.



/*-------------------------------------------------------+
| PHP-Fusion Content Management System
| Copyright (C) 2002 - 2011 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: groups.php
| Author:    KasteR (http://www.php-fusion.us)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at http://www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
require_once 'maincore.php';
require_once THEMES.'templates/header.php';
include LOCALE.LOCALESET."admin/user_groups.php";
include LOCALE.LOCALESET."user_fields.php";

// group is not selected
if(!isset($_GET['group_id'])){
$result = dbquery("
   SELECT group_id, group_name, group_description
   FROM ".DB_USER_GROUPS."
   ORDER BY group_name ASC;
");
opentable($locale['u057']);

if (dbrows($result)) {
   echo '';
   while ($data = dbarray($result)) {
      $group_id =             $data['group_id'];
      $group_name =          $data['group_name'];
      $group_description =    $data['group_description'];
      echo '
         
            
            
         
      ';
      }
   echo '
'.substr($locale['432'],0,-1).''.substr($locale['433'],0,-1).'
'.$group_name.''.$group_description.'
';
} else { echo "
No groups found.
\n"; }

closetable();
}

// group is selected
if(isset($_GET['group_id'])){
$result2 = dbquery("
         SELECT user_id, user_name, user_level, user_status
         FROM ".DB_USERS."
         WHERE user_groups REGEXP('^\\\.{$_GET['group_id']}$|\\\.{$_GET['group_id']}\\\.|\\\.{$_GET['group_id']}$')
         ORDER BY user_level DESC, user_name
");
     while($data = dbarray($result2)) {
      $group_name =          $data['group_name'];
      $group_description =    $data['group_description'];
      $user_id =             $data['user_id'];
      $user_name =          $data['user_name'];
      $user_type =         $data['user_status'];
      $tbody .=             ''.profile_link($data['user_id'], $data['user_name'], $data['user_status']).''.getuserlevel($data['user_level']).'';
}
opentable($locale['u110'].": ".$group_name." (".sprintf((dbrows($result2) == 1 ? $locale['u111'] : $locale['u112']), dbrows($result2)).")");
   echo '

'.$locale['433'].' '.$group_description.'

';
   echo ''.$tbody.'
'.$locale['446'].''.$locale['447'].'
';
closetable();
}

require_once THEMES."templates/footer.php";
?>
 
http://kaster.us
penehoff
Top  #16 Print Post
Posted on 04-28-2015 17:24
User Avatar

Member



Posts: 349
Joined: 11.24.14

It list the groups but when i click on each group it just takes me to the sites home page view  
http://unsignedandindependentbands.com/
KasteR
Top  #17 Print Post
Posted on 04-29-2015 15:55
User Avatar

Admin



Posts: 556
Joined: 04.16.12

Try to clear your browser cache. It's not doing that for me, on your site.  
http://kaster.us
penehoff
Top  #18 Print Post
Posted on 04-29-2015 17:19
User Avatar

Member



Posts: 349
Joined: 11.24.14

hmm cleared cache and nothing .. and tried different browsers and it still does the same thing

Tried re-copying the code too ..  
http://unsignedandindependentbands.com/
KasteR
Top  #19 Print Post
Posted on 04-29-2015 18:55
User Avatar

Admin



Posts: 556
Joined: 04.16.12

No problem, we'll get to the bottom of it. Paste the link you're using. Maybe I'm looking at the wrong page. Here's my link with the same code.
http://7dev.kaster.us/groups.php  
http://kaster.us
penehoff
Top  #20 Print Post
Posted on 04-29-2015 19:23
User Avatar

Member



Posts: 349
Joined: 11.24.14

http://unsignedandindependentbands.co...page_id=29  
http://unsignedandindependentbands.com/
Jump to Forum
Similar Threads
Thread Forum Replies Last Post
Different Homepage For Each User Group? Addon Requests 3 10-18-2017 12:06
Adding Selz Link to User Profile Addon Requests 1 10-14-2017 07:42
Any way to restrict individual forum posts by group? Addon Requests 2 05-08-2016 13:39
User Store help [7.02.XX] General Development 2 09-15-2015 03:49
User rights and Prilidges General Chat 11 01-23-2015 16:54