Drupal6 sidebar code? I got this d7 sidebar code from a theme and I am trying to make it work for d6..  Can someone help 

Info file contains:
regions[sidebar_a] = 'Sidebar A'
regions[sidebar_b] = 'Sidebar B'

This is the code:

                  &lt;?php 
                      if(isset($variables) &amp;&amp; isset($variables['sidebars'])):

                        if(isset($variables['sidebars']['left'])):
                          foreach($variables['sidebars']['left'] as $value):
                            if (!empty($page['sidebar_'.$value])): ?&gt;
                            &lt;div id="sidebar-&lt;?php echo $value; ?&gt;" class="col-&lt;?php echo $value; ?&gt; sidebar left tb-height-balance tb-region tb-scope tb-sidebar tb-left"&gt;
                              &lt;?php print render($page['sidebar_'.$value]); ?&gt;
                            &lt;/div&gt;
                        &lt;?php endif; endforeach; endif; ?&gt;

                      &lt;?php 
                        if(isset($variables['sidebars']['right'])):
                          foreach($variables['sidebars']['right'] as $value):
                            if (!empty($page['sidebar_'.$value])): ?&gt;
                            &lt;div id="sidebar-&lt;?php echo $value; ?&gt;" class="col-&lt;?php echo $value; ?&gt; sidebar right tb-height-balance tb-region tb-scope tb-sidebar tb-right"&gt;
                              &lt;?php print render($page['sidebar_'.$value]); ?&gt;
                            &lt;/div&gt;

                        &lt;?php endif; endforeach; endif; ?&gt;

                      &lt;?php 
                        if(isset($variables['sidebars']['hidden'])):
                          foreach($variables['sidebars']['hidden'] as $value):
                            if (!empty($page['sidebar_'.$value])): ?&gt;
                            &lt;div id="sidebar-&lt;?php echo $value; ?&gt;" class="col-&lt;?php echo $value; ?&gt; sidebar right tb-height-balance tb-region tb-scope tb-sidebar tb-right tb-hidden"&gt;
                              &lt;?php print render($page['sidebar_'.$value]); ?&gt;
                            &lt;/div&gt;

                    &lt;?php endif; endforeach; endif; endif; ?&gt; &lt;!-- end sidebars --&gt;
Functionality aside, I think the basic structure for D6 would be:

&lt;?php
if(isset($sidebars['left'])):
  foreach($sidebars['left'] as $value):
    if (!empty(${'sidebar_'.$value})): ?&gt;
    &lt;div id="sidebar-&lt;?php echo $value; ?&gt;" class="col-&lt;?php echo $value; ?&gt; sidebar left tb-height-balance tb-region tb-scope tb-sidebar tb-left"&gt;
      &lt;?php print ${'sidebar_'.$value}; ?&gt;
    &lt;/div&gt;
    &lt;?php 
    endif; 
  endforeach; 
endif; ?&gt;