Site maintenance: Sun 15 Nov, from 12:00 UTC, about 4–6 hours. Details

This cutover relies on some testing that is still incomplete so may be cancelled at short notice

Forums / Templates, Stylesheets, Page Layout / Sorting EZ-Pages Into Sideboxes

Sorting EZ-Pages Into Sideboxes

Started by ojhernandez on 14 May 2011, 4:24 PM · Views: 2,185

Results 1 to 20 of 31
14 May 2011, 4:24 PM
#1
ojhernandez avatar

ojhernandez

New Zenner

Join Date:
May 2010
Posts:
67
Plugin Contributions:
0

Sorting EZ-Pages Into Sideboxes

Hello,

I've tried searching the forum and have kind of found what I've been looking for but I don't exactly understand it.

My main issue is that I need to clone the "sideboxes/ezpages.php" sidebox.

But after I do this, I need to take an extra step and make some EZ-Pages appear in one sidebox and some appear in another.

Basically, let's say I have four EZ-Pages, named "A," "E," "C," and "D."

I then have two EZ-Page sideboxes named "Vowels" and "Consonants"

The pages would then have to be sorted this way:

Vowels: A E

Consonants: C D

How can I do this?

Thanks In Advance :D,

ojhernandez

14 May 2011, 5:27 PM
#2
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Sorting EZ-Pages Into Sideboxes

My guess is that this is not that easy... You may need to duplicate a lot more than just the sidebox, because EZPages are stored in the database, and are not files like the define pages.

You may be able to build something that creates a flag on a page ID, where the flag identifies the relevant sidebox, so when you create a page you would at that point specify what sidebox is needs to relate to.

Whatever solution, it will require many files to be edited, and most certainly some changes/additions to the database.

20 years a Zencart User

14 May 2011, 6:37 PM
#3
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: Sorting EZ-Pages Into Sideboxes

Actually, it would not be that difficult to make a basic filter, and would only require adding code to the two ez-page sidebox module files.```php
$box_id = 'ezpages';
$rows = 0;
while (!$page_query->EOF) {
if (in_array($page_query->fields['pages_id'], explode(',', '1,3,5,7,11'))) { //list of ez-page ids to display in this box

    //existing code

    } //in_array
    $page_query->MoveNext();
  }

Alternate:php
if (in_array($page_query->fields['pages_id'], explode(',', EZPAGES_SIDEBOX_LIST))) { //list of ez-page ids to display in this box

and in a language file```php
define('EZPAGES_SIDEBOX_LIST', '1,3,5,7,11');
define('EZPAGES2_SIDEBOX_LIST', '2,4,6,8,9,10');
14 May 2011, 6:39 PM
#4
ojhernandez avatar

ojhernandez

New Zenner

Join Date:
May 2010
Posts:
67
Plugin Contributions:
0

Re: Sorting EZ-Pages Into Sideboxes

I appreciate your reply!

Have you heard of anyone who has done this?

Maybe with some documentation on how to implement this?

Thanks In Advance,

ojhernandez

14 May 2011, 6:43 PM
#5
ojhernandez avatar

ojhernandez

New Zenner

Join Date:
May 2010
Posts:
67
Plugin Contributions:
0

Re: Sorting EZ-Pages Into Sideboxes

gjh42:

Actually, it would not be that difficult to make a basic filter, and would only require adding code to the two ez-page sidebox module files.

I just saw your reply!

So basically (Since my knowledge of PHP is certainly lacking), the sidebox is just calling EZ-Pages with certain IDs which I determine?

I apologize for the inconvienence but could you please explain what the code does and where do I add it to?

Thank You So Much!

ojhernandez

14 May 2011, 6:50 PM
#6
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: Sorting EZ-Pages Into Sideboxes

