How to override a theme function? I'm using LoginToboggan as my login page, and on the login form, it has: "You are not logged in." I want to be able to edit this text, and the admin interface doesn't give an option to do so.

Searching around, I see that this is set in the LoginToboggan module in a theme function:

function theme_lt_unified_login_page($variables) {
...
$output .= '&lt;div id="login-message"&gt;' . t('You are not logged in.') . '&lt;/div&gt;';
...
}


So I can't edit the module directly, nor would I wish to "patch" it. I see that theme_lt_unified_login_page is called by:

function logintoboggan_unified_login_form($active_form = 'login') {
...
$output = theme('lt_unified_login_page', $variables);
...
}


I don't really understand what hook I would use to intercept and override / edit just this text? It doesn't appear in the $form object.
The quickest way might be/would be to copy...

/**
 * Theme function for unified login page.
 *
 * @ingroup themable
 */
function theme_lt_unified_login_page($variables) {

  $login_form = $variables['login_form'];
  $register_form = $variables['register_form'];
  $active_form = $variables['active_form'];
  $output = '';

  $output .= '&lt;div class="toboggan-unified ' . $active_form . '"&gt;';

  // Create the initial message and links that people can click on.
  $output .= '&lt;div id="login-message"&gt;' . t('You are not logged in.') . '&lt;/div&gt;';
  $output .= '&lt;div id="login-links"&gt;';
  $output .= l(t('I have an account'), 'user/login', array('attributes' =&gt; array('class' =&gt; array('login-link'), 'id' =&gt; 'login-link')));
  $output .= ' ';
  $output .= l(t('I want to create an account'), 'user/register', array('attributes' =&gt; array('class' =&gt; array('login-link'), 'id' =&gt; 'register-link')));

  $output .= '&lt;/div&gt;';

  // Add the login and registration forms in.
  $output .= '&lt;div id="login-form"&gt;' . $login_form . '&lt;/div&gt;';
  $output .= '&lt;div id="register-form"&gt;' . $register_form . '&lt;/div&gt;';

  $output .= '&lt;/div&gt;';

  return $output;
}


to your theme's template.php file and rename it...

/**
 * Theme function for unified login page.
 *
 * @ingroup themable
 */
function YOURTHEME_lt_unified_login_page($variables) {

  $login_form = $variables['login_form'];
  $register_form = $variables['register_form'];
  $active_form = $variables['active_form'];
  $output = '';

  $output .= '&lt;div class="toboggan-unified ' . $active_form . '"&gt;';

  // Create the initial message and links that people can click on.
  $output .= '&lt;div id="login-message"&gt;' . t('PLACE YOUR CUSTOM MESSAGE HERE.') . '&lt;/div&gt;';
  $output .= '&lt;div id="login-links"&gt;';
  $output .= l(t('I have an account'), 'user/login', array('attributes' =&gt; array('class' =&gt; array('login-link'), 'id' =&gt; 'login-link')));
  $output .= ' ';
  $output .= l(t('I want to create an account'), 'user/register', array('attributes' =&gt; array('class' =&gt; array('login-link'), 'id' =&gt; 'register-link')));

  $output .= '&lt;/div&gt;';

  // Add the login and registration forms in.
  $output .= '&lt;div id="login-form"&gt;' . $login_form . '&lt;/div&gt;';
  $output .= '&lt;div id="register-form"&gt;' . $register_form . '&lt;/div&gt;';

  $output .= '&lt;/div&gt;';

  return $output;
}


...along with whatever you wanted that login-message to be.  Clear caches/theme registry and you should be on your way.

ADDITION:

This drupal fu works because, instead of calling theme_lt_unified_login_page() directly, it does it like this:

$output = theme('lt_unified_login_page', $variables);


and it is the theme() function that does the magic in that when you build the theme registry, it will discover that there is a YOURTHEME_lt_unified_login_page() function out there, and will call that as an override to the theme_lt_unified_login_page() one that logintoboggan provides.  

(Note that the first argument doesn't start with theme_ or YOURTHEME_, one of these are prepended by the theme system as described above.)