How do I create custom tokens? Possible Duplicate:
  Programmatically create a token  




How do I create custom tokens?  Also, is it possible to attach a token to a callback function?  For example: If my string is 'this is my [name]', can I somehow make it so that [name] will be replaced with the return value of a function?
Take a look this link: token.inc
What you need is to create a module that implements hook_tokens and hook_token_info.