PDA

View Full Version : Member Location Stats Module


spirito
11-19-2004, 11:25 AM
This is my first post so apologies if its in the wrong section.

I have vbAdvanced cmps installed and I would like a module that lists all the UK Counties together with a count of how many members live in each County. I would also like the Counties grouped by a region header that is collapsible.

V | Region 1 20
County A 10
County B 3
County C 7
> | Region 2 36
> | Region 3 17

etc.

Each count would be a hyperlink that, when clicked, would run the advanced search in the memberlist and display all the members in that particular county.

I have created a single selection custom user profile field called county and populated it with all the County names. I can write a query in MySQL that groups by and counts the values in the userfield table, but that only returns counts for counties that have been selected by users. I would do a join on the profilefield table to get a list of all the counties but I have found that the list is stored in a single row.

I am still quite new to vbulletin, php and mysql so any help with creating this mod would be gratefully received!