[ABD] Temporary Groups

Any abandoned MODs will be moved to this forum.

WARNING: MODs in this forum are not currently being supported or maintained by the original MOD author. Proceed at your own risk.
Forum rules
IMPORTANT: MOD Development Forum rules

WARNING: MODs in this forum are not currently being supported nor updated by the original MOD author. Proceed at your own risk.
User avatar
eunaumtenhoid
Registered User
Posts: 998
Joined: Wed Jun 03, 2009 12:46 am
Location: ????

Re: [DEV] Temporary Groups

Post by eunaumtenhoid »

NintendoMii wrote:
eunaumtenhoid wrote:nice^^
look:
a page where the User will select which group will participate and for how long.
u understand?
So when it's an open group, make users choose themselves how long they want to join?
yeah, on/off all on acp^^
My translations of the extensions for Brazilian Portuguese
https://github.com/phpBBTraducoes
NintendoMii
Registered User
Posts: 547
Joined: Thu Aug 04, 2011 9:08 pm

Re: [DEV] Temporary Groups

Post by NintendoMii »

eunaumtenhoid wrote:
NintendoMii wrote:
eunaumtenhoid wrote:nice^^
look:
a page where the User will select which group will participate and for how long.
u understand?
So when it's an open group, make users choose themselves how long they want to join?
yeah, on/off all on acp^^
I don't see clearly why, but maybe I'll add it in a future version.
User avatar
eunaumtenhoid
Registered User
Posts: 998
Joined: Wed Jun 03, 2009 12:46 am
Location: ????

Re: [DEV] Temporary Groups

Post by eunaumtenhoid »

NintendoMii wrote:
eunaumtenhoid wrote:
NintendoMii wrote:
eunaumtenhoid wrote:nice^^
look:
a page where the User will select which group will participate and for how long.
u understand?
So when it's an open group, make users choose themselves how long they want to join?
yeah, on/off all on acp^^
I don't see clearly why, but maybe I'll add it in a future version.
but, adm select the groups that will be displayed, times, and so entered the User Group if the adm approval, ok?

thkx man waiting for beta realese^^
My translations of the extensions for Brazilian Portuguese
https://github.com/phpBBTraducoes
NintendoMii
Registered User
Posts: 547
Joined: Thu Aug 04, 2011 9:08 pm

Re: [DEV] Temporary Groups

Post by NintendoMii »

eunaumtenhoid wrote:
NintendoMii wrote:
eunaumtenhoid wrote:
NintendoMii wrote:
eunaumtenhoid wrote:nice^^
look:
a page where the User will select which group will participate and for how long.
u understand?
So when it's an open group, make users choose themselves how long they want to join?
yeah, on/off all on acp^^
I don't see clearly why, but maybe I'll add it in a future version.
but, adm select the groups that will be displayed, times, and so entered the User Group if the adm approval, ok?

thkx man waiting for beta realese^^
It won't be done before tomorrow, sadly. I can't find the place where the auto ban expire gets handled, but I'll keep looking for it!
NintendoMii
Registered User
Posts: 547
Joined: Thu Aug 04, 2011 9:08 pm

Re: [DEV] Temporary Groups

Post by NintendoMii »

I finished the part that kicks the user out the group. Due it being a bit extreme to check every user on every page load time, I only made the current user check on each page asking for the user's permissions. Also, when visiting the viewtopic or viewprofile, the users being shown in there will get checked against membership.

I will put a beta for this up soon, and then I'm going to look for another way of handling this.
demon327
Registered User
Posts: 847
Joined: Thu Nov 16, 2006 2:16 pm

Re: [DEV] Temporary Groups

Post by demon327 »

NintendoMii wrote:I finished the part that kicks the user out the group. Due it being a bit extreme to check every user on every page load time, I only made the current user check on each page asking for the user's permissions. Also, when visiting the viewtopic or viewprofile, the users being shown in there will get checked against membership.

