So far its not too bad.
I have a 3 column page set up and the first column shows 1st and 2nd level categories and links to the correct pages all alphabetically sorted.
The second column shows a list of manufacturers alphabetically sorted.
Its the third column that I am having problems with. Its supposed to show a list of all the help pages on the website, and there are many. I am not using the infopages setup which may be a problem, or not making it easier. I just have not got round to updating all the pages. Nothing shows in the list and I am stuck on what to ask AI next.
Each of the help pages in the language file has a class set in a div which is what AI is trying to target unsuccessfully.
Is there an easy way of getting a list of these files or is it something that is not possible.
Here is the section of code for that part of the page that AI has created which I am sure could be improved.
Code: Select all
// Help Pages (Check Language Files for infopage Class)
echo '<li>Help Pages<ul>';
// Directory where your help pages are stored (root folder)
$help_pages_dir = DIR_FS_CATALOG; // Adjust this if needed
// Scan for main help page files in the root folder
$main_files = glob($help_pages_dir . '*.php');
foreach ($main_files as $main_file) {
// Assuming the language file follows the naming convention
$file_name = basename($main_file, '.php'); // Get base file name (without extension)
$language_file = DIR_FS_CATALOG . '/pclatest/includes/language/english/' . $file_name . '.php'; // Adjust as necessary
// Check if the language file exists
if (file_exists($language_file)) {
include($language_file); // Load the language definitions
// Now check if the language file contains the infopage class
if (strpos($language_contents, '<div class="infopage">') !== false) {
// If the infopage class exists, display the help page
$display_name = ucwords(str_replace('_', ' ', $file_name)); // Convert to readable name
echo '<li><a href="index.php/' . $file_name . '.php">' . $display_name . '</a></li>';
}
} else {
// Optional: You could log or handle missing language files
}
}
echo '</ul></li>';