[2.0.6] Rank in memberlist

The cleanup is complete. This forum is now read only.

Rating:

Excellent!
83
69%
Very Good
26
21%
Good
8
7%
Fair
1
1%
Poor
3
2%
 
Total votes: 121

netclectic
Former Team Member
Posts: 4439
Joined: Wed Mar 13, 2002 3:08 pm
Location: Omnipresent
Contact:

Post by netclectic »

What other mods have you installed?

There should only be one closing brace.

This bit...

Code: Select all

if ( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) ) 
{
should be closed right back at the start, like this...

Code: Select all

if ( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) )
{
	$mode = ( isset($HTTP_POST_VARS['mode']) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode'];
}
else
{
	$mode = 'joined';
}
Defend the game:
Image
Discordia
Registered User
Posts: 7
Joined: Thu Feb 13, 2003 11:57 am
Contact:

Post by Discordia »

Hi, this is getting interesting! I have no mods installed which edited the member pages.

My origibal code looks like this:

Code: Select all

if ( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) )
{
	$mode = ( isset($HTTP_POST_VARS['mode']) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode'];

	switch( $mode )
	{
		case 'joindate':
			$order_by = "user_regdate ASC LIMIT $start, " . $board_config['topics_per_page'];
			break;
		case 'username':
			$order_by = "username $sort_order LIMIT $start, " . $board_config['topics_per_page'];
			break;
		case 'location':
			$order_by = "user_from $sort_order LIMIT $start, " . $board_config['topics_per_page'];
			break;
		case 'posts':
			$order_by = "user_posts $sort_order LIMIT $start, " . $board_config['topics_per_page'];
			break;
		case 'email':
			$order_by = "user_email $sort_order LIMIT $start, " . $board_config['topics_per_page'];
			break;
		case 'website':
			$order_by = "user_website $sort_order LIMIT $start, " . $board_config['topics_per_page'];
			break;
		case 'topten':
			$order_by = "user_posts DESC LIMIT 10";
			break;
		default:
			$order_by = "user_regdate $sort_order LIMIT $start, " . $board_config['topics_per_page'];
			break;
	}
}
else
So I don't know how that got there :lol:
Perhaps something went wrong during the 2.0.3 to 2.0.4 update? Just guessing at this point....
Luciouslinda
Registered User
Posts: 190
Joined: Thu Dec 26, 2002 6:12 am
Location: Singapore
Contact:

Post by Luciouslinda »

Discordia wrote: Hi, this is getting interesting! I have no mods installed which edited the member pages.

My origibal code looks like this:

Code: Select all

if ( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) )
{
	$mode = ( isset($HTTP_POST_VARS['mode']) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode'];

	switch( $mode )
	{
		case 'joindate':
			$order_by = "user_regdate ASC LIMIT $start, " . $board_config['topics_per_page'];
			break;
		case 'username':
			$order_by = "username $sort_order LIMIT $start, " . $board_config['topics_per_page'];
			break;
		case 'location':
			$order_by = "user_from $sort_order LIMIT $start, " . $board_config['topics_per_page'];
			break;
		case 'posts':
			$order_by = "user_posts $sort_order LIMIT $start, " . $board_config['topics_per_page'];
			break;
		case 'email':
			$order_by = "user_email $sort_order LIMIT $start, " . $board_config['topics_per_page'];
			break;
		case 'website':
			$order_by = "user_website $sort_order LIMIT $start, " . $board_config['topics_per_page'];
			break;
		case 'topten':
			$order_by = "user_posts DESC LIMIT 10";
			break;
		default:
			$order_by = "user_regdate $sort_order LIMIT $start, " . $board_config['topics_per_page'];
			break;
}
So I don't know how that got there :lol:
Perhaps something went wrong during the 2.0.3 to 2.0.4 update? Just guessing at this point....


Add this after the above then

Code: Select all

// MOD RANK MEMBERLIST BEGIN 
$sql = "SELECT * 
FROM " . RANKS_TABLE . " 
ORDER BY rank_special, rank_min"; 
if ( !($result = $db->sql_query($sql)) ) 
{ 
message_die(GENERAL_ERROR, "Could not obtain ranks information.", '', __LINE__, __FILE__, $sql); 
} 
$ranksrow = array(); 
while ( $row = $db->sql_fetchrow($result) ) 
{ 
$ranksrow[] = $row; 
} 
$db->sql_freeresult($result); 
// MOD RANK MEMBERLIST END 

So it should look like this (See below)

Code: Select all

switch( $mode )
{
	case 'joined':
		$order_by = "user_regdate ASC LIMIT $start, " . $board_config['topics_per_page'];
		break;
	case 'username':
		$order_by = "username $sort_order LIMIT $start, " . $board_config['topics_per_page'];
		break;
	case 'location':
		$order_by = "user_from $sort_order LIMIT $start, " . $board_config['topics_per_page'];
		break;
	case 'posts':
		$order_by = "user_posts $sort_order LIMIT $start, " . $board_config['topics_per_page'];
		break;
	case 'email':
		$order_by = "user_email $sort_order LIMIT $start, " . $board_config['topics_per_page'];
		break;
	case 'website':
		$order_by = "user_website $sort_order LIMIT $start, " . $board_config['topics_per_page'];
		break;
	case 'topten':
		$order_by = "user_posts $sort_order LIMIT 10";
		break;
	default:
		$order_by = "user_regdate $sort_order LIMIT $start, " . $board_config['topics_per_page'];
		break;
}
// MOD RANK MEMBERLIST BEGIN
		$sql = "SELECT *
   			FROM " . RANKS_TABLE . "
   			ORDER BY rank_special, rank_min";
		if ( !($result = $db->sql_query($sql)) )
		{
   			message_die(GENERAL_ERROR, "Could not obtain ranks information.", '', __LINE__, __FILE__, $sql);
		}
		$ranksrow = array();
		while ( $row = $db->sql_fetchrow($result) )
		{
   		$ranksrow[] = $row;
		}
		$db->sql_freeresult($result);
// MOD RANK MEMBERLIST END
Mine now works fine!!
Last edited by Luciouslinda on Sun Feb 16, 2003 5:36 pm, edited 1 time in total.
Linda
netclectic
Former Team Member
Posts: 4439
Joined: Wed Mar 13, 2002 3:08 pm
Location: Omnipresent
Contact:

Post by netclectic »

Ok, it seems that section of code changed in 2.0.4

You should add the mod section of code after this...

Code: Select all

else
{
	$order_by = "user_regdate $sort_order LIMIT $start, " . $board_config['topics_per_page'];
}
Defend the game:
Image
Discordia
Registered User
Posts: 7
Joined: Thu Feb 13, 2003 11:57 am
Contact:

Post by Discordia »

netclectic wrote: Ok, it seems that section of code changed in 2.0.4


Solved! :lol:
Thanks a lot! :lol:
Luciouslinda
Registered User
Posts: 190
Joined: Thu Dec 26, 2002 6:12 am
Location: Singapore
Contact:

Post by Luciouslinda »

netclectic wrote: Ok, it seems that section of code changed in 2.0.4

You should add the mod section of code after this...

Code: Select all

else
{
	$order_by = "user_regdate $sort_order LIMIT $start, " . $board_config['topics_per_page'];
}


Well i have to say that i am running 2.0.4 and it is all ok, i had a fresh install of 2.0.4.

I was just blind and did not read the install script correctly. But once i saw my mistake and i found it, it now works fine! Your MOD is fine and a great one!
Linda
netclectic
Former Team Member
Posts: 4439
Joined: Wed Mar 13, 2002 3:08 pm
Location: Omnipresent
Contact:

Post by netclectic »

Yes, the instructions in the mod are fine for a clean install of 2.0.4 but in earlier versions the code was slightly different (as shown) and for some reason it appears not to have changed when doing an upgrade as opposed to a clean install.
Defend the game:
Image
Bradman
Registered User
Posts: 84
Joined: Mon Nov 11, 2002 6:39 am
Location: Ledyard, CT
Contact:

nice

Post by Bradman »

A very good mod, I like it. Worked perfectly the first try. I'd like to say thanks for adding in the bit about changing the colspan. I put it another mod that didn't, so it was nice to see it there.
Vokbain
Registered User
Posts: 10
Joined: Mon Feb 17, 2003 9:12 am
Location: The Future
Contact:

Post by Vokbain »

Great mod, but is it supposed to create a sort method for rank or not? If it is, then it isnt working right :P. If it isn't, then can anybody tell me how to do that?
netclectic
Former Team Member
Posts: 4439
Joined: Wed Mar 13, 2002 3:08 pm
Location: Omnipresent
Contact:

Post by netclectic »

No, i doesn't add a sort method for the rank.
Maybe in the next version.
Defend the game:
Image
LuigiMan89
Registered User
Posts: 17
Joined: Sat Feb 15, 2003 1:04 am

Post by LuigiMan89 »

For some reason people's special ranks aren't showing up. The rank they would have if they didn't have a special rank is showing up instead. How do I solve this?
AbelaJohnB
Former Team Member
Posts: 5674
Joined: Fri Jul 06, 2001 11:56 pm

Post by AbelaJohnB »

MOD Updated To Version: 1.0.1
See initial post for latest download.
floatempole
Registered User
Posts: 3
Joined: Mon Mar 24, 2003 1:45 am

Post by floatempole »

Hello All!

I am a newbie to this and I have to ask you the following questions about installing mods. HOW DO YA DO IT?? 8O I cannot install ANYTHING. I cannot find ANYTHING about how to install mods. The mods themselves come with NO INSTRUCTIONS on what to put WHERE. I am just going APE**** over this MOD stuff! Can ANYONE HELP? :cry:
netclectic
Former Team Member
Posts: 4439
Joined: Wed Mar 13, 2002 3:08 pm
Location: Omnipresent
Contact:

Post by netclectic »

All the mods in the mods database come with full instructions. You might want to read this... [Tutorial] How to install a MOD
Defend the game:
Image
User avatar
Jools
Former Team Member
Posts: 1567
Joined: Sun Dec 01, 2002 5:06 pm
Location: UK

Post by Jools »

I have just installed this, and voted excellent :D
I justed wanted to say thanks, it is a great Mod, excellent job 8)
Cheers
Julie :)
no support via PM
Knowledge Base
Post Reply

Return to “[2.0.x] MOD Database Cleanup”