Zen Cart Logo

More Banners

Locked

Views: 3,491

Results 1 to 20 of 26
This thread is locked. New replies are disabled.
29 Sep 2009, 1:36 PM
#1
ruzzell avatar

ruzzell

New Zenner

Join Date:
Sep 2009
Posts:
7
Plugin Contributions:
0

More Banners

Hi
On the standard Zen Cart install, there is a banner on the left and 2 banners on the right.

Is there a way to easily add more banners (left and right) without modifying the SQL or PHP code.

I an looking to have 4-5 banners each side and am not sure how to do this.

Does not matter if they are dynamic or static.

Using ZC 1.3.8a, no add ons, no customisation.

Any help would be appreciated.

29 Sep 2009, 2:19 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: More Banners

Peek at the Tools ... Banner Manager ... and add your new banners there ...

29 Sep 2009, 3:37 PM
#3
ruzzell avatar

ruzzell

New Zenner

Join Date:
Sep 2009
Posts:
7
Plugin Contributions:
0

Re: More Banners

Ajeh:

Peek at the Tools ... Banner Manager ... and add your new banners there ...

hi Ajeh, many thanks for your response.

I have looked at the banner manager, but to be perfectly honest after playing with it for hours I seem to be a little stuck, and have not achieved my desired look.

I was only wondering if ther may be a walkthrough or something similar that would help me learn how to use it properly / more effectively.

Many thanks once again.

29 Sep 2009, 5:13 PM
#4
ajeh avatar

ajeh

Oba-san

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

Re: More Banners

Could you give an idea of what kind of Banners are you trying to make? :smile:

30 Sep 2009, 3:15 PM
#5
ruzzell avatar

ruzzell

New Zenner

Join Date:
Sep 2009
Posts:
7
Plugin Contributions:
0

Re: More Banners

Ajeh:

Could you give an idea of what kind of Banners are you trying to make? :smile:

Hi Ajeh.
I am trying to add static banners, which are 125px wide * 180 px, in .gif format.

But I am trying to stack 4 on each side, on above the other.

Banner Main content Banner

Banner ------------------- Banner

Banner ------------------- Banner

Banner ------------------- Banner

not the best graphical description, sorry, but the best i could come up with.

I hope this helps describe my problem.

Many thanks

30 Sep 2009, 4:57 PM
#6
ajeh avatar

ajeh

Oba-san

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

Re: More Banners

There is a sidebox called:
/includes/modules/sideboxes/banner_box_all.php
/includes/templates/templates_default/sideboxes/tpl_banner_box_all.php

You could clone that so you have two of them ...

Then you can make your banners and assign them to the BannersAll group for one of the sets and assign them to a new group BannersAll2 ...

To get the new group to work for you via the Admin you can use:

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_all2', 'SHOW_BANNERS_GROUP_SET_ALL2', 'BannersAll2', 'The Banner Display Group may only be from one (1) Banner Group for the Banner All2 sidebox<br /><br />Default Group is BannersAll2<br /><br />What Banner Group do you want to use in the Side Box - banner_box_all?<br />Leave blank for none', '19', '73', '', '', now());

and that will show in the Configuration ... Layout Settings ...

30 Sep 2009, 7:41 PM
#7
ruzzell avatar

ruzzell

New Zenner

Join Date:
Sep 2009
Posts:
7
Plugin Contributions:
0

Re: More Banners

Hi Ajeh

Thank you for your patience and understanding for a New Zenner.

Could you please advise where and which file would I insert the code that you have suggested.

I have looked through the configuration files and cannot find anything that matches it - or similar.

Again, my thanks.

1 Oct 2009, 3:35 AM
#8
ajeh avatar

ajeh

Oba-san

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

Re: More Banners

That is a SQL statement to be run in the Tools ... Install SQL Patches ... so that you can have a method of customizing the cloned Banners All 2 sidebox ...

1 Oct 2009, 1:20 PM
#9
ruzzell avatar

ruzzell

New Zenner

Join Date:
Sep 2009
Posts:
7
Plugin Contributions:
0

Re: More Banners

Hi Ajeh.

Many thanks for your reply.

I will be able to try this tonight and let you know how I get on.

I appreciate your help.

Kind regards

2 Oct 2009, 1:32 PM
#10
ruzzell avatar

ruzzell

New Zenner

Join Date:
Sep 2009
Posts:
7
Plugin Contributions:
0

Re: More Banners

Hi Ajeh.

I have managed to get most of this working, many thanks to your guidance. But, the SQL references the banners being allocated to the Bannersall sidebox.

If the Bannersall sidebox is set left in Tools\Layout Boxes Controller then all the images appear left.

Can I modify the SQL so that one set of images references the Bannersall sidebox and are set left, and another group is assigned to the Sidebox-Banners group which can be set right.

Does the 19, 73 in the SQL have any significant purpose. I.E. can I use the same, but modified code, but leave the 19, 73 the same.

I am really grateful for your help and I am really pleased with the results.

Many thanks, once again.

Russell

2 Oct 2009, 2:18 PM
#11
ajeh avatar

ajeh

Oba-san

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

Re: More Banners

19 is the configuration_group_id which is the Layout Settings where all the other Banner Group definitions are and 73 is the sort_order so it should land under the Banners All setting ...

This will let you have the Banners All and the new Banners All 2 configurable from the Admin, based on the premise that you cloned Banners All in a manner where the only difference is the "all" becomes a "all2" in everything ...

