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.
User avatar
katib
Registered User
Posts: 562
Joined: Thu Jun 26, 2008 12:27 pm

Re: Auto Groups

Post by katib »

Hi all
I am trying to make this Mod automatically put in a usegroup users who made a post in the last 7 days (active posters group)
I have the code for pulling last post time for a user

Code: Select all

      $sql = "SELECT MAX(post_time) AS last_post_time
            FROM " . POSTS_TABLE . "
            WHERE poster_id = " . $db->sql_escape($user->data['user_id']);
   
      $result = $db->sql_query($sql);
      $row = $db->sql_fetchrow($result);
      $db->sql_freeresult($result);
   
      $last_post_time = (int) $row['last_post_time'];
After several retries, I cant integrate it with code from includes/functions_autogroup

Code: Select all

	// if we have a list of user IDs, clean them up
	if (is_array($users))
	{
		$users = array_map('intval', $users);
	}

	if ($users === false)
	{
		$users = array($user->data['user_id']);

		$user_row[$user->data['user_id']] = $user->data;
		$check['posts'][$user->data['user_id']] = (int) $user->data['user_posts'];
		$check['days'][$user->data['user_id']] = (int) max(1, round((time() - $user->data['user_regdate']) / 86400));
		$check['warnings'][$user->data['user_id']] = (int) $user->data['user_warnings'];
	}
	else
	{
		// we need some info from the DB...to avoid possible SQL injection, we select *
		$sql = 'SELECT * FROM ' . USERS_TABLE .
			" WHERE " . $db->sql_in_set('user_id', $users);
		$result = $db->sql_query($sql);

		while ($row = $db->sql_fetchrow($result))
		{
			$user_row[$row['user_id']] = $row;
			$check['posts'][$row['user_id']] = (int) $row['user_posts'];
			$check['days'][$row['user_id']] = (int) max(1, round((time() - $row['user_regdate']) / 86400));
			$check['warnings'][$row['user_id']] = (int) $row['user_warnings'];
		}
	}
and this code:

