richy96
11-04-2010, 10:00 PM
Hi
I need to make another mod to my site
What I need to do now is organize the member list (memberlist.php results) into the order of last logged in
The reason is I have a lot of mods to the member search facilities - this is because on my site members actually do search for and meet each other ;)
Now some parts of my memberlist.php are already modified by a third party who is now absent so I am not always 100% sure what is original vb code and what isn't but from what I can see from my site is that memberlist.php code builds an array $userinfo[] which contains all the members - and these are in the order in which the members registered (userid i guess)
The modified code then checks each member in $userinfo[] array (using data provided by the searching user from a custom search page that allows search on any combination of custom use fields) and rejects those that do not meet the search parameters. It then returns the results in another array
This is all working OK but as the site gets bigger the returned results are too many now if the user specifies a very broad search parameter
So what I need to do is get this $userinfo[] array sorted by last logged in, and then run the search filter and return the first couple of hundred hits only (or less if f there are not that many) that match the specific search from the total membership. Then at least the results show the most active (recent log in) members first
I could I guess write code to sort the $userinfo[] array into the desired order and then search the resulting array and limit how many I return to the user - but I guess it would be more efficient to build the array in the desired 'last visit' order in the first place by modifying the sql that builds it ???
But this is where i need some guidance as I am not a very experienced programmer (self taught in fact) so I would really appreciate a prod in the right direction of achieving this
SO the main question is - what sql builds this array?
Please feel free to check out my site 'Search For members' page to see how things are working now - don't forget to click 'advanced search' option if you do. The link is in my sig.
thanks
Rich
I need to make another mod to my site
What I need to do now is organize the member list (memberlist.php results) into the order of last logged in
The reason is I have a lot of mods to the member search facilities - this is because on my site members actually do search for and meet each other ;)
Now some parts of my memberlist.php are already modified by a third party who is now absent so I am not always 100% sure what is original vb code and what isn't but from what I can see from my site is that memberlist.php code builds an array $userinfo[] which contains all the members - and these are in the order in which the members registered (userid i guess)
The modified code then checks each member in $userinfo[] array (using data provided by the searching user from a custom search page that allows search on any combination of custom use fields) and rejects those that do not meet the search parameters. It then returns the results in another array
This is all working OK but as the site gets bigger the returned results are too many now if the user specifies a very broad search parameter
So what I need to do is get this $userinfo[] array sorted by last logged in, and then run the search filter and return the first couple of hundred hits only (or less if f there are not that many) that match the specific search from the total membership. Then at least the results show the most active (recent log in) members first
I could I guess write code to sort the $userinfo[] array into the desired order and then search the resulting array and limit how many I return to the user - but I guess it would be more efficient to build the array in the desired 'last visit' order in the first place by modifying the sql that builds it ???
But this is where i need some guidance as I am not a very experienced programmer (self taught in fact) so I would really appreciate a prod in the right direction of achieving this
SO the main question is - what sql builds this array?
Please feel free to check out my site 'Search For members' page to see how things are working now - don't forget to click 'advanced search' option if you do. The link is in my sig.
thanks
Rich