Index: phptemplate.engine
===================================================================
RCS file: /cvs/drupal-contrib/contributions/theme-engines/phptemplate/phptemplate.engine,v
retrieving revision 1.21
diff -u -F^f -r1.21 phptemplate.engine
--- phptemplate.engine	6 Mar 2005 14:39:20 -0000	1.21
+++ phptemplate.engine	14 Mar 2005 20:02:50 -0000
@@ -1,4 +1,5 @@
 <?php
+// $Id$
 
 /**
  * Execute a template engine call.
@@ -59,16 +60,10 @@ function phptemplate_init($template) {
   }
 }
 
-/**
- * The folowing two lines need to replace the above two lines to enable phptemplate to be used with the multisite patch.
- *http://drupal.org/node/view/5942
- */
 function phptemplate_templates($directory = 'themes') {
   return system_listing('^page\.tpl\.php$', $directory, 'filename');
 }
 
-
-
 function phptemplate_features() {
   return array(
        'logo',
@@ -82,9 +77,6 @@ function phptemplate_features() {
        'toggle_comment_user_picture');
 }
 
-
-
-
 /**
  * PHPTemplate specific theme settings
  *
@@ -149,14 +141,14 @@ function phptemplate_page($content) {
     $mission = theme_get_setting('mission');
     $frontpage = true;
   }
- 
+
   $links['primary'] = array();
   $links['secondary'] = array();
- 
+
   foreach (array('primary', 'secondary') as $type) {
     //Get the data to populate the textfields, if the variable is not an array .. try to parse the old-style link format.    
     $value = variable_get('phptemplate_' . $type . '_links', '');
-  
+
     //Get the amount of links to show, possibly expanding if there are more links defined than the count specifies. 
     $count = variable_get('phptemplate_' . $type . '_link_count', 5);
     $count = ($count > sizeof($value['link'])) ? $count : sizeof($value['link']);
@@ -233,7 +225,7 @@ function phptemplate_page($content) {
   if (sizeof($node_cache) == 1) {
     $vars['node'] = $node_cache[0];
   }
-  
+
   return _phptemplate_callback('page', $vars);
 }
 
@@ -251,7 +243,7 @@ function phptemplate_node($node, $main =
   else {
     $taxonomy = array();
   }
-  
+
   $vars = array(
       'title'          => $node->title,
       'node_url'       => url('node/' . $node->nid),
@@ -261,7 +253,7 @@ function phptemplate_node($node, $main =
       'sticky'         => $node->sticky,
       'picture'        => theme_get_setting('toggle_node_user_picture') ? theme('user_picture', $node) : '',
       'content'        => ($main && $node->teaser) ? $node->teaser : $node->body,
-      'links'          => theme('links', $node->links),
+      'links'          => $node->links ? theme('links', $node->links) : '',
       'mission'        => $mission,
       'page'           => $page,
       'taxonomy'       => $taxonomy,
@@ -321,12 +313,10 @@ function phptemplate_box($title, $conten
   ));
 }
 
-
 /** 
  * Default callback for PHPTemplate.
  */
 function _phptemplate_default($hook, $vars, $file = null) {
-
   if ($file && file_exists(path_to_theme() . "/$file.tpl.php")) {
     $file = path_to_theme() . "/$file.tpl.php";
   } 
@@ -346,7 +336,6 @@ function _phptemplate_default($hook, $va
     }
   }
 
-  
   if ($file) {
     $phptemplate = new Template(dirname($file));
     $phptemplate->set_vars($vars);