Code: Select all

	$where_sql = $auto_add_users = array();
	// auto groups mod added
	if (!empty($group_attributes['group_min_posts']) || !empty($group_attributes['group_max_posts']) || !empty($group_attributes['group_min_days']) ||
		!empty($group_attributes['group_max_days']) || !empty($group_attributes['group_max_days']) || !empty($group_attributes['group_min_warnings']) || !empty($group_attributes['group_max_warnings']))
	{
		$field_ary = array(
			'posts'		=> 'user_posts',
			'days'		=> 'user_regdate',
			'warnings'	=> 'user_warnings',);
I've added all necessary edits to ither files...so Min last post time and Max last post time are showing in ACP
Any idea please
User avatar
Bon en er
I've Been Banned!
Posts: 80
Joined: Sun Mar 21, 2010 1:25 pm
Location: The Netherlands
Name: Mark
Contact:

Re: Auto Groups

Post by Bon en er »

What will this mean?
Kopieer bestanden
Kopieer: root/language/nl/mods/info_acp_auto_groups.php
Naar: language/nl/mods/info_acp_auto_groups.php

and SQL
CODE:SELECT ALL
ALTER TABLE phpbb_groups ADD group_min_posts MEDIUMINT(8) DEFAULT 0;
ALTER TABLE phpbb_groups ADD group_max_posts MEDIUMINT(8) DEFAULT 0;
ALTER TABLE phpbb_groups ADD group_min_warnings MEDIUMINT(8) DEFAULT 0;
ALTER TABLE phpbb_groups ADD group_max_warnings MEDIUMINT(8) DEFAULT 0;
ALTER TABLE phpbb_groups ADD group_min_days MEDIUMINT(8) DEFAULT 0;
ALTER TABLE phpbb_groups ADD group_max_days MEDIUMINT(8) DEFAULT 0;
ALTER TABLE phpbb_groups ADD group_auto_default TINYINT(1) DEFAULT 0;
ALTER TABLE phpbb_user_group ADD auto_group TINYINT(1) DEFAULT '0';
No support by: PM! Read: Board Rules|Rule 4e
Image
The Support Request Template Generator will make it easy to help you!
User avatar
Bon en er
I've Been Banned!
Posts: 80
Joined: Sun Mar 21, 2010 1:25 pm
Location: The Netherlands
Name: Mark
Contact:

Re: Auto Groups

Post by Bon en er »

BUMP
No support by: PM! Read: Board Rules|Rule 4e
Image
The Support Request Template Generator will make it easy to help you!
User avatar
katib
Registered User
Posts: 562
Joined: Thu Jun 26, 2008 12:27 pm

Re: Auto Groups

Post by katib »

Bon en er wrote:What will this mean?Kopieer bestandenKopieer: root/language/nl/mods/info_acp_auto_groups.phpNaar: language/nl/mods/info_acp_auto_groups.php
It means: copy root/language/nl/mods/info_acp_auto_groups.php
into language/nl/mods/info_acp_auto_groups.php

Then launch phpmyadmin, click on SQL
Copy, paste then excute the following queries:

Code: Select all

ALTER TABLE phpbb_groups ADD group_min_posts MEDIUMINT(8) DEFAULT 0;
ALTER TABLE phpbb_groups ADD group_max_posts MEDIUMINT(8) DEFAULT 0;
ALTER TABLE phpbb_groups ADD group_min_warnings MEDIUMINT(8) DEFAULT 0;
ALTER TABLE phpbb_groups ADD group_max_warnings MEDIUMINT(8) DEFAULT 0;
ALTER TABLE phpbb_groups ADD group_min_days MEDIUMINT(8) DEFAULT 0;
ALTER TABLE phpbb_groups ADD group_max_days MEDIUMINT(8) DEFAULT 0;
ALTER TABLE phpbb_groups ADD group_auto_default TINYINT(1) DEFAULT 0;
ALTER TABLE phpbb_user_group ADD auto_group TINYINT(1) DEFAULT '0';
pawelooss
Registered User
Posts: 48
Joined: Wed Nov 04, 2009 8:26 pm

Re: Auto Groups

Post by pawelooss »

Hello, I found a bug. (?)

Sometimes I see in ACP this strange admin logs...

Code: Select all

ZeroPostNewUser   Today 19:29   Members removed from usergroup "500postsToAutoAdd"   
» pawelooss, ThisGroup-Member

ZeroPostNewUser   Today 19:29   Group "500postsToAutoAdd" made default for members   
» pawelooss, ThisGroup-Member

ZeroPostNewUser   Today 19:29   Added new members to usergroup "500postsToAutoAdd"   
» pawelooss, ThisGroup-Member

ZeroPostNewUser   Today 19:29   Members removed from usergroup "500postsToAutoAdd"   
» pawelooss, ThisGroup-Member

ZeroPostNewUser   Today 19:29   Group "500postsToAutoAdd" made default for members   
» pawelooss, ThisGroup-Member

ZeroPostNewUser   Today 19:29   Added new members to usergroup "500postsToAutoAdd"   
» pawelooss, ThisGroup-Member

ZeroPostNewUser   Today 19:29   Members removed from usergroup "500postsToAutoAdd"   
» pawelooss, ThisGroup-Member

ZeroPostNewUser   Today 19:29   Group "500postsToAutoAdd" made default for members   
» pawelooss, ThisGroup-Member

ZeroPostNewUser   Today 19:29   Added new members to usergroup "500postsToAutoAdd"   
» pawelooss, ThisGroup-Member

ZeroPostNewUser   Today 19:29   Members removed from usergroup "500postsToAutoAdd"   
» pawelooss, ThisGroup-Member

ZeroPostNewUser   Today 19:29   Group "500postsToAutoAdd" made default for members   
» pawelooss, ThisGroup-Member

ZeroPostNewUser   Today 19:29   Added new members to usergroup "500postsToAutoAdd"   
» pawelooss, ThisGroup-Member
The already autoadding group members are chaotic removing and adding again many times (e.g. 4-10). WTF?

This loops are causing by accidental users, even newly registered. I haven't discovered yet what causes this loops (i.e. what are they doing, when the loops are executing), but it's evident error in script.

Please help! Thanks for advance!


Best regards,
pawelooss
phpBB3 fan! ;)
User avatar
Bon en er
I've Been Banned!
Posts: 80
Joined: Sun Mar 21, 2010 1:25 pm
Location: The Netherlands
Name: Mark
Contact:

Re: Auto Groups

Post by Bon en er »

katib wrote:
Bon en er wrote:What will this mean?Kopieer bestandenKopieer: root/language/nl/mods/info_acp_auto_groups.phpNaar: language/nl/mods/info_acp_auto_groups.php
It means: copy root/language/nl/mods/info_acp_auto_groups.php
into language/nl/mods/info_acp_auto_groups.php

Then launch phpmyadmin, click on SQL
Copy, paste then excute the following queries:

