On Wed, Mar 19, 2008 at 10:53:41AM -0400, Loui wrote:
Daaaamn. I knew it was pretty bad but I don't remember noticing that one. I'm not a huge fan of the wrecking ball approach anymore though... I've come to realise that it can be a real pain to figure out what's going on and it's a lot easier to test and be confident of small changes. But lots of small changes add up!
Well, a little progress update. The first half hour was spent swearing (alot) and documenting every single request variable the function deals with. This is probably useful to you guys as well... /* pkg_search_page(SID) * outputs the body of search/search results page * * parameters: * SID - current Session ID * preconditions: * package search page has been accessed * request variables have not been sanitized * * request vars: * O - starting result number * PP - number of search hits per page * L - package location ID number * C - package category ID number * K - package search string * SO - search hit sort order: * values: a - ascending * d - descending * SB - sort search hits by: * values: l - package location * c - package category * n - package name * v - number of votes * m - maintainer username * SeB- property that search string (K) represents * values: nd - package name&description * m - package maintainer's username * s - package submitter's username * do_MyPackages - boolean. whether to only include * logged in's packages * do_Orphans - boolean. whether to search packages * without a maintainer * do_Search - boolean. whether to execute a search * * * These two are actually handled in packages.php. * * IDs- integer array of ticked packages' IDs * action - action to be taken on ticked packages * values: do_Flag - Flag out-of-date * do_UnFlag - Remove out-of-date flag * do_Adopt - Adopt * do_Disown - Disown * do_Delete - Delete * do_Notify - Toggle notification */