Forums / General Questions / Banner Manager

Banner Manager

Results 1 to 20 of 26
27 Dec 2013, 03:26
#1
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
6

Banner Manager

This is an area in Zen Cart I really never played around with ... :lookaroun

Lets say I upload (3) images and assign them to: Banner Display Groups - Header Position 1

How do I display all (3) images at once instead of 1 random image per page load?
27 Dec 2013, 03:55
#2
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
6

Re: Banner Manager

Never mind, figured it out.
27 Dec 2013, 15:43
#3
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,907
Plugin Contributions:
1

Re: Banner Manager

rbarbour:

Never mind, figured it out.


And the answer is for those that happen across this thread looking for the same thing?
27 Dec 2013, 18:01
#4
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
6

Re: Banner Manager

mc12345678:

And the answer is for those that happen across this thread looking for the same thing?


Custom Coding

This is probably a unique situation of my clients and the reason for doing so can be seen here.

Simply allows my client to use the stock Banner Manager, show multiple banners as a group (jQuery Slide) and assign different effects to each banner group.

I needed a simple lightweight solution and alternative to ZX_slideshow and other sliders that require hard coding images in tpl or define files.

All banners loaded record Banner Views
All banners loaded record Banner Clicks
28 Dec 2013, 02:43
#5
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Posts:
10,011
Plugin Contributions:
1

Re: Banner Manager

rbarbour:

Custom Coding

This is probably a unique situation of my clients and the reason for doing so can be seen here.

Simply allows my client to use the stock Banner Manager, show multiple banners as a group (jQuery Slide) and assign different effects to each banner group.

I needed a simple lightweight solution and alternative to ZX_slideshow and other sliders that require hard coding images in tpl or define files.

All banners loaded record Banner Views
All banners loaded record Banner Clicks

Ummm I believe the ZX Slideshow uses the banner manager and so does the slideshow Anne includes in her templates..
28 Dec 2013, 02:52
#6
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,907
Plugin Contributions:
1

Re: Banner Manager

DivaVocals:

Ummm I believe the ZX Slideshow uses the banner manager and so does the slideshow Anne includes in her templates..


Yes, the slideshow of Anne's templates (at least recent ones) does use the banner manager. Not familiar with the older templates, so can't speak for/about them.
28 Dec 2013, 03:42
#7
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
6

Re: Banner Manager

DivaVocals:

Ummm I believe the ZX Slideshow uses the banner manager and so does the slideshow Anne includes in her templates..


mc12345678:

Yes, the slideshow of Anne's templates (at least recent ones) does use the banner manager. Not familiar with the older templates, so can't speak for/about them.


Good to know for future reference.

I have used ZX Slideshow and from my experience it "ADDS" additional banner groups and would require including its tpl_ file to include those additional banner groups.

I simply needed to make the "Stock" banner groups display dynamic banners without the shop owner entering the HTML code which also doesn't record the clicks.
28 Dec 2013, 15:10
#8
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Posts:
10,011
Plugin Contributions:
1

Re: Banner Manager

rbarbour:

Good to know for future reference.

I have used ZX Slideshow and from my experience it "ADDS" additional banner groups and would require including its tpl_ file to include those additional banner groups.

I simply needed to make the "Stock" banner groups display dynamic banners without the shop owner entering the HTML code which also doesn't record the clicks.


Right.. The ZX Slideshow does add additional banner groups as does the slideshow Anne uses in her templates. Neither requires entering in the HTML code for the slides, they utilize image banners so it does record the clicks for each slide.. This means that it's EASY to add new slides and there's VERY little chance a client could foul up the slideshow (which is why Anne changed the slideshow she uses to use the banners feature). The ZX Slideshow only makes one SMALL modification to the "tpl_index_categories.php" and "tpl_index_default.php" files to include a call to the "zx_slideshow.php" file. The "zx_slideshow.php" file is where the new banner groups are called..

So yes if you want to use the stock banner positions, you will need custom code.. What code depends on whether you want one slideshow per banner group versus one image per banner group..

Now if you wanted to use the stock banner groups/positions with the ZX Slideshow code you could adapt some of the the "zx_slideshow.php" file's code to suit your needs. For example in the "tpl_main_page.php" file you could add modified code from the "zx_slideshow.php" file near the banner position you want to use.. You could then remove ALL of the current stock banner code in the "tpl_main_page.php" file. (this is not ALL of the "zx_slideshow.php" file, just a small example of how the code might be adapted)

