Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.

Banner_Box_All on specific page?

Locked
This thread is locked. New replies are disabled.
27 Mar 2009, 2:58 PM
#1
robomike avatar

robomike

New Zenner

Join Date:
Nov 2008
Posts:
40
Plugin Contributions:
0

Post #1 by robomike

Hi Zenners,

I was just wondering if it was possible to put the Banner_Box_all on a specific eZpage, and not all of the pages?

If so, please let me know.

Thanks!!

27 Mar 2009, 3:08 PM
#2
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Post #2 by yellow1912

if($current_page_base == 'page' && $_GET['id'] == 19){
// replace 19 with the specific id of the ezpage.
// banner code
}

I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

27 Mar 2009, 6:29 PM
#3
robomike avatar

robomike

New Zenner

Join Date:
Nov 2008
Posts:
40
Plugin Contributions:
0

Post #3 by robomike

yellow1912:

if($current_page_base == 'page' && $_GET['id'] == 19){
// replace 19 with the specific id of the ezpage.
// banner code
}

Where is that code located?

27 Mar 2009, 6:42 PM
#4
robomike avatar

robomike

New Zenner

Join Date:
Nov 2008
Posts:
40
Plugin Contributions:
0

Post #4 by robomike

Doh... silly me. ;)

27 Mar 2009, 7:26 PM
#5
robomike avatar

robomike

New Zenner

Join Date:
Nov 2008
Posts:
40
Plugin Contributions:
0

Post #5 by robomike

Ok the code for that box is

// 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());
// ALTER TABLE `banners` ADD `banners_sort_order` INT( 11 ) DEFAULT '0' NOT NULL;

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

  if ($show_banner_box_all == true) {
    $banner_box[] = TEXT_BANNER_BOX_ALL;
    $banner_box_group= SHOW_BANNERS_GROUP_SET_ALL;

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

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

I'm a little lost... any ideas? :mellow:

27 Mar 2009, 8:56 PM
#6
robomike avatar

robomike

New Zenner

Join Date:
Nov 2008
Posts:
40
Plugin Contributions:
0

Post #6 by robomike

Ok, My code is now

<?php
/**
 * banner_box_all 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_all.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_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());
// ALTER TABLE `banners` ADD `banners_sort_order` INT( 11 ) DEFAULT '0' NOT NULL;
if($current_page_base == 'page' && $_GET['id'] = 2){
	// replace 19 with the specific id of the ezpage.
	// banner code

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

  if ($show_banner_box_all == true) {
    $banner_box[] = TEXT_BANNER_BOX_ALL;
    $banner_box_group= SHOW_BANNERS_GROUP_SET_ALL;

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

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

The problem is that when I change the number 2 in

if($current_page_base == 'page' && $_GET['id'] = 2){

The banners don't move to another page.

so when my EzPages tell me that the Ezpage is number 2, how can I verify that?

In case you want to look at, my site , i am looking for my Order ..... , to have the sidebox banners all....

The Order page is the link to the right of Home.

I look forward to your help.

27 Mar 2009, 9:13 PM
#7
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Post #7 by yellow1912

This one https://smartmow.com/index.php?main_page=product_info&cPath=1&products_id=1 ?

This is not an ezpage tho?

Or this one?
http://smartmow.com/index.php?main_page=page&id=2

Also, your site has some problem, zenid is attached to all links even after the 2nd page load.

I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

28 Mar 2009, 8:18 AM
#8
robomike avatar

robomike

New Zenner

Join Date:
Nov 2008
Posts:
40
Plugin Contributions:
0

Post #8 by robomike

yellow1912:

This one https://smartmow.com/index.php?main_page=product_info&cPath=1&products_id=1 ?

This is not an ezpage tho?

Or this one?
http://smartmow.com/index.php?main_page=page&id=2

Also, your site has some problem, zenid is attached to all links even after the 2nd page load.

They're ezpages ... I made them with the EzPage tool, and they show up in my Ezpage listing. I even edit them through there....

What problem does my site have?? This is the first time I am hearing this and your help would be great!

16 Apr 2009, 9:48 PM
#9
robomike avatar

robomike

New Zenner

Join Date:
Nov 2008
Posts:
40
Plugin Contributions:
0

Post #9 by robomike

Can't someone help me?

18 Apr 2009, 1:46 PM
#10
ajeh avatar

ajeh

Oba-san

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

Post #10 by ajeh

You have a typo that you are working with, where you have a single equal ( = ) vs a double equal ( == ) in the IF statement that will break things ... :eek:

So, let's make the code a bit easier ...

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

[B]if ($current_page_base == 'page' && $_GET['id'] == 2) {
// only show on one ez_page id 2
    $show_banner_box_all = true;
} else {
// do not show
    $show_banner_box_all = false;
}
[/B]
  if ($show_banner_box_all == true) {

This method allows the original code to be there, then your new condition to happen in the middle and then the main IF test follows to see whether or not the code should even be run ...

You can do this code either way ... I just like to keep the code small and easy to spot on the changes ...

See if this helps you out ...

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!

4 Jun 2009, 7:58 PM
#11
gezuvor avatar

gezuvor

New Zenner

Join Date:
Apr 2007
Location:
Orange County, CA
Posts:
88
Plugin Contributions:
2

Post #11 by gezuvor

yellow1912:

if($current_page_base == 'page' && $_GET['id'] == 19){
// replace 19 with the specific id of the ezpage.
// banner code
}

I am trying to do something similar to this, where I control content based on whether I'm on the home page or not.

Is there some similar code that will do this:

<?php if($current_page_base == 'index'){
//Do one thing
} else {
//Do another thing
} ?>

I know the above isn't accurate, but can someone help with the call I should use??

5 Jun 2009, 2:59 AM
#12
ajeh avatar

ajeh

Oba-san

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

Post #12 by ajeh

$this_is_home_page will tell you if you are on the Home page of the site ...

if ($this_is_home_page == true) { 

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!