Zen Cart Logo
Forums / Basic Configuration / banner_box_all add problem

banner_box_all add problem

Locked

Views: 3,322

Results 1 to 20 of 22
This thread is locked. New replies are disabled.
19 Mar 2007, 2:29 AM
#1
dvenzo avatar

dvenzo

New Zenner

Join Date:
Mar 2006
Posts:
39
Plugin Contributions:
0

banner_box_all add problem

hello!

im having some problems w/ adding another banner box.

heres my site. https://www.kidnemo.com

i made duplicates of my original banner_box_all in modules and templates and renamed all of them (even the content) to banner_box_all2.

under banner box control, the banner_box_all2 shows but under layout settings, the banner_box_all2 doesnt.

When I set the copy to active on the site, all it does it duplicates the original...

am i missing a step somewhere?

thx for your help everyone

Becky Lee
Kid Nemo Company

20 Mar 2007, 7:40 AM
#2
dvenzo avatar

dvenzo

New Zenner

Join Date:
Mar 2006
Posts:
39
Plugin Contributions:
0

Re: banner_box_all add problem

i tried refering to the regular banners and see how it was setup and applied it to the 2 banner_box_all modules... but still no luck...

can anyone help me out please?

thank you in advance

21 Mar 2007, 4:49 AM
#3
ajeh avatar

ajeh

Oba-san

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

Re: banner_box_all add problem

What setting do you have for:

  $new_banner_search = zen_build_banners_group(SHOW_BANNERS_GROUP_SET_ALL);

In the tpl_ file?

Did that change to:
SHOW_BANNERS_GROUP_SET_ALL2

And does that have its own settings somewhere?

21 Mar 2007, 7:45 AM
#4
dvenzo avatar

dvenzo

New Zenner

Join Date:
Mar 2006
Posts:
39
Plugin Contributions:
0

Re: banner_box_all add problem

thank you in advance for helping ajeh!

heres what i am looking at.

/www/includes/modules/sideboxes/banner_box_all2.php

<?php
/**
 * banner_box2 sidebox - second box used to display "square" banners in sideboxes
 *
 * @package templateSystem
 * @copyright Copyright 2003-2005 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: banner_box2.php 3133 2006-03-07 23:39:02Z ajeh $
 */

// test if box should display
  $show_banner_box2 = true;
  if (SHOW_BANNERS_GROUP_SET8 == '') {
    $show_banner_box2 = false;
  }

  if ($show_banner_box2 == true) {
    $banner_box[] = TEXT_BANNER_BOX2;
    $banner_box_group= SHOW_BANNERS_GROUP_SET8;

    require($template->get_template_dir('tpl_banner_box2.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_banner_box2.php');

// if no active banner in the specified banner group then the box will not show
// uses banners in the defined group $banner_box_group
    if ($banner->RecordCount() > 0) {

      $title =  BOX_HEADING_BANNER_BOX2;
      $title_link = false;
      require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
    }
  }
?>

/www/includes/templates/template_default/sideboxes/tpl_banner_box_all2.php

<?php
/**
 * Side Box Template
 *
 * @package templateSystem
 * @copyright Copyright 2003-2005 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_banner_box_all2.php 2982 2006-02-07 07:56:41Z birdbrain $
 */
    $content = '';
    $content .= '<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_ALL2);

  // 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_ALL2);
    $content .= zen_display_banner('static', $banners_all->fields['banners_id']);
// add spacing between banners
    if ($banner_cnt < $banners_all->RecordCount()) {
      $content .= '<br /><br />';
    }
    $banners_all->MoveNext();
  }
  $content .= '</div>';
?>

Thanks again for your kind help^^

Becky L

21 Mar 2007, 4:43 PM
#5
ajeh avatar

ajeh

Oba-san

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

Re: banner_box_all add problem

banner_box2.php or did you mean to post a copy of the clone you made for banner_box_all.php ...:unsure:

21 Mar 2007, 7:34 PM
#6
dvenzo avatar

dvenzo

New Zenner

Join Date:
Mar 2006
Posts:
39
Plugin Contributions:
0

Re: banner_box_all add problem

hi ajeh~

i wanted a second banner_box_all for my site, so I cloned the original banner_box_all and renamed it and its content in both the template and modules area.

i renamed it banner_box_all2.php

in my admin, the banner_box_all2 shows, but under layout setting in config, the option is not there to rename the banner destination.

22 Mar 2007, 2:55 AM
#7
ajeh avatar

ajeh

Oba-san

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

Re: banner_box_all add problem

You need to configure something to indicate the Banner Group(s) used by the new banner_box_all2 ...

22 Mar 2007, 3:24 AM
#8
dvenzo avatar

dvenzo

New Zenner

Join Date:
Mar 2006
Posts:
39
Plugin Contributions:
0

Re: banner_box_all add problem

yeah...

i already designated groups for all of the banner boxes already in configuration>layout settings...

