Memberlist

What's happening at the Club. You can post your suggestions and ideas here, along with reports of any problems using the site.

Moderators: IMOC Moderators, IMOC Committee Members

Locked
michael
Posts: 6940
Joined: Mon Dec 13, 2004 10:34 pm
Location: Yorkshire

Memberlist

Post by michael »

Is there any way that the memberlist can be made searchable rather than just being able to order it in different ways?

Is it possible to add a "real name" field as well to aid in searches?
poyntesm

Re: Memberlist

Post by poyntesm »

OK so you want

1) Real Name for user
2) Searchable memberlist??

Anything else about the memberlist before I start?

Regards
Esmond
michael
Posts: 6940
Joined: Mon Dec 13, 2004 10:34 pm
Location: Yorkshire

Re: Memberlist

Post by michael »

Stop being so responsive to requests, I don't have a chance to give things the thought I should ;)

I can't think of anything else right now, at the moment I just get lost if I want to find someone in particular and know their real name and not their forum name - as time goes on and more people join it will get harder to find them..... ah that reminds me of something else afterall, the bit at the bottom where you can jump to certain pages 1 2 3 ... 12 13 14 etc - can that be made to show all pages or let you search by letter as well?

Maybe a search by car type so you can bring up all MK1s, MK2s etc? Not too fussed about that though :?
poyntesm

Re: Memberlist

Post by poyntesm »

User name thing I agree with so I will look to add that, although all registered users will need to go back and add it, plus for new users I do not think it should be required incase the do not want to give their name.

I can do the view all on one page and will look at the via letter sort as well. Just do not want to make it too difficult for the average user to understand.

Since we already have the car data stored we could do a sort by car as well.

Let me have a play over the next day or two and I will see what works best and get you have a look at it on the test site.
Sidewinder
Posts: 2766
Joined: Tue Dec 14, 2004 1:48 pm
Location: Wellingborough (or thereabouts)
Contact:

Re: Memberlist

Post by Sidewinder »

michael wrote:Is it possible to add a "real name" field as well to aid in searches?


An excellent feature IMHO, and would solve the naming problem at meets, i.e.

"I'm Fred Bloggs"

"Who?"

"Oh yeah, sorry, aka 'FB92GTS' on the IMOC forums" :D
Mk2 NA Rev1 -*- Mk2 Turbo Rev2 -*- Mk1 NA -*- Mk2 Turbo Rev 3 = all gone!
_______________________________________
"Cruisey, Sporty, more innovation, more adult. A Man In Dandism. Powered mid-ship specialty."
poyntesm

Re: Memberlist

Post by poyntesm »

OK...I will start to look at it today then.
poyntesm

Re: Memberlist

Post by poyntesm »

Right both these are now done.

Although that member search via letter was a right pig.

Michael,

Can you check out

http://www.13awingfield.com/imoc/forums/memberlist.php

Right two main changes. Basically you now have real name as a new field and below the first search you have every letter.

The letters perform as an addition filter to whatever sort you already have one. So if you are viewing by join date ( default) and then click "M" it will show by Join Date any username beginning with M

If you then change to 1/4 mile sort the letter sort is removed and all 1/4 mile users shown. Now if you click "M" it will show by 1/4 mile any username beginning with M.

That what you wanted? I really hope so as I have been pulling my hair out trying to get the SQL in the backend to perform as I wanted but think it works now.

Regards
Esmond
michael
Posts: 6940
Joined: Mon Dec 13, 2004 10:34 pm
Location: Yorkshire

Re: Memberlist

Post by michael »

Spot on sir :thumright:
poyntesm

Re: Memberlist

Post by poyntesm »

<Mr Burns voice>
Excellent
</Mr Burns voice>

Right I will look to bring this across as I agree it would be very useful
michael
Posts: 6940
Joined: Mon Dec 13, 2004 10:34 pm
Location: Yorkshire

Re: Memberlist

Post by michael »

The only addition I can think of would be a small explanation on how to use all the features :)
poyntesm

Re: Memberlist

Post by poyntesm »

Right this is now live...