5 Oct 2009, 7:56 PM
#12
ruzzell avatar

ruzzell

New Zenner

Join Date:
Sep 2009
Posts:
7
Plugin Contributions:
0

Re: More Banners

Hi Ajeh.

I have played with this for a while now, and I am still having difficulties.

I have gone back to basics and I think that the problem is that in banner manager, when I create a new banner, after following the steps earlier, I only have 3 banner groups available:

BannersAll, Sidebox-Banners and Wide Banners.

Should there be another group in there, BannerAll2, that I have created with the modifications.

If it is any help, I am working on the site, on a temporary domain: https://www.tempr.com.

Many thanks

Russell.

5 Oct 2009, 9:23 PM
#13
ajeh avatar

ajeh

Oba-san

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

Re: More Banners

Below the dropdown is an input box ...

Type in your new Banner Group that you want to use for the first Banner that you are making ...

Once you have save the first Banner to this new Banner Group name, it will show up in the drop down ...

23 Oct 2009, 5:15 PM
#14
ahaynes106 avatar

ahaynes106

New Zenner

Join Date:
Oct 2009
Posts:
38
Plugin Contributions:
0

Re: More Banners

Well I tried following these great tips, but I must have screwed something up in the cloning of banner_box_all.php. Now in the Layout Boxes Controller, when I turn on banner_box_all2.php, my store will no longer show the footer and will not show the banner generated in banner manager. When I turn off banner_box_all2.php, the footer shows back up and all is well. I am including the code for banner_box_all2.php below to so you can tell this noob what he screwed up. :shocking:

Thanks in advance. As a new zener I have already been able to solve multiple issues and find answers to a multitude of questions through the great support found in these forums.

Cart version 1.38a

<?php
/**
 * banner_box_all2 sidebox - 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_box_all2.php 3133 2006-03-07 23:39:02Z ajeh $
 */

// 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_all2', 'SHOW_BANNERS_GROUP_SET_ALL2', 'BannersAll2', 'The Banner Display Group may only be from one (1) Banner Group for the Banner All2 sidebox<br /><br />Default Group is BannersAll2<br /><br />What Banner Group do you want to use in the Side Box - banner_box_all2?<br />Leave blank for none', '19', '73', '', '', now());
// ALTER TABLE `banners` ADD `banners_sort_order` INT( 11 ) DEFAULT '0' NOT NULL;

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

  if ($show_banner_box_all2 == true) {
    $banner_box[] = TEXT_BANNER_BOX_ALL2;
    $banner_box_group= SHOW_BANNERS_GROUP_SET_ALL2;

    require($template->get_template_dir('tpl_banner_box_all2.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_banner_box_all2.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 ($banners_all2->RecordCount() > 0) {

      $title =  BOX_HEADING_BANNER_BOX_ALL2;
      $title_link = false;
      require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
    }
  }
?>
23 Oct 2009, 6:43 PM
#15
ahaynes106 avatar

ahaynes106

New Zenner

Join Date:
Oct 2009
Posts:
38
Plugin Contributions:
0

Re: More Banners

also in the copy, tpl_banner_box_all2.php, should SHOW_BANNERS_GROUP_SET_ALL be changed to SHOW_BANNERS_GROUP_SET_ALL2?

23 Oct 2009, 7:52 PM
#16
ajeh avatar

ajeh

Oba-san

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

Re: More Banners

Check if you left space(s) or blank line(s) after the closing php bracket ?> in the new files ...

23 Oct 2009, 8:32 PM
#18
ahaynes106 avatar

ahaynes106

New Zenner

Join Date:
Oct 2009
Posts:
38
Plugin Contributions:
0

Re: More Banners

Ajeh:

Check if you left space(s) or blank line(s) after the closing php bracket ?> in the new files ...

I checked banner_box_all2.php and tpl_banner_box_all2.php. No blank lines or spaces after the closing php bracket ?>

23 Oct 2009, 9:05 PM
#19
ajeh avatar

ajeh

Oba-san

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

Re: More Banners

And you added the INSERT to the configure table and somewhere you added the language definition for the BOX_HEADING_BANNER_BOX_ALL2

If you get the Debug Tool from the Free Software Add Ons it will probably reveal the error message for you ...

NOTE: when using the Debug Tool, be sure, after you trigger the error, to REFRESH the directory in your FTP software to make sure you see the new files generated by the error ...

3 Nov 2009, 5:12 PM
#20
enzo_ita avatar

enzo_ita

Zen Follower

Join Date:
Jul 2009
Posts:
402
Plugin Contributions:
0

Re: More Banners

Ajeh:

There is a sidebox called:
/includes/modules/sideboxes/banner_box_all.php
/includes/templates/templates_default/sideboxes/tpl_banner_box_all.php

You could clone that so you have two of them ...

Then you can make your banners and assign them to the BannersAll group for one of the sets and assign them to a new group BannersAll2 ...

To get the new group to work for you via the Admin you can use:

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_all2', 'SHOW_BANNERS_GROUP_SET_ALL2', 'BannersAll2', 'The Banner Display Group may only be from one (1) Banner Group for the Banner All2 sidebox<br /><br />Default Group is BannersAll2<br /><br />What Banner Group do you want to use in the Side Box - banner_box_all?<br />Leave blank for none', '19', '73', '', '', now());

> 
> and that will show in the Configuration ... Layout Settings ...

I do not understand in which file and where I should insert the code posted.
Thanks
enzo