开发者

how change hook_user?

开发者 https://www.devze.com 2023-02-17 12:19 出处:网络
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开发者_开发技巧\']);

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

精彩评论

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