I'm a PHP and CSS novice, trying to tweak a 5.1 install using the Zen theme.

I have two questions, if anyone is inclined to help.

1. I'd like to use the service_links module, but I'm having problems understanding the installation instructions.

From the README:

   Include service links in your theme:
   -----------------------------------
   In the included template.php file there are an example how to insert
   the service links in to a PHPTemplate theme. Remember to place the
   template.php file in the folder of your theme.

Zen includes a template.php file in the theme folder already, so I can't just overwrite with the service_links version. And I've tried inserting selected text from the service_links template.php into the zen template.php, but I'm not having any luck. Any guidance as to exactly how I should move forward with installation is greatly appreciated.

2. The default "posted by..." information for the Zen theme includes the date of content creation, but not a timestamp. For example, on a blog-entry or comment, it reads: "Posted February 15th, 2007 by..."

How can I modify that to include a timestamp as well, so that it will read "Posted February 15th, 2007 at 10:14:00 AM by..."?

I've looked in node.tpl.php, and I've tried to tweak this line:

<?php if ($submitted): ?>
    <span class="submitted"><?php print t('Posted ') . format_date($node->created, 'custom', "F jS, Y") . t(' by ') . theme('username', $node); ?></span> 
  <?php endif; ?>

I had no luck tweaking that.

I've also looked in comment.tpl.php and found this line:

<?php print t('On ') . format_date($comment->timestamp, 'custom', 'F jS, Y'); ?> <?php print theme('username', $comment) . t(' says:'); ?>

I've modified both of those calls, but I've not been able to produce any changes whatsoever. I've also played with the "Display post information on..." settings under Adminiser --> Themes --> Global Settings and not had any success with that, either.

I'd appreciate any advice that could be given in regards to either of these questions.

Thank you!

Comments

dman’s picture

Copying the content of the sample template.php file into yours IS the right thing to do. You will probably also have to rename the functions so they start with the name of your theme
I don't know service_links , but I'll guess service_links_funcname() becomes zen_funcname().

That's normal for theme customizing.

Check the docs for date formatting
and make your custom version in that third parameter

 format_date($comment->timestamp, 'custom', 'F jS, Y h:i:s A'); 

.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/

gordyhulten’s picture

Thank you - both your solutions worked!