Zen Cart Logo
Forums / Bug Reports / [Fixed 1.6.0] ez pages toc links not displaying any more

[Fixed 1.6.0] ez pages toc links not displaying any more

Locked

Views: 7,073

Results 21 to 30 of 30
This thread is locked. New replies are disabled.
30 Sep 2012, 4:08 PM
#21
wilt avatar

wilt

Oji-san

Join Date:
Jun 2003
Location:
Newcastle UK
Posts:
1,837
Plugin Contributions:
3

[Fixed 1.6.0] ez pages toc links not displaying any more

Also

Just wanted to say, despite me asking about datadiggers querycache stuff, I am not blaming his code.
The fact that we included it in v1.5.1 shows that we like his work :smile:

My gut feeling at the moment is that the problem is caused by an interaction of a number of factors.
Some to do with the core queryFactory code, some to do with the change in the core mysql drivers in php5.3
and some other strange effects (possibly exacerbated by query cache) with the way php copies/clone objects and how this affects mysql resource id references, and their internal state.

30 Sep 2012, 9:46 PM
#22
artworkz avatar

artworkz

New Zenner

Join Date:
Nov 2010
Location:
Fife, Scotland
Posts:
22
Plugin Contributions:
0

Re: [Fixed 1.6.0] ez pages toc links not displaying any more

My earlier site which has been in stasis since end of May, when I migrated to a new server....both of my sites are the same 1.3.9.h, apart from the following changes, mainly to ensure faster operation.....here's my changelog

27/6/12
php.ini added at root to define mysqli default socket
15/06/12
modded sessions database table to innoDB
GZip turned on
modded whos_online table to innoDB
Get rid of products_viewed stats /includes/modules/pages/product_info/main_template_vars.php
removed the line with the update ( it should be line 39-42)

added mod Query Cache (data diggers)
caching improvements from Zen info pages added to includes/.htaccess
29/09/12
modded in includes/modules/pages/page/header_php.php
$pages_listing = $db->execute($pages_order_query); moved 5 lines lower as quick fix for table of contents bug conflict

Both sites use image handler 2, stock by attributes, zen lightbox, uk postcode shipping mods...

And both sites show the same behaviour...

1 Oct 2012, 4:08 PM
#23
wilt avatar

wilt

Oji-san

Join Date:
Jun 2003
Location:
Newcastle UK
Posts:
1,837
Plugin Contributions:
3

Re: [Fixed 1.6.0] ez pages toc links not displaying any more

confused.

I asked if you had datadiggers query cache installed and you said no.

Hi Wilt...no query cache installed for me..have asked justhost to let me know what upgrades they did on the server...should hear soon

and now you say you do have it installed

Get rid of products_viewed stats /includes/modules/pages/product_info/main_template_vars.php
removed the line with the update ( it should be line 39-42)

added mod Query Cache (data diggers)

1 Oct 2012, 5:06 PM
#24
artworkz avatar

artworkz

New Zenner

Join Date:
Nov 2010
Location:
Fife, Scotland
Posts:
22
Plugin Contributions:
0

Re: [Fixed 1.6.0] ez pages toc links not displaying any more

Hi Wilt

sorry...brain fade on that one...just to confirm, then, my legacy site has NO query cache installed....the current live site DOES. Both had the same ToC problem. Apologies....

1 Oct 2012, 10:08 PM
#25
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: [Fixed 1.6.0] ez pages toc links not displaying any more

I'd like to test what I think is an improvement to the code overall:

/includes/modules/pages/page/header_php.php
change the following:```
[strike]$pages_listing = $db->execute($pages_order_query);[/strike]

while (!$pages_ordering->EOF) {
$vert_links[] = $pages_ordering->fields['pages_id'];
$pages_ordering->MoveNext();
}
to this instead (changing one line, adding another line):
[B]$toc_links = array();[/B]

while (!$pages_ordering->EOF) {
$vert_links[] = $pages_ordering->fields['pages_id'];
[B] $toc_links[] = array('pages_id' => $pages_ordering->fields['pages_id'], 'pages_title' => $pages_ordering->fields['pages_title']);[/B]
$pages_ordering->MoveNext();
}


And also for /includes/templates/YOUR_TEMPLATE_NAME_HERE/templates/tpl_page_default.php
change this:

if ($pages_listing->RecordCount() > 1 and EZPAGES_SHOW_TABLE_CONTENTS == '1') {?>

<div id="navEZPagesTOCWrapper"> <h2 id="ezPagesTOCHeading"><?php echo TEXT_EZ_PAGES_TABLE_CONTEXT; ?></h2> <div id="navEZPagesTOC"> <ul> <?php while (!$pages_listing->EOF) { // could be used to change classes on current link and toc (table of contents) links if ($pages_listing->fields['pages_id'] == $_GET['id']) { ?> <li><?php echo CURRENT_PAGE_INDICATOR; ?><a href="<?php echo zen_ez_pages_link($pages_listing->fields['pages_id']);?>"><?php echo $pages_listing->fields['pages_title']; ?></a></li> <?php } else { ?> <li><?php echo NOT_CURRENT_PAGE_INDICATOR; ?><a href="<?php echo zen_ez_pages_link($pages_listing->fields['pages_id']); ?>"><?php echo $pages_listing->fields['pages_title']; ?></a></li> <?php } [strike] $pages_listing->MoveNext();[/strike] } ?> </ul> ```to this:``` if ([B]sizeof($toc_links) [/B]> 1 and EZPAGES_SHOW_TABLE_CONTENTS == '1') {?> <div id="navEZPagesTOCWrapper"> <h2 id="ezPagesTOCHeading"><?php echo TEXT_EZ_PAGES_TABLE_CONTEXT; ?></h2> <div id="navEZPagesTOC"> <ul> <?php [B]foreach($toc_links as $link) [/B]{ // could be used to change classes on current link and toc (table of contents) links if ($[B]link[/B]['pages_id'] == $_GET['id']) { ?> <li><?php echo CURRENT_PAGE_INDICATOR; ?><a href="<?php echo zen_ez_pages_link($[B]link[/B]['pages_id']);?>"><?php echo $[B]link[/B]['pages_title']; ?></a></li> <?php } else { ?> <li><?php echo NOT_CURRENT_PAGE_INDICATOR; ?><a href="<?php echo zen_ez_pages_link($[B]link[/B]['pages_id']); ?>"><?php echo $[B]link[/B]['pages_title']; ?></a></li> <?php } } ?> </ul> ```
3 Oct 2012, 6:05 PM
#26
wilt avatar

