*** comment.tpl.php	Wed Jun 21 03:06:40 2006
--- comment.tpl.php	Thu Oct 25 17:50:26 2007
***************
*** 2,8 ****
      <?php if ($picture) {
      print $picture;
      } ?>
!     <h3 id="commettitle"><?php print $title; ?></h3><?php if ($new != '') { ?><span class="new"><?php print $new; ?></span><?php } ?>
      <div style="border: 1px solid #575A23">    <p><?php print $submitted; ?></p>
      <p><?php print $content; ?></p>
      <p>&raquo; <?php print $links; ?></p>
--- 2,8 ----
      <?php if ($picture) {
      print $picture;
      } ?>
!     <h3 id="commenttitle"><?php print $title; ?></h3><?php if ($new != '') { ?><span class="new"><?php print $new; ?></span><?php } ?>
      <div style="border: 1px solid #575A23">    <p><?php print $submitted; ?></p>
      <p><?php print $content; ?></p>
      <p>&raquo; <?php print $links; ?></p>
*** page.tpl.php	Fri Jun 23 19:23:50 2006
--- page.tpl.php	Thu Oct 25 21:42:26 2007
***************
*** 1,10 ****
! <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml" lang="<?php print $language ?>" xml:lang="<?php print $language ?>">
  
  <head>
    <title><?php print $head_title ?></title>
    <?php print $head ?>
    <?php print $styles ?>
    <script type="text/javascript"><?php /* Needed to avoid Flash of Unstyle Content in IE */ ?> </script>
  </head>
  
--- 1,23 ----
! <?php
! /*
! changes for 5.0:
! 
! To improve the code.:
!       <?php if (isset($secondary_links)) { ?><?php print candy_corn_secondary_links() ?><?php } ?>
!       <?php if (isset($secondary_links)) { print candy_corn_secondary_links(); } ?>
! 
!       <?php if (isset($primary_links)) { ?><?php print candy_corn_primary_links() ?><?php } ?>
!       <?php if (isset($primary_links)) { print candy_corn_primary_links(); } ?>
! 
! */
! ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml" lang="<?php print $language ?>" xml:lang="<?php print $language ?>">
  
  <head>
    <title><?php print $head_title ?></title>
    <?php print $head ?>
    <?php print $styles ?>
+   <?php print $scripts ?>
    <script type="text/javascript"><?php /* Needed to avoid Flash of Unstyle Content in IE */ ?> </script>
  </head>
  
***************
*** 12,18 ****
  
    <div id="banner">
      <div class="top_links clearfix" id="topnav">
!       <?php if (isset($secondary_links)) { ?><?php print candy_corn_secondary_links() ?><?php } ?>
      </div>
      <?php if ($logo) { ?><a href="<?php print $base_path ?>" title="<?php print t('Home') ?>"><img src="<?php print $logo ?>" alt="<?php print t('Home') ?>" /></a><?php } ?>
      <div class="page_title"><?php if ($site_name) { ?><a id="page_title" href="<?php print $base_path ?>" title="<?php print t('Home') ?>"><?php print $site_name ?></a><?php } ?><br />
--- 25,31 ----
  
    <div id="banner">
      <div class="top_links clearfix" id="topnav">
!       <?php if (isset($secondary_links)) { print candy_corn_secondary_links(); } ?>
      </div>
      <?php if ($logo) { ?><a href="<?php print $base_path ?>" title="<?php print t('Home') ?>"><img src="<?php print $logo ?>" alt="<?php print t('Home') ?>" /></a><?php } ?>
      <div class="page_title"><?php if ($site_name) { ?><a id="page_title" href="<?php print $base_path ?>" title="<?php print t('Home') ?>"><?php print $site_name ?></a><?php } ?><br />
***************
*** 23,30 ****
  	
    <?php if ($sidebar_left) { ?>
      <div class="leftcontent" id="nav">
        <img alt="bg image" src="<?php print base_path() .'/'. drupal_get_path('theme', 'candy_corn') .'/images/left_bg_top.gif';?>" />
!       <?php if (isset($primary_links)) { ?><?php print candy_corn_primary_links() ?><?php } ?>
  	  <div class="left_news">
        <p>&nbsp;</p>
        <?php print $sidebar_left ?>
--- 36,54 ----
  	
    <?php if ($sidebar_left) { ?>
      <div class="leftcontent" id="nav">
+       <img alt="bg image" src="<?php
+ /*
+ In the following line, base_path() may contain a /. Only add another / if base path does not end with a /.
        <img alt="bg image" src="<?php print base_path() .'/'. drupal_get_path('theme', 'candy_corn') .'/images/left_bg_top.gif';?>" />
! */
! $base_path = base_path();
! if(substr($base_path, -1) != '/')
! {
! 	$base_path .= '/';
! }
! print $base_path . drupal_get_path('theme', 'candy_corn') .'/images/left_bg_top.gif';
! ?>" />
!       <?php if (isset($primary_links)) { print candy_corn_primary_links(); } ?>
  	  <div class="left_news">
        <p>&nbsp;</p>
        <?php print $sidebar_left ?>
*** style.css	Fri Jun 23 19:23:50 2006
--- style.css	Thu Oct 25 17:50:37 2007
***************
*** 209,215 ****
  text-decoration: none;
  }
  
! #commettitle {
  font-family:Verdana, Arial, Helvetica, sans-serif;
  font-weight:bold;
  color:#000000;
--- 209,215 ----
  text-decoration: none;
  }
  
! #commenttitle {
  font-family:Verdana, Arial, Helvetica, sans-serif;
  font-weight:bold;
  color:#000000;
*** template.php	Wed Jun 21 03:06:40 2006
--- template.php	Thu Oct 25 21:47:25 2007
***************
*** 6,30 ****
  }
  
  function candy_corn_primary_links() {
!   $links = menu_primary_links();
!   if ($links) {
!     $output .= '<ul>';
!     foreach ($links as $link) {
! 
!       $output .= '<li>' . $link . '</li>';
!     }; 
!     $output .= '</ul>';
!   }
!   return $output;
  }
  
  function candy_corn_secondary_links() {
!   $links = menu_secondary_links();
    if ($links) {
      $output .= '<ul>';
      foreach ($links as $link) {
! 
!       $output .= '<li>' . $link . '</li>';
      }; 
      $output .= '</ul>';
    }
--- 6,41 ----
  }
  
  function candy_corn_primary_links() {
!   return candy_corn_all_links(menu_primary_links());
  }
  
  function candy_corn_secondary_links() {
!   return candy_corn_all_links(menu_secondary_links());
! }
! 
! function candy_corn_all_links($links) {
    if ($links) {
      $output .= '<ul>';
      foreach ($links as $link) {
! /* $link may be an array. The array contains elements title, href and may have attributes.
! */
! 		if(is_array($link))
! 		{
! 			$attributes = '';
! 			if(isset($link['attributes']))
! 			{
! 				foreach($link['attributes'] as $attribute_name => $attribute_value)
! 				{
! 					$attributes .= ' ' . $attribute_name . '="' . $attribute_value . '"';
! 				}
! 			}
! 			$link_text = '<a href="' . $link['href'] . '"' . $attributes . '>' . $link['title'] . '</a>';
! 		}
! 		else
! 		{
! 			$link_text = $link;
! 		}
!       $output .= '<li>' . $link_text . '</li>';
      }; 
      $output .= '</ul>';
    }
