As you just want to remove that text, then you can say to Drupal not to show that information: Go to admin/build/themes/settings, and de-select the content types for which you don't want to show that string. In the screenshot, the "submitted by" information is not shown for the "Page" content type, but it is shown for the other content types.
If you wanted to alter the string basing on some criteria, and use (for example) a different string basing on the content then you could alter the theme function called when Drupal (or any modules) call theme("node_submitted", $node)
, which means you would need to implement hook_theme_registry_alter(), using code similar to the following one:
function mymodule_theme_registry_alter(&$theme_registry) {
if (isset($theme_registry['node_submitted'])) {
$theme_registry['node_submitted']['function'] = 'theme_mymodule_node_submitted';
}
}
If you only want to use a different string, that is always used instead of "Submitted by !username on @datetime," there are easier alternatives:
- Using the String Overrides module you can replace any string a module passes to
t()
with another string you prefer.
Adding the following code in settings.php you can obtain the same result.
$conf['locale_custom_strings_en'] = array(
'Submitted by !username on @datetime' => 'The string you want to use',
);
The pro of the second method is that you don't need to use another module, but you need to alter the settings.php, which is not as easy as the first method.
Between using a theme function in a theme, and using a module, I would rather use a module, as it doesn't require to change the used theme; in the case the users are able to set a theme for themselves, this means not altering all the selectable themes. The other pro is that, in the case you want to use the original string, you just need to disable the module.