wilt

Oji-san

Join Date:
Jun 2003
Location:
Newcastle UK
Posts:
1,837
Plugin Contributions:
3

Re: [Fixed 1.6.0] ez pages toc links not displaying any more

artworkz:

Hi Wilt

sorry...brain fade on that one...just to confirm, then, my legacy site has NO query cache installed....the current live site DOES. Both had the same ToC problem. Apologies....

No Probs. Thanks for the clarification :smile:

6 Oct 2012, 7:32 PM
#27
laurelsstitchery avatar

laurelsstitchery

Zen Follower

Join Date:
Jun 2010
Posts:
145
Plugin Contributions:
0

Re: [Fixed 1.6.0] ez pages toc links not displaying any more

DrByte - I upgraded to 1.5.1 last night and discovered my TOC for a set of EZ-pages wasn't working this morning. I implemented the changes you detailed below and it's working again. Thanks! :)

DrByte:

I'd like to test what I think is an improvement to the code overall:

/includes/modules/pages/page/header_php.php
change the following:```
[strike]$pages_listing = $db->execute($pages_order_query);[/strike]

while (!$pages_ordering->EOF) {
$vert_links[] = $pages_ordering->fields['pages_id'];
$pages_ordering->MoveNext();
}
to this instead (changing one line, adding another line):
[B]$toc_links = array();[/B]

while (!$pages_ordering->EOF) {
$vert_links[] = $pages_ordering->fields['pages_id'];
[B] $toc_links[] = array('pages_id' => $pages_ordering->fields['pages_id'], 'pages_title' => $pages_ordering->fields['pages_title']);[/B]
$pages_ordering->MoveNext();
}

> 
> And also for /includes/templates/YOUR_TEMPLATE_NAME_HERE/templates/tpl_page_default.php
> change this:
> ```
  if ($pages_listing->RecordCount() > 1 and EZPAGES_SHOW_TABLE_CONTENTS == '1') {?>
 <div id="navEZPagesTOCWrapper">
 <h2 id="ezPagesTOCHeading"><?php echo TEXT_EZ_PAGES_TABLE_CONTEXT; ?></h2>
 <div id="navEZPagesTOC">
 <ul>
<?php while (!$pages_listing->EOF) {
 // could be used to change classes on current link and toc (table of contents) links
      if ($pages_listing->fields['pages_id'] == $_GET['id']) { ?>
 
<li><?php echo CURRENT_PAGE_INDICATOR; ?><a href="<?php echo zen_ez_pages_link($pages_listing->fields['pages_id']);?>"><?php echo $pages_listing->fields['pages_title']; ?></a></li>
 
 <?php } else { ?>
 
<li><?php echo NOT_CURRENT_PAGE_INDICATOR; ?><a href="<?php echo  zen_ez_pages_link($pages_listing->fields['pages_id']); ?>"><?php echo $pages_listing->fields['pages_title']; ?></a></li>
 <?php
       }
[strike]      $pages_listing->MoveNext();[/strike]
     } ?>
 </ul>
```to this:```
  if ([B]sizeof($toc_links) [/B]> 1 and EZPAGES_SHOW_TABLE_CONTENTS == '1') {?>
 <div id="navEZPagesTOCWrapper">
 <h2 id="ezPagesTOCHeading"><?php echo TEXT_EZ_PAGES_TABLE_CONTEXT; ?></h2>
 <div id="navEZPagesTOC">
 <ul>
<?php [B]foreach($toc_links as $link) [/B]{
 // could be used to change classes on current link and toc (table of contents) links
      if ($[B]link[/B]['pages_id'] == $_GET['id']) { ?>
 
<li><?php echo CURRENT_PAGE_INDICATOR; ?><a href="<?php echo zen_ez_pages_link($[B]link[/B]['pages_id']);?>"><?php echo $[B]link[/B]['pages_title']; ?></a></li>
 
 <?php } else { ?>
 
<li><?php echo NOT_CURRENT_PAGE_INDICATOR; ?><a href="<?php echo zen_ez_pages_link($[B]link[/B]['pages_id']); ?>"><?php echo $[B]link[/B]['pages_title']; ?></a></li>
 <?php
       }
     } ?>
 </ul>
6 Oct 2012, 8:11 PM
#28
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: [Fixed 1.6.0] ez pages toc links not displaying any more

Thanks for confirming.

20 Nov 2012, 9:20 AM
#30
enzo_ita avatar

enzo_ita

Zen Follower

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

Re: [Fixed 1.6.0] ez pages toc links not displaying any more

Had the same problem,
found this thread and fixed.
I can confirm it works either.
ZC 1.5.1. Italian version.
Ciao from Italy. enzo