开发者

how change hook_user?

i need change hook user.I've inserted code in line 326 of user.module. it's work .db_query('INSERT INTO {beep} (uid) VALUES (%d)', $array['uid开发者_开发技巧']); Do not hack core! Please help me.


Make a custom module that implements hook_user() and wrap your code in a conditional so that it fires when you want it to:

function my_module_user($op, &$edit, &$account, $category = NULL) {
   if( /* condition goes here */) {
      /* Do some custom processing */
      db_query('INSERT INTO {beep} (uid) VALUES (%d)', $array['uid']);
   }
}

Look here http://drupal.org/developing/modules for details on creating your own modules.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