<div class="slider-wrapper theme-<?php echo ZX_SLIDESHOW_THEME; ?>">
        <div id="slider" class="nivoSlider">
            <?php
  if (SHOW_BANNERS_GROUP_SET1 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET1)) {
    if ($banner->RecordCount() > 0) {
        echo zen_display_zx_slide('static', $banner); 
    }
  }
?>
            
            <?php
  if (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2)) {
    if ($banner->RecordCount() > 0) {
        echo zen_display_zx_slide('static', $banner); 
    }
  }
?>


This all assumes that you want the slideshow to display in ONE location on the page using only the stock banner groups..

If you were instead wanting to use only ONE banner group per SLIDESHOW (versus one image per banner group), then this of course will not work..
29 Dec 2013, 02:59
#9
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
6

Re: Banner Manager

DivaVocals:

Right.. The ZX Slideshow does add additional banner groups as does the slideshow Anne uses in her templates. Neither requires entering in the HTML code for the slides, they utilize image banners so it does record the clicks for each slide..


Right, but in order to use the six stock banner positions and use dynamic banners one has to enter the via the HTML code section.

DivaVocals:


This means that it's EASY to add new slides and there's VERY little chance a client could foul up the slideshow (which is why Anne changed the slideshow she uses to use the banners feature). The ZX Slideshow only makes one SMALL modification to the "tpl_index_categories.php" and "tpl_index_default.php" files to include a call to the "zx_slideshow.php" file. The "zx_slideshow.php" file is where the new banner groups are called..


Right but my OP was to find an alternative to ZX, I will take a further look at Anne's.

DivaVocals:


So yes if you want to use the stock banner positions, you will need custom code.. What code depends on whether you want one slideshow per banner group versus one image per banner group..


Is that a question?

DivaVocals:


Now if you wanted to use the stock banner groups/positions with the ZX Slideshow code you could adapt some of the the "zx_slideshow.php" file's code to suit your needs. For example in the "tpl_main_page.php" file you could add modified code from the "zx_slideshow.php" file near the banner position you want to use.. You could then remove ALL of the current stock banner code in the "tpl_main_page.php" file. (this is not ALL of the "zx_slideshow.php" file, just a small example of how the code might be adapted)

<div class="slider-wrapper theme-<?php echo ZX_SLIDESHOW_THEME; ?>">
        <div id="slider" class="nivoSlider">
            <?php
  if (SHOW_BANNERS_GROUP_SET1 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET1)) {
    if ($banner->RecordCount() > 0) {
        echo zen_display_zx_slide('static', $banner); 
    }
  }
?>
            
            <?php
  if (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2)) {
    if ($banner->RecordCount() > 0) {
        echo zen_display_zx_slide('static', $banner); 
    }
  }
?>


This all assumes that you want the slideshow to display in ONE location on the page using only the stock banner groups..

If you were instead wanting to use only ONE banner group per SLIDESHOW (versus one image per banner group), then this of course will not work..


ZX has already been ruled out, not even interested in trying to use it in place of the original six, it severely slows page loads using it just as a main page slider.
29 Dec 2013, 04:19
#10
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Posts:
10,011
Plugin Contributions:
1

Re: Banner Manager

Anne's slideshow is constructed just like the ZX Slideshow.. BOTH create new banner groups, and require you to upload your banner images to these new banner groups (one --or more-- images per banner group)

Neither uses the default banner groups and neither requires you to use the HTML code section of the banner manager.... it's all banner images..

rbarbour:

Right, but in order to use the six stock banner positions and use dynamic banners one has to enter the via the HTML code section.



Right but my OP was to find an alternative to ZX, I will take a further look at Anne's.



Is that a question?



ZX has already been ruled out, not even interested in trying to use it in place of the original six, it severely slows page loads using it just as a main page slider.
29 Dec 2013, 08:40
#11
balihr avatar

balihr

Totally Zenned

Join Date:
Oct 2008
Posts:
1,745
Plugin Contributions:
17

Re: Banner Manager

rbarbour:

ZX has already been ruled out, not even interested in trying to use it in place of the original six, it severely slows page loads using it just as a main page slider.


Hm... I would really love to hear more about this... ZX loads only on home page and has no affect on any other inner page of the site. As for severely slowing down page loads - I find that not true. It adds around 25kB and 7-8 requests so it can't be held responsible for slow loading. Of course, add 5 non-optimized 1000x400px images and it will take long to load it, but that's got nothing to do with ZX Slideshow itself.

rbarbour:

Custom Coding

I hope you realize how unfair this reply was. You asking for free help, but don't want to share your solution with others? There's quite a lot of custom code shared around here...
Or am I just being grumpy because I didn't get enough sleep?
29 Dec 2013, 08:50
#12
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
6

