• Top class table-less, CSS designs
  • Highly optimized for performance
  • Various theme configuration options
  • Themes with installation profile
  • Free E-mail support
PSD to Drupal
PSD to Drupal

Get your design converted into world class Drupal theme by Drupal experts. Our PSD to Drupal service starts from just $599.

More details

User login

Recent comments

Modify node submitted information, remove author name from post information.

In this article I am going to show you how to modify Drupal submitted information by editing your template.php file from your theme directory.

By default, Drupal's node info is shown like this Submitted by author_name on Thu, 06/05/2008 - 17:20. We will first change it to author_name on monday 06/05/2008 then we will remove author name and change it to Posted on Thu 6/5/2008. By doing this you will know the basic concept of this function.

To print submitted information on node, Drupal themes uses $submitted variable on theme's node.tpl.php file. Drupal take this variable as argument (timestamp of node) to a hook functiontheme_node_submitted($node) which manipulates the argument and return it. We will modify this function in our template.php to achieve our goals. We will make use of php date function.

First lets change it to author_name on monday 06/05/2008.
In your template.php file add this code:

function phptemplate_node_submitted($node) {
  return t('!username on @day @datetime',
    array(
      '!username' => theme('username', $node),
	  // Here you need little php date function knowledge.
	  '@day' => format_date($comment->timestamp,'custom','l'),
      '@datetime' => format_date($comment->timestamp,'custom','m/d/y'),
    ));
}

Now lets remove the author name from and make it Posted on 6/5/2008.
In your template.php file add this code:

function phptemplate_node_submitted($node) {
  return t('Posted on @day @datetime',
    array(
      // '!username' => theme('username', $node),
      '@day' => format_date($comment->timestamp,'custom','D'),
      '@datetime' => format_date($comment->timestamp,'custom','m/d/y'),
    ));
}

Now if your know ledge of php date function is good, you can change your submitted info to practically anything.

Comments on this post

Codo

Very Useful information , this is both good reading for, have quite a few good key points, and I learn some new stuff from it too, thanks for sharing your information.

regards,
handbags

Don B

I prefer working with Joomla the easiest most robust CMS out The admin panel is a breeze article posting is super easy and with all the modules like CB and Virtumart there is very little limit to what you can do in Joomla

Mike

Any way to do this on particular nodes?

e.g. I have a block that I am inserting into my page node content via php snippet, but the submitted information for that block (webform block) is popping up.. i want it gone completely.

Guest

in template header i want change my logo can any one help me,
mobile kitchen rental

Custom Project

If you are looking for a Custom Drupal theme or Drupal project developer, you can contact us to get a quote.

Contact

Theme customization

We offer affordable Drupal theme customization service. You can use this service to let us customize your theme.

Drupal organization member
Paypal verified

Recent Free Themes

Recent Articles