Ported D5 custom "member hack" to D6 custom module

Committee or Team: 
Web Design
Component: 
nynj_custom
Version: 
Drupal 6 Test
Date: 
10/27/2010
Author(s): 
Visitor
Details: 
After porting the hook_menu() function from the D5 custom module to D6, I think I have worked out the member hack for D6. In the D5 custom module, the function nynj_custom_grant_member_role() calls two other functions: _role_action() which provides for changing a users role temporarily and _get_expiration_date() which provides for setting a timestamp. Neither of these functions are available in D6. I found what appears to be a reasonable substitute for _role_action() which was an ubercart function. The substitute is uc_roles_grant() which seems to provide what we want here. For the timestamp, I just used the php time() function and added 86400 (1 day) for testing purposes. This all seems to work for the checkout page in that a message is sent to the page from the function confirming the role change and the prices on the page change to the discounted prices but the cart block in the right sidebar does not reflect the discount.
Hours: 
3hours xx.x
Groups: