upgrade prob groupcp.php

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
Locked
User avatar
BMX DIRECT
Registered User
Posts: 201
Joined: Thu Oct 14, 2004 10:49 pm
Location: Poison city

upgrade prob groupcp.php

Post by BMX DIRECT » Fri Feb 22, 2008 11:29 pm

Im having a small problem finding this line in my groupcp.php file. ORDER BY aa.auth_mod DESC";
can someone help me find the correct line? part of the group.php file is below.
THANKS!

Mod file:

Code: Select all

#
#-----[ FIND ]---------------------------------------------
# Line 428
							SELECT aa.group_id 
							FROM " . AUTH_ACCESS_TABLE . " aa 
							WHERE aa.group_id = g.group_id  
						)
					)

#
#-----[ FIND ]---------------------------------------------
# Line 433
				ORDER BY aa.auth_mod DESC";

#
#-----[ REPLACE WITH ]---------------------------------------------
#
				ORDER BY auth_mod DESC";
#
#
#

snippet of my file:

Code: Select all


	//

	// For security, get the ID of the group moderator.

	//

	switch(SQL_LAYER)

	{

		case 'postgresql':

			$sql = "SELECT g.group_moderator, g.group_type, aa.auth_mod 

				FROM " . GROUPS_TABLE . " g, " . AUTH_ACCESS_TABLE . " aa 

				WHERE g.group_id = $group_id

					AND aa.group_id = g.group_id 

					UNION (

						SELECT g.group_moderator, g.group_type, NULL 

						FROM " . GROUPS_TABLE . " g

						WHERE g.group_id = $group_id

							AND NOT EXISTS (

							SELECT aa.group_id 

							FROM " . AUTH_ACCESS_TABLE . " aa 

							WHERE aa.group_id = g.group_id  

						)

					)";

			break;



		case 'oracle':

			$sql = "SELECT g.group_moderator, g.group_type, aa.auth_mod 

				FROM " . GROUPS_TABLE . " g, " . AUTH_ACCESS_TABLE . " aa 

				WHERE g.group_id = $group_id

					AND aa.group_id (+) = g.group_id";

			break;



		default:

			$sql = "SELECT g.group_moderator, g.group_type, aa.auth_mod 

				FROM ( " . GROUPS_TABLE . " g 

				LEFT JOIN " . AUTH_ACCESS_TABLE . " aa ON aa.group_id = g.group_id )

				WHERE g.group_id = $group_id";

			break;

	}

	if ( !($result = $db->sql_query($sql)) )

	{

		message_die(GENERAL_ERROR, 'Could not get moderator information', '', __LINE__, __FILE__, $sql);

	}



	if ( $group_info = $db->sql_fetchrow($result) )

	{

		$group_moderator = $group_info['group_moderator'];

	

		if ( $group_moderator == $userdata['user_id'] || $userdata['user_level'] == ADMIN )

		{

			$is_moderator = TRUE;

		}

User avatar
ric323
Former Team Member
Posts: 22909
Joined: Tue Feb 06, 2007 12:33 am
Location: Melbourne, Australia
Name: Ric
Contact:

Re: upgrade prob groupcp.php

Post by ric323 » Sat Feb 23, 2008 2:00 am

Your file has an extra blank line between every line, probably from using different settings for ASCII mode when uploading and downloading the file from your server.

The bit you want is right there, and the end of the 'postgresql' section

//

// For security, get the ID of the group moderator.

//

switch(SQL_LAYER)

{

case 'postgresql':

$sql = "SELECT g.group_moderator, g.group_type, aa.auth_mod

FROM " . GROUPS_TABLE . " g, " . AUTH_ACCESS_TABLE . " aa

WHERE g.group_id = $group_id

AND aa.group_id = g.group_id

UNION (

SELECT g.group_moderator, g.group_type, NULL

FROM " . GROUPS_TABLE . " g

WHERE g.group_id = $group_id

AND NOT EXISTS (

SELECT aa.group_id

FROM " . AUTH_ACCESS_TABLE . " aa

WHERE aa.group_id = g.group_id

)

)";

break;
The Knowledge Base contains solutions to many common problems!
How to fix "Doesn't have a default value" and "Incorrect string value: xxx for column 'post_text' " errors.
How to do a clean re-install of the latest phpBB3 version.
Problems with permissions? Read phpBB3 Permissions

User avatar
BMX DIRECT
Registered User
Posts: 201
Joined: Thu Oct 14, 2004 10:49 pm
Location: Poison city

Re: upgrade prob groupcp.php

Post by BMX DIRECT » Sat Feb 23, 2008 2:45 am

im sorry, i still dont get what your saying. im not a total noob at this- bt i cannot see what you are pointing out. Nothing matches up?!


this section:
SELECT g.group_moderator, g.group_type, NULL
FROM " . GROUPS_TABLE . " g
WHERE g.group_id = $group_id
AND NOT EXISTS (
SELECT aa.group_id
FROM " . AUTH_ACCESS_TABLE . " aa
WHERE aa.group_id = g.group_id
)
)";
break;
does not say anything like:
ORDER BY auth_mod DESC";

...so do i just remove the "aa." from that one section?

Crazy-S
Registered User
Posts: 138
Joined: Wed Feb 07, 2007 12:41 am
Contact:

Re: upgrade prob groupcp.php

Post by Crazy-S » Sat Feb 23, 2008 4:10 am

What you are looking for begins with the following code around line 413:

Code: Select all

//
	// For security, get the ID of the group moderator.
	//
	switch(SQL_LAYER)
	{
		case 'postgresql':
			$sql = "SELECT g.group_moderator, g.group_type, aa.auth_mod 
				FROM " . GROUPS_TABLE . " g, " . AUTH_ACCESS_TABLE . " aa 
				WHERE g.group_id = $group_id
					AND aa.group_id = g.group_id 
					UNION (
						SELECT g.group_moderator, g.group_type, NULL 
						FROM " . GROUPS_TABLE . " g
						WHERE g.group_id = $group_id
							AND NOT EXISTS (
							SELECT aa.group_id 
							FROM " . AUTH_ACCESS_TABLE . " aa 
							WHERE aa.group_id = g.group_id  
						)
					)
				ORDER BY aa.auth_mod DESC";
Just ignore the first bit of the find code and just look for the second find: and you should find it around line: 433
Visit Crazy-Software.com for some great personalized gift making software!

Like Personalized candy Wrappers? Then visit Our Community

User avatar
BMX DIRECT
Registered User
Posts: 201
Joined: Thu Oct 14, 2004 10:49 pm
Location: Poison city

Re: upgrade prob groupcp.php

Post by BMX DIRECT » Sat Feb 23, 2008 6:27 pm

Thanks for your guys input...i have added the line after what looks like is correct. Either the instructions are incorrect or very different different to my code or im just a noob and know jack.

Just to run it by you by again, this is what ive done, its as best as i can make out from your guys replies:

Code: Select all


  WHERE aa.group_id = g.group_id  
                  )
               )
            ORDER BY aa.auth_mod DESC";
thanks again

User avatar
Lumpy Burgertushie
Registered User
Posts: 66735
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: upgrade prob groupcp.php

Post by Lumpy Burgertushie » Sat Feb 23, 2008 9:05 pm

The whole reason for using the MOD style update is because your files have been changed by other MODS.

That means that there will be times that you will have to figure out where to put some edits called for in the update.

and of course, that is what we are here for.


robert
I'm baaaaaccckkkk. still doing work on donation basis. PM your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

Locked

Return to “2.0.x Support Forum”