Auto Groups

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in the Customisations Database.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTICE: This forum is only for the announcement of new releases and/or updates of MODs. Any MOD support should be obtained through the Customisations Database in the support area designated for each MOD.

A direct link to support for each MOD is in the first post of the respective topic.
pavobe
Registered User
Posts: 19
Joined: Mon Oct 29, 2007 4:27 pm
Location: Poland

Re: Auto Groups

Post by pavobe »

I have one special group for user with warnings.

I've got a small problem. Everything is set as 0, only "Min Warning Points" field is 3. I don't know why for example am I added to this group? I don't have any user, that should be in this group, but there have been 5 users so far. What do i do wrong?
Last edited by pavobe on Sat Nov 15, 2008 1:12 am, edited 1 time in total.
User avatar
A_Jelly_Doughnut
Former Team Member
Posts: 34459
Joined: Sat Jan 18, 2003 1:26 am
Location: Where the Rivers Run

Re: Auto Groups

Post by A_Jelly_Doughnut »

pavobe: You might try this fix from a user on the last page: http://www.phpbb.com/community/viewtopi ... 5#p4663105
A Donut's Blog
"Bach's Prelude (Cello Suite No. 1) is driving Indiana country roads in Autumn" - Ann Kish
pavobe
Registered User
Posts: 19
Joined: Mon Oct 29, 2007 4:27 pm
Location: Poland

Re: Auto Groups

Post by pavobe »

Thanks, I will try it.

Sorry, I know I could read last page, but reading so many pages in foreign language is hard for me.
moozer
Registered User
Posts: 102
Joined: Sat Nov 10, 2007 10:36 pm
Location: Netherlands

Re: Auto Groups

Post by moozer »

hi jelly :)

I have created a group with the following settings:
Minimum days of membership: 1
Maximum days of membership: 7

now it seems not all people who created a account last week get forced into this group,
also, and most important to me, random people wich are member for several months get forced into this group. i could be mistaken, but it seems everybody who logges into the website gets forced into this group.

can u please explain this?
Board at http://www.noobdude.com , Running phpbb3, Template(s) used: ProSilver, Language(s) used: English, Its hosted on a local server, Version of PHP used: 5.2.0, Database and version used: MySQL 5
User avatar
A_Jelly_Doughnut
Former Team Member
Posts: 34459
Joined: Sat Jan 18, 2003 1:26 am
Location: Where the Rivers Run

Re: Auto Groups

Post by A_Jelly_Doughnut »

moozer: I can't really explain that ... but does it work if you set the minimum days to 0 and the maximum days to 7?
A Donut's Blog
"Bach's Prelude (Cello Suite No. 1) is driving Indiana country roads in Autumn" - Ann Kish
rashy
Registered User
Posts: 58
Joined: Sun Dec 02, 2007 4:51 pm

Re: Auto Groups

Post by rashy »

Hi A_Jelly_Doughnut

Asking my question again :?

Can you please explain with screenshots of phpBB v3.0 how to create a new group say "new". Every newly registered member should go in this group, they have achieved the post count of 20 posts only then they could enter certain topics and upgraded to normal registered group :?:
Soory for asking this much cause i got it installed without any problem but am facing problems in using it :oops:
moozer
Registered User
Posts: 102
Joined: Sat Nov 10, 2007 10:36 pm
Location: Netherlands

Re: Auto Groups

Post by moozer »

A_Jelly_Doughnut wrote:moozer: I can't really explain that ... but does it work if you set the minimum days to 0 and the maximum days to 7?
I tried all the configurations i could think of, buet everytime the mod addad more people to the group than it should.
then i found this code (either in this topic, or the closed one in the "mods in progress" forum):

Code: Select all

                if ($user_id == ANONYMOUS)
                  {
                      continue;
                  }
  
                  // If there is no limit, skip it.
                  if ((int) $data['group_min_' . $column] == 0 && (int) $data['group_max_' . $column] == 0)
                  {
                      continue;
                  }
  
                  // If they are outside the thresholds ...
                  if (($data['group_min_' . $column] != 0 && $value < $data['group_min_' . $column]) ||
                      ($data['group_max_' . $column] != 0 && $value > $data['group_max_' . $column]))
                  {
                      $remove_groups[$group_id][] = $user_id;
                  }
                  else if ((($data['group_min_' . $column] != 0 && $value >= $data['group_min_' . $column]) ||
                            ($data['group_max_' . $column] != 0 && $value <= $data['group_max_' . $column])) &&
                           (!isset($remove_groups[$group_id]) || !in_array($user_id, $remove_groups[$group_id])))
                  {
                      $add_groups[$group_id][] = $user_id;
                  }
after replacing a part of the original code with this code, it works properly. everyday im checking if all the users are in the right group, cause after a few mistakes im not fully trusting it if u know what i mean ;) but for the last 2 days it now works like it should.

