This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

Change default field values on user registration screen

I'm trying to implement a payment system using 2Checkout. (Yes, I tried the e-commerce mod and it didn't do what I needed.) Everything is working great except that I can't figure out how to set the default field values on the user registration screen. What I want to do is take the data from their transaction over on 2checkout's site and populate the fields on the drupal registration screen with email and name. 2Checkout passes all the field values to my server when the customer is finished.

I think I know how to use php to grab the values ($_POST['username_from_2checkout']). What I need to know is where to put that value in drupal to have it show up on the registration screen in the Username: field.

I thought it would be in user.module around line 1025-26:

$default = form_textfield(t('Username'), 'name', $edit['name'], 30, 64, t('Your full name or your preferred username; only letters, numbers and spaces are allowed.'), NULL, TRUE);
$default .= form_textfield(t('E-mail address'), 'mail', $edit['mail'], 30, 64, t('A password and instructions will be sent to this e-mail address, so make sure it is accurate.'), NULL, TRUE);

But it is not obvious to me where to put it. When I view source I see:

Clearly, there is a call on this somewhere else that formats the true html.

Request to drupal using xmlHttpRequest

Hello users..

I'm building new modules.. in this modules i'm requesting to other drupal site using xmHttRequest, but i want return from the other drupal site only body content of the especific node.

Sorry my english..

Any help
VR72

ecommerce: your wishlist

Dear All,
Please give me your wish list for ecommerce. Next week I'll be at the drupal conference. I'll try to talk to developers after enhancing the module, to include automatic debiting for paid memberships and to manage more than one role. see node 47263. I've spent a lot of time trying to get paypal subscription to work. see node 44295 but I just installed ecommerce yesterday.

Overhead of hook system in module calls

My fellow drupal developers,

I am planning to extend a module to include aditional functionalities. I am pondering between inserting this new functionality either in a extra php file which the module includes, or to add new hooks to the module that then calls the implementing module.

I am aware the second option seems the most desirable, but how much overhead does the hook system adds, if the hook is made in a place where multiple call to it can be made per page request (up to 20 requests)?

Could someone give me an advice on the best approach?

_user hook: when does a uid get assigned?

I'm creating a module that needs to know the uid of a new user to update a db table. I've tried placing my SQL call in the 'validate' and 'insert' sections of hook_user, but neither work: in validate I get a uid of 0, in insert I don't get a uid at all.

Any help on this? The life-cycle documentation for many of the hooks with operation arguments is pretty poorly documented. I'm not even sure that $user or $edit is valid in a hook_user 'insert'.

Thanks

does anyone have a php function - to build a CSS ID selector from a node name?

Does anyone have php code to build a CSS ID selector from a simple node url?

it would convert a node in the form

"node/subnode/subsubnode/subsubsubnode"

into:

"node-subnode-subsubnode-subsubsubnode"

So that the resultant string could be inserted into the output html with a css ID selector on every node drupal displays.

This function would go into the

node.tpl.php file of a phptemplate theme

So that certain desired nodes in pages produced by the theme could be styled in the style.css with the node unique ID selectors:

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions