32
I have been hacking away at XM-Memberstats to show a list of users based on search criteria. I am also using Extended Profiles to manage users and the initial registration form. With Extended Profiles, you can add any number of custom fields, so you could add a dropdown, and then populate with all 50 states as options (all by using the Extended Profiles admin area - bit of a pain but it does work)
e.g.
1 - Alabama
2 - Arizona
Then you would have to hack XM-Memberstats to add a search form, with searching by state one of the criteria. This could be done with the xoopsformloader.php class - much like how other forms are built in xoops.
Then when you run your search, you would have to tweak the MySQL query to search the user_profiles tables for where state = '2' (for users in arizona).
Code would be something like this
Quote:
if ($_POST[state]) $querystate = $xoopsDB->prefix("user_profile").".state = '$_POST[state]."'";
else $querystate = 1;
$result = $xoopsDB->query("SELECT * FROM ".$xoopsDB->prefix("users")." INNER JOIN ".$xoopsDB->prefix("user_profile")." ON ".$xoopsDB->prefix("users").".uid=".$xoopsDB->prefix("user_profile").".profileid WHERE ".$xoopsDB->prefix("users").".level>0 AND $querystate");
Then loop through the users and display them. to do all this you would have to be comfortable creating a XOOPS search form, building a MySQL query from the search criteria, and looping through the results and displaying them. If not, then I dont think you should tackle it.
The XOOPS documentation on getting up to speed in developing forms using XOOPS classes is minimal and you kindof have to see how other modules display their forms and then replicate the code snippets.