Re: Banner Manager

balihr:

Hm... I would really love to hear more about this... ZX loads only on home page and has no affect on any other inner page of the site. As for severely slowing down page loads - I find that not true. It adds around 25kB and 7-8 requests so it can't be held responsible for slow loading. Of course, add 5 non-optimized 1000x400px images and it will take long to load it, but that's got nothing to do with ZX Slideshow itself.


Of course my reply is MO!

balihr:


I hope you realize how unfair this reply was. You asking for free help, but don't want to share your solution with others? There's quite a lot of custom code shared around here...
Or am I just being grumpy because I didn't get enough sleep?


I offer my fair share of FREE help and FREE contributions.
29 Dec 2013, 16:16
#13
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Posts:
10,011
Plugin Contributions:
1

Re: Banner Manager

rbarbour:

Right but my OP was to find an alternative to ZX, I will take a further look at Anne's.

ZX has already been ruled out, not even interested in trying to use it in place of the original six, it severely slows page loads using it just as a main page slider.

Your original objection was based on the use of new banner groups versus the six original banner groups not page load.. :smile:

Neither Anne's slideshow or the ZX Slideshow use the six original banner groups.. BOTH create new groups for the slideshow. Hence my previous posted suggestion on how these slideshows could be adapted to use the six stock banner groups. (I used code from the ZX Slideshow as an example)

balihr:

Hm... I would really love to hear more about this... ZX loads only on home page and has no affect on any other inner page of the site. As for severely slowing down page loads - I find that not true. It adds around 25kB and 7-8 requests so it can't be held responsible for slow loading. Of course, add 5 non-optimized 1000x400px images and it will take long to load it, but that's got nothing to do with ZX Slideshow itself.
I have to agree. The Nivo Slider (of which the ZX Slideshow uses) is responsive and does not slow down page load at all.. non-optimized images will affect the page load and setting the slide transitions too slow will give the "appearance" of slow load. Neither of these is because of the Nivo Slider itself, and could be an issue for ANY slideshow.. This however is EASILY rectified, by adjusting the slide transitions and optimizing the slideshow images.
29 Dec 2013, 17:15
#14
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
6

Re: Banner Manager

rbarbour:



Lets say I upload (3) images and assign them to: Banner Display Groups - Header Position 1

How do I display all (3) images at once instead of 1 random image per page load?


rbarbour:



Simply allows my client to use the stock Banner Manager, show multiple banners as a group (jQuery Slide) and assign different effects to each banner group.

I needed a simple lightweight solution and alternative to ZX_slideshow and other sliders that require hard coding images in tpl or define files.

All banners loaded record Banner Views
All banners loaded record Banner Clicks


DivaVocals:

Your original objection was based on the use of new banner groups versus the six original banner groups not page load.. :smile:

Neither Anne's slideshow or the ZX Slideshow use the six original banner groups.. BOTH create new groups for the slideshow. Hence my previous posted suggestion on how these slideshows could be adapted to use the six stock banner groups. (I used code from the ZX Slideshow as an example)


OK, thanks for clarifying my original objective.

DivaVocals:


I have to agree. The Nivo Slider (of which the ZX Slideshow uses) is responsive and does not slow down page load at all.. non-optimized images will affect the page load and setting the slide transitions too slow will give the "appearance" of slow load. Neither of these is because of the Nivo Slider itself, and could be an issue for ANY slideshow.. This however is EASILY rectified, by adjusting the slide transitions and optimizing the slideshow images.


Again, my comments about ZX is MO.
29 Dec 2013, 17:28
#15
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Posts:
10,011
Plugin Contributions:
1

Re: Banner Manager

rbarbour:

OK, thanks for clarifying my original objective.
Sure..:smile:



rbarbour:

Again, my comments about ZX is MO.
Right.. NO IDEA what MO means.. but okay.. wasn't trying to talk you into anything.. just offering suggestions 'tis all..:smile:
29 Dec 2013, 17:49
#16
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,907
Plugin Contributions:
1

Re: Banner Manager

DivaVocals:

Sure..:smile:



Right.. NO IDEA what MO means..


MO = My Opinion :)
30 Dec 2013, 10:11
#17
balihr avatar

balihr

Totally Zenned

Join Date:
Oct 2008
Posts:
1,745
Plugin Contributions:
17

Re: Banner Manager

So, for anyone else interested in this thread and looking for a solution, here's one simple approach.

Requirement: show all banners from a specified group at once, instead of standard Zen Cart's random pick, but use Banner Manager and all of it's advantages (recording impressions and clicks, using links, using SSL filters etc).

