CCK + Contemplate for SOC Commits

Earlier on I posted a CCK diffs on a single file that worked with Drupal 5.x CCK modules.

This version is meant to link to Drupal.org's commit numbers. It's compatible with Drupal 6.x and CCK 6.x-2.0-rc4 and Contemplate 6.x-0.13.

CCK Field

Create an integer field in your desired content type with Number of values set to Unlimited.

My field name is field_commit.

Contemplate

The contemplate for the blog content type.

In general, depending on what you named the field, (My CCK field was named field_commit, you will have to change the name of that key (from field_commit to whatever you have).

<?php if(!empty($node->field_commit[0]['value'])) {
 
  $commitplural = (count($node->field_commit) > 1) ? "s" : "";
 
  $commits = array();
  foreach ($node->field_commit as $commit) {
    $commits[] = "<a href=\"http://drupal.org/cvs?commit=".$commit['value']."\">#".$commit['value']."</a>";
  }
 
  $commits = implode($commits, ", ");
  ?>
 
 
<div style="text-align:center">
<div style="clear:both; margin: 0px auto; ">
  <div style="padding: .25em; text-align: left; "><strong>Commit<?php print $commitplural ?></strong>
  <?php print $commits; ?></div>
</div>
</div>

<?php }
print $node->content['body']['#value']; ?>