something else,
would it work if i add a similair code in it for the user_lastvisit row?
im not really good at writing code, but i can manage my way around and so i would like to try making a group for people who not visited the website for a perticular time...i think it could be very helpfull for many phpbb users aswell.
soooo, it would help me alot if u could let me know if im on the right track if i use similar codes used for the user_regdate part
Board at http://www.noobdude.com , Running phpbb3, Template(s) used: ProSilver, Language(s) used: English, Its hosted on a local server, Version of PHP used: 5.2.0, Database and version used: MySQL 5
moozer
Registered User
Posts: 102
Joined: Sat Nov 10, 2007 10:36 pm
Location: Netherlands

Re: Auto Groups

Post by moozer »

oke, it seems the "lastactive" group is doing its thing now..
people get forced into and out groups when they visit again right? so they will only get moved to the "not active group" when they visit again. is there a way to move them as soon as they hit the setted "lastactive" amount of days? even when they are not visiting the website?

edit.
i am confucing myself :P ofcourse people will not get moved to the "not active" group when they visit again, cause when they visit again, they are active again and the column get changed.. hehe, i really could use some help with this, so if anyone is in the mood for this ... :oops: :)
Board at http://www.noobdude.com , Running phpbb3, Template(s) used: ProSilver, Language(s) used: English, Its hosted on a local server, Version of PHP used: 5.2.0, Database and version used: MySQL 5
User avatar
soumik
Registered User
Posts: 486
Joined: Tue Nov 06, 2007 7:27 pm

Re: Auto Groups

Post by soumik »

Thank you, A_Jelly_Doughnut, for this wonderful mod. :)
Powered by chocolate
Dogginator
Registered User
Posts: 3
Joined: Mon Mar 17, 2008 3:37 pm

Re: Auto Groups

Post by Dogginator »

just forget it :D naturally blonde ... thanx ... :lol:

Moni
Who let the dogs out?
dogginator
mejane
Registered User
Posts: 4
Joined: Fri Nov 24, 2006 8:06 am

Re: Auto Groups

Post by mejane »

Thanks for the great MOD Jelly. Works fine once I realised I should clear cache following install ;)
CorporateGoth
Registered User
Posts: 10
Joined: Tue Nov 13, 2007 1:39 pm

Re: Auto Groups

Post by CorporateGoth »

Another bug I found which cropped up while trying to delete a topic:

Here is the existing code:

Code: Select all

          // because phpBB doesn't check if users are actually members of the group
          // before removing them, we check it before calling group_user_del()
          foreach ($remove_groups as $group_id => $user_id_ary)
          {     
              $remove_groups[$group_id] = implode(', ', $user_id_ary);
          }
            
          $sql = 'SELECT user_id, group_id FROM ' . USER_GROUP_TABLE . '
              WHERE ' . $db->sql_in_set('group_id', array_keys($remove_groups)) . '
              AND ' . $db->sql_in_set('user_id', array_values($remove_groups));
          $result = $db->sql_query($sql);
The problem is it creates code like "WHERE group_id = 236 AND user_id = 123, 456, 789"

Here is the corrected code:

Code: Select all

          // because phpBB doesn't check if users are actually members of the group
          // before removing them, we check it before calling group_user_del()
          $user_ids = array();
          foreach ($remove_groups as $group_id => $user_id_ary)
          {     
              $user_ids = array_merge($user_ids, $user_id_ary);
          }
            
          $sql = 'SELECT user_id, group_id FROM ' . USER_GROUP_TABLE . '
              WHERE ' . $db->sql_in_set('group_id', array_keys($remove_groups)) . '
              AND ' . $db->sql_in_set('user_id', $user_ids);
          $result = $db->sql_query($sql);
This properly puts all user ID's into an array so that the 'AND' condition is accurate.
ddeg10
Registered User
Posts: 180
Joined: Mon Oct 21, 2002 8:24 am

Re: Auto Groups

Post by ddeg10 »

Even with the fix discussed a few posts ago, I am still having issues.

My settings consist of the following:
Minimum days of membership: 730 (2 years)
Maximum days of membership: 0
Minimum post count: 100
Maximum post count: 0
Minimum warnings points: 0
Maximum warning points: 3
So basically I am making a "Senior Members" area where users who have been registered on the forum for 2 years, have at least 100 posts, and less than 3 warnings, will be granted access to this area. However, every time I set this criteria, after I check the group a few minutes later, there are users in this group who haven't even been members for 1 year yet. Is there a fix for this?
Last edited by ddeg10 on Thu Mar 27, 2008 7:47 pm, edited 1 time in total.
User avatar
david63
Registered User
Posts: 20646
Joined: Thu Dec 19, 2002 8:08 am

Re: Auto Groups

Post by david63 »

Should you not be setting Minimum post count = 100 and Maximum post count = 0?????
David
Remember: You only know what you know and - you don't know what you don't know!

I now no longer support any of my extensions but they will start to become available here
ddeg10
Registered User
Posts: 180
Joined: Mon Oct 21, 2002 8:24 am

Re: Auto Groups

Post by ddeg10 »

david63 wrote:Should you not be setting Minimum post count = 100 and Maximum post count = 0?????
Sorry, that was a typo - yes it is set to 100. I have edited the post.

Return to “[3.0.x] MOD Database Releases”