Assuming you understand the basic process of cloning a sidebox and using the template override system (or can read the tutorials on those subjects), you would add the two lines to /includes/modules/sideboxes/your_template/ezpages.php and ezpages2.php```php
if (in_array($page_query->fields['pages_id'], explode(',', '1,3,5,7,11'))) { //list of ez-page ids to display in this box

    } //in_array
14 May 2011, 7:56 PM
#7
ojhernandez avatar

ojhernandez

New Zenner

Join Date:
May 2010
Posts:
67
Plugin Contributions:
0

Re: Sorting EZ-Pages Into Sideboxes

I'm sorry for my confusion but in your original reply you had three code boxes.

Which ones do I use? Also, one mentioned language files.

Where does each code snippet go?

Thank You So Much!

ojhernandez

14 May 2011, 8:14 PM
#8
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: Sorting EZ-Pages Into Sideboxes

The second and third boxes are an alternate method - more flexible and elegant, but not to worry about if they confuse you. Just use the one I described first and expanded on.

15 May 2011, 1:40 AM
#9
ojhernandez avatar

ojhernandez

New Zenner

Join Date:
May 2010
Posts:
67
Plugin Contributions:
0

Re: Sorting EZ-Pages Into Sideboxes

Thank You for all your help!

Can you please direct me to the tutorial for cloning a sidebox?

I have seen several posts on this and don't want to choose the right one.

Thanks,

ojhernandez

15 May 2011, 2:04 AM
#10
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: Sorting EZ-Pages Into Sideboxes

If you don't want to choose the right one, then you probably won't want to look at this forum thread ;)
how to add an additional sidebox

15 May 2011, 5:11 PM
#11
ojhernandez avatar

ojhernandez

New Zenner

Join Date:
May 2010
Posts:
67
Plugin Contributions:
0

Re: Sorting EZ-Pages Into Sideboxes

gjh42:

If you don't want to choose the right one, then you probably won't want to look at this forum thread ;)
how to add an additional sidebox

I was able to successfully modify the existing code in "ezpages.php" to see how it works.

Now that I know how to edit it successfully I want to clone it but I am having trouble following the tutorial you sent me.

I am at the part where it says to create a new configuration key called "SHOW_BANNERS_GROUP_SET10".

I can't find the equivilent of this for EZ-Pages.

I looked at "tpl_ezpages.php" and can't find it.

Am I looking in the wrong place?

Thanks!,

ojhernandez

15 May 2011, 7:09 PM
#12
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: Sorting EZ-Pages Into Sideboxes

The content details of that post are for a banner sidebox, and are not applicable to the ezpages sidebox. Make the clone by duplicating the module and template file with "2" added to the name in all relevant places including inside the file code, adjust for the different page ids, and you should be good to go.

Another way you could handle it would be to get the Blank Sidebox mod from Free Addons, adjust its filenames to your purposes, and copy the functional ez-pages code into those files and adjust.

15 May 2011, 7:52 PM
#13
ojhernandez avatar

ojhernandez

New Zenner

Join Date:
May 2010
Posts:
67
Plugin Contributions:
0

Re: Sorting EZ-Pages Into Sideboxes

gjh42:

The content details of that post are for a banner sidebox, and are not applicable to the ezpages sidebox. Make the clone by duplicating the module and template file with "2" added to the name in all relevant places including inside the file code, adjust for the different page ids, and you should be good to go.

Hello!

Thanks for all your help until this point. I greatly appreciate it.

I cloned it and I believed it was successful except now, the sidebox doesn't display EZ-Pages. When the ID is enabled in the code, it displays the sidebox with the heading but doesn't actually show the pages.

I put the code here because I know I'm probably making a simple mistake.

ezpages.php:

<?php
/**
 * ezpages sidebox - used to display links to EZ-Pages content
 *
 * @package templateSystem
 * @copyright Copyright 2003-2007 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: ezpages.php 6021 2007-03-17 16:34:19Z ajeh $
 */

  $zco_notifier->notify('NOTIFY_START_EZPAGES_SIDEBOX');

  // test if sidebox should display
  if (EZPAGES_STATUS_SIDEBOX == '1' or (EZPAGES_STATUS_SIDEBOX== '2' and (strstr(EXCLUDE_ADMIN_IP_FOR_MAINTENANCE, $_SERVER['REMOTE_ADDR'])))) {
    if (isset($var_linksList)) {
      unset($var_linksList);
    }
    $page_query = $db->Execute("select * from " . TABLE_EZPAGES . " where status_sidebox = 1 and sidebox_sort_order > 0 order by sidebox_sort_order, pages_title");
    if ($page_query->RecordCount()>0) {
      $title =  BOX_HEADING_EZPAGES;
      $box_id =  'ezpages';
      $rows = 0;
      while (!$page_query->EOF) {

	if (in_array($page_query->fields['pages_id'], explode(',', '11,12,13,14,15,16'))) { //list of ez-page ids to display in this box

        $rows++;
        $page_query_list_sidebox[$rows]['id'] = $page_query->fields['pages_id'];
        $page_query_list_sidebox[$rows]['name'] = $page_query->fields['pages_title'];
        $page_query_list_sidebox[$rows]['altURL']  = "";
        switch (true) {
          // external link new window or same window
          case ($page_query->fields['alt_url_external'] != ''):
          $page_query_list_sidebox[$rows]['altURL']  = $page_query->fields['alt_url_external'];
          break;
          // internal link new window
          case ($page_query->fields['alt_url'] != '' and $page_query->fields['page_open_new_window'] == '1'):
          $page_query_list_sidebox[$rows]['altURL']  = (substr($page_query->fields['alt_url'],0,4) == 'http') ?
          $page_query->fields['alt_url'] :
          ($page_query->fields['alt_url']=='' ? '' : zen_href_link($page_query->fields['alt_url'], '', ($page_query->fields['page_is_ssl']=='0' ? 'NONSSL' : 'SSL'), true, true, true));
          break;
          // internal link same window
          case ($page_query->fields['alt_url'] != '' and $page_query->fields['page_open_new_window'] == '0'):
          $page_query_list_sidebox[$rows]['altURL']  = (substr($page_query->fields['alt_url'],0,4) == 'http') ?
          $page_query->fields['alt_url'] :
          ($page_query->fields['alt_url']=='' ? '' : zen_href_link($page_query->fields['alt_url'], '', ($page_query->fields['page_is_ssl']=='0' ? 'NONSSL' : 'SSL'), true, true, true));
          break;
        }

        // if altURL is specified, use it; otherwise, use EZPage ID to create link
        $page_query_list_sidebox[$rows]['link'] = ($page_query_list_sidebox[$rows]['altURL'] =='') ?
        zen_href_link(FILENAME_EZPAGES, 'id=' . $page_query->fields['pages_id'] . ($page_query->fields['toc_chapter'] > 0 ? '&chapter=' . $page_query->fields['toc_chapter'] : ''), ($page_query->fields['page_is_ssl']=='0' ? 'NONSSL' : 'SSL')) :
        $page_query_list_sidebox[$rows]['altURL'];
        $page_query_list_sidebox[$rows]['link'] .= ($page_query->fields['page_open_new_window'] == '1' ? '" target="_blank' : '');

	} //in_array        

	$page_query->MoveNext();
      }

      $title_link = false;

      $var_linksList = $page_query_list_sidebox;

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

      $zco_notifier->notify('NOTIFY_END_EZPAGES_SIDEBOX');
      require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
    }
  } // test for display

  $zco_notifier->notify('NOTIFY_END_EZPAGES_SIDEBOX');
?>

ezpages2.php

<?php
/**
 * ezpages sidebox - used to display links to EZ-Pages content
 *
 * @package templateSystem
 * @copyright Copyright 2003-2007 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: ezpages.php 6021 2007-03-17 16:34:19Z ajeh $
 */

  $zco_notifier->notify('NOTIFY_START_EZPAGES2_SIDEBOX');

  // test if sidebox should display
  if (EZPAGES2_STATUS_SIDEBOX == '1' or (EZPAGES2_STATUS_SIDEBOX== '2' and (strstr(EXCLUDE_ADMIN_IP_FOR_MAINTENANCE, $_SERVER['REMOTE_ADDR'])))) {
    if (isset($var_linksList)) {
      unset($var_linksList);
    }
    $page_query = $db->Execute("select * from " . TABLE_EZPAGES2 . " where status_sidebox = 1 and sidebox_sort_order > 0 order by sidebox_sort_order, pages_title");
    if ($page_query->RecordCount()>0) {
      $title =  BOX_HEADING_EZPAGES2;
      $box_id =  'ezpages2';
      $rows = 0;
      while (!$page_query->EOF) {
		if (in_array($page_query->fields['pages_id'], explode(',', '2,3,17,4,5,6,1,7,8,9,10'))) { //list of ez-page ids to display in this box

         
        $rows++;
        $page_query_list_sidebox[$rows]['id'] = $page_query->fields['pages_id'];
        $page_query_list_sidebox[$rows]['name'] = $page_query->fields['pages_title'];
        $page_query_list_sidebox[$rows]['altURL']  = "";
        switch (true) {
          // external link new window or same window
          case ($page_query->fields['alt_url_external'] != ''):
          $page_query_list_sidebox[$rows]['altURL']  = $page_query->fields['alt_url_external'];
          break;
          // internal link new window
          case ($page_query->fields['alt_url'] != '' and $page_query->fields['page_open_new_window'] == '1'):
          $page_query_list_sidebox[$rows]['altURL']  = (substr($page_query->fields['alt_url'],0,4) == 'http') ?
          $page_query->fields['alt_url'] :
          ($page_query->fields['alt_url']=='' ? '' : zen_href_link($page_query->fields['alt_url'], '', ($page_query->fields['page_is_ssl']=='0' ? 'NONSSL' : 'SSL'), true, true, true));
          break;
          // internal link same window
          case ($page_query->fields['alt_url'] != '' and $page_query->fields['page_open_new_window'] == '0'):
          $page_query_list_sidebox[$rows]['altURL']  = (substr($page_query->fields['alt_url'],0,4) == 'http') ?
          $page_query->fields['alt_url'] :
          ($page_query->fields['alt_url']=='' ? '' : zen_href_link($page_query->fields['alt_url'], '', ($page_query->fields['page_is_ssl']=='0' ? 'NONSSL' : 'SSL'), true, true, true));
          break;
        }

        // if altURL is specified, use it; otherwise, use EZPage ID to create link
        $page_query_list_sidebox[$rows]['link'] = ($page_query_list_sidebox[$rows]['altURL'] =='') ?
        zen_href_link(FILENAME_EZPAGES2, 'id=' . $page_query->fields['pages_id'] . ($page_query->fields['toc_chapter'] > 0 ? '&chapter=' . $page_query->fields['toc_chapter'] : ''), ($page_query->fields['page_is_ssl']=='0' ? 'NONSSL' : 'SSL')) :
        $page_query_list_sidebox[$rows]['altURL'];
        $page_query_list_sidebox[$rows]['link'] .= ($page_query->fields['page_open_new_window'] == '1' ? '" target="_blank' : '');
       } //in_array
	 $page_query->MoveNext();
      }

      $title_link = false;

      $var_linksList = $page_query_list_sidebox;

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

      $zco_notifier->notify('NOTIFY_END_EZPAGES_SIDEBOX');
      require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
    }
  } // test for display

  $zco_notifier->notify('NOTIFY_END_EZPAGES2_SIDEBOX');
?>

tpl_ezpages.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_ezpages.php 2982 2006-02-07 07:56:41Z birdbrain $
 */
  $content = "";
  $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">';
  $content  .= "\n" . '<ul style="margin: 0; padding: 0; list-style-type: none;">' . "\n";
  for ($i=1, $n=sizeof($var_linksList); $i<=$n; $i++) { 
    $content .= '<li><a href="' . $var_linksList[$i]['link'] . '">' . $var_linksList[$i]['name'] . '</a></li>' . "\n" ;
  } // end FOR loop
  $content  .= '</ul>' . "\n";
  $content .= '</div>';
?>

tpl_ezpages2.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_ezpages.php 2982 2006-02-07 07:56:41Z birdbrain $
 */
  $content = "";
  $content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">';
  $content  .= "\n" . '<ul style="margin: 0; padding: 0; list-style-type: none;">' . "\n";
  for ($i=1, $n=sizeof($var_linksList); $i<=$n; $i++) { 
    $content .= '<li><a href="' . $var_linksList[$i]['link'] . '">' . $var_linksList[$i]['name'] . '</a></li>' . "\n" ;
  } // end FOR loop
  $content  .= '</ul>' . "\n";
  $content .= '</div>';
?>

I will say that to me, it didn't look like I needed to change anything in the "tpl" files so they are exactly the same, maybe that right there is the problem?

Thanks in Advance!

ojhernandez

16 May 2011, 12:32 AM
#14
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: Sorting EZ-Pages Into Sideboxes

One name that must not be changed is the database table: TABLE_EZPAGES2 should still be TABLE_EZPAGES. Does the original ezpages sidebox still work correctly?```php
$page_query = $db->Execute("select * from " . TABLE_EZPAGES2 . " where status_sidebox = 1 and sidebox_sort_order > 0 order by sidebox_sort_order, pages_title");
if ($page_query->RecordCount()>0) {

16 May 2011, 8:20 AM
#15
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Sorting EZ-Pages Into Sideboxes

When I look at the contributions Glenn Herbert makes to this forum I realise just how fortunate the forum is to have his expertise and commitment.

This series of posts is extremely valuable. Thanks a TON, Glen, for all you do around here. :clap:

20 years a Zencart User

16 May 2011, 10:10 PM
#16
ojhernandez avatar

ojhernandez

New Zenner

Join Date:
May 2010
Posts:
67
Plugin Contributions:
0

Re: Sorting EZ-Pages Into Sideboxes

schoolboy:

When I look at the contributions Glenn Herbert makes to this forum I realise just how fortunate the forum is to have his expertise and commitment.

I agree wholeheartedly with this observation.

gjh42:

One name that must not be changed is the database table: TABLE_EZPAGES2 should still be TABLE_EZPAGES. Does the original ezpages sidebox still work correctly?```php
$page_query = $db->Execute("select * from " . TABLE_EZPAGES2 . " where status_sidebox = 1 and sidebox_sort_order > 0 order by sidebox_sort_order, pages_title");
if ($page_query->RecordCount()>0) {


The original EZ-Pages Sidebox does work correctly!

"ezpages2.php" however is another story. I was trying to test it out with my EZ-Page '1' and it will not display even after I have verified that it is set to show in the sidebox with a sort order of 1.

I have edited the file by changing the mistake you told me to fix. The code is shown below.

ezpages2.php:
```php
<?php
/**
 * ezpages sidebox - used to display links to EZ-Pages content
 *
 * @package templateSystem
 * @copyright Copyright 2003-2007 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: ezpages.php 6021 2007-03-17 16:34:19Z ajeh $
 */

  $zco_notifier->notify('NOTIFY_START_EZPAGES2_SIDEBOX');

  // test if sidebox should display
  if (EZPAGES2_STATUS_SIDEBOX == '1' or (EZPAGES2_STATUS_SIDEBOX== '2' and (strstr(EXCLUDE_ADMIN_IP_FOR_MAINTENANCE, $_SERVER['REMOTE_ADDR'])))) {
    if (isset($var_linksList)) {
      unset($var_linksList);
    }
    $page_query = $db->Execute("select * from " . TABLE_EZPAGES . " where status_sidebox = 1 and sidebox_sort_order > 0 order by sidebox_sort_order, pages_title");
    if ($page_query->RecordCount()>0) {
      $title =  BOX_HEADING_EZPAGES2;
      $box_id =  'ezpages2';
      $rows = 0;
      while (!$page_query->EOF) {
		if (in_array($page_query->fields['pages_id'], explode(',', '1,2,3,17,4,5,6,1,7,8,9,10'))) { //list of ez-page ids to display in this box

         
        $rows++;
        $page_query_list_sidebox[$rows]['id'] = $page_query->fields['pages_id'];
        $page_query_list_sidebox[$rows]['name'] = $page_query->fields['pages_title'];
        $page_query_list_sidebox[$rows]['altURL']  = "";
        switch (true) {
          // external link new window or same window
          case ($page_query->fields['alt_url_external'] != ''):
          $page_query_list_sidebox[$rows]['altURL']  = $page_query->fields['alt_url_external'];
          break;
          // internal link new window
          case ($page_query->fields['alt_url'] != '' and $page_query->fields['page_open_new_window'] == '1'):
          $page_query_list_sidebox[$rows]['altURL']  = (substr($page_query->fields['alt_url'],0,4) == 'http') ?
          $page_query->fields['alt_url'] :
          ($page_query->fields['alt_url']=='' ? '' : zen_href_link($page_query->fields['alt_url'], '', ($page_query->fields['page_is_ssl']=='0' ? 'NONSSL' : 'SSL'), true, true, true));
          break;
          // internal link same window
          case ($page_query->fields['alt_url'] != '' and $page_query->fields['page_open_new_window'] == '0'):
          $page_query_list_sidebox[$rows]['altURL']  = (substr($page_query->fields['alt_url'],0,4) == 'http') ?
          $page_query->fields['alt_url'] :
          ($page_query->fields['alt_url']=='' ? '' : zen_href_link($page_query->fields['alt_url'], '', ($page_query->fields['page_is_ssl']=='0' ? 'NONSSL' : 'SSL'), true, true, true));
          break;
        }

        // if altURL is specified, use it; otherwise, use EZPage ID to create link
        $page_query_list_sidebox[$rows]['link'] = ($page_query_list_sidebox[$rows]['altURL'] =='') ?
        zen_href_link(FILENAME_EZPAGES2, 'id=' . $page_query->fields['pages_id'] . ($page_query->fields['toc_chapter'] > 0 ? '&chapter=' . $page_query->fields['toc_chapter'] : ''), ($page_query->fields['page_is_ssl']=='0' ? 'NONSSL' : 'SSL')) :
        $page_query_list_sidebox[$rows]['altURL'];
        $page_query_list_sidebox[$rows]['link'] .= ($page_query->fields['page_open_new_window'] == '1' ? '" target="_blank' : '');
       } //in_array
	 $page_query->MoveNext();
      }

      $title_link = false;

      $var_linksList = $page_query_list_sidebox;

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

      $zco_notifier->notify('NOTIFY_END_EZPAGES_SIDEBOX');
      require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
    }
  } // test for display

  $zco_notifier->notify('NOTIFY_END_EZPAGES2_SIDEBOX');
?>

Could it be something related to "tpl_ezpages2.php"? I have left this file unchanged.

Thanks in Advance!

ojhernandez

16 May 2011, 10:17 PM
#17
ojhernandez avatar

ojhernandez

New Zenner

Join Date:
May 2010
Posts:
67
Plugin Contributions:
0

Re: Sorting EZ-Pages Into Sideboxes

I was looking at "ezpages2.php" again and saw that there was one mention of "EZPAGES" that was not edited to have the 2 after it.

This is shown in the line below:

$zco_notifier->notify('NOTIFY_END_EZPAGES_SIDEBOX');

This line is now edited to read:

$zco_notifier->notify('NOTIFY_END_EZPAGES2_SIDEBOX');

I fixed this and it still does not work.

Just wanted to add this in case that was the error.

Thanks,

ojhernandez

16 May 2011, 11:15 PM
#18
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Re: Sorting EZ-Pages Into Sideboxes

I can't see anything that should be a problem, assuming all of the constants for EZPAGES2 have been defined correctly... Okay, that's it.
Some of the constants are for admin settings, and without adding new code to probably several admin files, this test will fail:```php
// test if sidebox should display
if (EZPAGES2_STATUS_SIDEBOX == '1' or (EZPAGES2_STATUS_SIDEBOX== '2' and (strstr(EXCLUDE_ADMIN_IP_FOR_MAINTENANCE, $_SERVER['REMOTE_ADDR'])))) {

It needs to refer to the only existing admin setting, EZPAGES_STATUS_SIDEBOX```php
  // test if sidebox should display
  if (EZPAGES_STATUS_SIDEBOX == '1' or (EZPAGES_STATUS_SIDEBOX== '2' and (strstr(EXCLUDE_ADMIN_IP_FOR_MAINTENANCE, $_SERVER['REMOTE_ADDR'])))) { 

Both sideboxes will be on or off together.

16 May 2011, 11:18 PM
#19
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,189
Plugin Contributions:
0

Re: Sorting EZ-Pages Into Sideboxes

schoolboy:

When I look at the contributions Glenn Herbert makes to this forum I realise just how fortunate the forum is to have his expertise and commitment.

This series of posts is extremely valuable. Thanks a TON, Glen, for all you do around here. :clap:

I second that comment.....

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.

Zen Cart Certified hosting at myZenCartHost.com.

17 May 2011, 5:15 PM
#20
hairydog avatar

hairydog

Zen Follower

Join Date:
Sep 2006
Posts:
165
Plugin Contributions:
0

Re: Sorting EZ-Pages Into Sideboxes

I had to make a few more changes to get it to work. On line 53 of ezpages2.php it should say

  zen_href_link(FILENAME_EZPAGES, 'id=' 
```(without EZPAGES2)

The page_query that decides which EZ Page goes into which box wasn't working, because they both had the same name, so I renamed the second to $page_query2

And I had to add 

define('BOX_HEADING_EZPAGES2','Box 2 Heading');

to ez_pages_definitions.php

And now it works a treat!

Would it be worth making it a contrib?