Code: Select all

ALTER TABLE phpbb_groups ADD group_min_posts MEDIUMINT(8) DEFAULT 0;
ALTER TABLE phpbb_groups ADD group_max_posts MEDIUMINT(8) DEFAULT 0;
ALTER TABLE phpbb_groups ADD group_min_warnings MEDIUMINT(8) DEFAULT 0;
ALTER TABLE phpbb_groups ADD group_max_warnings MEDIUMINT(8) DEFAULT 0;
ALTER TABLE phpbb_groups ADD group_min_days MEDIUMINT(8) DEFAULT 0;
ALTER TABLE phpbb_groups ADD group_max_days MEDIUMINT(8) DEFAULT 0;
ALTER TABLE phpbb_groups ADD group_auto_default TINYINT(1) DEFAULT 0;
ALTER TABLE phpbb_user_group ADD auto_group TINYINT(1) DEFAULT '0';
Thanks for you help!
No support by: PM! Read: Board Rules|Rule 4e
Image
The Support Request Template Generator will make it easy to help you!
kiore
Registered User
Posts: 91
Joined: Wed Aug 26, 2009 1:11 am

Re: Auto Groups

Post by kiore »

Ok i made sure everything was installed right but no matter what i put into the inputs nothing sticks it all goes back to 0
kiore
Registered User
Posts: 91
Joined: Wed Aug 26, 2009 1:11 am

Re: Auto Groups

Post by kiore »

also i don't under stand the Min and Max Is it Max they will be moved out and MIn they will be added?
suhaill
Registered User
Posts: 138
Joined: Sat Sep 26, 2009 7:42 pm

Re: Auto Groups

Post by suhaill »

my board 3.0.7-PL1
after instail this mod my users post not increase
only still same for example my user post 100
then my uers post 2 new show only 100 not show 102
how i do
User avatar
katib
Registered User
Posts: 562
Joined: Thu Jun 26, 2008 12:27 pm

Re: Auto Groups

Post by katib »

suhaill wrote:my board 3.0.7-PL1
after instail this mod my users post not increase
only still same for example my user post 100
then my uers post 2 new show only 100 not show 102
how i do
Your problem is not related with Auto Group Mod !!
Check ACP
under Forums ---> forum permissions
Choose a group
Advanced
then set increment post count
User avatar
katib
Registered User
Posts: 562
Joined: Thu Jun 26, 2008 12:27 pm

Re: Auto Groups

Post by katib »

Hi all
How this Mod update user's grouping?
every time a user log in?
or every time a user make a post?
When it runs, does it update all users or only the logged user?

Can we make it update infos every time a user visit index page?
User avatar
Praetorian Guard
Registered User
Posts: 789
Joined: Wed Oct 07, 2009 12:42 am

Re: Auto Groups

Post by Praetorian Guard »

First, will this MOD work with 3.07 PL-1?

Also, here is what I am trying to do, perhaps someone can tell me if this mod would work, or suggest another.

I have four groups (3 default - admin, reg users, mods) and one created group (private members). First, these groups are static, and I do not want anyone moving around groups without me approving them or manually setting them to a new group. What I am trying to do is isolate groups, but provide different ranks and images within said group. So for instance, I have reg user group. Based on posts, a user in this group will only be able to move up in RANK and RANK ICON, not group. So a reg user group could have 10 ranks associated with that group and based on their postings can move up the ranks (NOT GROUPS). I am also wondering if this mod would isolate the ranks from each group. So for instance, GROUP A could only use ranks/icon images 1-10, while GROUP B would only be able to use ranks/icon images 11-20 - no rank over lay between groups. Hope this makes sense. Any help appreciated. Thanks!!!
User avatar
Praetorian Guard
Registered User
Posts: 789
Joined: Wed Oct 07, 2009 12:42 am

Re: Auto Groups

Post by Praetorian Guard »

Bump!!
mbreezy
Registered User
Posts: 74
Joined: Sun Oct 04, 2009 1:11 pm

Re: Auto Groups

Post by mbreezy »

Will this work on 3.0.5?
farazhamzaa
Registered User
Posts: 128
Joined: Tue Mar 24, 2009 7:37 pm

Re: Auto Groups

Post by farazhamzaa »

i have installed this. and its working perfect.


i have create a group, when a member got 500 post then he added to that group.
But i want to exclude a member from this group but he have 500 post and whenever he becam online he automaticly again aded to that group.

so how can exclude that member to add in new group.
Locked

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