Forums / Templates, Stylesheets, Page Layout / Multiple Banners on Main page

Multiple Banners on Main page

Locked

Views: 1,288

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
15 Aug 2008, 1:36 AM
#1
skylab001 avatar

skylab001

New Zenner

Join Date:
Jan 2008
Posts:
67
Plugin Contributions:
0

Multiple Banners on Main page

I would like to be able to display multiple banners at the same time on my 'main page' in the same way that the banners_all box in the column. I have already taken care of getting banners_group3 to only display on only the main page, but I have been trying to figure out this multiple banners at the same time for a few weeks now and I think I'm going crazy. Nothing I try has worked. I tried copying the core code from the banners_all template page and replacing my banners_group3 code. I have tried to copy and paste banners_group 1&4 and place those in the same area on my page as group3, hoping to get 3 banners, but nothing shows up. I thought I was having issues with configuring the banners so I bought the zen cart book but it has not helped me.

I need them to be trackable so just embedding HTML into my main page won't work.

I have combed this site hoping that somebody had figured this out and nothing.

Does anybody know how to do this or can help as I'm lost at this point?

22 Aug 2008, 5:32 AM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Multiple Banners on Main page

This would allow banners_all to run in the tpl_footer.php ...

You could adapt this to a new group to do the same thing ...

<!--eof-banner #5 display -->

<?php
// bof: make banners all run in the footer
    $bannerscontent = '';
    $bannerscontent .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent centeredContent">';
// select banners_group to be used
  $new_banner_search = zen_build_banners_group(SHOW_BANNERS_GROUP_SET_ALL);

  // secure pages
  switch ($request_type) {
    case ('SSL'):
      $my_banner_filter=" and banners_on_ssl= " . "1 ";
      break;
    case ('NONSSL'):
      $my_banner_filter='';
      break;
  }

  $sql = "select banners_id from " . TABLE_BANNERS . " where status = 1 " . $new_banner_search . $my_banner_filter . " order by banners_sort_order";
  $banners_all = $db->Execute($sql);



// if no active banner in the specified banner group then the box will not show
  $banner_cnt = 0;
  while (!$banners_all->EOF) {
    $banner_cnt++;
    $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET_ALL);
    $bannerscontent .= zen_display_banner('static', $banners_all->fields['banners_id']);
// add spacing between banners
    if ($banner_cnt < $banners_all->RecordCount()) {
      $bannerscontent .= '<br /><br />';
    }
    $banners_all->MoveNext();
  }
  $bannerscontent .= '</div>';

echo 'TEST BANNER ALL:<br />' . $bannerscontent . '<br />';
// eof: make banners all run in the footer
?>


<!--bof- site copyright display -->

Note: you would want to change the classes and such to keep them unique if needed as the variables are not defined ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!