I will put a beta for this up soon, and then I'm going to look for another way of handling this.
Why not look at where the ban expire system is, and use that? *unsure*
NintendoMii
Registered User
Posts: 547
Joined: Thu Aug 04, 2011 9:08 pm

Re: [DEV] Temporary Groups

Post by NintendoMii »

demon327 wrote:
NintendoMii wrote:I finished the part that kicks the user out the group. Due it being a bit extreme to check every user on every page load time, I only made the current user check on each page asking for the user's permissions. Also, when visiting the viewtopic or viewprofile, the users being shown in there will get checked against membership.

I will put a beta for this up soon, and then I'm going to look for another way of handling this.
Why not look at where the ban expire system is, and use that? *unsure*
I was thinking of that first too, but the ban system only gets checked in the ACP and when logged in. Because banning someone doesn't change his group there is no need to make sure his group colour is changed in the memberlist, viewtopic and viewprofile. This is what makes it hard.
NintendoMii
Registered User
Posts: 547
Joined: Thu Aug 04, 2011 9:08 pm

Re: [BETA] Temporary Groups

Post by NintendoMii »

Beta is up, look in first post for download.
User avatar
Jessica
Former Team Member
Posts: 4342
Joined: Sun Jul 18, 2010 2:53 pm
Location: Pennsylvania, USA
Name: Jessica
Contact:

Re: [BETA] Temporary Groups

Post by Jessica »

I have this installed on my board: http://www.phpbb.com/community/viewtopi ... &t=1227605

but since it's abandoned...you're pretty much making a mod similar to that one?
Pro-choice, Atheist, Pro-LGBT rights
Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid. - Albert Einstein
NintendoMii
Registered User
Posts: 547
Joined: Thu Aug 04, 2011 9:08 pm

Re: [BETA] Temporary Groups

Post by NintendoMii »

No, you got it totally wrong. This mod will only make users member of a group till a certain date or time. Par example, I make you moderator till the 4th of December, and at the 4th of December you will be kicked out till an admin re-adds you. This is perfect for VIP groups to only have them being a VIP member for a month and then back a regular member.

I hope you get what I mean.
User avatar
Blue Blood
Registered User
Posts: 767
Joined: Sat Apr 11, 2009 7:09 am
Location: U§A
Name: Blue Blood
Contact:

Re: [BETA] Temporary Groups

Post by Blue Blood »

This will be a very useful mod!!

Thank you!!
demon327
Registered User
Posts: 847
Joined: Thu Nov 16, 2006 2:16 pm

Re: [BETA] Temporary Groups

Post by demon327 »

Automod install: Works
Mod: Does not work.

Error:

Code: Select all

Parse error: syntax error, unexpected T_ELSE in G:\wamp\www\mijnhdtv\includes\functions.php on line 1341
Call Stack
#	Time	Memory	Function	Location
1	0.0009	778176	{main}( )	..\index.php:0
2	0.0014	844752	include( 'G:\wamp\www\mijnhdtv\common.php' )	..\index.php:20
Error code block:

Code: Select all

}
		}

		return;
	}
// Temporary Groups: ADD
	function temp_membership_expire($user_id)
	{
		global $db;
		$sql = 'SELECT membership_till, group_id
				FROM ' . USER_GROUP_TABLE . '
				WHERE user_id = \'' . $user_id . '\'';
		$result = $db->sql_query($sql);
		while($row = $db->sql_fetchrow($result))
		{
			if ($row['membership_till'] && $row['membership_till'] > time())
			{
				/* We want to kick the user out the group, his membership is expired. */
				include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
				$user_id_ary[] = $user_id;
				$error = group_user_del($row['group_id'], $user_id_ary, false, false);
				if($error)
				{
					trigger_error($user->lang[$error], E_USER_WARNING);
				}
			}
		}
	}