Solution: use native code from banners_all with minimal modification:
<?php
$content = '';
$content .= '<div id="myImages">';
$new_banner_search = zen_build_banners_group(SHOW_BANNERS_GROUP_SET1);

  // 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_SET1);
    $content .= '<div class="eachImage">'.zen_display_banner('static', $banners_all->fields['banners_id']).'</div>';
// add spacing between banners (this is optional so I'm gonna disable it, we can control it from CSS)
/*    if ($banner_cnt < $banners_all->RecordCount()) {
      $content .= '<br /><br />';
    }
	*/
    $banners_all->MoveNext();
  }
  $content .= '</div>';
  echo $content;
?>

Incredibly simple, isn't it? I've just highlighted the changes I added...
30 Dec 2013, 12:03
#18
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
6

Re: Banner Manager

balihr:

So, for anyone else interested in this thread and looking for a solution, here's one simple approach.

Requirement: show all banners from a specified group at once, instead of standard Zen Cart's random pick, but use Banner Manager and all of it's advantages (recording impressions and clicks, using links, using SSL filters etc).

Solution: use native code from banners_all with minimal modification:
<?php
$content = '';
$content .= '<div id="myImages">';
$new_banner_search = zen_build_banners_group(SHOW_BANNERS_GROUP_SET1);

  // 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_SET1);
    $content .= '<div class="eachImage">'.zen_display_banner('static', $banners_all->fields['banners_id']).'</div>';
// add spacing between banners (this is optional so I'm gonna disable it, we can control it from CSS)
/*    if ($banner_cnt < $banners_all->RecordCount()) {
      $content .= '<br /><br />';
    }
	*/
    $banners_all->MoveNext();
  }
  $content .= '</div>';
  echo $content;
?>

Incredibly simple, isn't it? I've just highlighted the changes I added...


Like I said the code pretty much already existed, I guess I don't have to submit the jquery plugin. Works out!

Nice job @balihr
30 Dec 2013, 17:30
#19
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Posts:
10,011
Plugin Contributions:
1

Re: Banner Manager

balihr:

So, for anyone else interested in this thread and looking for a solution, here's one simple approach.

Requirement: show all banners from a specified group at once, instead of standard Zen Cart's random pick, but use Banner Manager and all of it's advantages (recording impressions and clicks, using links, using SSL filters etc).

Solution: use native code from banners_all with minimal modification:
<?php
$content = '';
$content .= '<div id="myImages">';
$new_banner_search = zen_build_banners_group(SHOW_BANNERS_GROUP_SET1);

  // 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_SET1);
    $content .= '<div class="eachImage">'.zen_display_banner('static', $banners_all->fields['banners_id']).'</div>';
// add spacing between banners (this is optional so I'm gonna disable it, we can control it from CSS)
/*    if ($banner_cnt < $banners_all->RecordCount()) {
      $content .= '<br /><br />';
    }
    */
    $banners_all->MoveNext();
  }
  $content .= '</div>';
  echo $content;
?>

Incredibly simple, isn't it? I've just highlighted the changes I added...

Nice.. As always you rock.. do you have a test site where one can see this in action??
30 Dec 2013, 18:35
#20
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
6

Re: Banner Manager

DivaVocals:

Nice.. As always you rock.. do you have a test site where one can see this in action??


Yes indeed, you made it look really simple :clap:

Couple Questions?

Is that a template file, module file?
If so, where do I put it? and Do I need to create a separate file for each banner group?

Probably not, I now see the code that calls the banner which means it replaces, I mean (does away with) the "stock" code in tpl_main_page.php, tpl_header.php & tpl_footer.php

Do I replace (cont.)
<?php
  if (SHOW_BANNERS_GROUP_SET1 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET1)) {
    if ($banner->RecordCount() > 0) {
?>
<div id="bannerOne" class="banners"><?php echo zen_display_banner('static', $banner); ?></div>
<?php
    }
  }
?>


with all this:?
<?php
$content = '';
$content .= '<div id="myImages">';
$new_banner_search = zen_build_banners_group(SHOW_BANNERS_GROUP_SET1);

  // 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_SET1);
    $content .= '<div class="eachImage">'.zen_display_banner('static', $banners_all->fields['banners_id']).'</div>';
// add spacing between banners (this is optional so I'm gonna disable it, we can control it from CSS)
/*    if ($banner_cnt < $banners_all->RecordCount()) {
      $content .= '<br /><br />';
    }
	*/
    $banners_all->MoveNext();
  }
  $content .= '</div>';
  echo $content;
?>


Just asking, for anyone else interested in this thread and looking for a solution?