As for explanation I am looking at updating the FAQ (http://www.imoc.co.uk/forums/faq.php) to content all the info on feature we have.

Enjoy.
poyntesm

Re: Memberlist

Post by poyntesm »

Fixed one small bug with the links at the bottom...if you filtered by "m" it would show 15 pages which was incorrect it should have only showed the M pages. It is fixed now.
poyntesm

Re: Memberlist

Post by poyntesm »

Right no complaints so guessing this suggestion is complete. I will look the thread. If any of you are interested some of the code for the letter filtering is below.


This gets the values when you select them.

Code: Select all

// alphanum Method
if &#40; isset&#40;$HTTP_GET_VARS&#91;'alphanum'&#93;&#41; || isset&#40;$HTTP_POST_VARS&#91;'alphanum'&#93;&#41; &#41; 
&#123; 
	$alphanum = &#40; isset&#40;$HTTP_POST_VARS&#91;'alphanum'&#93;&#41; &#41; ? htmlspecialchars&#40;$HTTP_POST_VARS&#91;'alphanum'&#93;&#41; &#58; htmlspecialchars&#40;$HTTP_GET_VARS&#91;'alphanum'&#93;&#41;;
	$alphanum = str_replace&#40;"\'", "''", $alphanum&#41;;
	switch&#40; $dbms &#41;
	&#123;
		case 'postgres'&#58;
			$alpha_where = &#40; $alphanum == 'num' &#41; ? "AND username !~ '^&#91;A-Z&#93;+'" &#58; "AND username ILIKE '$alphanum%'";
			$alpha_l = "$alphanum";
			break;

		default&#58;
			$alpha_where = &#40; $alphanum == 'num' &#41; ? "AND username NOT RLIKE '^&#91;A-Z&#93;'" &#58; "AND username LIKE '$alphanum%'";
			$alpha_l = "$alphanum";
			break;
	&#125;
&#125;
else
&#123;
	$alpahnum = '';
	$alpha_where = '';
&#125;


This setups the variables to display the letters to sort by and the links they are.

Code: Select all

//
// gets for alphanum
//
$alpha_range = array&#40;&#41;;
$alpha_letters = array&#40;&#41;;
$alpha_letters = range&#40;'A','Z'&#41;;
$alpha_start = array&#40;$lang&#91;'All'&#93;, '#'&#41;;
$alpha_range = array_merge&#40;$alpha_start, $alpha_letters&#41;;

$i = 0;
while&#40; $i < count&#40;$alpha_range&#41; &#41;
&#123;
	
	if &#40; $alpha_range&#91;$i&#93; != $lang&#91;'All'&#93; &#41;
	&#123;
		if &#40; $alpha_range&#91;$i&#93; != '#' &#41;
		&#123;
			$temp = strtolower&#40;$alpha_range&#91;$i&#93;&#41;;
		&#125;
		else
		&#123;
			$temp = 'num';
		&#125;
		$alphanum_search_url = append_sid&#40;$phpbb_root_path . "memberlist.$phpEx?mode=$mode&order=$sort_order&show=50&alphanum=$temp"&#41;;
	&#125;
	else
	&#123;
		$alphanum_search_url = append_sid&#40;$phpbb_root_path . "memberlist.$phpEx?mode=$mode&order=$sort_order&show=$show"&#41;;
	&#125;

	if &#40; &#40; $alphanum == $temp &#41; || &#40; $alpha_range&#91;$i&#93; == $lang&#91;'All'&#93; && empty&#40;$alphanum&#41; &#41; &#41;
	&#123;
		$alpha_range&#91;$i&#93; = '<b>' . $alpha_range&#91;$i&#93; . '</b>';
	&#125;

	$template->assign_block_vars&#40;'alphanumsearch', array&#40;
		'SEARCH_SIZE' => floor&#40;100/count&#40;$alpha_range&#41;&#41; . '%',
		'SEARCH_TERM' => $alpha_range&#91;$i&#93;,
		'SEARCH_LINK' => $alphanum_search_url&#41;
	&#41;;

	$i++;
&#125;

$hidden_fields = '<input type="hidden" name="start" value="' . $start . '">';
$hidden_fields .= '<input type="hidden" name="alphanum" value="' . $alphanum . '">';


This works out the number of pages your sort has produced.

Code: Select all

$sql = "SELECT count&#40;*&#41; AS total
		FROM " . USERS_TABLE . "
		WHERE user_id <> " . ANONYMOUS ." $alpha_where";

	if &#40; !&#40;$result = $db->sql_query&#40;$sql&#41;&#41; &#41;
	&#123;
		message_die&#40;GENERAL_ERROR, 'Error getting total users', '', __LINE__, __FILE__, $sql&#41;;
	&#125;

	if &#40; $total = $db->sql_fetchrow&#40;$result&#41; &#41;
	&#123;
		$total_members = $total&#91;'total'&#93;;

		if &#40; $alpha_l &#41;
		&#123;
		$pagination = generate_pagination&#40;"memberlist.$phpEx?mode=$mode&alphanum=$alpha_l&order=$sort_order", $total_members, $board_config&#91;'topics_per_page'&#93;, $start&#41;. '&nbsp;';
		&#125;
		else
		&#123;
		$pagination = generate_pagination&#40;"memberlist.$phpEx?mode=$mode&order=$sort_order", $total_members, $board_config&#91;'topics_per_page'&#93;, $start&#41;. '&nbsp;';
		&#125;
	&#125;
	$db->sql_freeresult&#40;$result&#41;;


Quiet sad really but I enjoyed doing that!!!
Locked

Return to “Club News and Announcements”