? .DS_Store
? notices_cleanup.patch
? headers/.DS_Store
? headers/Super_Monkey_Ball.jpg
Index: nitobe_utils.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/themes/nitobe/nitobe_utils.php,v
retrieving revision 1.2
diff -u -p -r1.2 nitobe_utils.php
--- nitobe_utils.php	25 Jun 2008 14:06:53 -0000	1.2
+++ nitobe_utils.php	25 Jun 2008 16:59:03 -0000
@@ -6,7 +6,7 @@
 
 define('NITOBE_CACHE_HDR', 'nitobe.headers.list');
 define('NITOBE_HEADER_PATH', drupal_get_path('theme', 'nitobe') . '/headers');
-define('NITOBE_HEADER_IMG_MASK', 
+define('NITOBE_HEADER_IMG_MASK',
        '.+\.jpg$|.+\.JPG$|.+\.jpeg*|.+\.JPEG*|.+\.gif$|.+\.GIF$|.+\.png$|.+\.PNG$');
 
 /**
@@ -16,33 +16,33 @@ define('NITOBE_HEADER_IMG_MASK', 
  *    1. '/' is replaced with ' / '
  *    2. '_' is replaced with ' '.
  *    3. '.***' extension is removed.
- * 
+ *
  * @param $refresh bool If TRUE, reload the image list and flush the cached
  *        version.
- * 
+ *
  * @return array
  */
 function _nitobe_get_header_list($refresh = FALSE) {
   $cached = cache_get(NITOBE_CACHE_HDR);
-  $files = ($cached != 0) ? $cached->data : NULL;
-  
+  $files = (!empty($cached)) ? $cached->data : NULL;
+
   if (($files == NULL) OR ($refresh == TRUE)) {
     $files = file_scan_directory(NITOBE_HEADER_PATH,
-                                 NITOBE_HEADER_IMG_MASK, 
+                                 NITOBE_HEADER_IMG_MASK,
                                  array('.', '..', 'CVS', '.svn'));
     foreach ($files as $filename => $data) {
       $name = substr($filename, strlen(NITOBE_HEADER_PATH) + 1);
       $name = preg_replace('/\//', ' / ', $name);
       $name = preg_replace('/_/', ' ', $name);
       $name = preg_replace('/\.(\w{3,4}$)/', '', $name);
-      
+
       $data->pretty_name = $name;
     }
-    
+
     // Cache the list for a week.
     cache_set(NITOBE_CACHE_HDR, $files, 'cache', time() + 604800);
   }
-  
+
   return $files;
 }
 
@@ -54,25 +54,25 @@ function _nitobe_get_header_list($refres
  */
 function _nitobe_random_header_js() {
   global $base_url;
-  
+
   $files = _nitobe_get_header_list();
   $names = array();
-  
+
   foreach ($files as $file => $data) {
     $names[] = $base_url . '/' . $file;
   }
 
   $name_js = drupal_to_js($names);
-  
+
   $js = <<<EOJS
 <script type="text/javascript">
-  $(document).ready(function() {  
+  $(document).ready(function() {
     var names = {$name_js};
     $('#navphoto').css('background-image', 'url(' + names[Math.floor(Math.random() * names.length)] + ')');
   });
 </script>
 EEOJS;
-  
+
   return $js;
 }
 
@@ -81,14 +81,14 @@ EEOJS;
  * Return the CSS to place inline to choose the header background image.
  *
  * @param string $filename The filename relative to the theme,
- * 
+ *
  * @return string The CSS to add to the header.
  */
 function _nitobe_fixed_header_css($filename) {
   global $base_url;
-  
+
   $url    = $base_url . '/' . $filename;
   $output = '<style type="text/css">#navphoto{background-image:url(%s);}</style>';
-  
+
   return sprintf($output, $url);
 }
Index: page.tpl.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/themes/nitobe/page.tpl.php,v
retrieving revision 1.2
diff -u -p -r1.2 page.tpl.php
--- page.tpl.php	25 Jun 2008 13:15:38 -0000	1.2
+++ page.tpl.php	25 Jun 2008 16:59:03 -0000
@@ -40,13 +40,13 @@
         <div id="navphoto" class="grid_16"></div>
       </div><!-- /#header -->
       <div class="rule-top">&nbsp;</div>
-     
+
       <div id="center">
         <?php print $breadcrumb; ?>
         <?php if ($title): ?>
           <div class="headline grid_12 alpha">
             <?php print '<h2'. ($tabs ? ' class="with-tabs grid_8 alpha"' : ' class="grid_8 alpha"') .'>'. $title .'</h2>'; ?>
-            <?php if (nitobe_show_datestamp($node)): ?>
+            <?php if (!empty($node) && nitobe_show_datestamp($node)): ?>
               <div class="timestamp grid_4 omega"><?php print format_date($node->created, 'custom', 'd M Y'); ?></div>
             <?php endif; ?>
           </div>
Index: template.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/themes/nitobe/template.php,v
retrieving revision 1.1
diff -u -p -r1.1 template.php
--- template.php	23 Jun 2008 18:20:30 -0000	1.1
+++ template.php	25 Jun 2008 16:59:03 -0000
@@ -13,10 +13,10 @@ require_once drupal_get_path('theme', 'n
  * @param string $type
  * @param string $theme
  * @param string $path
- * 
+ *
  * @return array
  */
-function nitobe_theme($existing, $type, $theme, $path) {
+function _nitobe_theme($existing, $type, $theme, $path) {
   $funcs = array(
     'nitobe_username'=> array(
       'arguments' => $existing['theme_username'],
@@ -25,7 +25,7 @@ function nitobe_theme($existing, $type, 
       'arguments' => array('form' => NULL),
     ),
   );
-  
+
   return $funcs;
 }
 
@@ -34,12 +34,12 @@ function nitobe_theme($existing, $type, 
  * Theme the search form for the theme by removing the
  *
  * @param array $form The search-theme-form element.
- * 
+ *
  * @return string The rendered HTML of the form.
  */
 function nitobe_search_theme_form($form) {
-  unset($form[search_theme_form]['#title']);
-  
+  unset($form['search_theme_form']['#title']);
+
   return drupal_render_form('search-theme-form', $form);
 }
 
@@ -48,7 +48,7 @@ function nitobe_search_theme_form($form)
  * Display the list of available node types for node creation.
  *
  * @param $content array
- * 
+ *
  * @return string The rendered HTML.
  */
 function nitobe_node_add_list($content) {
@@ -60,7 +60,7 @@ function nitobe_node_add_list($content) 
     foreach ($content as $item) {
       $output .= '<dt class="' . $class . '">'. l($item['title'], $item['href'], $item['options']) .'</dt>';
       $output .= '<dd class="' . $class . '">'. filter_xss_admin($item['description']) .'</dd>';
-      
+
       $class = ($class == 'odd') ? 'even' : 'odd';
     }
     $output .= '</dl>';
@@ -74,16 +74,16 @@ function nitobe_node_add_list($content) 
  * comment. Otherwise, it calls the default implementation.
  *
  * @param object $object An instance of a node, comment, etc.
- * 
+ *
  * @return string A string containing an HTML link to the user's page if
- *         the passed object suggests that this is a site user. Otherwise, 
+ *         the passed object suggests that this is a site user. Otherwise,
  *         only the username is returned.
  */
 function nitobe_username($object) {
   // Is it a comment?
   if (!empty($object->cid)) {
     if (!empty($object->homepage)) {
-      $output = l($object->name, $object->homepage, 
+      $output = l($object->name, $object->homepage,
                   array('attributes' => array('rel' => 'external nofollow')));
     }
     else {
@@ -94,7 +94,7 @@ function nitobe_username($object) {
   else {
     $output = theme_username($object);
   }
-  
+
   return $output;
 }
 
@@ -103,7 +103,7 @@ function nitobe_username($object) {
  * Determine whether to show the date stamp for the given node.
  *
  * @param $node object The node to check.
- * 
+ *
  * @return bool TRUE if the node is of a type that should show the date
  *         stamp, FALSE if not.
  */
@@ -112,7 +112,7 @@ function nitobe_show_datestamp($node) {
     'story',
     'image',
   );
-  
+
   if (!empty($node) AND !empty($node->type)) {
     return in_array($node->type, $valid_types);
   }
@@ -126,13 +126,13 @@ function nitobe_show_datestamp($node) {
  * string with every other word wrapped in a span with the class "alt-color".
  *
  * @param $text string The text to render.
- * 
+ *
  * @return string The rendered HTML.
  */
 function nitobe_alt_word_text($text = '') {
   $words  = explode(' ', $text);
   $result = '';
-  
+
   if (is_array($words)) {
     $alt = FALSE;
     foreach ($words as $word) {
@@ -142,11 +142,11 @@ function nitobe_alt_word_text($text = ''
       else {
         $result .= $word;
       }
-      
+
       $alt = !$alt;
     }
   }
-  
+
   return $result;
 }
 
@@ -163,31 +163,31 @@ function nitobe_alt_word_text($text = ''
 function nitobe_render_terms($node, $prefix = NULL, $separator = ',') {
   $prefix = ($prefix == NULL) ? t('Tags:') : $text;
   $output = '';
-  
+
   if (module_exists('taxonomy')) {
     $terms = taxonomy_link('taxonomy terms', $node);
   }
   else {
     $terms = array();
   }
-  
+
   if (count($terms) > 0) {
     $output  .= $prefix . ' <ul class="links inline">';
     $rendered = nitobe_list_of_links($terms);
-    
+
     $i = 1;
     foreach ($rendered as $term) {
       $output .= '<li class="' . $term[1] . '">' . $term[0];
-      
+
       if ($i < count($terms)) {
         $output .= $separator . ' ';
       }
-      
+
       $output .= '</li>';
-      
+
       $i++;
     }
-    
+
     $output .= '</ul>';
   }
 
@@ -200,7 +200,7 @@ function nitobe_render_terms($node, $pre
  * <ul> and <li>.
  *
  * @param $links array A keyed array of links to be themed.
- * 
+ *
  * @return array An array of arrays. The first element of each inner array
  *         will be the rendered link. The second element will be the CSS
  *         class that should be applied to any wrapping element of that
@@ -216,7 +216,7 @@ function nitobe_list_of_links($links) {
     foreach ($links as $key => $link) {
       $class = $key;
 
-      // Add first, last and active classes to the list of links to help 
+      // Add first, last and active classes to the list of links to help
       // out themers.
       if ($i == 1) {
         $class .= ' first';
@@ -233,7 +233,7 @@ function nitobe_list_of_links($links) {
         $output[] = array(l($link['title'], $link['href'], $link), $class);
       }
       else if (!empty($link['title'])) {
-        // Some links are actually not links, but we wrap these in <span> for 
+        // Some links are actually not links, but we wrap these in <span> for
         // adding title and class attributes
         if (empty($link['html'])) {
           $link['title'] = check_plain($link['title']);
@@ -258,12 +258,12 @@ function nitobe_list_of_links($links) {
  * Return the comment link to display for a node rendered as a teaser.
  *
  * @param $node object The node to render the comment link for.
- * 
+ *
  * @return string The rendered comment link.
  */
 function nitobe_teaser_comment_link($node) {
     $count = $node->comment_count;
-    
+
     if ($count > 0) {
       $text = format_plural($node->comment_count,
                             '1 Comment', '@count Comments');
@@ -272,7 +272,7 @@ function nitobe_teaser_comment_link($nod
         'html'       => TRUE,
         'attributes' => array('title' => t('Read comments for or comment on ' . $node->title)),
       );
-      
+
       $output = l($text, 'node/' . $node->nid, $options);
     }
     else {
@@ -281,10 +281,10 @@ function nitobe_teaser_comment_link($nod
         'html'       => TRUE,
         'attributes' => array('title' => t('Comment on ' . $node->title)),
       );
-      
+
       $output = l(t('Add a Comment'), 'comment/reply/' . $node->nid, $options);
     }
-    
+
     return $output;
 }
 
@@ -367,11 +367,11 @@ function phptemplate_comment_wrapper($co
  */
 function phptemplate_preprocess_page(&$vars) {
   $vars['tabs2'] = menu_secondary_local_tasks();
-  
+
   // Random header each page refresh.
   $header_img = theme_get_setting('header_image');
   $header_img = empty($header_img) ? '<random>' : $header_img;
-  
+
   if ($header_img == '<random>') {
     $vars['closure'] .= _nitobe_random_header_js();
   }
@@ -389,22 +389,22 @@ function phptemplate_preprocess_page(&$v
 function phptemplate_preprocess_comment(&$variables) {
   $comment = $variables['comment'];
   $node    = $variables['node'];
-  
+
   $variables['author']  = theme('username', $comment);
   $variables['content'] = $comment->comment;
-  
+
   $params = array(
-    '@date' => format_date($comment->timestamp, 'custom', 'M jS, Y'), 
+    '@date' => format_date($comment->timestamp, 'custom', 'M jS, Y'),
     '@time' => format_date($comment->timestamp, 'custom', 'g:i a'),
   );
   $variables['date']    = t('@date at @time', $params);
-  
+
   if (user_access('administer comments')) {
     $links = array(
       l(t('Edit'), 'comment/edit/' . $comment->cid),
       l(t('Delete'), 'comment/delete/' . $comment->cid),
     );
-    
+
     $variables['links'] = implode(' | ', $links);
   }
   else {
Index: theme-settings.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/themes/nitobe/theme-settings.php,v
retrieving revision 1.2
diff -u -p -r1.2 theme-settings.php
--- theme-settings.php	25 Jun 2008 14:05:44 -0000	1.2
+++ theme-settings.php	25 Jun 2008 16:59:03 -0000
@@ -11,20 +11,20 @@ require_once drupal_get_path('theme', 'n
  *
  * @param array $settings An array of saved settings for this
  *        theme.
- * 
+ *
  * @return array A form array.
  */
 function nitobe_settings($settings) {
   $images  = _nitobe_get_header_list(TRUE);
   $options = array('<random>' => 'Random Header Image');
-  
+
   foreach ($images as $filename => $data) {
     $options[$filename] = $data->pretty_name;
   }
-  
+
   $form = array();
-  
-  $current = $settings['header_image'];
+
+  $current = empty($settings['header_image']) ? '' : $settings['header_image'];
   $default = in_array($current, array_keys($options)) ? $current : '<random>';
   $form['nitobe_header']['header_image'] = array(
     '#type'          => 'select',
@@ -33,5 +33,5 @@ function nitobe_settings($settings) {
     '#default_value' => $default,
   );
 
-  return $form;   
+  return $form;
 }
