Jump to content
Jack_mcs

Information Pages SEO addon

Recommended Posts

This addon allows the easy creation and handling of pages from within admin as well as a way to manage text on any page in the shop. It is based on the Information Pages Unlimited addon that has been around for years. While much of the code is different in this version, I wanted to keep the  compatibility with the original version, thus the similar name.

NOTE: There are three sets of files in this package, for different versions of oscommerce. The BS version is the only one that has all of the new features. The other two  versions are improvements over the original code but nowhere near that which is in the BS version. So any instructions or descriptions may apply to the other versions but are mainly meant for the BS version.

This version fixes many coding mistakes in the other version and adds many new features making it easier to use and more powerful. Some of the features are:

- Has a Box ID setting that allows you to control where the link to the page shows up. So, for example, if there are four footer modules installed, each could have links specific to them.

- A link can have sub-links (currently only available in the included module). So there could be a main link for widgets and sub-links for various kinds of widgets. There are two advantages to this: first, it takes up less room when there are many links and, second, the search engines will still be able to get to the pages.- There is a quick view button to allow displaying the page in a  browser to check the changes.

- There are quick fill options that allows categories and products to be added to a page with just a short statement. For example, if your site sells automobile parts and you are creating a new page about tires, you just need to type in PNAME(tires)PNAME and links for all of the products in your shop with tires in the name will be added to the page. See the Notes section on the editor page for additional methods.

- Allows setting the browser title and meta tags while editing the page in admin (only if Header Tags SEO is installed).

Share this post


Link to post
Share on other sites

Hi, I am using this addon. I have figured how to get the links to add to the Information box. But cannot figure how to add messages and where they go.

I tried editing the custiomer greeting but nothing happens.

I am using the BS version with template. Can send you link if you wish.

Share this post


Link to post
Share on other sites

To use the messages you need to add a line of code to wherever you want the message text to appear. See the readme_additional.txt file for what is needed. Please post again if you can't get it to work.

Share this post


Link to post
Share on other sites

I used a file editor to compared my site with the addon and what I am posting is only the part that is showing up as being different. The first file I am showing is from the (oscom-information addon) and the second file I posted is from my site.

My question is should I use the addon file to replace my site, try to combine them somehow or leave it alone?

 

application_top.php     oscom-information