but the banner_box_all2 isnt coming up in layout settings so I cant designate a group for it.

22 Mar 2007, 4:57 AM
#9
ajeh avatar

ajeh

Oba-san

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

Re: banner_box_all add problem

The setting in the configuration table for the configuration_key
SHOW_BANNERS_GROUP_SET_ALL

Manages the Banners All sidebox ...

This is an actual setting in the database ...

If you make a new one for:
SHOW_BANNERS_GROUP_SET_ALL2

Somewhere that either has to be defined in the database configuration table or you need a define that loads in the right sequence for the new banner box to hear it ...

22 Mar 2007, 5:31 AM
#10
dvenzo avatar

dvenzo

New Zenner

Join Date:
Mar 2006
Posts:
39
Plugin Contributions:
0

Re: banner_box_all add problem

hi ajeh... thank you for your help and patience.

do you happen to know where i should be looking then?

my html knowledge is almost zero so pointing me in the right direction is much appriciated.

22 Mar 2007, 6:01 AM
#11
dvenzo avatar

dvenzo

New Zenner

Join Date:
Mar 2006
Posts:
39
Plugin Contributions:
0

Re: banner_box_all add problem

Ajeh:

banner_box2.php or did you mean to post a copy of the clone you made for banner_box_all.php ...:unsure:

opps.. yeah the first one was the regular banner_box_all

24 Mar 2007, 12:50 AM
#12
ajeh avatar

ajeh

Oba-san

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

Re: banner_box_all add problem

The Banners Box All uses this sql statement to add itself to the Layout Settings:

INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) VALUES ('Banner Display Group - Side Box banner_box_all', 'SHOW_BANNERS_GROUP_SET_ALL', 'BannersAll', 'The Banner Display Group may only be from one (1) Banner Group for the Banner All sidebox<br /><br />Default Group is BannersAll<br /><br />What Banner Group do you want to use in the Side Box - banner_box_all?<br />Leave blank for none', '19', '72', '', '', now());

You can adapt this INSERT to work with your new configuration_key for the:
SHOW_BANNERS_GROUP_SET_ALL2

This will allow you to configure it in the Layout Settings as well as ensure that it is loaded at the right time to work with your new sidebox ... providing all else is coded correctly ...

24 Mar 2007, 2:15 AM
#13
dvenzo avatar

dvenzo

New Zenner

Join Date:
Mar 2006
Posts:
39
Plugin Contributions:
0

Re: banner_box_all add problem

im really sorry ajeh,

where do i insert the adapted sql statement into?

24 Mar 2007, 2:22 AM
#14
ajeh avatar

ajeh

Oba-san

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

Re: banner_box_all add problem

If you use the Tools ... Insert SQL Patches ...

It will add it to your database configuration table for you ...

NOTE: read that carefully as that is the one for the original configuration_key for:
SHOW_BANNERS_GROUP_SET_ALL

You will want to edit it a bit for your configuration_key for your new sidebox:
SHOW_BANNERS_GROUP_SET_ALL2

And perhaps update the text etc. to reflect which box this is when viewing it from the Layout Settings ...

24 Mar 2007, 3:31 AM
#15
dvenzo avatar

dvenzo

New Zenner

Join Date:
Mar 2006
Posts:
39
Plugin Contributions:
0

Re: banner_box_all add problem

omg ajeh!

it worked!

you really made my week!

much praise to you for your great help and patience w/ my questions!

<3 ajeh and zencart !!!

-Becky Lee
KNC

24 Mar 2007, 3:55 AM
#16
ajeh avatar

ajeh

Oba-san

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

Re: banner_box_all add problem

/me thud ... :lamo:

Remember us when you are rich and famous ... :smartass:

24 Mar 2007, 8:21 AM
#17
dvenzo avatar

dvenzo

New Zenner

Join Date:
Mar 2006
Posts:
39
Plugin Contributions:
0

Re: banner_box_all add problem

i wish! lol

oh btw... i forgot to ask... (here i go again)

would you know how i can change the spacing between the banners in banner_all? i want the images to be a bit closer together.

lol thx!

24 Mar 2007, 1:43 PM
#18
ajeh avatar

ajeh

Oba-san

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

Re: banner_box_all add problem

View source ... see if this is breaks or class managed ...

25 Mar 2007, 1:20 AM
#19
dvenzo avatar

dvenzo

New Zenner

Join Date:
Mar 2006
Posts:
39
Plugin Contributions:
0

Re: banner_box_all add problem

i looked around in templates and modules and havent seen anything that mentions breaks or class in the banner_all groups

25 Mar 2007, 1:22 AM
#20
ajeh avatar

ajeh

Oba-san

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

Re: banner_box_all add problem

psst ...

// add spacing between banners
    if ($banner_cnt < $banners_all->RecordCount()) {
      $content .= '<br /><br />';
    }