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>
```
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.