// add category names or the manufacturer name to the breadcrumb trail

  if (isset($cPath_array)) {

    for ($i=0, $n=sizeof($cPath_array); $i<$n; $i++) {

      $categories_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$cPath_array[$i] . "' and language_id = '" . (int)$languages_id . "'");

      if (tep_db_num_rows($categories_query) > 0) {

        $categories = tep_db_fetch_array($categories_query);

        $breadcrumb->add($categories['categories_name'], tep_href_link(FILENAME_DEFAULT, 'cPath=' . implode('_', array_slice($cPath_array, 0, ($i+1)))));

      } else {

        break;

      }

    }

  } elseif (isset($HTTP_GET_VARS['manufacturers_id'])) {

    $manufacturers_query = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");

 

 application_top.php     MY site

 

$n=sizeof($cPath_array);

    for ($i=0; $i<$n; $i++) {     

      if ( defined('MODULE_HEADER_TAGS_CATEGORY_TITLE_SEO_BREADCRUMB_OVERRIDE') && (MODULE_HEADER_TAGS_CATEGORY_TITLE_SEO_BREADCRUMB_OVERRIDE == 'True') ) {

        $categories_query = tep_db_query("select coalesce(NULLIF(categories_seo_title, ''), categories_name) as categories_name from categories_description where categories_id = '" . (int)$cPath_array[$i] . "' and language_id = '" . (int)$languages_id . "'");

      }

      else {

        $categories_query = tep_db_query("select categories_name from categories_description where categories_id = '" . (int)$cPath_array[$i] . "' and language_id = '" . (int)$languages_id . "'");

      }   

      if (tep_db_num_rows($categories_query) > 0) {

        $categories = tep_db_fetch_array($categories_query);

        $breadcrumb->add($categories['categories_name'], tep_href_link(FILENAME_DEFAULT, 'cPath=' . implode('_', array_slice($cPath_array, 0, ($i+1)))));

      } else {

        break;

      }

    }

  } elseif (isset($_GET['manufacturers_id'])) {

    if ( defined('MODULE_HEADER_TAGS_MANUFACTURER_TITLE_SEO_BREADCRUMB_OVERRIDE') && (MODULE_HEADER_TAGS_MANUFACTURER_TITLE_SEO_BREADCRUMB_OVERRIDE == 'True') ) {

      $manufacturers_query = tep_db_query("select coalesce(NULLIF(mi.manufacturers_seo_title, ''), m.manufacturers_name) as manufacturers_name from manufacturers m, manufacturers_info mi where m.manufacturers_id = mi.manufacturers_id and m.manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "' and mi.languages_id = '" . (int)$languages_id . "'");

    }

    else {

      $manufacturers_query = tep_db_query("select manufacturers_name from manufacturers where manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "'");

    }

Share this post


Link to post
Share on other sites

Please read the install readme file. There are two small changes needed. Make those in your files and you're all set.

Share this post


Link to post
Share on other sites

I coded it to run without Header Tags SEO though I didn't test it that way so I can't say for sure.  Also, I don't know how, or even if, the stock Header Tags code will work with Information Pages.

Share this post


Link to post
Share on other sites

@Jack_mcs

Thank you very much for this addon. I installed it on BS (frozen) version.
In admin infobox, i can see two page link:
=================================================
Messages (information_manager.php?gID=2)
Pages (information_manager.php?gID=1)
=================================================
Both I have problem of using Browser Title / Meta Description / Meta Keywords.

How can I enable to use those?

 

=================================================
Messages (information_manager.php?gID=2)
=================================================

And when I add Messages, on the front page, i can not see any link of the message, unless I on admin/message, i lick on VIEW and it will link me to the front end with URL: mysite.com/information.php?info_id=8
---> how can i make the message show up in the front end homepage infobox?

ID= 1       HEADING_TITLE                     
ID= 2      TEXT_GREETING_PERSONAL                     
ID= 3       TEXT_GREETING_PERSONAL_RELOGON                       
ID= 4       TEXT_GREETING_GUEST                      
ID= 5        TEXT_MAIN

and at your instruction read_additional.txt

__________________________________________________________________
ADD TEXT TO ANY PAGE:

Find where you want to add the text on the
page and add the following:

 <!-- // BOF: Information Pages SEO -->
 <?php echo GetInformationPageText(XX); ?>
 <!-- // EOF: Information Pages SEO -->

Change the XX to the ID of the message in the Messages section in admin.
__________________________________________________________________

does it means i have to modify all the modules/content/index file so that it can show up? without any modification (no instruction) it doesn't seems modify any index message.

=================================================
Pages (information_manager.php?gID=1)
=================================================
eg, insert two pages: Page A and Page B, if I set up both pages without Parent ID, it will show up both pages on front page without problem, if I setup Page B with Parent ID Page A, on the front Page, I only see Page A, and there is no where has Page B show up, how can I make it works?


 

 

Many thanks!

Lyn

Share this post


Link to post
Share on other sites
6 hours ago, ce7 said:

Both I have problem of using Browser Title / Meta Description / Meta Keywords.

How can I enable to use those?

You don't mention what the problem is so I can only guess. But the title and tags section only works if you have my Header Tags SEO addon installed. If you do have that installed, be sure you have the pseudo_handler.php uploaded. It is located in the Extras directory of this archive. But there is a mistake in that it shows it belonging in the shops includes/modules/ directory while it should be in the admin includes/modules/ directory.

7 hours ago, ce7 said:

does it means i have to modify all the modules/content/index file so that it can show up? without any modification (no instruction) it doesn't seems modify any index message.

Messages only display if you add the code to display them. See the instructions in the readme_additional.txt file.

7 hours ago, ce7 said:

eg, insert two pages: Page A and Page B, if I set up both pages without Parent ID, it will show up both pages on front page without problem, if I setup Page B with Parent ID Page A, on the front Page, I only see Page A, and there is no where has Page B show up, how can I make it works?

Links to child pages only show up in the "Information Pages Block" module. If that is not installed and you want to see the links, you would have to add them by editing the code.

Please let me know if you have any other questions.

Share this post


Link to post
Share on other sites

Yes, it will work. There are some problems with the released version that will still be there but they won't stop it from working. I'll release an update with those fixes but it might be a month or so.

Share this post


Link to post
Share on other sites

A new version has been uploaded with these changes:

  • Added code to cross reference a message to a product and vice versa.
  • Added a pages setting for Messages to allow them to be shown on certain pages via hooks.
  • Added an option to add redirect code for original pages that are being replaced.
  • Added the Version Checker files.
  • Added the missing ajax file that allowed changing settings from the list page.
  • Added missing code to allow running without Header Tags SEO installed.
  • Added an infobox module.
  • Changed the Messages code so that the message ID or the message Title can be used to find the message.
  • Corrected the support thread link in the code so it goes to the correct thread.
  • Corrected spelling errors on the submit page that prevented the Header Tags settings from being added for new pages.
  • Corrected the code to properly show links to child pages.
  • Removed the predefined entries in the Messages section since this version allows for changing them.
  • Replaced the pseudo file with one that has security and spelling fixes.

This version is compatible with Phoenix. For both Frozen and Phoenix, only two core changes are needed for installation.

Here are some additional notes about a few of the changes that may not be clear:

- Cross Reference: In the admin for Pages, there is a box to enter what page, category, manufacturer, or product that the page is related to (or any combination of them). So if you enter pid=1 in that location, a link will appear on the product page that has an ID of 1 that references that page.

- Redirection: If you use this addon to replace a stock page, like privacy.php, you can have the code add redirection code from that page to the new one.

- Child pages: This all works correctly now. A page can be marked as a child to some other page so that related pages can be grouped.

Share this post


Link to post
Share on other sites
24 minutes ago, Jack_mcs said:

This version is compatible with Phoenix. For both Frozen and Phoenix, only two core changes are needed for installation.

If you changed that from functions to a class in includes/classes or under includes/modules, you could get rid of the catalog core changes.  Because when the autoloader sees something like

info_pages_class::call_method

It would automatically load includes/classes/info_pages_class.php if it exists. 


Always back up before making changes.

Share this post


Link to post
Share on other sites
18 hours ago, ecartz said:

If you changed that from functions to a class in includes/classes or under includes/modules, you could get rid of the catalog core changes.

Yes, I know. But it would take more time than I have for it to make that change. Maybe in the next version.

Share this post


Link to post
Share on other sites

Hi Jack @Jack_mcs, Good afternoon.

I uploaded all the files and completed all the installation steps.

On the index page of my site I receive the following errors:

Warning: include_once(/home2/XXX/includes/languages/espanol/information_pages.php): failed to open stream: No existe el fichero o el directorio in /home2/XXX/includes/hooks/shop/siteWide/information_pages_xref.php on line 25

Warning: include_once(): Failed opening '/home2/XXX/includes/languages/espanol/information_pages.php' for inclusion (include_path='.:/opt/php71/lib/php') in /home2/XXX/includes/hooks/shop/siteWide/information_pages_xref.php on line 25

My site is in spanish , I didnt find in the addon files I downloaded the file includes/languages/english/information_pages.php

Any clues?

Best regards.

Valqui


:heart: Community Oscommerce fan :heart: You'll find the latest osC community version here.

 

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites
21 hours ago, valquiria23 said:

My site is in spanish , I didnt find in the addon files I downloaded the file includes/languages/english/information_pages.php

You are correct. The file is missing. It is attached. Please give it a try and let me know if there are other problems.

information_pages.php

Share this post


Link to post
Share on other sites

A new version has been uploaded. It just contains missing files, mainly for the Frozen version, so if you are not having problems with the addon, you can skip this version.

Share this post


Link to post
Share on other sites

Phoenix 1.0.4.3  PHP 7.3

Admin seems OK

Shop side I get this when accessing pages that I have created.

Warning: Use of undefined constant INFORMATION_PAGES_SEO_XREF_ENABLE - assumed 'INFORMATION_PAGES_SEO_XREF_ENABLE' (this will throw an Error in a future version of PHP) in D:\*****\htdocs\includes\hooks\shop\siteWide\information_pages_xref.php on line 21


Live Phoenix 1.0.5.0 on PHP 7.3

Is your version of osC up to date? You'll find the latest osC community version (CE Phoenix 1.0.6.0) here.

Share this post


Link to post
Share on other sites

It looks like you didn't run the database script. Please give that a try and let me know if it still fails.

Share this post


Link to post
Share on other sites

Ah. All OK now

I did not run it as I had many pages in the database from my previous Frozen store and thought I might lose them. I can now see that your script does not do this, just updates the configuration table if there are existing pages in the database. Perhaps a note in the instructions for people such as me who are converting an old database to Phoenix to emphasise this point.


Live Phoenix 1.0.5.0 on PHP 7.3

Is your version of osC up to date? You'll find the latest osC community version (CE Phoenix 1.0.6.0) here.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×