// END Temporary Groups: ADD
	else if ($mode == 'topics')
	{
NintendoMii
Registered User
Posts: 547
Joined: Thu Aug 04, 2011 9:08 pm

Re: [BETA] Temporary Groups

Post by NintendoMii »

demon327 wrote:Automod install: Works
Mod: Does not work.

Error:

Code: Select all

Parse error: syntax error, unexpected T_ELSE in G:\wamp\www\mijnhdtv\includes\functions.php on line 1341
Call Stack
#	Time	Memory	Function	Location
1	0.0009	778176	{main}( )	..\index.php:0
2	0.0014	844752	include( 'G:\wamp\www\mijnhdtv\common.php' )	..\index.php:20
Error code block:

Code: Select all

}
		}

		return;
	}
// Temporary Groups: ADD
	function temp_membership_expire($user_id)
	{
		global $db;
		$sql = 'SELECT membership_till, group_id
				FROM ' . USER_GROUP_TABLE . '
				WHERE user_id = \'' . $user_id . '\'';
		$result = $db->sql_query($sql);
		while($row = $db->sql_fetchrow($result))
		{
			if ($row['membership_till'] && $row['membership_till'] > time())
			{
				/* We want to kick the user out the group, his membership is expired. */
				include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
				$user_id_ary[] = $user_id;
				$error = group_user_del($row['group_id'], $user_id_ary, false, false);
				if($error)
				{
					trigger_error($user->lang[$error], E_USER_WARNING);
				}
			}
		}
	}
// END Temporary Groups: ADD
	else if ($mode == 'topics')
	{
Seems like an edit has been done wrong, let me check if I didn't do a mistake in the MODX.
NintendoMii
Registered User
Posts: 547
Joined: Thu Aug 04, 2011 9:08 pm

Re: [BETA] Temporary Groups

Post by NintendoMii »

NintendoMii wrote:
demon327 wrote:Automod install: Works
Mod: Does not work.

Error:

Code: Select all

Parse error: syntax error, unexpected T_ELSE in G:\wamp\www\mijnhdtv\includes\functions.php on line 1341
Call Stack
#	Time	Memory	Function	Location
1	0.0009	778176	{main}( )	..\index.php:0
2	0.0014	844752	include( 'G:\wamp\www\mijnhdtv\common.php' )	..\index.php:20
Error code block:

Code: Select all

}
		}

		return;
	}
// Temporary Groups: ADD
	function temp_membership_expire($user_id)
	{
		global $db;
		$sql = 'SELECT membership_till, group_id
				FROM ' . USER_GROUP_TABLE . '
				WHERE user_id = \'' . $user_id . '\'';
		$result = $db->sql_query($sql);
		while($row = $db->sql_fetchrow($result))
		{
			if ($row['membership_till'] && $row['membership_till'] > time())
			{
				/* We want to kick the user out the group, his membership is expired. */
				include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
				$user_id_ary[] = $user_id;
				$error = group_user_del($row['group_id'], $user_id_ary, false, false);
				if($error)
				{
					trigger_error($user->lang[$error], E_USER_WARNING);
				}
			}
		}
	}
// END Temporary Groups: ADD
	else if ($mode == 'topics')
	{
Seems like an edit has been done wrong, let me check if I didn't do a mistake in the MODX.
EDIT: I see, it might be that it is conflicting with another modification installed. Undo the functions.php edits and redo them, but instead of using the find in the MODX, use ?> as find and add it before. I will fix it in version 0.0.3 or 0.1.0. (Depending on which one comes first. )

EDIT: EDIT: URG, I keep hitting the quote button instead of editing. :(
demon327
Registered User
Posts: 847
Joined: Thu Nov 16, 2006 2:16 pm

Re: [BETA] Temporary Groups

Post by demon327 »

The error is gone when i place it at the bottom of the file, a new error shows up:

Code: Select all

SQL ERROR [ mysqli ]

Unknown column 'membership_till' in 'field list' [1054]
Can't even run the install.php file because of the missing table ;)
Locked

Return to “[3.0.x] Abandoned MODs”